Skip to content

Unify Button states, receipts, and overflow - #212

Merged
max-sixty merged 6 commits into
mainfrom
codex/canonical-buttons
Sep 2, 2026
Merged

max-sixty merged 6 commits into
mainfrom
codex/canonical-buttons

Conversation

@max-sixty

@max-sixty max-sixty commented Sep 2, 2026 •

Copy link
Copy Markdown
Owner

Leaf's document-bound Buttons now share one interaction model and visual grammar. This addresses controls that changed shape, hid useful actions during editing, or left a settled outcome looking clickable. The circles keep a soft neutral border; weight distinguishes an immediate action from a disclosure, and only the icon carries positive or negative colour. Standing reactions keep the existing neutral settled-state mark so selection remains distinct from hover.

The core is living-margin.js: contributions declare stable keys, semantic roles and lifecycle state. The margin orders the controls, keeps completion and escape actions exposed, bounds larger clusters, and makes excess actions reachable through Page map. Keyboard focus and pointer hover identify the exact target without moving the controls.

Suggestions now settle into receipt text with Undo, and failed actions expose Retry/Cancel. Draft editing uses the same lifecycle and Button faces. The shared projection owns named-gesture Undo eligibility, while the compact composer sizes itself to the available space and repositions after typed or mirrored edits.

Regression coverage exercises ordering, overflow reachability, focus, receipts, retry/undo, icon-only colour, shared border colour, and composer placement. The release-notes example and generated corpus demonstrate the updated controls, with light/dark browser checks on composed pages.

This was written by Codex on behalf of max-sixty

# Conflicts:
#	skills/leaf/assets/runtime/composing/input.js
#	skills/leaf/assets/runtime/projection.js
#	skills/leaf/assets/widgets/lf-suggestion.js
#	skills/leaf/packages/default/widgets/lf-draft.js

@leaf-agent leaf-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One thing the new grammar leaves without a reading: a reaction token the reader has already put down. Detail inline.

# Conflicts:
#	skills/leaf/CLAUDE.md
#	skills/leaf/assets/runtime/chrome-style.js
#	skills/leaf/assets/runtime/composing/surface.js
#	tests/test_render_reactions.py
@max-sixty
max-sixty merged commit 35b2f33 into main Sep 2, 2026
6 checks passed
@max-sixty
max-sixty deleted the codex/canonical-buttons branch September 2, 2026 06:03
max-sixty added a commit that referenced this pull request Sep 2, 2026
Takes #212, which unifies Button states, receipts, and overflow, and answers
the 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, no ring, and no tab stop.

Main's model wins the merge: the `receipt` behavior, its theme and chrome
rules, its tab-stop handoff, its reference paragraph, and its test come out,
and the accessible-name test beside it stays. Where both sides changed one
line, both are kept: the label tooltip wraps as main has it and casts its
shadow in this branch's `--shade`, and the anchors test's hit sweep takes
main's margin-item controls while still skipping boxes that take no pointer.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
max-sixty added a commit that referenced this pull request Sep 2, 2026
…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]>
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