Skip to content

Give every corner one of three sizes - #3796

Merged
max-sixty merged 4 commits into
mainfrom
rectangular-chips
Oct 24, 2026
Merged

max-sixty merged 4 commits into
mainfrom
rectangular-chips

Conversation

@max-sixty

@max-sixty max-sixty commented Oct 24, 2026 •

Copy link
Copy Markdown
Owner

Corners were set one at a time, at eleven different lengths, with circles for margin entries and corner marks. The 👍 you press in the selection toolbar was a 6px rounded square, and it became a circle once it landed in the margin. The theme now has three corner sizes, chosen by what wears them. GitHub's Primer and Web Awesome's defaults use the same scale:

  • --r-s (3px): marks no taller than a line of text, such as chips, keys, inline code, tooltips, checkboxes, corner marks and word highlights.
  • --r (6px): controls and boxes in the page's flow, such as buttons, fields, margin entries, menu rows and code blocks.
  • --r-l (12px): surfaces floating over the page that hold controls, such as the Leaf panel and its menu, the thread card and dialogs.

Dots, radio marks and count pills stay round.

What a reviewer will see change:

  • Margin entries use --r. A pin uses --r on three corners and leaves the corner pointing into its block square, where it used to be a teardrop. The unread dot now sits on the corner with a paper ring.
  • Corner marks (fold, attachment removal, Undo last stroke) go from discs to --r-s. controls.css records this change to the face settled on 22 October.
  • The thread card goes from 10px to --r-l, matching the panel. The command reference dialog goes from 6px to --r-l, matching the Page Map dialog.
  • Role tokens --chip-r, --tip-r and --code-inline-r stay as their faces' tokens and now refer to --r-s. Web Awesome's radius tokens refer to Leaf's scale.

Tests that asserted the old faces (50% entries in replies, 50% corner marks, 8px thumbnails) now assert the new ones. The shadow-staged work marker test opens its page with pins but asserted the rail's face, so it was already failing on main; it now expects the pin's face.

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

max-sixty and others added 3 commits October 23, 2026 17:25
Margin entries were the theme's only round controls: buttons, fields, menu rows
and the selection toolbar's responses all wear the 6px corner (--r), so a 👍
pressed in the toolbar changed shape when it landed in the margin. A new
--margin-entry-r token sets the entry's corner to --r; a pin takes the same
corners with the one pointing into its block left square, in place of the
teardrop. The unread dot now sits on a squared corner, over the border, so every
entry gives it the paper ring pins already had.

Behavior change: rail entries compute border-radius 6px and pins 6px 6px 6px
0px, where they were 50% and 50% 50% 50% 3px; the tests asserting those faces
now assert the new ones.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Corners were set one by one: 2, 3, 4, 5, 6, 7, 8, 9, 10, 12 and 14px, with a
circle for the margin entries and corner marks. The theme now states a scale,
the one GitHub's Primer and Web Awesome's defaults share: --r-s (3px) for marks
no taller than a line of text, --r (6px) for controls and boxes in the page's
flow, and --r-l (12px) for surfaces floating over the page that hold controls.
Only what is round by meaning stays round: dots, radio marks, a count's pill.

- Margin entries take --r and drop the --margin-entry-r token the previous
  commit added; a pin keeps --r with its pointing corner square.
- The thread card goes from 10px to --r-l, the panel's corner, and the command
  reference dialog from 6px to --r-l beside the Page Map dialog.
- Corner marks (fold, attachment removal, Undo last stroke) go from discs to
  --r-s. This changes the face the 22 October choice settled, which was about
  the mark's ground rather than its shape; controls.css records it.
- The keyboard badge, tooltips, inline code, chips, checkboxes, word highlights
  and trace labels take --r-s; menu rows, notices, peeks, the new-reply jump,
  attachment thumbnails and the file editor's buttons take --r; the panel's
  count badge is a pill.
- --chip-r, --tip-r and --code-inline-r stay as their faces' tokens and name
  --r-s; Web Awesome's radius tokens name Leaf's scale.

Behavior change: tests now assert 6px margin entries in replies, 3px corner
marks and 6px attachment thumbnails, where they asserted 50%, 50% and 8px.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
leaf-agent previously approved these changes Oct 24, 2026
The test opens its page with pins, so the marker wears the pin's face (26px,
one square corner). It asserted the rail's face and failed on main too, where it
read 50% 50% 50% 3px against 50%.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@max-sixty
max-sixty merged commit 9bacd36 into main Oct 24, 2026
3 checks passed
@max-sixty
max-sixty deleted the rectangular-chips branch October 24, 2026 07:26
leaf-agent added a commit that referenced this pull request Oct 24, 2026
The [main CI
run](https://github.com/max-sixty/leaf/actions/runs/40072986191) failed
three layout cases because their assertions still expected the old
`wide` measure. #3788 changed `--wide` from 1080px to 840px and aligned
wide blocks with the prose's start edge. The rail test now checks the
current measure plus its page padding; the pictured-options test checks
that widening gives both pictures more room without requiring the old
480px size.

The fourth failure in that run, a margin marker corner assertion, was
updated by #3796 and passes on current `main`. The three changed cases
failed before this patch and pass after it in focused Chromium runs (`uv
run pytest -q -n0` with those node IDs). The preceding main run at
a550f98 passed these tests before #3788 landed.

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