Repository navigation
Cut a margin card's name before its time - #3104
Merged
Merged
Conversation
A margin card at its narrowest, with Previous and Next for its target's
threads and a notice of held news, left its message heads 67px. The
metadata shrank with the name's width held, so the head clipped the time
mid-letter ("just nov").
The head row now gives up room in one order: the annotations after the
time first, each with an ellipsis, then the name, with an ellipsis. The
time is never cut. In the margin card the metadata is a grid whose least
width is the time's, where each annotation's track contributes nothing,
and it shrinks with a weight of a million to the name's one, so the name
keeps its whole width whenever the annotations alone make the room. Each
annotation carries its gap, so one cut to nothing takes its gap too.
At 320px with Previous and Next and "2 new replies", the head holds
"just now" and 13.5px of name, which reads "M…" for "Me": the time and
the notice stay whole, as the rule asks, and the name takes the cut.
Tests: `test_a_card_s_head_row_cuts_the_name_before_the_time` is new and
fails on the base with the time cut.
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
approved these changes
Oct 16, 2026
max-sixty
added a commit
that referenced
this pull request
Oct 28, 2026
…for its first fact On a phone's margin card holding news, the head of the user's message still read "M51d ago": the notice stood at a notice's room (`--lf-news-width`) whatever the head beside it needed. A margin card now measures that room: the notice's width and the narrowest head's width beyond its padding, name, gap and time, which the actions' track and the heads' track trade one for one (thread-card.js, `#fitMarginNews`, `--lf-news-room`), watched as a time ticks on. The notice takes no more. Where even its first fact would be cut, the notice now says one count of all that waits instead, "2 new", or "+2" where that doesn't fit either (`data-lf-short`). The existing drop-and-count observer decides it from the cut it already reads; the facts keep their places, unseen, so what it measures doesn't change with what it shows and the accessible name still says every fact. The count is the sum of the news's counts, a settling counting as one, measured with the runtime's `textWidth`. A desktop card is unchanged: the room is wider than a notice's, so it still reads "Me 51d ago 1 new reply +1". A 320px phone card can't hold the head's name, time and Edit beside three 44px controls and a 44px notice, so its heads now give up the time before the name: annotations, then the time, then the name, each with an ellipsis. That reverses #3104's order, in which the time was never cut; the phone card reads "Me 5… ✎ 2 new". `test_a_card_s_head_keeps_the_user_s_name_beside_news` now runs at a desktop and a phone width; the phone case asserts "2 new" and "Me" whole.
max-sixty
added a commit
that referenced
this pull request
Oct 28, 2026
27f92a8 had a margin card's head give up its time before its name. This restores #3104's order: the annotations after the time first, then the name, and the time is never cut. The defect was the notice drawn over the head, which the notice's fitted room and its one count fix by themselves. A phone's 320px card now reads "M 51d ago ✎ 2 new": the notice stands clear of the head and the time is whole. Beside a finger-wide Edit, the name has no content room left, so its first letter shows cut in its padding. The margin card refits its notice's room when a head's time changes size, in the next frame rather than inside the size observer's delivery, and watches only the times, whose size the fit doesn't change. Fitting inside the delivery resized boxes the delivery had already passed, which Chrome reported as "ResizeObserver loop completed with undelivered notifications". `test_a_card_s_head_stands_whole_beside_news` (renamed from `…_keeps_the_user_s_name_beside_news`) now asserts on a phone that the notice says "2 new" and stands clear of the head, the time stands whole and clear of the Edit, and the name is cut with an ellipsis.
max-sixty
added a commit
that referenced
this pull request
Oct 28, 2026
…e news count A phone's margin card holding news read "M51d ago": the name, squeezed to no room, kept the gap before the time as its own padding, so a sliver of its first letter stood in the gap against the time (main's desktop card showed the same). The gap is now the time's: the metadata carries it as padding, with its ground over it as the name's was, so a name cut to nothing takes no box and the time starts clean. Where a head the notice still leaves short would show less than an em of its name, which is a sliver of a letter or of the ellipsis, the margin card's fit gives the name no width (`data-lf-nameless`, thread-card.js). #3104's order holds: the annotations, then the name, and the time is never cut. The phone card reads "51d ago ✎ 2 new". The fit reads a head's words at the fraction of a pixel they are laid out at, from a range, rather than by scrollWidth, which rounds a whole name and counts a cut one's ellipsis; a 0.3px shortfall had left a desktop head reading "M…". The notice's counts, "+1" past its facts and the one count that replaces them, stand out of the words' flow, so the face's underline under the pointer stopped at the facts and "+1" read as something apart. They now inherit it through the words. The one count hides the facts by visibility rather than by a transparent colour, so the underline they still carried isn't drawn under nothing; the title names the press while they are hidden. The phone case of `test_a_card_s_head_stands_whole_beside_news` now asserts that the name takes no box. Its desktop case no longer asserts the notice's full facts: since main gave a head's Copy and Edit their room, the desktop card says one count too.
max-sixty
added a commit
that referenced
this pull request
Oct 29, 2026
A survey of Leaf's controls found several presses that drew their own look where a canonical one existed: reactions the user added, accent text presses among words, and the rows of every list. Each now wears one face, chosen from side-by-side candidates on a review page. The faces are roles in `ACTION_FACES` (`browser/runtime/prepaint.js`), drawn in `browser/styles/components/controls.css`. ## Reactions the user added A reaction the user added, `.lf-react[aria-pressed="true"]` outside the margin, takes the accent ink, an accent border and `--accent-tint`. Under the pointer or keyboard focus this deepens to a 24% accent mix. Before this, a pressed reaction differed from an unpressed one only by a faint chip. Margin reactions keep the margin-entry look. ## The inline role The new **inline** role, `lf-inline-action`, is a press set among words. It draws accent ink at weight 600 and line size, underlined only under the pointer, and `data-lf-news` turns it danger red. It replaces the separate looks of: - the held-news notice on thread cards and in the activity feed; - the floating panel's Next unread; - Full quote; - a thread's disclosures, such as a progress run's "N steps". A card's held news now fits the head's room (`#fitMarginNews` in `thread-card.js`, `newsNotice` in `held-news.js`). Where the room is too small, the notice shortens to "+N" or "N new". Room in the head goes first from annotations, then from the author's name, and never from the time (#3104). A cut name keeps its gap before the time, using a transparent border, so its ellipsis never runs into the time. ## The row role The new **row** role, `lf-row`, is one row of a list or menu. A row is square in every state and washes with `--offer-hover` under the pointer. The current row (`aria-current` or `aria-selected`) gets `--accent-tint` and a 2px accent stripe at its start. The role is used by: - the panel's menu, Versions, Threads, On me and All pages; - both Back presses, now drawn as one press; - the Page Map; - `lf-timeline`, through a new last argument to `selectableOffer*`; - `lf-trace`; - visual review's cases. ## Supporting changes - **Contract.** `skills/leaf/references/module-authoring.md` lists the two new roles. - **Tests.** `test_interact_layer.py` holds the role list to the code's copy. New margin tests cover the order in which a head gives up room, and the name's gap before the time. The reopened-picker test in `test_render_reactions.py` asserts the new pressed face. - **Stills.** `dev/leaf_dev/commands/stills.py` gains the states these faces need. Most of the remaining diff is the rebuilt kernel under `dist/kernel/` and the vendored first-render files of the packages. > _This was written by Claude Code on behalf of max-sixty_
max-sixty
added a commit
that referenced
this pull request
Oct 29, 2026
The user chose (28 October 2026) to keep a short name whole and let the time give way, reversing #3104's order. A squeezed margin head now gives up its annotations, then its time, each with an ellipsis, then its name. The metadata is a flex row again so the time can shrink after the annotations: a grid shared its free space among them evenly. The margin card's news fit counts the controls' room and the time as what a head gives up before its name, so `data-lf-nameless` marks a name only once both are gone. Tests: the phone arm of `test_a_card_s_head_stands_whole_beside_news` now expects "Me" whole and the time cut. `test_a_cut_name_leaves_the_gap_before_the_time_clear` is deleted: a name is now cut only after the time is gone, so no cut name stands beside a time. Co-Authored-By: Claude Code <[email protected]>
max-sixty
added a commit
that referenced
this pull request
Oct 29, 2026
…queezed head's time before its name (#4661) A margin card's head kept a blank strip at its end for its message's Edit and Copy even while they were hidden, so a queued message read "Me just now · Qu…" beside 60px of empty room. Now a head's words use that room while the controls hide, and the controls stand over the words' end, on the message's ground, when they show. Nothing re-lays out under the pointer. A squeezed margin head also cuts its time before a short name, reversing #3104's order. Both were the user's picks on 28 October. - **The room** (`browser/styles/components/controls.css`): the controls' room is now the head's last flex box (`.lf-msg-head::after`) instead of padding. It still counts in the head's intrinsic size, so cards keep their width, and it is the first thing a short head gives up. A `::before` paints the message's ground under the controls while they show, fading in as an open rewrite's Discard and Save do. The room stays whole where a news notice stands before it (`.lf-primary-news`, a page thread's first head) and under a finger, where the controls always show. - **The order** (`browser/runtime/annotation-overlay/annotation-chrome.css`): the margin head's metadata is a flex row again. It gives up its annotations, then its time, then its name, each with an ellipsis. - **The news fit** (`#fitMarginNews` in `browser/runtime/thread/thread-card.js`): it reads the room from `--lf-msg-control`, now registered as a length. It hides a name (`data-lf-nameless`) only once the time and any room that can yield are gone. Behavior changed in tests: - `test_a_head_s_words_take_its_controls_room_while_they_hide` is new. - The phone arm of `test_a_card_s_head_stands_whole_beside_news` now expects "Me" whole and the time cut. - `test_a_cut_name_leaves_the_gap_before_the_time_clear` is deleted, since a name is now cut only after the time is gone. Checked in Chromium and Firefox at card widths of 318, 236 and 170px. > _This was written by Claude Code on behalf of max-sixty_ --------- Co-authored-by: Claude Code <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #3102. A margin card at its narrowest (320px), with Previous and Next for its target's two threads and "2 new replies" held while the user writes, leaves its message heads 67px wide. The metadata shrank while the name kept its width, so the head clipped the time mid-letter: "Me just nov".
The head row now gives up room in one order: first the annotations after the time (such as "· Sent"), each with an ellipsis, then the name, with an ellipsis. The time is never cut, and the notice still reads whole. In the margin card,
.lf-msg-metais a grid whose least width is the time's, because each annotation's track contributes nothing to it. It shrinks with a weight of a million to the name's one, so the name keeps its whole width whenever cutting the annotations alone makes the room. Each annotation carries its own gap, so an annotation cut to nothing takes its gap with it.At that narrowest card with Previous and Next, all three can't fit: "just now" takes 45px, which leaves 13.5px for the name, so "Me" reads "M…". I chose to cut the name, as the rule asks. With a single thread (no Previous and Next), the same card shows "Me just now · Sent" whole beside the notice. I checked Chromium and Firefox, light and dark.
Hand-written lines (
git diff --numstat origin/main): +23 / −4 inannotation-chrome.css, +54 in tests.test_a_card_s_head_row_cuts_the_name_before_the_timeis new and fails on the base with the time cut.