Repository navigation
Answer one decision beside its evidence and on a board (TODO #25) - #3935
Merged
Merged
Conversation
A review page that asks Next, Later or Drop beside each proposal and also shows every answer on a board used to record two independent facts: the section's `lf-options` pick and the board card's `move`. The door admitted both, `page state` reported both, and nothing said which one held. The obligation model had already settled that the section's widget owns the answer; this builds the board's write to that owner.
## The contract
A board card with `shows="<widget id>"` is a view of that widget's answer (`x-shows`, owned by `src/leaf/shown_answers.py`):
- **Source identity.** `shows` is a plain `x-refers` relation to a widget in the card's own document: the page, or the reply that holds it (frozen-thread scope). A card in a reply that names a page widget is refused (`shows-outside`).
- **Column to value, without coupling core to `lf-options`.** The card's `x-shows.value` names the attribute on its compound owner (`lf-column value`) holding the answer that column stands for. The widget says how its answer reads as a value: a `value` record's attribute value, or, for an `attribute` record, the new `x-awaits.key`, which `lf-options` declares as `value` on each `lf-option` (unique per group through `x-unique`). An answer names a value only when it is one string; an empty pick, an option the user wrote in (no `value`), or picks with different values name none, and the card stands in a column without `value`.
- **The write is the owner's own command.** The board composes through the existing public API: `shownAnswer(card)` (new export in `widget-api.js`, `browser/runtime/shown-answer.js`) reads the owner's state through its controller and `answer(value, says)` sends the owner's `x-awaits.value` verb through `widgetController(owner).dispatch`. A drop and a section pick are the same event at `[rail-choice, rail-choice, choose]`, so undo, refusal and `restated` work on one fact and both views redraw from it.
- **Admission.** The guarantee composition lacked was not the owner write (the owner's own declaration already admits or refuses every value a view can send) but the second fact: the door now refuses a position move of a unit that shows an answer (`shown-unit`).
- **Markup.** `page check` and message admission refuse a card placed apart from its widget's authored answer (`shown-elsewhere` names the column to move it to), a board with no column for answers that name no value, a column value the widget cannot answer, and a `shows` naming a widget whose answer no view can show. `package check` holds both sides of the declaration (`shows-reference`, `shows-value`, `awaits-key`).
- **Order.** A shown card keeps its authored order in whichever column its answer puts it; the arrows only change its column and the grip offers no up or down. Order stays a board fact for the board's own cards; a shown card's order would be a second fact placed among columns the answer decides.
- **Multiple selection.** A `multiple` group shows by the value its picks share; a drop replaces the set with the member holding the column's value, and the group's Done still completes the obligation.
## Alternatives rejected
- An Answer record or a value field on `lf-ask` (the note's reason: it moves the answer off the widget that owns its words, options and obligation).
- A `via` field naming the view, with the door proving the view may invoke the owner's command. The owner's declaration already decides every value; the field would be bookkeeping no reader needs, and it would have been a protocol change.
- Board ranks for shown cards. Allowing a reorder `move` would need the door and both folds to read another widget's state to keep its column consistent; dropped until a page needs ranked answers.
- The discarded prototype's coupling (board naming `lf-options`/`choose`, option `for` overloaded): the mapping is now declared on both sides and read generically.
No protocol bump: the change adds an `x-` key, an `x-awaits` field and a widget-api export, and the door's new refusal can only fire on pages vendored with `x-shows`. An earlier page's vendored layer has none of these.
## Key files
- `src/leaf/shown_answers.py`: the contract, the value rule and the markup checks; door refusal in `event_contracts.position_record_error`.
- `browser/runtime/shown-answer.js`: the browser reading and write.
- `packages/default/widgets/lf-board.js`: places shown cards from the answer in `render()`, routes drops to the owner, per-card movability.
- `packages/default/registry.json`, `browser/registry.json` (`x-shows`, `$awaits.key`), `src/leaf/schema.py`, `src/leaf/registry/widgets.py`.
- Instructions: `skills/leaf/references/authoring-decisions.md` ("One decision in its section and on a board"), `package-data.md` ("Views of an answer"), `module-reading.md` (`shownAnswer`), `events.md` (position moves).
- `examples/developer/feature-gallery.html`: a Decisions scenario (`bg-ask-board`).
- `notes/shared-decisions.md` is deleted (its contract now lives in `shown_answers.py` and the references); TODO #25 is removed.
## What ran
- `tests/model/test_shown_answers.py` (new): door refusal, the four markup refusals, reply scope, the value rule.
- `tests/model/interact_contract/test_registry_door.py`: the three declaration refusals, and the rest of `interact_contract`, `test_obligations.py`, `test_interact_document.py`, `test_interact_product.py`, `test_interact_layer.py`, `test_unused_exports.py`.
- `tests/browser/widgets/test_boards.py::test_a_section_and_a_board_answer_one_decision` (new, 2.5 s): a section pick and a keyboard drop land as two `choose` actions on the section's group, undo restores both views, a version that marks the group `restated` retracts the pick in both, and a refused drop leaves both where the server has them; plus the existing board tests touching availability, keyboard and pointer moves.
- `pnpm run test:runtime` (550 pass), `pnpm run check:browser`, pre-commit.
- Real-browser journeys with `leaf-dev probe` on a two-proposal page, Chromium (recorded) and Firefox: section pick, keyboard drop, pointer drag, undo, refused drop and refused pick, and a live revision restating a pick; a board in an agent reply showing a group frozen in the same reply.
Not done: no `evals/` run for the new authoring section; it is conditional on the user needing all answers on one board, so I judged the risk to other decision pages low.
> _This was written by Claude Code on behalf of max-sixty_
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
# Conflicts: # dist/kernel/kernel.json
…none A group may offer an answer the board has no column for. Its card stood where the board's own fold left it, which is no longer where the answer puts it; it now stands in the column without a value, in page check and in the board alike. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
previously approved these changes
Oct 25, 2026
# Conflicts: # dist/kernel/kernel.json # dist/kernel/runtime/widget-api.js
leaf-agent
approved these changes
Oct 25, 2026
max-sixty
added a commit
that referenced
this pull request
Oct 27, 2026
Main's #3935 builds the grip's arrow routes once, dropping up and down for a card that shows another widget's answer; the merge names the left and right routes for the column there. #3921's travels flag stays on the move route. stills keeps both the phone states and main's metrics states. Co-Authored-By: Claude Opus 5.5 <[email protected]>
leaf-agent
pushed a commit
that referenced
this pull request
Oct 27, 2026
…3869) On a phone every bucket of a board is now a scroll down away, the gesture the rest of the page already takes, and each column is its own height. The board used to page sideways once its box was 640px or narrower: one column took the width, 8px of the next stood at the edge as the cue, every other column sat behind a sideways swipe nothing else on the page asks for, and every column stretched to the tallest one's height. On `triage-board` at 390px the one blocking card was followed by 500px of empty field and the release rationale stood 1013px down. Stacked, the first screen shows the blocking column and the start of the next, and the rationale follows the last column. The fix is the widget's (`packages/default/styles/board.css`), so every board page gets it; the example's markup is unchanged. The board's grid flows by column and a container query cannot restyle its own container, so the `(width <= 640px)` query gives each `lf-column` `grid-column: 1` and sparse placement stacks them, in place of the `100cqi` minimum width and snap alignment that paged. The boundary is the one the paging already used, so a board wider than 640px lays out as before. The phone's direct destination buttons stay, since a distant column is now a long press-hold drag through autoscroll away; a move still follows the card to where it landed, and the leaf menu's Undo row takes it back. The keys follow the layout (`lf-board.js`). Left and Right still change column, now titled "Move it to the previous/next column" rather than "Move it left/right", which a stacked board makes false; a card that shows another widget's answer (#3935) has only these two routes. Where the columns stack, Down past a column's last card continues into the column below at its top and Up past a first card into the column above at its end, the next slot the user sees; side by side, the step past an end still does nothing. The board reads whether the next column stands below it from its own boxes, not from the CSS rule. ## Evidence `uv run leaf-dev probe triage-board --viewport 390x844 --touch`, column boxes `[x, y, w, h]`: | | base | head | | --- | --- | --- | | board | 342 wide, 667 tall, scrollWidth 1296 | 342 wide, 1593 tall, scrollWidth 342 | | Blocking release | `[24, 322, 318, 667]` | `[24, 322, 342, 256]` | | Fix in 2.4.1 | `[350, 322, 318, 667]` (off screen) | `[24, 586, 342, 626]` | | Defer from 2.4 | `[676, 322, 318, 667]` (off screen) | `[24, 1220, 342, 452]` | | Needs a repro | `[1002, 322, 318, 667]` (off screen) | `[24, 1680, 342, 235]` | | `#triage-status` top | 1013 | 1939 | At 1440 (`--viewport 1440x900 --base`, light and `--scheme dark`) the four columns' boxes are identical on both arms and the dark screenshots differ in no pixel. `leaf-dev stills --state triage --state triage-grabbed --state activity-feed --state triage-phone --state triage-phone-dark`: the three desktop states unchanged, the two phone states (new in the catalogue) changed as above. A touch journey on the stacked page (`probe --touch --journey`): tapping "Move Digest email uses server timezone to Defer from 2.4" puts the card in `#col-defer`, scrolls it into view with its grip focused (scrollY 57 → 1197), hides that column's own button and offers the origin's; the leaf menu's row reads "Undo: Moved to Defer from 2.4 · just now" and tapping it returns the card to `#col-next`. Other boards the boundary reaches: the feature gallery's workspace-pane board `#bg-layout-board` is 410px wide at 1440×900 and now stacks its three columns (each 382×80 at y = 14, 102, 190 inside the board, scrollWidth 410) where it paged them sideways (358px columns at x = 0, 366, 732, scrollWidth 1118). The eight-column test board stacks at a 680px window (632px box) and scrolls sideways at 700px (652px box). ## Tests - `tests/browser/widgets/test_boards.py::test_a_phone_board_stacks_its_columns_and_moves_a_card_by_its_destination_buttons` (rewritten from `..._gives_its_column_room_and_keeps_the_next_one_discoverable`): columns stack at the board's width, the board doesn't scroll sideways, a destination tap moves the card and follows it, the emptied column stands at its own height. - `test_a_keyboard_move_keeps_the_card_in_view`: the `columns` arm and `test_tabbing_to_a_grip_reveals_its_whole_card` move from 390px to 720px (`SIDEWAYS`), where the eight-column board is wider than 640px and narrower than its floor, and both assert the board scrolls before relying on it; a new `stacked` arm walks Right down the stacked columns at 390px and checks the document reveals each placement. - `test_on_a_stacked_board_a_vertical_step_past_a_column_s_end_enters_the_next` (new): Down and Up across stacked columns, the no-op past an end side by side, and Escape restoring the origin. - `tests/browser/test_render_pages.py::test_a_boards_minimum_keeps_the_room_the_column_can_grant`: a 540px board now asserts no sideways scroll. - Rewritten tests fail against `main`'s built sheet; the new vertical-step test fails against the widget without the `#step` change. Ran: `uv run pytest tests/browser/widgets/test_boards.py tests/browser/test_render_pages.py -k "keyboard_move or tabbing or stacked_board or cancelling or reversing or at_its_floor or taller_grip or phone_board or says_which_column or boards_minimum" -n 2` (16 passed), `pnpm run build:browser`, `pnpm run check:browser`, pre-commit on the changed files. ## Decisions Max may reverse - Stacking replaces paging at the existing 640px container boundary rather than at "fewer than two columns fit", so a pane up to 640px stacks too, the feature gallery's 410px pane board among them. - A destination tap keeps following the card to its new column (page scroll on a stacked board), since the result among its new neighbours is the comparison context the move asks for and the leaf's Undo then takes it at once; the alternative keeps the view on the origin column. - Left and Right keep their column meaning on a stacked board (previous column is up the screen) and the titles name the column; Down and Up cross into the stacked neighbour past a column's end. The alternative is to leave the arrows as they were and let Down stop at the column's last card. - The example's authored order is unchanged: on a phone the rationale still reads after the board, with the lede carrying the one-line version. - Undo doesn't carry the view back to the origin column (the card returns above the viewport). A board gesture leaves no reversal with `retainGesture`, which the widget API doesn't expose; left as a follow-up. ## Not verified - The catalogue still for `triage-board` is a desktop first screen, which is unchanged; `wt refresh-previews` not run. - Firefox and a real iOS device: Chromium only. - The route titles in the command reference dialog, by eye; no test reads them. - `pnpm run check` and the broad suite, which land runs. Part of #4023. **On landing, update** #4023: `triage-board` is done. > _This was written by Claude Code on behalf of max-sixty_ Co-authored-by: Claude Fable 5.1 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A review page that asks Next, Later or Drop beside each proposal and also shows every answer on a board used to record two independent facts: the section's
lf-optionspick and the board card'smove. The door admitted both,page statereported both, and nothing said which one held. The obligation model had already settled that the section's widget owns the answer; this builds the board's write to that owner.The contract
A board card with
shows="<widget id>"is a view of that widget's answer (x-shows, owned bysrc/leaf/shown_answers.py):showsis a plainx-refersrelation to a widget in the card's own document: the page, or the reply that holds it (frozen-thread scope). A card in a reply that names a page widget is refused (shows-outside).lf-options. The card'sx-shows.valuenames the attribute on its compound owner (lf-column value) holding the answer that column stands for. The widget says how its answer reads as a value: avaluerecord's attribute value, or, for anattributerecord, the newx-awaits.key, whichlf-optionsdeclares asvalueon eachlf-option(unique per group throughx-unique). An answer names a value only when it is one string; an empty pick, an option the user wrote in (novalue), or picks with different values name none, and the card stands in a column withoutvalue, as it does for a value no column holds.shownAnswer(card)(new export inwidget-api.js,browser/runtime/shown-answer.js) reads the owner's state through its controller andanswer(value, says)sends the owner'sx-awaits.valueverb throughwidgetController(owner).dispatch. A drop and a section pick are the same event at[rail-choice, rail-choice, choose], so undo, refusal andrestatedwork on one fact and both views redraw from it.shown-unit).page checkand message admission refuse a card placed apart from its widget's authored answer (shown-elsewherenames the column to move it to), a board with no column for answers that name no value, a column value the widget cannot answer, and ashowsnaming a widget whose answer no view can show.package checkholds both sides of the declaration (shows-reference,shows-value,awaits-key).multiplegroup shows by the value its picks share; a drop replaces the set with the member holding the column's value, and the group's Done still completes the obligation.Alternatives rejected
lf-ask(the note's reason: it moves the answer off the widget that owns its words, options and obligation).viafield naming the view, with the door proving the view may invoke the owner's command. The owner's declaration already decides every value; the field would be bookkeeping no reader needs, and it would have been a protocol change.movewould need the door and both folds to read another widget's state to keep its column consistent; dropped until a page needs ranked answers.lf-options/choose, optionforoverloaded): the mapping is now declared on both sides and read generically.No protocol bump: the change adds an
x-key, anx-awaitsfield and a widget-api export, and the door's new refusal can only fire on pages vendored withx-shows. An earlier page's vendored layer has none of these.Key files
src/leaf/shown_answers.py: the contract, the value rule and the markup checks; door refusal inevent_contracts.position_record_error.browser/runtime/shown-answer.js: the browser reading and write.packages/default/widgets/lf-board.js: places shown cards from the answer inrender(), routes drops to the owner, per-card movability.packages/default/registry.json,browser/registry.json(x-shows,$awaits.key),src/leaf/schema.py,src/leaf/registry/widgets.py.skills/leaf/references/authoring-decisions.md("One decision in its section and on a board"),package-data.md("Views of an answer"),module-reading.md(shownAnswer),events.md(position moves).examples/developer/feature-gallery.html: a Decisions scenario (bg-ask-board).notes/shared-decisions.mdis deleted (its contract now lives inshown_answers.pyand the references); TODO Wait for the disclosure to hold the thread before pressing it open #25 is removed.What ran
tests/model/test_shown_answers.py(new): door refusal, the four markup refusals, reply scope, the value rule.tests/model/interact_contract/test_registry_door.py: the three declaration refusals, and the rest ofinteract_contract,test_obligations.py,test_interact_document.py,test_interact_product.py,test_interact_layer.py,test_unused_exports.py.tests/browser/widgets/test_boards.py::test_a_section_and_a_board_answer_one_decision(new, 2.5 s): a section pick and a keyboard drop land as twochooseactions on the section's group, undo restores both views, a version that marks the grouprestatedretracts the pick in both, and a refused drop leaves both where the server has them; plus the existing board tests touching availability, keyboard and pointer moves.pnpm run test:runtime(550 pass),pnpm run check:browser, pre-commit.leaf-dev probeon a two-proposal page, Chromium (recorded) and Firefox: section pick, keyboard drop, pointer drag, undo, refused drop and refused pick, and a live revision restating a pick; a board in an agent reply showing a group frozen in the same reply.Not done: no
evals/run for the new authoring section; it is conditional on the user needing all answers on one board, so I judged the risk to other decision pages low.