Repository navigation
Say news in the banner and keep the reader's keys through a revision - #205
Conversation
A gesture's acknowledgement, an arrived version, or a refused send used to appear twice: as the banner's count and as a toast in the opposite corner. The toast is gone. `notice` writes the sentence into the banner's status slot in place of the status line, which returns when the notice fades; the live region hears the same words. The agent-reply notice is text now rather than a click target, since the Threads button beside it is the route. A revision arriving under a reader mid-press dropped their focus onto body when `body > main` was replaced, so the key line's "1–2 toggle the nth" over a pick mark vanished and the digit picked nothing. Activation now writes the standing down by id before the swap — the nearest element carrying one, and the control within it by kind and position — and hands it back afterwards where the revision kept it. An armed `g` chord already held through the swap; `s`, `r`, `/`, a drag or grab defer the activation, as before. `focusDestination` moves from the address chord into widget-elements so both arrivals share it. The corner-toast geometry test goes with the toast, and the decision-walk test now expects the ring to stay on the decision the reader was in when the version landed. Co-Authored-By: Claude Fable 5.1 <[email protected]>
leaf-agent
left a comment
There was a problem hiding this comment.
docs/demo.gif — the README's front-door image — still shows the surface this PR deletes. Its last frame carries the corner toast reading "Updated to Draft after v1", because record-demo.py waits for the notice to show and then holds a 2400ms frame on it; that wait is retargeted to .lf-notice here, but the committed GIF was recorded against the toast. Re-recording it with record-demo.sh is the missing step — CLAUDE.md asks for public docs and generated outputs the feature affects, and the immediately preceding commit on main (6bfce46, the Button-cluster PR) re-recorded it for the same reason.
Nothing else from my pass. The standing capture/restore reads sound to me: captureStanding scoping the index to the nearest [id]:not(.lf-ui) keeps the position query small enough that a revision reordering elsewhere in the page can't mis-restore, the shadow-staged control degrades to the place by way of indexOf returning -1, and restoreStanding bailing on any non-body focus keeps it off a reader who moved into the chrome during the settle. The {view, standing} split is the right seam too — view is what travels through tabStore, where restoring focus stays forbidden.
How the GIF was checked
uv run --no-project --with pillow python -c "
from PIL import Image
im = Image.open('docs/demo.gif'); im.seek(im.n_frames - 1)
im.convert('RGB').save('/tmp/demo-last.png')"
Frame 8 of 8: a dark pill in the bottom-right corner, "Updated to Draft after v1", above the key line.
git log --oneline -- docs/demo.gif shows eight re-records over the repo's history, the most recent being this PR's own base commit.
The GIF held its final frame on the corner toast this branch removes; the recorder already waits on the notice, so re-running it is the whole change. The landing stills come off the same scene. Co-Authored-By: Claude Fable 5.1 <[email protected]>
… corpus travel between versions (#207) Three simplifications from the architecture review, plus the rewrite the first of them turned out to need. Each was picked on the review page; nothing here changes behaviour the suites pin. **Version travel is one module.** `runtime/version.js` replaces `version-navigation.js`, `version-diff.js`, `version-activation.js`, and `view-continuity.js`, which were one gesture split four ways and wired back together with callbacks. The first pass merely joined the files (1200 lines for 1201), so it was rewritten: state application drives activation through `prepareActivation` and `renderVersions` instead of eleven accessors; `install()` returns the closure that restores the reader's place, standing, and comparison; the 95-line rollback snapshot is gone because the chooser renders from the last accepted state once the three current-document fields are restored beside the others; one fetcher serves the comparison base and the followed revision; one row builder serves stamped versions and drafts; the authored roots are captured at import. Code lines 844 to 789; `leaf.js` loses 51; #205's focus-keeping activation and banner notices are ported in. **Diagram and diff are packages.** `lf-diagram` with Mermaid and `lf-diff` with the diff renderer move out of the default package into bundled `diagram` and `diff` packages selected by name; pr-review pages select `diff` beside it. A default `page init` goes from 7.73 MB to 2.57 MB. `scripts/vendor.py` gains `package_vendor(name)`. **The corpus travels between versions.** `examples/log-retention` ships a prior version under `examples/versions/`, and every builder stamps priors oldest first, so the corpus, the site, and the harness sweep reach the chooser, the changes-since marks, and a thread that survives a revision. `example_versions()` refuses a gap in the numbering. **The MCP snapshot reads the document's own text.** Its posted quote now equals the file-side reading (shared collapse rules and block vocabulary), and the anchor refusal names a recourse both readers have. Parity tests compare the snapshot's quote with the file reader and the mark on the full page. Also: three tests derive the version count and pr-walkthrough's title instead of assuming them, the standing-action gate composes the packages the served page runs, the layer test holds `examples/layer.json` against the packages directory so a bundled package cannot go unlisted, and `tests/conftest.py` carries main's macOS browser-fixture fix. <details><summary>Verification</summary> On fe4005a: `uv run pytest tests` 796 passed. The eight browser files that pin version travel pass plain and with `--run-nightly` except two reds that fail on main without this branch (the pr-walkthrough axe contrast check and the fragment-hydration retry); three other reds under a load average above 90 pass alone on both this branch and main. `pre-commit run --from-ref main --to-ref HEAD` clean. An independent review of the version delta found four items, all folded in: the newest-version chip is painted only at the commit so a refused candidate's rollback is complete, an unused export removed, the module docstring names its whole surface, one formatter spelling. </details> > _This was written by Claude Code on behalf of max-sixty_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01BvsgqUYTVQJ7gz9bmNqasz --------- Co-authored-by: Claude Fable 5.1 <[email protected]>
…diff: ten pieces from a UI and UX review (#209) A UI and UX review of the layer, run as a Leaf page, and the ten pieces picked from it as "Now", each built with a test. The review page is the record of what was found and why each piece was picked; this description is the map to the diff. ## What changed **The banner folds instead of clipping.** Its addresses fold into one overflow menu in a stated order when the row runs out of width, and the status line is the one thing that gives up width; the newest-version chip is marked urgent so the menu's door says when it holds news (`runtime/banner-shelf.js`, `runtime/chrome-style.js`). The versions menu hangs from the button that opens it, and its two ways out say their direction (`runtime/version.js`). **Every control has a box a reader can hit.** One theme rule gives every pressable in the layer a floor of 24px on a fine pointer and 44px on a coarse one, and one marker, the `data-lf-offer` value, says what a reader can press, so the cursor and the outline come from the theme rather than from each widget (`chrome-style.js`, `packages/default/theme.css`). A receipt is a flat Button, not a press (`runtime/living-margin.js`). **The margin rail is reserved before the first gesture**, so the page no longer narrows when the reader's first mark lands (`runtime/margin-layout.js`). The inline thread card has a floor, and it follows its marker when the page reflows under it (`living-margin.js`). **A reader who lands is handed their place and their way in.** The skip link rests transparent and stands where an ask arrival lands, an ask arrival stands on the decision rather than below the fold, an empty Asks tray says what it is empty of, and the resting key line shows only presses that say something back, with the priority no row declared cut from the register (`runtime/keyboard/`, `runtime/decisions/`, `runtime/trays.js`). **Diff basics.** A file header that pins under the banner while its rows scroll, `]` `[` `}` `{` hunk and file keys — from the diff itself, with nothing focused inside it, `]` lands on the first hunk and `[` on the last — and a Soft wrap switch that paper always takes (`packages/diff/widgets/lf-diff.js`, `packages/diff/theme.css`). A page with only a manifest loads the renderer when it first draws lines. **A page loads only the widget modules it uses**, and a version or a reply that carries a new tag imports its module before insertion (`runtime/widget-loader.js`, `runtime/version.js`, `runtime/state-application.js`). **The agent's path answers in sentences** where leaf was silent, `leaf edit` included, with `--json` for the tests that parse it (`scripts/leaf/cli.py`). **Polish sweep**: a reacted passage has a visible mark, every elevation shadow is cast in the scheme's own ink, every word on a surface names one thing, a sheet prints what it can show and nothing it can press, a reader can take an approval back, the diff tools row is declared as a control archetype, and the small-screen map reads its seat from the row's one order. ## Reading the diff The branch merges main seven times; #205 (banner notices, persisted keys) was dispatched from this review and is already on main. The #207 merge takes its single `runtime/version.js` and `diff` package: this branch's hunks in the four modules it folded and the theme block it moved are ported there, and `readingBlock` replaces the `blocksOnScreen` export as the one reading the decision walk and the keyboard reference start from. The fifth takes 17ed171, which moves each file's "Mark reviewed" press out of its `<summary>` into a `.lf-diff-file` row beside it. Two of this branch's rules met that row and are fixed in the merge commit: the pinned summary's z-index covered the press on every file, so the press now shares that level and paints above as the later sibling; and the soft-wrap switch reached its rows through `~ details`, which the wrapper broke, so it names the file rows. A review of that merge found the third meeting: once a long file's header pinned, the press stayed absolute at the file's top and drifted off it, its reserved column empty and out of pointer reach for the rest of the file. The press is now a block in the flow ahead of the disclosure, which is pulled back up over it by a negative top margin, and sticks with the summary where it pins; the pull is the disclosure's rather than the press's because a sticky box is held inside its containing block by its margin box, and a negative margin on the press let it outlive its file by 32px at every boundary. The pinned-header test reads the press on the pinned line, reaches it with a pointer, and reads it leaving with its file. The seventh takes #212 (Button states, receipts, overflow), which answers the same question this branch's "Sew a receipt Button flat" answered: what the Button beside a move already made should promise. #212 keeps it a pressable disclosure wearing its phase as a corner mark and states that a settled outcome is receipt text beside Undo, never an inert Button-shaped status; this branch had made it a flat `status` with no press. The merge takes main's model and drops the flat receipt, its theme rule, and its test; the accessible-name test beside it stays. The choice is flagged in the review page, where the pick that led to the flat receipt stands. The sixth merge takes #211, which lands `a` on the region that explains an ask, and 9a59df7's growing comment field. This branch focuses the decision itself on arrival, its controls the next Tab stops, so the walk keeps `arriveAt` in front of main's region travel, and #211's three arrival tests expect the suggestion focused rather than its Accept, as this branch's own arrival tests do. The tend review on 1708469 read the whole diff and asked for three things, all in ec55abb: `[` with nothing focused inside the diff answered no hunk anywhere and walked the whole file list opening and fetching each one — `beyond` now answers true in both directions, so the backward walk opens the last file and lands on its last hunk, with a test on a collapsed manifest that counts fetches and open files and fails on the old answer; a comment in twice in `served_state/conversation.py`; and `taken_back(events)` rebuilt per event inside the `done` comprehension, now hoisted as every other reader does. <details><summary>Verification</summary> On the branch head before the #207 merge (2fe649e): ten render suites 590 passed with one failure, main's own WCAG nested-interactive red on the pr-walkthrough diff review button (since fixed on main by 17ed171); everyday suite 793 passed; `pre-commit` clean. After merging #207 and #208 (fbc02fe), on a machine at load average 200 shared with another session's suite: everyday suite 797 passed, 1 failed — a test this branch added whose page carries an `lf-diagram` that #207 moved into the `diagram` package, fixed in 03cd748 by selecting the package. CI's lint caught an unread console capture in one new test, fixed in the same commit. An independent review of the merge resolution found every branch hunk ported and no defects; its one design note, the widget import spent inside the activation transition, is 3dea60b. A fourth commit dropped two `.lf-margin-action` minimums as dead under the aim floor and 1b66f16 restores them: the floor's rule sits inside the `@scope (.lf-chrome)` block and margin items are hoisted into `main`, outside it, which a margin shape test pins. The thread-card fix carries a test that fails with its listener removed. The b89560d merge ("Asks (3/7)" while standing in an ask) keeps this branch's landing on the decision in the one test both sides touched and takes main's count; the 17 ask and decision tests pass. After the 17ed171 merge and the review fixes, the 19 diff, hunk and control-sweep tests across four render modules pass, the Python sign-off tests pass, and the everyday suite passed on ec55abb (798). After the #211 merge the 27 ask, decision, arrival and response-field tests pass and the everyday suite passed again on the merge (a56cdeb, 798) and on the pinned press (4bf1bb7, 798); CI's lint wrapped one assertion in that test, 7dd0d41. CI on this PR is the clean-machine gate. </details> > _This was written by Claude Code on behalf of max-sixty_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Fable 5.1 <[email protected]>
A Leaf page now has one place for news, the banner, and a revision arriving under a reader mid-press hands them back the control they were on. Both came from a page-wide comment on a live review page: notices appeared twice (a banner count and a bottom-right toast), and pending keypresses vanished when an update came through.
Notice in the banner.
toast/showToastbecamenoticeacross the runtime, the package widgets, the tests and the demo recorder (runtime/notifications.js). It writes into a span beside the status text; a:hasrule hides the status line while the notice shows for four seconds, and the live region announces the same words. Every former toast message lands there: recorded acknowledgements, "Updated to v3", send refusals and outbox retries, the agent-reply line, which is text now rather than a click target since the Threads button sits beside it. The corner positioning inchrome-layout.jsand its geometry test are gone.Standing across activation. Measured before changing anything: an armed
gchord and the?shelf already survive an activation, andshints,r,/, a drag or keyboard grab defer it. What was lost is focus inside the page: on an option mark the key line offers1–2 toggle the nth; the swap dropped focus tobody, those rows vanished, and the digit picked nothing.captureStandinginruntime/view-continuity.jsrecords the nearest authored id'd element plus the control within it by tag, first class and index beforeversion-activation.jsswapsbody > main;restoreStanding(called fromstate-application.jsafterrestoreView) refocuses the same control where the revision kept it, its owner where only that survived, and nothing where neither did, leaving alone a reader who moved into the chrome during the swap.focusDestinationmoved from the address chord intowidget-elements.jsso both arrivals share it. Both a draft revision and a stamped version take this path; a?pinreader still gets the chip and a fresh navigation.Contract. Four passages of
skills/leaf/CLAUDE.md: the chrome list, the news paragraph, the activation paragraph, and the document-travel paragraph that had forbidden focus restoration (now scoped to travel).Trade-offs kept. The notice inherits the status line's clipping in a crowded wide banner, where the toast wrapped at full width; the full text is in the hover title and the live region. A notice covers the offline line for its four seconds.
Testing. Two new render tests, each shown failing with its behaviour put back:
test_a_recorded_move_is_acknowledged_in_the_banner_and_nowhere_else(controls) andtest_the_presses_a_reader_is_mid_way_through_survive_the_page_following(projection, crossing a draft revision then a stamped version). The decision-walk activation test now expects the ring to stay on the decision the reader was in. Everyday suite green on the merged tree. Across the twelve render files run locally, five tests are red and the same five are red on current main (run there as a control): the WCAG and ring sweeps on the pr-walkthrough example, the render-gate second-application test, the failed-fragment hydration test, and the gate scroller test.🤖 Generated with Claude Code