Skip to content

Stand a control's badges in one row, so a margin entry's unread dot no longer covers its count - #6336

Merged
max-sixty merged 4 commits into
mainfrom
margin-marker-mistake
Nov 18, 2026
Merged

max-sixty merged 4 commits into
mainfrom
margin-marker-mistake

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

A margin entry holding several threads, one with an unread answer, drew its blue unread dot over its black count badge, so the count read as a crescent. Each badge (count, unread dot, error dot) was seated on a corner by its own CSS rule, some by left and right and some by start and end, on two controls. Probed in Firefox on main, four of eight control, place and direction cases drew one badge over another: the rail entry left to right, a pin on a right-to-left page, and the folded leaf in both directions, where an unseen error's dot sat wholly under the On Me count left to right.

Both controls now put their badges in one .lf-badges flex row along the top edge (browser/styles/components/controls.css): the count on one corner, the dots side by side on the other, and the dots on the count's corner when no count shows. That is the arrangement chosen for the folded leaf in #2696, now on the margin entry too. The row runs left to right whatever the page's direction, since both controls stand at the window's right, and each badge keeps its size, so badges wider together than their control run past its left end. The margin entry's dot becomes an .lf-unread-dot element that presentContributionEntry draws from an unread option, replacing a ::after copy of the dot's face, syncContributionUnread and data-lf-unread on entries.

To weigh: with a count, the margin entry's dot now stands on the corner opposite it, and the folded leaf's error dot rides its top edge beside the news dot rather than inside its corner. A lone count or dot stands where it did, except a right-to-left page's lone dot, now on the right. The feature gallery gains a "Count and news" sample, so the stills catalogue shows the pair.

Asked for by the user after meeting the overlap on a figure with three threads. Tests: test_a_control_s_badges_stand_apart_whichever_show (both controls, both directions, two-digit counts; fails with a count pulled over the dot, a dot positioned onto the leaf's count, or badges allowed to shrink), the tests whose selectors changed, pnpm run test:runtime, pnpm run check:browser. Firefox stills of the margin, Page Map and panel states are pixel-identical to main.

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

A margin entry holding several threads, one of them with an unread
answer, drew the unread dot on top of its count: both badges were seated
on the entry's top-right corner by rules of their own, so the count read
as a black crescent behind a blue dot. The user met it on a figure with
three threads on 17 November 2026 and asked what the UI was.

Each badge chose its corner independently, some by physical sides and
some by logical ones, on two carriers. Probed in Firefox on the merge
base, four of the eight carrier, place and direction cases drew one badge
over another:

- a margin entry in the rail, left to right: the dot over the count;
- a pin on a right-to-left page: the dot over the count;
- the folded leaf, left to right: an unseen error's dot wholly under the
  On Me count, so the error never showed;
- the folded leaf, right to left: the error's dot over the news dot.

Both carriers now put their badges in one `.lf-badges` flex row along
their top edge (controls.css). The count holds a corner, the dots stand
side by side at the other corner, and with no count the dots take the
count's corner: the arrangement the user chose for the folded leaf in
its design review (#2696), now on the margin entry too. The row runs
left to right whatever the page's direction, since both carriers stand
at the window's right and a pin keeps its count off the window's edge.
A carrier sets only the row's box and how far its count reaches past
the corner (`--lf-badge-reach`); a pin's count takes the left corner.

The margin entry's dot is now an `.lf-unread-dot` element in the row,
rendered by `presentContributionEntry` from an `unread` option, in place
of a `::after` that copied the dot's face; `syncContributionUnread` and
the entry's `data-lf-unread` go. The leaf's sibling rule moving the news
dot to the count's corner goes too. Where only one badge shows, and for
a count with a dot, every badge stands where it did, except that a lone
dot on a right-to-left page's margin entry stands on the right like the
rest, and the folded leaf's error dot joins the row over its edge rather
than inside its corner.

`test_a_control_s_badges_stand_apart_whichever_show` holds the rule on
both carriers in both directions; it fails with a count pulled over the
dot and with a dot positioned onto the leaf's count.
…how a count with news in the feature gallery

A two-digit On Me count, news and an error are together wider than the folded leaf, and flex shrank the dots out of round (8px to 7.5px, and narrower with a three-digit count, whose digits then spilled past the badge). Each badge in `.lf-badges` now keeps its size, and the row runs past its start instead. The test now seeds twelve threads and twelve questions, so the margin entry's count and the leaf's count have two digits, and checks that each dot stays round and each count holds its digits.

The feature gallery's Face anatomy group gains a "Count and news" sample, so the stills catalogue shows a count and an unread dot together; `presentContributionEntry` documents its `unread` option in module-annotations.md, which the gallery's widget now passes.
The badges' boxes were read while the fold could still be moving the leaf, so one read could straddle the motion.
@max-sixty
max-sixty merged commit 1506517 into main Nov 18, 2026
5 checks passed
@max-sixty
max-sixty deleted the margin-marker-mistake branch November 18, 2026 02:04
leaf-agent added a commit that referenced this pull request Nov 18, 2026
…#6336 (#6347)

#6336 added a "Count and news" sample to the feature gallery's Face
anatomy group
(`examples/developer/feature-gallery.page/margin-entry-gallery-view.js`),
so it shows a margin entry's unread dot next to its count. That brings
the gallery from 22 samples to 23.
`test_an_export_reveals_its_widgets_and_releases_readable_failure_fallback`
checks that an export draws the full gallery, and it still expected 22.
It failed on main in push run
[44230156303](https://github.com/max-sixty/leaf/actions/runs/44230156303)
with `Locator expected to have count '22'` / `Actual value: 23`. The
test now expects 23. The sample is the new behavior #6336 meant to add,
so the test changes and the gallery stays as it is.

Locally, the test fails on `main` (`Actual value: 23`) and passes with
this change.

Refs #3985 — automated triage

Co-authored-by: leaf-agent <[email protected]>
max-sixty added a commit that referenced this pull request Nov 18, 2026
A margin entry's count (a 14px ink pill inside a 1px paper border) and
the folded leaf's (a 17px green pill with a 2px paper ring) were two
faces for one role, and so were their unread dots (6px and 8px). Both
controls are 32px and, since #6336, put their badges in the same
`.lf-badges` row. Every badge in that row now takes the folded leaf's
face from `browser/styles/components/controls.css`: a 17px pill, an 8px
dot and a 2px paper ring. A count is ink unless what it counts has a
colour, so the leaf's count of what is On me keeps its green. The folded
leaf is pixel-identical to `main`.

To weigh: a pin is 26px, so the larger badges clipped its glyph's
corners; a pin's badge row now stands 2px further out, which leaves the
glyph whole. On a pin the 17px pill and 8px dot read heavier than the
14px pill and 6px dot they replace. The margin count's own class,
`lf-margin-count`, goes.

Asked for by the user. Tests: the badge-row test, the tests whose
selectors changed, `tests/model/test_interact_layer.py`, `pnpm run
check:browser`, `pnpm run test:runtime`, and Firefox before/after
captures of the rail, a pin in both directions and the folded leaf.

> _This was written by Claude Code on behalf of max-sixty_
leaf-agent added a commit that referenced this pull request Nov 18, 2026
… a fixed 44 (#6393)

#6336 added a "Count and news" sample to the feature gallery's Face
anatomy group, taking the margin-entry gallery from 22 samples to 23.
`test_complete_views_restore_native_values_in_wrapped_layouts` serves a
page with two galleries (`faces-one` and `faces-two` in
`INITIAL_DRAWING_PAGE`) and asserted 44 `.margin-entry-gallery-face`
elements, so it read 46 (two per new sample, not a duplicate face) and
failed in both widths on Linux and macOS since scheduled run
[44289276069](https://github.com/max-sixty/leaf/actions/runs/44289276069).
The new sample is what #6336 intended, so the gallery stays and the test
changes, as #6347 did for the export test.

Instead of moving the literal to 46, the test now asserts that each of
the two galleries draws one face per `.margin-entry-gallery-item`, and
that both draw the same non-zero number. That keeps what the count
protected (no face drawn twice, no gallery left empty after the upgrade)
without breaking on the next sample the gallery gains.

Locally both `[1200]` and `[390]` fail on `main` (`assert 46 == 44`) and
pass with this change.

Closes #6389 — automated triage

Co-authored-by: leaf-agent <[email protected]>
max-sixty added a commit that referenced this pull request Nov 21, 2026
The folded leaf's dot (news, or a kept draft's grey) stood on the leaf's
top-right corner until a count of what is On me appeared, then jumped to
the top-left so the count could take the right. A rail margin entry's
unread dot did the same beside its count. The shared badge row
(`browser/styles/components/controls.css`) now keeps the dots at the
left corner and the count at the right whichever show, through a
flexible `::after` between them; a pin keeps its count left and its dot
right, as before.

This reverses the "dots take the count's corner when no count shows"
arrangement from #6336, so a rail entry's lone unread dot now sits
top-left too; the user chose to keep margin entries with the leaf rather
than restore their old corner. The row still packs at its right end, so
badges wider than the leaf (two-digit count, news and an error) still
spill past its left end with the count on its corner. The feature
gallery's face samples gain News, a dot alone, so the margin-gallery
still shows the corner.

Asked for by the user. Tests:
`test_a_control_s_dot_keeps_its_corner_whether_a_count_shows` (fails on
main for the leaf and the rail entry), the badge-row test, the drafts
sending tests, `tests/model/test_interact_layer.py`; Chromium stills of
the leaf, the panel row and the margin gallery, and a Firefox probe of
the leaf.

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