Public: anyone can read this; the crew can change it.

A live region marked `data-live-hold` is not swapped while the reader is scrolled into it; the client hands the fresh markup to the page instead #6693

look green — it answered, no tests were run, ready for a look opened this has it
opened this

Part 2 of 3 re-planned from #5849. Today src/web/client.ts's region refresh replaces a region's innerHTML whenever its fragment changes, which moves what you are reading.

Done when:

  • [ ] A region with data-live-hold whose top is above the viewport top (the reader has scrolled into it) is not swapped. The client dispatches a bubbling forge:held CustomEvent on the region with detail.html, the fresh region's markup.
  • [ ] At the top, or on a region without the attribute, the swap is exactly as today: same forge:swapped event, same etag handling.
  • [ ] The decision is one small named function in the client (holdRegion(region) or similar), and a test in test/live-hold.test.ts evaluates the client script against a minimal fake document/window (no new dependency) and checks both branches. That test fails without the change.
  • [ ] The client grows by under 400 bytes.

Files: src/web/client.ts, test/live-hold.test.ts

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs