Skip to content

Replace the feature gallery's interaction replays with live samples, and delete passive samples (F86) - #2530

Merged
max-sixty merged 5 commits into
mainfrom
agent-a5ca83a7ed5dc5636
Oct 12, 2026
Merged

max-sixty merged 5 commits into
mainfrom
agent-a5ca83a7ed5dc5636

Conversation

@max-sixty

@max-sixty max-sixty commented Oct 12, 2026 •

Copy link
Copy Markdown
Owner

Survey item F86, as decided on the survey page ("can we turn them into lf-samples?"). The feature gallery's Interactions tab played four scripted replays (Accept a suggestion, Move a card, Send a comment, Open and close Threads) in inert "passive" sample frames that kernel code drove. Each is now an ordinary lf-sample the visitor performs, and the replay machinery goes.

What the visitor does now

  • Accept a suggestion: press the suggestion's Accept check (✓); the retired wording folds away.
  • Move a card: drag the card to "Tried", or press Enter on its grip and use the arrow keys.
  • Send a comment: select the sentence, press c (or click the Comment field), type, press Enter; the field becomes the inline thread.
  • Open and close Threads: a window sample with the seeded thread (data-sample-threads, a real lf-sample attribute); press Threads in its top bar, close with × or Escape.

Each gesture was driven in Chromium against a preview of this branch, and the published-site test now waits for all four samples to present.

What is deleted

  • runtime/interaction-gallery.js, -frame.js, -playback.js (919 lines), their bundle entry and eslint boundary entry.
  • leaf.js's syncInteractionGallery and passive capability handoff, and two responseSurface exports only the replay read.
  • Passive samples everywhere: mountSample's passive option, POST /api/samples's passive field, data-lf-sample-passive, passiveSample, and the passive branches in bootstrap.js, sample-child.js, state-feed.js and user-view.js. A whole-tree search found no other user.
  • The framing check's data-interaction-gallery clause and the F85 kernel-selector guard's exemption, so that guard now expects no leak at all.
  • The gallery's CSS, its replay tests, and the passive-sample tests. Three tests that held a general contract through the gallery now hold it on a plain page: page-interface preparation holds the first upgrade, a rejected page-interface promise is reported once without blocking presentation, and a sample presents after a slow first state read.

Code is 1,026 lines shorter net and tests 975. The page's meta description, the tab's intro, docs/examples.html and test_site's catalog assertion describe live samples rather than replays; the corpus is regenerated.

This was written by Claude Code on behalf of max-sixty

max-sixty and others added 4 commits October 11, 2026 23:52
…and delete passive samples (F86)

The feature gallery's Interactions tab played four scripted replays (Accept
a suggestion, Move a card, Send a comment, Open and close Threads) in
passive, inert sample frames driven by kernel code. Each is now an
ordinary `lf-sample` the visitor performs, with a caption naming the
gesture: press the suggestion's Accept check; drag the card to "Tried" or
move it by its grip with Enter and the arrows; select the sentence, press
c, type and press Enter; open Threads from the top bar of a `window`
sample and close it with its x or Escape. The Accept, card and comment
samples start empty; the Threads sample keeps its seeded thread through
`data-sample-threads`. The comment sample no longer seeds a thread, since
the visitor's own comment now makes the transition the replay faked.

What the replay needed and nothing else used goes with it:

- `runtime/interaction-gallery.js`, `-frame.js` and `-playback.js`, the
  bundle entry, and the eslint boundary entry.
- `leaf.js`'s `syncInteractionGallery` and the passive-sample capability
  handoff (`replayReady`), plus `responseSurface`'s `detachComposer` and
  `fabFrameAt` exports, which only the replay read.
- Passive samples throughout: `mountSample`'s `passive` option, the
  `passive` field of `POST /api/samples`, `data-lf-sample-passive`,
  `passiveSample` in `context.js`, and the passive branches in
  `bootstrap.js`, `sample-child.js`, `state-feed.js` and `user-view.js`.
  Every sample is now operable: its body leaves `inert` once it presents,
  and it runs the ordinary live feed.
- The framing check's `data-interaction-gallery` exemption, and the F85
  kernel-selector guard's named exemption, so that guard now admits no
  leak at all.

Tests: the gallery's replay tests go (test_site's eight, the two
playback tests and the playback stability row in test_render_controls,
the gallery import barrier test, and the passive sample visibility test).
Those that held a general contract through the gallery now hold it on a
plain page: page-interface preparation still holds the first widget
upgrade; a rejected page-interface promise is reported once without
withholding presentation; a sample presents after a slow first state
read with its storage and interaction log scoped to the child. The
published-site check now waits for the gallery's four live samples to
present. test_site's catalog assertion reads the new description.

Code -1026 lines net (the three replay modules were 919), tests -975.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@max-sixty
max-sixty merged commit 25ed854 into main Oct 12, 2026
2 checks passed
@max-sixty
max-sixty deleted the agent-a5ca83a7ed5dc5636 branch October 12, 2026 08:03
max-sixty added a commit that referenced this pull request Oct 12, 2026
When a sample's child document departs, the sample now keeps one `ready`
promise for its next document, and owners wait on it rather than
rejecting. #2501 gave departure its own error (`SampleDepartedError`).
It still rejected `ready` on every departure, though, and minted a fresh
promise on the reload, so each owner had to tell a departure from a
failure and start over.

**Review item 47 (Lit follow-up round).** What changed:

- **(a) `lf-sample.showThread` across a reload.** It used to reject when
the child left, so the examples' `void sample.showThread(…)` calls in
`feature-gallery.html` and `corpus.html` logged an unhandled rejection.
Now a selection the child leaves before presenting waits for the next
document and lands there. It returns false only when a newer selection,
Reset or removal supersedes it, as Reset already did. `lf-sample`
follows one `ready` per host presentation, so a departure and its reload
are one wait, and `lf-sample-ready` fires once the next document
presents.
- **(b) and (c), the interaction gallery's early arrival and its missing
Reset.** #2530 deleted the gallery and passive samples, so neither gap
exists any more. Earlier commits on this branch fixed both; the merge
with `main` drops them.
- **Contract.** In `sample.js`, `ready` is the presentation of the next
document. A departure, and the reload after it, share one pending
presentation. Reset or destroy cancels it with `AbortError`, and a
successor that fails to start rejects it with its failure. Commands in
flight still reject with `SampleDepartedError`, since they belong to one
document. A departure clears the in-flight operation Reset would
otherwise coalesce with, so Reset during the wait starts a fresh
allocation. The module header and page-authoring's "Live samples" state
this.
- **`aborted(signal)`.** `lf-sample`'s selection race and `sample.js`'s
load-queue wait now await aborts through the helper #2521 added.
`widget-api.js` exports it for package modules, and
`module-authoring.md` names it. The host's own `showThread` keeps its
listener and removes it when the call settles, so a later abort cannot
cancel a newer view.

Tests, written first, failed on `main`:

- A reload that interrupts `showThread` lands the selection in the next
document: a panel view only the next document's own command can present
resolves `true`. On `main` it rejected with `SampleDepartedError`.
- The native-departure test now expects `ready` and selections to wait
until Reset, rather than reject. After Reset, the waiting selection
returns false.

Line deltas, from `git diff --numstat` against `main`: hand-written
source +83 / −60 (net +23) across `sample.js`, `lf-sample.js`,
`rendering.js` and `widget-api.js`. Tests +50 / −11 (net +39).

One behaviour changes: a departure during a sample's *first* load now
keeps that load pending until a next document arrives or the user
presses Reset. A reload, the common case, presents and settles it. An
external destination before the first presentation, such as an authored
template script that navigates during startup, leaves the `lf-sample`
widget's presentation pending until Reset. The parent cannot tell that
case from a reload. `lf-sample.js` and `rendering.js` record it as the
one open-ended rendering hold.

> _This was written by Claude Code on behalf of max-sixty_

---------

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants