Repository navigation
Stand the margin's bars, outline and card clear of a list item's marker - #6615
Conversation
The working line beside a list item the agent was at work on crossed the item's bullet, in Firefox and Chromium alike. Max saw it on a README item of the sparkjoy release page. The line stood 10px left of the item's box, and the browser draws an outside marker beyond that box, in the list's 24px inset. The change bar (4px out), the outline round a pointed change (12px out) and the change card read the same box, so the outline cut through the bullet too and the card covered half of it. `margin-bars.js` now takes the start edge of a list item, or of anything inside one, as its list's edge (`inked`), and the bars, the outline and the card all read it. A top-level item's line now aligns with a paragraph's; a nested item's stands in its parent's marker column, beside the nested item's own lines. Right-to-left lists take the list's right edge. Two cases stay as they were. Two-digit numbers are wider than the 24px inset and hang 3px past the list's edge: the working line clears "10." by 7px, and the change bar stands 1px from it. Widening numbered lists' inset would fix that on every page by moving their text right, a theme change left to Max. A page whose own CSS narrows a list's inset below its markers still gets the line across them; no browser API gives a marker's box. `test_the_bar_beside_a_list_item_stands_clear_of_its_marker` protects the line staying outside the list for an item and for a paragraph in one; it fails on the previous code. Before and after captures of the real item, nested and numbered items, the outline and the card, in both engines, were checked by an independent look at the captures, which found only the two-digit case above. > _This was written by Claude Code on behalf of max-sixty_
leaf-agent
left a comment
There was a problem hiding this comment.
inked reaches to the start edge of the item's whole list. For a list laid out in rows or columns, that edge belongs to a different item. A page that draws a card grid as <ul style="display:grid; grid-template-columns:1fr 1fr; list-style:none; padding:0"> is a common pattern. On one, the working line for the second card stood at x=227, beside the first card (x=240) and 380px from its own card (x=608). The outline round a pointed change, and the card's width, stretch the same way across the first column. Before this change, both columns placed their paint correctly.
Reaching from the item's own start edge by its list's padding-inline-start gives the same result as this PR for a plain vertical list, nested lists included. It doesn't widen a grid whose list has no inset. I tried the suggestion below on the merged tree. The grid card's bar stood at x=595, beside its own card, and test_the_bar_beside_a_list_item_stands_clear_of_its_marker still passed. A grid case in the new test would cover this.
…s beside it Taking a list item's start edge as its whole list's edge moved the paint for an item in a list laid out as a grid or a row of cards to the list's first column: on a two-column card grid, the second card's working line stood 380px from it, beside the first card, and its outline and change card stretched across the first column. The leaf-agent review on #6615 found and measured it. `inked` now reaches from the item's own edge by its list's `padding-inline-start`, the room where the browser draws the item's marker. For a vertical list, nested lists included, that is the list's edge as before; the fixture's bars stand where they did in Firefox and Chromium. A grid of cards with no inset keeps its paint beside each card. The list-item test gains a grid case, which fails on the previous commit. > _This was written by Claude Code on behalf of max-sixty_
…rgin bars use (#6700) 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 #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_
…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_
The working line beside a list item the agent is working on crossed the item's bullet. It stood 10px left of the item's box, and the browser draws an outside marker beyond that box, in the list's 24px inset. The change bar, the outline round a pointed change and the change card read the same box, so the outline cut through the bullet too.
margin-bars.jsnow reaches from the start edge of a list item, or of anything inside one, by its list'spadding-inline-start, the room the marker sits in, and all four read that edge. A top-level item's line now aligns with a paragraph's; a nested item's stands in its parent's marker column. Reaching from the item rather than taking the whole list's edge keeps a grid or row of cards built as a list with each card's paint beside it.Two cases remain. Two-digit numbers are wider than the 24px inset: the working line clears "10." by 7px, but the change bar stands 1px from it. Widening numbered lists' inset would fix that by moving every numbered list's text right, which I left as a theme decision. A page whose own CSS narrows a list's inset below its markers still gets the line across them, since no browser API gives a marker's box.
Asked for by Max on a Leaf page. Before/after captures in Firefox and Chromium were checked by a fresh reviewer. The new
test_the_bar_beside_a_list_item_stands_clear_of_its_markercovers an item, a paragraph in an item and a grid card, and fails on main and on the first commit here; the bar, outline, gap and card tests intest_changes_in_place.pyandpnpm run checkpass.