Repository navigation
Arrange plain playground choices in the author's columns again - #3963
Merged
Merged
Conversation
#3952 made `--playground-choice-columns` arrange plain label choices as it does rich candidates: in 24 configuration samples, authors looked the property up in Leaf's CSS, and 13 of 78 pages ended with rules against the generated `.lf-playground-choices` class. #3953 then made plain label choices a wrapping row that breaks between whole labels, since equal grid cells broke "over 1% (today)" across two lines in a card with room to spare. Its merge kept the row and dropped #3952's behavior, so on `main` plain choices ignore the property while rich candidates honor it, and `packages/playground/instructions/author.md` says plain choices take no columns. Now both hold. Plain label choices are a wrapping row by default. When the property is set on the choice control or its parent, plain and rich choices both take its value as their grid columns, through one rule in `packages/playground/theme.css`. A plain face starts its cell at its words' width, so a label wraps only where its column is narrower than it. A `var()` fallback can't turn the plain row's flex box into a grid, so the rule sits in `@container style(--playground-choice-columns)`, which asks the group's parent, the control, whether the property is set. The boolean style query matched in Chromium 153, Firefox 155 and WebKit 26.6; `if()` failed in Firefox 155, which is why the change doesn't use it. Rich candidates keep their auto-fit default when the property is unset. The rule's `:scope` (the control) outweighs that default, and a quoted playground still reads the property on its candidates directly. `author.md` now says plain choices wrap between whole labels by default and that the property arranges either kind. A new browser test, `test_plain_choices_wrap_between_whole_labels_until_the_author_sets_columns`, checks both states. It fails on `main`, where the property leaves plain choices in one row. Evidence (local, `.tmp/cols/evidence/` in this change's worktree): a fixture with long labels in a 28rem card, `leaf-dev probe --base` crops. - `main-default-row.png` and `fix-default-row.png` match. "over 1% (today)" and "Open a ticket for the payments team" stay on one line and wrap between labels. - `main-columns-set.png`: with `repeat(2, minmax(0, 1fr))` and `repeat(3, minmax(0, 1fr))` set, the choices stay in a row. - `fix-columns-set.png`, and `fix-columns-set-firefox.png` from Firefox: the same choices sit in two and three columns. A label wraps only where it's wider than its column. - `motion-playground` (rich, with the property and its narrow-screen media query) computes the same columns and gap on both arms. `leaf-dev stills` for playground-choice, playground-choice-phone-dark, playground-controls, playground-controls-phone, quoted-playground and motion-controls reports 6 of 6 states unchanged. Checks: - `tests/browser/widgets/test_playgrounds.py`, `tests/browser/controls/test_rings.py` and `tests/browser/controls/test_theme_and_device.py` with `-k "choice or candidates or preset or narrow or playground"`: 27 passed. The `playground` term matched the module name, so this ran all of `test_playgrounds.py`. - `pnpm run test:runtime`: 550 passed. - `pnpm run check:browser` is clean. The CSS is hand-written and has no generated copy. - pre-commit passes. > _This was written by Claude Code on behalf of max-sixty_ Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
approved these changes
Oct 25, 2026
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.
#3952 made
--playground-choice-columnsarrange plain label choices as it does rich candidates: in 24 configuration samples, authors looked the property up in Leaf's CSS, and 13 of 78 pages ended with rules against the generated.lf-playground-choicesclass. #3953 then made plain label choices a wrapping row that breaks between whole labels, since equal grid cells broke "over 1% (today)" across two lines in a card with room to spare. Its merge kept the row and dropped #3952's behavior, so onmainplain choices ignore the property while rich candidates honor it, andpackages/playground/instructions/author.mdsays plain choices take no columns.Now both hold. Plain label choices are a wrapping row by default. When the property is set on the choice control or its parent, plain and rich choices both take its value as their grid columns, through one rule in
packages/playground/theme.css. A plain face starts its cell at its words' width, so a label wraps only where its column is narrower than it.A
var()fallback can't turn the plain row's flex box into a grid, so the rule sits in@container style(--playground-choice-columns), which asks the group's parent, the control, whether the property is set. The boolean style query matched in Chromium 153, Firefox 155 and WebKit 26.6;if()failed in Firefox 155, which is why the change doesn't use it. Rich candidates keep their auto-fit default when the property is unset. The rule's:scope(the control) outweighs that default, and a quoted playground still reads the property on its candidates directly.author.mdnow says plain choices wrap between whole labels by default and that the property arranges either kind.A new browser test,
test_plain_choices_wrap_between_whole_labels_until_the_author_sets_columns, checks both states. It fails onmain, where the property leaves plain choices in one row.Evidence (local,
.tmp/cols/evidence/in this change's worktree): a fixture with long labels in a 28rem card,leaf-dev probe --basecrops.main-default-row.pngandfix-default-row.pngmatch. "over 1% (today)" and "Open a ticket for the payments team" stay on one line and wrap between labels.main-columns-set.png: withrepeat(2, minmax(0, 1fr))andrepeat(3, minmax(0, 1fr))set, the choices stay in a row.fix-columns-set.png, andfix-columns-set-firefox.pngfrom Firefox: the same choices sit in two and three columns. A label wraps only where it's wider than its column.motion-playground(rich, with the property and its narrow-screen media query) computes the same columns and gap on both arms.leaf-dev stillsfor playground-choice, playground-choice-phone-dark, playground-controls, playground-controls-phone, quoted-playground and motion-controls reports 6 of 6 states unchanged.Checks:
tests/browser/widgets/test_playgrounds.py,tests/browser/controls/test_rings.pyandtests/browser/controls/test_theme_and_device.pywith-k "choice or candidates or preset or narrow or playground": 27 passed. Theplaygroundterm matched the module name, so this ran all oftest_playgrounds.py.pnpm run test:runtime: 550 passed.pnpm run check:browseris clean. The CSS is hand-written and has no generated copy.