Repository navigation
Merge 21 theme tokens into the roles they alias or nearly copy - #7156
Merged
Merged
Conversation
A theme's colour, type and motion settings each stand for one thing a theme author would set apart. Names that only aliased another token, or duplicated one within a step, are merged into it, and every reader is cut over: - Leaf's marks wear the theme's roles: the user's (--lf-here, --lf-turn, --lf-turn-ink, --lf-turn-wash) read --lf-ok, --lf-ok-ink and --lf-ok-wash; the agent's (--lf-thread, --lf-work, --lf-news) read --lf-accent; what changed (--lf-change) reads --lf-muted; and what is settled (--lf-settled, --lf-settled-ink, --lf-settled-tint) reads --lf-ink-2, --lf-ink and --lf-chip. - The On Me count (--lf-badge-fill, --lf-badge-ink) wears --lf-paper digits on --lf-ok-ink: the same in light, and a light green pill with dark digits in dark, where its contrast rises from 4.9:1 to 9.7:1. - Inline code (--lf-code-bg) stands on --lf-chip, an empty box's words (--lf-quiet) wear --lf-muted, and an added or removed line (--lf-add-tint, --lf-del-tint) stands on --lf-ok-tint or --lf-danger-tint. - A chip's corner (--lf-chip-r) is --lf-r-s, a region's small-capital name (--lf-font-label) is set in --lf-font-heading, the dial's stacked choice (--lf-font-choice-stacked) is --lf-font-choice set solid, and a frame returning from its editor (--lf-motion-return) takes --lf-motion-fold. - --lf-font-count stays Leaf's own: only the margin marks read it. - The tooltip's private aliases (--lf-tip-bg and the rest) give way to the tokens they named. leaf-dev interface lists 204 styling names, from 226. Asked for by the maintainer on a Leaf page: reduce the cardinality of the theme's settings, leaning towards too much consolidation.
… renames another --lf-quiet is not a near-duplicate of --lf-muted: it is a full step dimmer (4.8:1 against the paper in light, where muted reads 5.8:1), and the user chose it for every empty box's words and the floating panel's status, which a notice outshines until it passes. Merging it made every placeholder a step louder and left the notice no brighter than the status, so it stays a token of its own. A theme token whose value is another token's, which no other scope restates, now fails tests/model/test_theme_tokens.py: every reader could read the token it names. The eleven mark tokens this branch merges were such names, and the test would have caught each of them. Also corrects two comments the merge touched: a tooltip's corners are --lf-r, not --lf-r-s, and muted on the danger tint reads 4.8:1 in light, as measured in Chromium, where the comment said 4.31:1.
leaf-agent
approved these changes
Nov 25, 2026
This was referenced Nov 25, 2026
max-sixty
pushed a commit
that referenced
this pull request
Nov 25, 2026
…st lf-age's first-paint change (#7189) `test_bundled_widgets_meet_the_widget_quality_checks` has failed in the nightly journeys since #7156. The `[default]` case failed on `lf-toc` and the `[browser]` case on `lf-age`. Both cases pass with this change. - **`lf-toc` (the cause #7179 tracks).** Before its outline arrives, `lf-toc:empty` reserves the closed toggle's height. That reservation hard-coded the label face's leading as `var(--lf-t-6) * 1.3 + 14px`. #7156 merged `--lf-font-label` into `--lf-font-heading`, whose leading is 1.45, so the upgraded toggle (`.lf-label`) grew taller than its first paint: 29px → 31px in a column page and 28px → 29px in a workspace page. The empty element now takes `--lf-font-heading` and reserves `1lh + 14px`, which is the toggle's line plus its padding. The first box and the toggle now read one token, so a later change to the face can't pull them apart again. On screen, the closed contents toggle's first-paint box is about 2px taller, the height the toggle already has once upgraded. Nothing else moves. - **`lf-age`.** This failure was also in scheduled run [45598918111](https://github.com/max-sixty/leaf/actions/runs/45598918111), and no cause issue owned it. An age first paints the words its author wrote, such as "24 Nov, 02:10 UTC", until the runtime defines the element and draws the computed age, such as "1d ago". Its registry entry already tells authors that an age changes width and how to reserve its room. So this is the kind of content-derived startup change `known_widget_findings.py` exists to list, and it joins that list under `browser`. Verification: at `32dc564a8`, `uv run pytest tests/journeys/test_widget_quality.py --run-nightly` fails on both findings. On this branch the file's 19 tests pass. `tests/browser/widgets/test_contents_and_glosses.py` and the theme and font model tests also pass. Closes #7179 — automated triage Co-authored-by: leaf-agent <[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.
Merges 21 theme tokens into the tokens they alias or nearly copy, so each name a theme sets stands for something a theme author would set apart.
leaf-dev interfacelists 205 styling names, from 226. A new test intests/model/test_theme_tokens.pyfails any token whose value is only another token's, which would have caught each of the eleven mark aliases.--lf-here,--lf-turn,--lf-turn-ink,--lf-turn-wash) read--lf-ok,--lf-ok-inkand--lf-ok-wash. The agent's (--lf-thread,--lf-work,--lf-news) read--lf-accent. A change (--lf-change) reads--lf-muted, and a settled choice (--lf-settled,--lf-settled-ink,--lf-settled-tint) reads--lf-ink-2,--lf-inkand--lf-chip. Each was already an alias of the token it now reads, so none of these changes a pixel.--lf-chip(a shade deeper), the added and removed line tints into--lf-ok-tintand--lf-danger-tint,--lf-chip-rinto--lf-r-s,--lf-font-labelinto--lf-font-heading(small-capital labels get 1.45 leading for 1.3, about 1.7px taller),--lf-font-choice-stackedinto--lf-font-choicewithline-height: 1(was 1.1), and--lf-motion-returninto--lf-motion-fold(a draft's frame returns in 220ms, was 180ms).--lf-paperdigits on--lf-ok-ink: unchanged in light; in dark it becomes a light green pill with dark digits, and its contrast rises from 4.9:1 to 9.7:1.--lf-font-countbecomes Leaf's own, since only the margin marks read it.A theme can no longer colour the unread dot, a thread's marker or the agent's work apart from links, give focus and the user's turn a colour apart from success green (focus alone can still be set through
--lf-focus-ringand--lf-focus-shadow), or set inline code's ground apart from chips.--lf-quietstays: it is a full step dimmer than--lf-muted, chosen for empty boxes and the panel's status.Asked for by max-sixty on a Leaf page, and reviewed by a fresh-context Claude Code session, whose finding on
--lf-quietis folded in.pnpm run check,pnpm run test:runtime, the token and font model tests, and focused browser tests on rings, margin entries, the folded leaf's badge, options and theme composition pass.