Repository navigation
Add a deck example to the catalog, make the deck developer page its scenarios, and list a pass's answers at its end - #6016
Conversation
…eck card at a time The catalog gains a page for the deck package: a maintainer back from a week away works through the seven notifications the agent left for them, each a card with its evidence, a drafted reply where one goes out, and its own options. The extending page's Deck card now opens it. A card that opens with an eyebrow's hgroup, as lf-ask's instructions suggest, kept the eyebrow's heading margin as a blank band at the card's top; the deck now trims it as it trims a card's first child. The catalog card has no preview image until `wt refresh-previews` runs.
…ch-up deck on a card that fits A card that Go through, Back, Later or an answer brings up could end under the floating panel: the deck sits below the page's opening, and a nearest landing counts a box under the panel as shown. Once the card lands, the deck now scrolls it up until its foot clears the panel, or to its top where it is taller than the room, with `scroll-margin-block` keeping the bar above it and the stack's edges below. It waits for the landing because until then the deck keeps the height of the card that went, and the page may not reach far enough. The catch-up example orders its cards quickest first, which also opens the deck on a card whose options stand above the panel on the first screen, and its lede drops to two lines. Test: a card left for later and brought back below the opening stands whole above the panel (fails without the deck change).
Once the pass ends, the cards are put away and the only record of what the user decided was Back, one card at a time. The end frame now lists every card that asks something: its question, by the heading On Me names it by, linked to the card, beside the answer in the runtime's words (`answerWords`), or Still waiting / Waiting on the agent in Leaf's voice. A row opens its card as any fragment link does, by pointer, finger or Tab and Enter. The rows are made once and kept, so a reading that arrives while one has focus leaves it there; they sit side by side where both columns fit and stack on a phone. The deck's registry description and author notes say the end of the pass lists the answers, so a card needs a heading that asks its question. Test: after a pass the recap lists each answer and that the left card still waits, and a row opens its card by Enter and by click (fails without this change).
…hrough Lit, and link recap rows to where each question is answered From an independent review of the deck branch: - A recap row linked to its card's id, so a plain wrapper card with no id gave a row with no href, which no press or Tab reached. A row now links to where its question is answered (the obligation's `prompt.target`), which opens the card holding it. - Each card's obligations came from `obligationsIn` per card, a pass over the page's whole inventory each time, several times a render, and once more for the recap. The deck now files its members under their cards once per inventory. - The bar's controls and the end frame were placed and updated by hand around a Lit status. `render()` now draws both generated containers, Back, forward and the step back in as retained nodes and the recap's rows by card, so the recap no longer widens a hand-updated view. - Tests: the recap test reaches the rows by the keyboard pass rather than forced focus, a card with no id opens from its row, and the scroll test compares the whole card with the panel's top rather than one point near the last option. - The catch-up example's `--stdin` card said a newline splits a path piped from `git ls-files`; git quotes such names instead, non-ASCII ones included, so it now says that, with the quoted form of a Japanese file name.
leaf-agent
left a comment
There was a problem hiding this comment.
The deck's per-card filing of obligations repeats the runtime's placement rule instead of calling it. See the inline comment.
…d and reading The single pass filed each obligation under a card by its widget's element, a second copy of the placement `obligationsIn` owns (`obligationPlace`, which stands a record unit at its projected datum). A later change to placement would have reached `lf-tally`, tab rows and the deck's own count but not its pips, recap and waiting set. The widget API exports no placed source to file by, so the deck asks `obligationsIn(card, …)` for each card and keeps the answer until the inventory changes: one pass over the page's obligations per card and reading, instead of several per card each render.
Max ran the catalog's preview capture for this branch, which published example-catch-up.jpg to leaf-assets and moved the pin and the README's image URLs. The site's catalog now composes on this branch.
…eveloper page the deck's scenario page Max found the catch-up example's asks unevenly presented: 3 of 7 recommended an option and 5 of 15 options carried a tag, and the deck's developer page, which he remembered as the deck's example, had neither. - catch-up: every option now carries a short tag for what the reader weighs (effort, what it touches, who hears), every ask recommends the option the agent would pick and says why and at what cost, and option prose that restated a tag is gone. The first card is tightened to fit the first screen again, and the CI card's facts no longer break an identifier across lines on a phone. - developer/deck.html becomes the deck's scenario page rather than a second catch-up: one card of each shape a deck holds (single choice, suggestion, multiple choice, a card that asks nothing, a reply to send, a permission), each labelled by its shape, held to the same standard, with a "What to try" list naming the gesture and the result to inspect. - The deck's count holds its line before the first reading, which moved the marks 8px when it arrived (startup CLS advice on both pages). - A recap row takes its card's heading where the widget asks outside an `lf-ask`, as a suggestion does; the row read empty before. Test fails without the change. - The recap's CSS uses main's `--lf-` token names.
…h-up presentation pass `uv run --frozen leaf-dev site previews` recaptured all 20 catalog previews, published them to max-sixty/leaf-assets, and moved the pin and the README's image URLs; the catch-up card now shows its tagged first card.
# Conflicts: # leaf-assets.json
leaf-agent
left a comment
There was a problem hiding this comment.
One change for the recap row's fallback name, in the inline comment.
…On Me names its question main stopped exporting Lit's names from widget-api.js (#6134), so the deck's module no longer loaded after merging it: render and repeat now come from /vendor/lit.js with html and nothing. A recap row for a question with no prompt words took its card's first heading, a second rule for naming an obligation beside the one On Me uses. It now asks the runtime's queueTitle for the question's own row in On Me's lists, so the end frame and On Me give one question one name. Behavior changed: a suggestion's row reads the words it suggests where it read the card's heading, and the test that held the heading holds On Me's name instead.
main's #6151 files every card's obligations in one pass (obligationsByRegion), where this branch asked obligationsIn once per card and kept each answer for the life of a reading. Resolved to main's one pass with this branch's keeping: the deck files the cards once per obligation reading and reads that map for every mark, word and row until the inventory changes.
…s to lf-group questions
…oup in the deck and default registry examples
leaf-agent
left a comment
There was a problem hiding this comment.
The first item under "To weigh" in the description no longer matches the code. It says the deck checks the panel's position itself because the runtime's alreadyShown counts a box under the panel as shown. The merge of main (1fde72d) took that check out: reveal in lf-deck.js now calls scrollIntoView(next, { block: "nearest", behavior }), and its comment says alreadyShown counts what the panel covers as unseen. test_a_card_brought_back_below_the_opening_stands_whole_above_the_panel passes at this head, so the runtime now does that job. The description becomes main's commit message on squash, so that item should go, along with its "left for the work on floating surfaces" follow-up.
…k pages after a first-time reader pass
…eight, and hand the forward control's focus to the step back in
A card an answer sends off stays in the DOM before the card that came up until its motion ends. The new card takes focus once it has settled (`SETTLE_MS`, 250 ms). On a slow machine the leaving card's motion outlasts that wait, so Shift+Tab from the new card went into the card still flying off. That card was then hidden, which left focus nowhere. This is why `test_by_keyboard_the_forward_control_hands_over_to_the_step_back_in` failed on CI's Mac, where Later read `inactive` for the full timeout. The leaving card is now `inert` from the moment it starts to move until `putAway` lets go of it, so Shift+Tab reaches the bar's Later, as it already did once the motion had ended. The change also covers the card Back covers: it comes after the arriving card, so Tab from the new card could have gone into it the same way. **Verification.** - `test_a_card_still_flying_off_takes_no_focus` holds the exit motion at its first frame (`HOLD_MOTION`) and presses Shift+Tab after an answer. It checks that focus reaches Later while the old card is still leaving, and that the old card drops `inert` once the motion finishes. An earlier version of the test slowed the animations to a tenth through CDP instead. That version failed without the fix, with focus inside the leaving `#beta-ask`, and passed with it. - The deck's keyboard tests also pass locally. - On CI's Mac (`--workers 1 --load 4`), the original test passed all 54 copies in [dispatch 44771816811](https://github.com/max-sixty/leaf/actions/runs/44771816811). For comparison, [dispatch 44762687613](https://github.com/max-sixty/leaf/actions/runs/44762687613) failed 3 of 18 copies on main. The race has been in the deck since its focus handoff landed in #6016. No recent change introduced it. Recent macOS runs only made the runner slow enough to hit it. Closes #6603 — automated triage --------- Co-authored-by: leaf-agent <[email protected]>
Adds
examples/catch-up.html, "Catch up on notifications", to the catalog's Everyday work group: a maintainer back from a week away answers the seven notifications an agent couldn't, one card at a time. It is the first catalog page that useslf-deck. Max asked for it ("definitely add an example based on it"). Each of its seven questions recommends an option with its reason and cost, and every option carries chips. The deck's developer page,examples/developer/deck.html, becomes its scenario page: one card of each shape a deck holds, with a list of what to try. Both pages use today's question markup: each card is anlf-groupwhoselabelasks it, each option has alabeland a<strong>title, andrecommendedis an attribute.Building and using the pages changed the deck:
queueTitle), so both lists use the same name for a question. The deck's height now glides to the end frame's full height, list included.The registry examples for
lf-deck,lf-optionsandlf-tabsalso drop the heading ids that #6345 removed elsewhere.To weigh: in Firefox, a user who reaches a card by pointer, such as by a recap link, and then presses an arrow key still loses focus after one step. The deck decides between keyboard and pointer users by
:focus-visible, which Firefox doesn't set on a later key press. Fixing it means either exporting the runtime's own reading (pressLed) to packages, or moving focus to the next card after a pointer answer too. Both change more than this PR should, so it is left for a follow-up.Checked with
page check --renderon both pages (no findings); a first-time reader pass on each in headless Firefox, whose wording and keyboard findings are fixed; a Codex review, whose three findings are fixed;pre-commit; the browser type check; all twelve deck browser tests; and the catalog and corpus tests by node id. Each new deck test fails without its fix.