Skip to content

Reach the marks round a list item over its marker, by the rule the margin bars use - #6700

Merged
max-sixty merged 3 commits into
mainfrom
focus-boxes
Nov 22, 2026
Merged

max-sixty merged 3 commits into
mainfrom
focus-boxes

Conversation

@max-sixty

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

Copy link
Copy Markdown
Owner

The marks Leaf draws round a list item now stand left of its bullet. That covers the aim and its veil, a comment's brackets, the margin trace, and the proxy and location rings. Before, they ran between the bullet and the words, touching Firefox's disc and covering a number's full stop. They now reach by the same rule the margin's change bars use, so the bars and the brackets stand in one place.

  • markerReach in geometry.js decides the reach. A box that draws an outside marker, or a block that opens one, reaches by the list inset on the item's start side. It reads computed styles, so a div drawn as a list item reaches and a list of cards with list-style: none doesn't. margin-bars.js reads it instead of its own rule from Stand the margin's bars, outline and card clear of a list item's marker #6615.
  • Each mark writer stamps the side on the boxes it marks (data-lf-beside-marker). It reads the side along with its other reads and writes the stamp along with its other writes, so marking many boxes lays the page out once.
  • A stamped box draws its marks as a border image, which can stand further out on one side than an outline. The aim's veil and the bracket clip reach with it. A plain focus ring keeps the outline, so a page's :focus { outline: none } still hides it.

Behaviour that changes:

  • A bar beside an item's second paragraph stands at that paragraph's edge, since no marker stands beside it.
  • A box beside a marker that draws its own border loses that border while a mark shows on it.
  • A ring that stands inside its box stands on the box's edge.

Still open: a marker wider than the list's 24px inset still runs under the bracket. That covers "100." in any font, and "10." where Charter is missing and the serif falls back to one with wider digits, such as DejaVu Serif on CI's Ubuntu runner. Also, when the aim shares a list item with a proxy or location ring, the veil doesn't cover the marker column.

Checked in Firefox, Chromium and WebKit, right to left, under forced colours and with an inward ring. test_the_aim_on_a_list_item_stands_clear_of_its_marker fails without the reach.

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

…rgin bars use

The browser draws an outside list marker beyond its item's border box, and
Leaf drew the aim, a comment's brackets, the margin trace and the proxy and
location rings as the marked box's outline, which stands the same distance
out on every side. On a list item those marks ran between the bullet and
the words: in Firefox the bracket touched the disc, and in every engine it
covered a number's full stop. The change bars, the outline round a pointed
change and the change card already stood clear of the marker (#6615), by a
rule of their own.

`markerReach` in geometry.js now holds one rule for all of them. A box that
draws an outside marker (`display: list-item` with a marker, outside), or a
block that opens one at its content's first line and start edge, reaches by
the list inset on the item's start side. Every other box keeps to its own
edge. The rule reads computed styles rather than the `li` tag, so a `div`
drawn as a list item reaches and a list of cards with `list-style: none`
doesn't.

- The bars, the change outline and the change card read `markerReach` in
  place of their own rule.
- Each mark writer reads the side for every box it marks along with its
  other reads, and stamps it as `data-lf-beside-marker="left|right"` along
  with its other writes, so marking many boxes lays the page out once.
- A stamped box draws its marks as a border image, which stands where the
  outline would on three sides and by the list inset further out on the
  stamped side. The aim's veil reaches with it. The bracket clip reads the
  same band, and also cuts what the veil's wider spread adds above and
  below. The new band properties are registered non-inheriting, as the
  others are.
- Focus alone keeps the outline, so a page's `:focus { outline: none }`
  still hides it.
- `--lf-list-inset` is registered as a length, so the runtime reads it in
  pixels.
- The design label above the aim reads the border image's outset as well
  as the outline's room.

Behaviour that changes:

- A bar beside an item's second paragraph now stands at that paragraph's
  edge, since no marker stands beside it.
- A box beside a marker that draws its own border loses that border while
  a mark shows on it, since the border image takes the border's place.
- A mark whose ring stands inside its box, beside a marker, stands on the
  box's edge, since a border image can't stand further in.

Measured marker ink, in px left of the item's words at the theme's 17px
text: a disc 18 to 12 in Chromium and WebKit and 14.5 to 8.5 in Firefox;
"9." 18 to 6 and "10." 27 to 6 in all three. With a 6px gap and a 2px
band, the outline stood 6 to 8px out.

Asked for by Max on a Leaf page. Firefox, Chromium and WebKit captures,
right to left, under forced colours and with an inward ring were checked,
and the built Firefox capture matches the approved sketch pixel for pixel.
A fresh reviewer read the captures, and Codex reviewed the diff: its
findings on a layout per marked box, the clip's band under an inward ring,
the stamp losing the marker's side, and `div` list items are fixed here.
`test_the_aim_on_a_list_item_stands_clear_of_its_marker` fails with the
reach removed and passes with it.
`test_the_bar_beside_a_list_item_stands_clear_of_its_marker`, the bracket,
ring, bar and outline tests, `pnpm run check:browser`,
`pnpm run test:runtime` and `tests/model/test_interact_layer.py` pass.
…ay: contents wrapper

markerReach read only the list style, so an item whose ::marker content
draws an arrow with list-style none got no reach, and its bracket ran
through the arrow. It now reads the marker's own computed content, which
also hides a marker. A display: contents holder between a paragraph and
its item draws no box, so the paragraph no longer has to stand at its
corner to open the item.

Found by Codex's second review; checked in Firefox, Chromium and WebKit.

> _This was written by Claude Code on behalf of max-sixty_

@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 PR's own test fails at this head on a Linux runner. test_the_aim_on_a_list_item_stands_clear_of_its_marker passes for #i and #p and fails for #n with #n: the aim's band runs across the list marker (assert 41 < 17). In the 48px strip left of the item, the band stands at x=16–17 and the "10." marker begins at x=17. The system serif there is DejaVu Serif, where "10." is about 31px wide, more than the 24px --lf-list-inset. So on that font the left band still touches the number's first digit, which is the defect the description says this fixes. CI's test job runs on the same kind of runner, so it's likely to go red the same way.

Comment thread browser/runtime/geometry.js Resolved
The reach covers a marker within the list's 24px inset. On CI's Ubuntu runner,
Charter is missing and the theme's serif falls back to DejaVu Serif, whose "10."
starts 33px left of the words, so the bracket at 30-32px crosses its "1"; with
Charter it starts at 27px and clears. "9." fits the inset in both and still has
the full stop the unreached band crossed. The band is now the blue the aim adds,
read against a capture before the aim, since a subpixel-smoothed "10." drew
blue glyph edges the old reading took for band.
@max-sixty
max-sixty merged commit 6c37c54 into main Nov 22, 2026
6 checks passed
@max-sixty
max-sixty deleted the focus-boxes branch November 22, 2026 20:30
max-sixty added a commit that referenced this pull request Nov 22, 2026
…hat stands by it (#6771)

Every surface Leaf stands beside a target now takes the target's box
from `geometry.js`: `inkedBox`, what the target draws with its list
marker, and `markedBox`, where Leaf's marks at its edges stand. Both
read each shown part and scale by the transforms on it (`elementAxes`).
The margin bars read the first. The thread card, the comment box and
previews keep clear of the second through `markRoom` (a new
`mark-room.js`), and the design label stands on it. Before, each
measured its own way: the card kept a fixed 16px, a preview a fixed
11px, the label read the outline from the box's style, and the bars kept
a copy of the list rule. This finishes what #6700 started for the marks
themselves.

To make the stylesheet the one statement of where marks stand, every box
now states `--lf-band-gap` and `--lf-band-room` at rest through the
existing `:where(*)` rule, and `markedBox` reads them. Worth weighing:

- **Two custom properties on every element.** On `leaf-dev bench`'s
largest page (12,211 elements) a keystroke, scroll, hover and aim cost
what they did; load measured 1,016ms against 978ms, lowest of three
rounds on a busy machine.
- **Marks of a box around the target count where they would stand in the
card's gap.** A choice widget rings on its own frame (2px) while the
decision around it rings 8px out, plus any padding; without this the
card stood on the decision's ring. `markRoom` walks up through the boxes
a comment can name whose edge stands within the surface's gap, and stops
at the first box with no edge there. Every box states a room, so the
walk skips boxes no comment names, which never wear a mark; a wrapper
with padding would otherwise push the card out.
- **What moves:** a card beside a table cell stands 8px off rather than
16, since a cell's marks stand inside it; a preview beside a region
stands 14px off rather than 11; a card on a list item's left, and the
design label over one, clear the marker; a card or preview beside a
widget in a padded decision stands past the decision's ring rather than
on it; a to-do's bar beside a `display: contents` target stands beside
it rather than at the window's edge, and a preview of an element inside
nested `display: contents` wrappers shows rather than standing nowhere.
- **A 1px wobble left in.** An action's mark draws a 1px band where
every other mark draws 2px, and the room follows the band the box shows,
so a card beside such a target stands 1px closer while that mark shows.
Holding the room still would take a second property beside
`--lf-band-room`, or moving that band 1px out.

The design legend, landings, pins and key chips keep their own boxes,
since each asks a different question. Before/after captures and the
gallery comparison are on the Leaf page for this work.

The maintainer asked for "a single way of working out boxes" that
handles bullets by design; Codex reviewed the change three times, and
its findings are fixed apart from the 1px wobble above. Tests: new tests
that a card on a widget stands its gap past the ring round its padded
decision (0px without the walk), and that a link's preview stands its
gap past the ring round a padded box it fills (1px without it); the
changed card, send-placement, code-review, bar and aim tests; the
preview and design-mode selections, `test_interact_layer.py`, and `pnpm
run test:runtime`.

> _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