Repository navigation
Move a deck's card on from an answer sent here, drop the bar's key chips, and hold the deck's height so m lands each card alike - #7150
Conversation
…s, and keep the deck's height so `m` lands each card alike Fixes three faults Max hit on leaf.page's catch-up example. **An answered card stayed put.** The deck moved a card on only if, when the server's reading of the answer arrived, the window had focus and focus was on the card. On leaf.page a new visitor's first answer reads back after 12 s (12.2 and 12.3 s in two Firefox runs), so turning to another window meanwhile left the card open with the count already down. The deck now hears the `lf-action` a widget on the open card records the user's answer with, in the capture phase, and moves on when the reading closes the card, wherever focus is by then. `#pressed` and the reading-time focus test are gone. An answer from another window, a comment and the agent ending a question still leave the card; a reply in a thread on the card, which records no widget action, now does too. **Two sets of arrows.** The deck asked Leaf for corner key chips on Back and forward since #4331, so a keycap ← / → stood beside each chevron whenever focus was in the deck. The rows no longer ask; pointing at a chevron still names the key in its preview. **`m` jumped by each card's height.** #6688 removed the 72px band the page kept at its foot. The deck ends that page, so when `m` swapped in a shorter card the deck shrank with no scroll left below it and the browser pulled the page down: in Firefox at 1100x900, cycling the last two cards put the bar at 12px, 49px, 12px (12px each time before #6688), and Next by pointer at the page's end moved the bar 91px under the pointer. The deck now keeps the height of the tallest card a pass has shown (`#hold`), letting go at the end of the pass, so a shorter card leaves a gap below itself rather than pulling the page; its height motion glides `min-block-size` with `height`. Max reported all three. Tests: two new deck tests, which fail on main (the card never moves; Back moves 378px under the pointer); the deck's 16 tests and the timeline's nested-deck test pass.
leaf-agent
left a comment
There was a problem hiding this comment.
The new answer signal hears only one of the three routes Leaf documents for recording an action, so the deck still decides "this tab answered the card" from part of the evidence. The key-chip and height changes look right; this is the one point that holds the verdict.
lf-action is the route a LeafElement takes, but module-state.md says widgetController(owner).dispatch(...) "records as lf-action does", and module-plain-elements.md, record.property, lets "a component written without Leaf" record through a property and its change event, with no lf-action at all. Neither dispatches anything on the card that the deck can hear. Two cases this breaks, both of which moved on before this PR whenever focus was on the card:
- A card holding an
lf-board: the board answers its cards' widgets throughcontroller.dispatch(shownAnswerinlf-board.js), so the user drags the last open card into a column, the reading closes every obligation on the deck card, and the deck stays put with Next. - A card holding another package's widget that records through
record.property, whichpackages/AGENTS.md, "A widget's need of Leaf", names as the preferred form ("Leaf can do it from outside").
All three routes meet at the widget controller's dispatch and applicationState.enqueue, which already knows that this tab sent a gesture for this widget. Reading that fact from the place the routes share, rather than from one of them, would cover the bundled widgets and other authors' widgets the same way. That probably means a small core reading (for example, whether the action in force on a widget came from this tab's own gesture) instead of a deck-local listener. Root AGENTS.md, Fix the underlying issue, asks for the fix at that layer. Keeping the lf-action listener and adding a second special case for dispatch would be exactly the patch-on-a-patch it warns against.
… moving the page, and fill the held height with the card Follows review of the first commit by Codex and by Tend. **Whose answer it was.** The first commit moved a card on once any widget on it had recorded an `lf-action` here. That missed answers recorded through `widgetController(owner).dispatch`, as `lf-board` records its cards', and through a declared `record.property`, and an unrelated action here, such as a draft edit, let an answer from another window move this window's card. The deck now asks whether the answer that closed the card was sent from this page: `sentHere(event)`, a new name in the package API, reads the event's `attempt`, which the posting page mints and the dispatcher already keeps (`submitted`). The served `EventReference` now carries the attempt, so `obligation.answer.event` can be checked. No existing name says whether an event came from this page; every recording route meets at the dispatcher, so one reading covers them all. **Late answers move the card, not the page.** A reading that comes after the user went on, scrolled away or left the window, used to scroll the next card into view anyway. The deck takes the user's intent (`retainUserIntent`) as the card's answer first shows, which it does at once, and moves the page or focus with the card only while that gesture is still their latest. **The held height.** The first commit's floor went per card and sampled only the incoming card, so a card that grew while open (a disclosure) still let the next shorter one pull the page, and the transient layout during a card swap clamped the scroll in both engines. The deck itself now holds the taller of its height before and after each change of card, and the open card or the end frame fills it (flex column), so the frame takes in the room a shorter card leaves. The end frame keeps the height too, its lines at its top, and a window resize lets the height go until the next change of card. Tests: the bar-at-the-page's-end case moves to the hold-still journey as the `deck-back` place and change (fails on main in Chromium and Firefox, passes here); the late-answer test now also checks the page stays where the user scrolled; the end-frame test asserts no jump whether or not the deck grows. Deck tests, the journey rows, the model tier and the runtime tests pass.
…scroll or key the user made since from being undone Follows Codex's second review. **The closing answer decides.** A card with two questions, one answered here and the last answered in another window, moved on here, since any answer sent from this page counted. The deck now takes the card's latest answer, the one that closed it, and moves on only when this page sent that one. **The user's latest gesture is read where it lands.** The deck takes the user's intent at each press or key in it, and where the answer came from a control outside it, such as a margin entry, as the card's answers change. A keyboard Done on a multiple choice, which changes no answer's value, kept the earlier selection's intent and so lost focus to the page; it now carries focus to the next card. Later, Back and Next take their press's intent too, and the focus arrival after an answer, which waits for the card to settle, and the scroll that brings the card in each check it as they act, so a wheel turned while the card comes up keeps the page where it went (main and the last commit pulled it back 242–272px). **The held height goes when the deck's width changes,** read from the deck's own box rather than the window's resize, so a container that widens without the window doing so drops it too. Tests: the other-window test now answers the card's other question here first; a new test turns the wheel as an answer by key brings up the next card. Both fail on the last commit's deck. The deck's tests, the journey's deck rows and the runtime tests pass.
A dashed frame drawn round the room the held height leaves read as a place to drop something (a fresh review of the captures). The end frame now keeps its own height, the deck's held height below it as plain page, and the bar still stays where it stood. The deck's end-frame tests pass.
leaf-agent
left a comment
There was a problem hiding this comment.
The description is now stale on the end frame, and it becomes main's commit message. Since 74644f9 the end frame keeps its own height inside the held deck, and only the open card fills it. Two sentences still say the end frame fills the height: "the open card or the end frame fills it" in the m paragraph, and "as does the end frame" in the second bullet under To weigh.
…istener of its own The deck's own keydown listener, which bound no key and only took the user's intent, broke the rule that every key enters the runtime through the register (test_the_register_is_the_only_way_a_key_enters_the_runtime). It now reads presses and keys aimed at it from onUserInput, the document's one reading of the user's inputs, as lf-code does. The layer tests, the deck tests and the journey's deck rows pass; keyboard Done on a multiple choice still carries focus to the next card, and a wheel turned as a card comes up still keeps the page.
…oo (#7170) Removes `sentHere(event)` from the package interface, which #7150 added so `lf-deck` could leave a card in place when another window sent the answer that closed it. Max asked why the interface needs it; it doesn't. The deck now moves a card on whenever the server's reading says an answer ended each of its obligations (the record's `answered`, which a comment or the agent ending a question leaves unset), and moves the page or focus only for a gesture toward the card in this window. The served event reference loses the `attempt` field it carried for `sentHere`. To weigh: with the same deck open in two windows, a card answered in one now moves on in the other too. Leaving it in place cost an interface name for a rare path, on which the card that moves is one the user already answered. Max asked for this on his review page and hasn't read the diff. Tests: the other-window deck test now checks that the card moves on; the deck tests around answers, the model tests of served state and obligations (607), runtime tests (1131) and the browser type check pass. > _This was written by Claude Code on behalf of max-sixty_
…deck's held height (#7188) Gives a served column or sidebar page room below its body for its last line to rise to the window's top, as an editor does, and drops `lf-deck`'s held height (#7150), which handled one widget's case of the same fault. At a page's end the browser can't scroll past the last pixel, so a block there that shrinks makes it pull the page down; since #6688 took away the panel's 72 px, a deck ending the page moved its bar under the pointer and `m` landed each card at its own height. The hold fixed that by keeping the deck tall, which left empty room inside a short card's frame and ran in the deck's own code. To weigh: every such page, the website's included, can now scroll until its last line stands at the window's top, blank below it. A workspace, a block sample and a nested Layout keep their ends. The obligation mark's landing margin moves to the theme's tier at no weight, so a deck card's own margin keeps the bar in view when `m` lands it; with the extra scroll, Chromium otherwise cut the bar off above the window. Max asked on his review page for a fix with no runtime code and no empty space under the card; this is the option recommended there, and he chose it. He hasn't read the diff. Codex reviewed an earlier version; its findings (room applied to nested Layouts, one-line summaries still moving, the cut-off bar, interactive exports, four tests) are folded in. Tests: the hold-still journey's deck-back rows pass in both engines and fail without the room; deck, obligation-walk landing, sample and model tests pass; three tests that need a page with no scroll range now strip the room from it. > _This was written by Claude Code on behalf of max-sixty_
…nter (#7462) A deck now stands as tall as the tallest card it has shown, and the open card's frame fills that height, as a slider does with its tallest slide. Since #7438 a page ends at its last line, so at a page's end Back from a tall card to a short one shrank the deck and the browser pulled the page down, carrying Back 404px from under the pointer. Now Back stays put, mid-page and at the end. This brings back #7150's hold (`#hold`, the width observer, the flex fill), which #7188 dropped in favour of the end room. Max picked "Size every card to the tallest" on his review page from five options, after trying each in a preview. To weigh: a short card's frame stands tall round its content (in the journey's page, 660px round about 256px of content). The height held is the tallest card shown so far, not the tallest in the deck, so the first visit to a taller card still grows the deck; growth moves nothing above it. Tests: the hold-still journey's deck-back rows pass in Chromium and Firefox and leave the expected-failure list; the deck tests on height, scrolling and Undo pass. > _This was written by Claude Code on behalf of max-sixty_
Fixes three faults in
lf-deckthat Max hit on leaf.page's catch-up example.An answered card stayed put. The deck moved a card on only if the window had focus, and focus was on the card, when the server's reading of the answer arrived. On leaf.page a new visitor's first answer reads back after about 12 s, so turning to another window meanwhile left the card open with the count already down. The deck now moves on when the answer that closed the card, its latest, was sent from this page, whatever route recorded it, and moves the page or focus with it only while the user's latest press or key toward the card still stands, read as each move lands.
Two sets of arrows. Back and forward asked for corner key chips (since #4331), so a keycap ← / → stood beside each chevron. They no longer ask; the chevron's preview still names the key.
mjumped by each card's height. Since #6688 took away the page's foot room, a shorter card at the page's end shrank the deck and the browser pulled the page down: the bar landed at 12px, then 49px, then 12px asmcycled two cards, and Back or Next by pointer moved the bar under the pointer. The deck now holds the tallest height it has stood at, and the open card fills it; the end of the pass keeps its own height inside it.To weigh:
sentHere(event), which reads the event'sattemptagainst the attempts this page posted; the servedEventReferencenow carriesattempt. No existing name says whether an event came from this page, and every recording route (lf-action,widgetController.dispatch,record.property) meets at the dispatcher that keeps those attempts.mat the page's end, in a window taller than the deck, can still land a newly tallest card lower than the last; page tabs avoid that by standing at least a window tall, which on a deck would push what follows a short deck a window down.Max reported all three and hasn't read the diff. Codex reviewed the first two commits; its findings and Tend's are folded in. Tests: the page-end hold is a new
deck-backrow of the hold-still journey (fails on main in both engines); the late-answer test checks the card moves and the page doesn't; deck tests, model tier and runtime tests pass.