Skip to content

Line the panel's field, tabs and thread controls, the margin card, dialog Close and plan marks up with their containers' edges - #6672

Merged
max-sixty merged 9 commits into
mainfrom
try-pritamux
Nov 21, 2026
Merged

max-sixty merged 9 commits into
mainfrom
try-pritamux

Conversation

@max-sixty

@max-sixty max-sixty commented Nov 21, 2026 •

Copy link
Copy Markdown
Owner

An alignment pass with the gridlines skill over the floating panel, the margin card and the chrome's dialogs found items standing 2.6–12px off the edges their containers share. This lines them up by changing each container's rule, not single items:

  • Panel field. The status, a draft and "Reply…" started 5px right of every other line in the panel, because the panel set --lf-thread-text-inset to its own 8px only inside a thread's view. The panel now sets it for everything it holds, so a draft's lines start where the sent message's will.
  • Panel tabs. A tab's words now stand --lf-fp-inset inside its frame, as the field's words do, and the strip hangs into the panel's padding by that much, so the first tab's words start on the text line and a selected tab's frame on the field's edge. An empty gap between two tabs takes a gutter track an inset wide, which gives way with the tabs' insets: the tabs keep 24px between their words on a desktop panel and still share a phone's line with Close, where a column-gap would keep its width and break that line.
  • Panel thread. Each message's react and copy hang into the 12px the transcript keeps at its end, so copy ends under the head's ✕.
  • Margin card. The card's controls and each message head's controls end their glyphs over the reply box's last control, 4px further in: under a mouse, on the edge the card's words wrap at. The card's controls take those 4px from their padding, so the first message's head beside them keeps its width. Where scrollbars take room (Linux, Windows, macOS with a mouse), a thread long enough to scroll puts its bar between the heads and the card's edge, so the heads' controls end one bar's width before the card's, as on main.
  • Dialog Close. Page Map, the command reference and About stood Close's box on their edge, leaving the ✕ 9px inside the edge their search field and words end on. The room between a symbol's box and its glyph is now --lf-symbol-inset on the symbol face, beside --lf-word-inset, and the dialog head hangs Close by it. About hangs Copy too. Its report now scrolls out to the sheet's padding edge, as the Page Map's list does, so its words sit 15px inside the dialog like Page Map's (5px further out than before), and Copy's focus ring stays inside the scroller.
  • Plan marks. A done step's ✓ sat inline, 2.6px below its title's centre, and a wrapped title's mark centred between its lines. The mark is now a line tall and centres its symbol.

It also lists gridlines among the external UI skills, with the two probe fixes it needs first (pritamux/gridlines#1).

Before After
Panel
Page Map
Plan, phone

Max asked to try the skill on Leaf and picked the tab, thread-control and card layouts from mocks. On a phone, where a tab's inset gives way, the first tab's words start 5.5px left of the text line, and the selected tab's frame stays on the field's edge. A fresh reviewer read the before/after stills, which found About's split symbol column, the wrapped plan step, and a selected tab crowding the next one before the gutter. Checked with leaf-dev stills in Chromium and Firefox at 1440px and phone width; the focused panel, card, dialog and stylesheet-guard tests pass, and two tests now assert the drawn position rather than a box: Page Map's ✕ at its head's end, and the first tab's words on the controls' start with its frame on the field's edge.

This was written by Claude Code on behalf of max-sixty

…tainers' edges

An alignment pass with the gridlines skill (pritamux/gridlines) over the
panel and the chrome's dialogs found three misses of 2.6px or more:

- The panel's field set its words at the anchored comment box's 13px
  inset, which the panel overrode only inside a thread's view, so the
  status, a draft and "Reply…" started 5px right of every other line in
  the panel (19px against 14px). The panel now sets the inset for all it
  holds, so the field's words start under the thread's, a draft's lines
  stand where the sent message's will, and the focused box keeps its
  words 14px inside its edge, as the anchored box does.
- Page Map, the command reference and About this page put Close's box
  on the dialog's edge, which left its ✕ 9px inside the edge the search
  field and the dialog's words end on. Close's box now reaches past that
  edge, so its ✕ ends on it, as the panel head's does; About's head pads
  its end as it does its start.
- A plan step's symbol (done, failed, working) sat inline on a line box
  inside its 16px mark, 2.6px below the title's centre. The mark now
  centres it in a grid cell; the open step's circle was already centred.

test_the_g_chord_opens_an_empty_page_map now asserts that Close's drawn
✕, rather than its box, ends at the head's end.

Checked in Chromium and Firefox at 1440px and at phone width with
leaf-dev stills; the probe reports the field's words at 14px, each
dialog's ✕ within 0.2px of its content edge, and the mark within 0.5px
of its title's centre.
The dialog head's Close computed the room between its box's edge and its
glyph inline. That room is a fact about the symbol face, so controls.css
now states it as `--lf-symbol-inset` beside the face, parallel to
`--lf-word-inset` for a word, and the dialog head hangs Close by it.
Nothing moves.
…ts first line

Review of the first pass found two misses it left:

- About this page put Close's ✕ on the report's edge but left each
  Copy's glyph 8px inside it, so the column of symbols down the dialog's
  end split in two. Copy now hangs by `--lf-symbol-inset` too, and the
  report keeps that much room at its sides, so the hang stays inside its
  scroller rather than scrolling it sideways. The report's words, its
  boxes, the title and both symbols now share one edge, 4px further in
  than the report's words stood.
- A plan step whose title wraps, as at phone width, centred its mark on
  the whole title, between its lines, while the step's time stood on the
  first. The mark is now a line tall and starts with the title.

`--lf-symbol-inset` is stated on the root as well as the symbol, so a
scroller can read it.

@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.

The new Copy hang in About cuts Copy's keyboard focus ring. .lf-copyable-head > .lf-icon-action pulls the button --lf-symbol-inset (9px) into .lf-inspection-body's inline padding, and that padding is now exactly --lf-inspection-inset (9px). So Copy's box ends on the scroller's padding edge. The ring draws --lf-focus-ring-room (5px) outside the box, and overflow: auto clips it. On base the button stood inside 5px of padding, which held the whole ring.

I checked this in Chromium with leaf-dev stills and a temporary state: About open, Structured report expanded, Copy focused by Tab. On head the ring's end side is missing; on base it is whole.

This is the cut ring #4125 tracks, and that issue rules out another per-case patch. So the cheaper move is to leave Copy unhung and keep its ring's room, giving up the glyph's alignment under Close. A classic scrollbar breaks that alignment anyway, since the scroller's track stands between the two glyphs. The other way is to widen the body's inline padding to --lf-symbol-inset plus --lf-focus-ring-room, which moves the report's words a further 5px in.

…ocus ring stays whole

The automated review on #6672 found that hanging Copy by --lf-symbol-inset put its box
on the edge of .lf-inspection-body's 9px padding, so overflow: auto cut its focus ring's
end side. The report now takes the sheet's padding as its own, as the Page Map's list
already does: it reaches out to the padding edge with margin-inline and pads back by the
same --lf-sheet-inset. Its words now start and end 15px inside the dialog, the edge Page
Map and the command reference use (20px before this branch), Close's ✕ and Copy's glyph
end on that edge, and Copy's box stands 5px inside the scroller, which holds the ring.
Measured in Chromium, Firefox and a 390px touch window: no sideways scroll and the ring
fits in each. The sheet's padding is now one custom property, which the Page Map's list
and the phone sheet's bottom padding read instead of repeating 14px.

Co-Authored-By: Claude <[email protected]>
leaf-agent
leaf-agent previously approved these changes Nov 21, 2026
…their containers' edges

The user picked these three layouts on the gridlines report.

Tabs: a tab's words stand `--lf-fp-inset` inside its frame, as the field's
words stand inside the field, and the strip hangs into the panel's padding
by that much. The first tab's words start on the panel's text line and a
selected tab's frame on the field's edge. The mock the user picked kept the
words 24px apart with an 8px gap between tabs; a fixed gap doesn't give way,
and at 390px it sent Close off the tabs' line, so the tabs stand side by
side, their words 16px apart. On a phone, where a tab's inset gives way, its
words start up to 7px left of the text line (3px right before).

Panel thread: each message's react and copy hang into the transcript's end
room, so copy ends under the head's ✕, its focus ring 6px inside the view.

Margin card: the card's controls, and the controls of each head that spans
the card, end their glyphs over the reply box's last control (the thread
text inset less `--lf-symbol-inset`): under a mouse 4px further in, where
the card's words wrap; under a finger over Send. A head beside the card's
controls keeps its controls before them, so the rule between the two stays
centred.

Also lists gridlines among the external UI skills, with the probe fixes it
needs first (pritamux/gridlines#1).

test_on_me_s_tabs_stand_where_a_view_names_itself now asserts the first
tab's words on the controls' start and its frame on the field's edge,
rather than its frame on the controls' start.
@max-sixty max-sixty changed the title Line the panel's field, dialog Close and plan marks up with their containers' edges Line the panel's field, tabs and thread controls, the margin card, dialog Close and plan marks up with their containers' edges Nov 21, 2026

@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.

The margin card change in efdae6c turns two tests/browser/threads/test_layout.py tests red. Both pass on the merge base and fail at this head, and this is the only commit in the PR that touches the margin card's CSS:

  • test_a_head_s_words_take_its_controls_room_while_they_hide, subtest "the controls hide": at rest, with no controls shown, the user's queued message no longer shows its whole receipt ({'whole': False, ..., 'controls': None}). The test protects the head lending its controls' room to its words while the controls hide. Now the head cuts its receipt for controls nobody can see, the "Me just now · Qu…" case its docstring describes.
  • test_a_margin_message_copy_keeps_its_edge_when_send_motion_ends: Copy ends 4px inside the message's edge (right: -4, expected 0). That 4px is the intended --lf-margin-symbol-end (13px − 9px), so this test needs updating to the new edge. It can't stay as written.

The first needs a fix to the CSS rather than the test. The 4px end margin on the head's .lf-msg-controls seems to keep taking room after the control room has given its width up. Putting the inset where it gives way along with the room would likely keep the receipt whole.

…a phone

The tabs stood side by side, their words 16px apart, because a column-gap
holds its width and sent Close off the tabs' line at 390px. A fresh look at
the stills found the selected tab's frame crowding the next tab's words (8px
from them, against 16px between words). An empty gap now stands between two
tabs in a minmax(0, --lf-fp-inset) gutter track, which gives way with the
tabs' insets, so at 540px the words stand 24px apart, as Max's pick showed,
and at 390px the gutters and insets share what the line lacks (gutters
2.9px, insets 1.5px). Measured in Chromium and Firefox; the phone tab test
and the tab position test pass.
…ays whole

efdae6c ended the card's controls 4px inside their track with a margin, which
widened the track by 4px and took that room from the first message's head beside
it. In DejaVu Sans, CI's face, a queued message's receipt then needed 118px and had
115px, so `test_a_head_s_words_take_its_controls_room_while_they_hide` failed on
Linux (the automated review's finding on efdae6c).

The card's controls now give the 4px up from their padding (8px to 4px), so their
track is as wide as on main and the receipt fits (118px of 118px in DejaVu). Every
head's controls in the card now end the same 4px inside the head, the first head's
included, and the rule between the first head's controls and the card's moves in
with them, so it stays centred in the 8px between the two sets of controls.
Padding alone, without the head's 4px, left the rule on Expand's box edge. On the
desktop stills the card looks as at 07d18b0; only the first head's box is 4px
wider. The later heads' end room now comes from that one rule rather than a
condition on later messages not beside the actions.

`test_a_margin_message_copy_keeps_its_edge_when_send_motion_ends` pinned Copy to the
message's edge, which the card's symbol end moved 4px in on purpose. It now pins
Copy's end to the card's own controls' end, the alignment the user picked, at the
last translated frame and at rest.

@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.

The rewritten test_a_margin_message_copy_keeps_its_edge_when_send_motion_ends fails on Linux Chromium, which CI's test job runs: {'right': -4, 'top': 0, 'cardEnd': 6}. The reply makes the margin card's transcript scroll, and with a classic scrollbar the transcript's 10px track stands between the message and the card's controls. So Copy ends 4px inside the message, as intended, but the card's controls end 10px further out. With overlay scrollbars, as on macOS, the track takes no room and the two ends meet. The receipt test passes here.

The suggestion below measures the card's end from the transcript's content edge, so the test pins what the CSS sets on every platform. It passes locally with that change. It also means that wherever scrollbars take room, a head's Copy and the card's Resolve don't share a column. The base already had that 10px offset, so this is not a regression.

Comment thread tests/browser/threads/test_layout.py Resolved
…transcript's bar

67287cd pinned Copy's end to the card's controls' end. On Linux Chromium, CI's
`test` job, the test failed with `{'right': -4, 'top': 0, 'cardEnd': 6}`: the reply
makes the transcript overflow, and its classic scrollbar (10px, `scrollbar-width:
thin`) stands between the message and the card's edge. Copy still ends 4px inside
the message, as the CSS sets; the card's controls end one bar's width further out.
With overlay scrollbars, as on macOS, the bar takes no room and the two ends meet.

The test now leaves the transcript's bar out of the comparison (the automated
review's suggestion), so it pins what the CSS sets on every platform. Where
scrollbars take room and a thread overflows, a head's Copy stands one bar's width
before the card's Resolve, as on main.
@max-sixty
max-sixty merged commit b627d08 into main Nov 21, 2026
7 checks passed
@max-sixty
max-sixty deleted the try-pritamux branch November 21, 2026 21:34
leaf-agent added a commit that referenced this pull request Nov 22, 2026
…nd room (#6698)

`test_a_message_reaction_trigger_meets_its_header_and_covers_no_words[360-True]`
has failed on main since #6672 (`b627d08c6`), first in [run
44959371689](https://github.com/max-sixty/leaf/actions/runs/44959371689).
#6672 deliberately hangs each panel message's controls into the 12px the
transcript keeps at its end, so react and copy end under the head's ✕.
On a touch phone Copy isn't drawn, so React ends the head's line and its
44px box runs from 300 to 344 against a head ending at 332. That trips
the test's `insideHeader` bound. At 1440px Copy is the control that
hangs, so React stays inside and that case kept passing.

The test now checks `onHeadLine`: the trigger overlaps its head's row
and stands between the head's start and the transcript's padding edge.
This follows #6672's intent and leaves the interface alone. The check
still fails if a control leaves that room: with the control room's hang
doubled to 24px, it reads `onHeadLine: False`.

Verification, locally in Chromium:
- On main at `2ca1362b0`, the test fails with `insideHeader: False` (1
failed, 1 passed).
- With this change it passes at that head and on `48a61a0ef`, the commit
before #6672 (2 passed each).
- I swapped the styles from the range's commits into the old test: it
passes at `48a61a0ef` and `c9d5e98f1` and fails at `b627d08c6`.

Closes #6697 — automated triage

Co-authored-by: leaf-agent <[email protected]>
max-sixty added a commit that referenced this pull request Nov 22, 2026
…he head

In the floating panel's thread view, each message's controls hang 12px past
their head's end into the room the transcript keeps there, so react and copy end
under the head's close (#6672). The head cuts what it holds 8px past its end, so
it cut the last 4px of each control: the focus ring lost its right side, and a
press on that strip landed on the transcript instead of the control (at
1440x900 under a finger, Edit and Add reaction span 940-984px and presses at 981
and 983 reached the transcript). The panel now states the hang once, as
`--lf-msg-controls-hang`; the room's end margin and the head's cut both read it,
so the cut stands a gap past wherever the controls end. Heads with no hang keep
their cut 8px past their end, as before.

The aim sweep in test_every_control_the_layer_offers_is_a_box_the_user_can_hit
found this as "lf-icon-action at 0x0 under .lf-thread-transcript", on main under
a fine pointer and, once the page stopped keeping room for the panel, under a
finger too.
leaf-agent added a commit that referenced this pull request Nov 22, 2026
…ip (#6745)

#6672 hung each panel message's react and copy 12px into the room the
transcript keeps at its end, with a negative margin on
`.lf-msg-control-room`. But a message head cuts what it holds a gap
(`--lf-sp-2`, 8px) past its own end (`surfaces.css`,
`:where(.lf-msg-head)`'s `clip-path`). So the last 4px of Copy, the
head's last control, fell outside the cut. A press there reached
`.lf-thread-transcript`, and the nightly aim sweep read Copy as a 0×0
target:

```
lf-icon-action "" at 0.0x0.0 under .lf-thread-transcript
```

This was a visible control losing part of its box, not a hidden control
the sweep should skip. In the panel at 1200px, Copy's box spans x
836–864, but a press at x 860–863 hit the transcript.

The negative margin now sits on the panel's `.lf-msg-head` instead of
its control room. The head itself reaches into the end room, its
controls stay its last item and end where #6672 put them, and the cut
stands a gap past them. The margin card's heads are untouched, since the
rule stays scoped to `.lf-fp-messages`.

**Verification**
-
`tests/journeys/test_render_controls.py::test_every_control_the_layer_offers_is_a_box_the_user_can_hit`
fails on `d53e9994f` and passes with the change, for both `[False]` and
`[True]`.
- `leaf-dev stills --state floating-thread --state reaction-palette
--state plan-thread-in-panel` reports 0 px changed against main. At rest
the panel draws the same. The change shows only where Copy's last 4px
and its focus ring had been cut.
- The focused reaction, panel, rewrite and thread-layout tests that read
the head's geometry pass.

Closes #6743 — automated triage

Co-authored-by: leaf-agent <[email protected]>
max-sixty added a commit that referenced this pull request Nov 27, 2026
…7366)

`leaf-dev stills` now reads two kinds of geometry fault on both versions
of each state it compares, and lists each fault the change adds. Faults
both versions share stay out of the report. Max asked for this after a
thread card's unread dot came back touching the card's edge:
`browser/AGENTS.md` already forbids that, but until now nothing checked
it, and each break was found by eye.

- **Edges** (`dev/leaf_dev/geometry.js`), in any engine: a box Leaf
draws that nearly touches its frame's edge, crosses it, or is cut by it,
and a round mark closer to the edge than `--lf-clear` (4px). The
floating panel and the margin card draw their outline and rounded
corners on a separate layer behind them (`.lf-box-ground`), so the
reading takes their edge from that layer. A box's corner is read against
every clip around it, the frame and any box between, so a rounded clip
nearer than the frame rounds it too. It reads three cases from what the
page itself declares, with no rule written for any one widget, and
leaves them out:
  - parts of a Web Awesome component, which keep the library's look;
- thumbs: anything inside a `slider` or `scrollbar` role, or moved by a
scroll timeline;
  - marks inside a drawing (`--lf-drawing`).
- **Rings** (`dev/leaf_dev/rings.py`), in Chromium only: a focus ring
that a clip cuts or another box covers. This is the reading the ring
tests already use. It moves out of `tests/render_cases_layout.py` and
`tests/page_scripts/` into `leaf_dev`, so the tests and stills call one
implementation. In Firefox, its pixel check reported 4 rings on main as
unpainted along one edge, and a Firefox screenshot of one of them shows
that edge painted. So stills reads rings in Chromium only.

**Caught at the commit before each fix, gone at the fix:**
- **#7138, the unread dot.** At the commit before #7138, the edge
reading flags the dot touching the card's border (`round left 0px`) and
cut 1px by the transcript (`cut left -1px`), in Chromium and Firefox.
Diffing the commits before and at #6773, which caused it, gives exactly
those two findings. Putting #6773's dot placement back on this branch
makes stills print exactly those two lines.
- **#7256, the deck card's ring.** The ring reading finds it cut 8px on
each side and covered at the top and bottom.
- **#6395, the file tree search field's ring.** With the field focused,
the ring's top edge is 4px outside the tree. No catalogue state focused
the field at the time. The edge reading also flags the field itself
standing 1px below the tree's top edge.

**Not caught:** #6672 (an alignment pass), and a reading of Leaf's boxes
overlapping each other, which I built, measured and left out:
- On main it found 11 overlaps in Chromium (11 in Firefox), all
deliberate and none a defect. Examples: a picture's remove button on its
corner, Copy over its code block, a timeline's marks over its gridlines,
a margin pin over a board card.
- At the commits before the fixes:
- #6336: it caught the count badge covering the folded leaf's error dot,
but only on a page built the way #6336's test builds it.
- #6830: in the catalogue's state, the fold mark crossed the picture by
1px, the same as a seam between two boxes, so it missed.
  - #6615: list markers have no box to measure, so it can't catch them.

**Findings on main, all 334 states:**
- **Edges:** 13 findings from 4 causes, the same in Chromium and
Firefox. Chromium adds 2 more from a 5th cause, in a state that holds
the runtime back, which Firefox can't open. All are real breaks of the
rule; there were no false alarms.
- **Rings:** 2 findings in Chromium, both false. In each, an overlay
scrollbar covers the ring's edge; the stills browser keeps scrollbars
visible on purpose.
- Since stills reports only faults a change adds, none of these show in
an ordinary run.
- **Cost:** the reading adds a median of 0.1 s per side of each state
(0.3 s at p90, 1.3 s at most), next to about 5 s to open that side.

**The live edge breaches, and whether Max chose them** (from `git log
-S`/`-L`; this PR fixes none of them):
- **The folded leaf's count badge and news dot**, 1px and 3px from its
edge: an accident. #3650 shrank the leaf and kept the badges' offsets.
- **The unread dot on the corner of a margin pin and a margin entry**,
touching the face's border: Max chose the top-left corner (#6627, and a
test pins it) and the dot's size (#6340). The touch came from #3796,
which listed the dot sitting on the corner as a point for reviewers to
look at; nothing records Max choosing it.
- **The 1px strip in the screenshot comparison**, between the frame's
border and the picture: an accident of #3704's transparent frame border.
- **The option list's rounded corners before the runtime loads:** an
accident. #6812's `:last-child` rule can't see the `::after` placeholder
that holds the Add/Done row's room until the runtime draws it.
- **The comparison's divider, cut at the end of its track:** Web
Awesome's own drawing, which the reading now leaves alone.

**Guidance:**
- `browser/AGENTS.md` now says a round mark stands clear by `--lf-clear`
and never touches an edge. The old wording said a dot keeps its corners
"wherever it stands". Scored with Opus, 3 runs per arm: the old wording
called a dot touching the edge a break 0 of 3 times, the new wording 3
of 3. A thumb, and a field meeting its frame's edge, scored the same
under both.
- `/developing-leaf` now says stills lists the faults a change adds, and
that a change hands over none it can fix. Both versions led the model to
fix the dot before handing over, 3 of 3. Without the sentence it misread
the fault lines as style changes.

**Catalogue states:** a separate commit repairs 11 states that failed on
main, most after a 2-minute timeout, which cost every stills run that
time. `plan-panel-dictating` and `table-scrolled-sideways` now fail in
Firefox within 5 s and say why, because Firefox has no surface for them.

**Size:**
- tooling: +922 / −7, about 280 of it moved from the tests
- tests: +48 / −354
- catalogue states: +80 / −39
- docs: +8 / −4
- lint config: +11 / −5

**Tests:** these ring-helper tests pass, run by node id:
-
`test_panes::test_a_pane_bodys_ring_is_drawn_whole_against_the_workspace_edges`
-
`test_rings::test_the_focus_sweep_distinguishes_stops_inside_a_live_frame`
- `test_threads::test_the_thread_walk_stops_at_each_unsent_comment`
-
`test_card_reply::test_next_on_me_rings_the_options_a_card_message_asks_with_whole`
-
`test_focus::test_the_keys_into_and_out_of_a_panel_thread_land_where_keys_act`

All 5,721 browser and journey tests collect. ruff, ty, eslint, oxfmt,
vulture, typos and knip pass.

> _This was written by Claude Code on behalf of max-sixty_
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