Repository navigation
Wrap playground label choices between whole labels - #3953
Conversation
A playground's label choices (kind="choice" with no preview) sat in equal
grid cells, so every label longer than its share of the row wrapped inside
itself: in a fresh Opus configuration page at 1600x1000 (an alert card about
450px wide), "over 1% (today)", "over 800 ms (today)" and "Page on-call
(today)" each broke onto two lines with half the card free. The same author
tried --playground-choice-columns, which only reaches rich candidates, and in
its next revision overrode the cells with display:flex in a data-controls
sheet to get one-line labels.
Label choices now run in a wrapping row, as a form's radios do, and wrap
between labels; a label wider than the whole row still wraps on its own.
Rich candidates keep their grid. In the rail, two short choices now sit
together at the start instead of at the two halves of the rail.
Evidence: .tmp/overnight/c1/config-choices-{base,after}.png;
stills playground-controls/choice/text in .tmp/stills/run-dp1pi0c2.
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
left a comment
There was a problem hiding this comment.
#3952 changes the same .lf-playground-choices rule to make plain choices honor --playground-choice-columns, while this PR switches that rule to flex, where the grid property has no effect. The two changes address the same authoring workaround with different interfaces. Reconcile that part of #3952 with this default before landing both; its description currently promises explicit columns for plain choices.
…#3957) Leaf dashboards and tuning pages were written as documents. The test was a release-rollout request: "I glance at it every few minutes ... the state has to read at a glance". Fresh Opus 5.5 authors on main followed `page-layout.md`'s "a release dashboard" to a sidebar page set as a document. Each page opened with a 46px title and a three-line lede, then metrics and decision prose. The trend chart, region table and checks fell below a 1600x1000 window, on pages 2229-2692px tall. The plain HTML control fitted status, metrics, chart, regions, checks, decision and log in that one window. On the same run's dashboards, panel headings came out as long all-caps sentences, such as a three-line, 129-character cause. And when the user's final settings were recorded on a configuration page, authors either left the playground authored at today's values under a "Final" heading, or folded it into a `<details>`. This PR makes four changes, one per commit. - **Window guidance** (`page-authoring.md`, "Composing a page"). The bullet for a screen the reader works in now also covers settings tuned against their evidence and a dashboard glanced at between other work. It states the goal: keep the working state in the reader's window, since a glance or a tuning pass doesn't scroll. It keeps the title and premise to a line or two and gives `main` `density-working`. A dashboard is a sidebar page with its regions side by side. `page-layout.md` says what `density-working` does on a column or sidebar `main`. - **Theme** (`browser/styles/theme.css`). On a working-density page, a sidebar page keeps the working title (22px) instead of the wide-page 46px title, and the page starts 28px from the window's top instead of 72px. Only the column and sidebar Layouts read `--page-pad-start`. Among the examples, only `examples/developer/playwright-trace-gallery.html` (a `layout-column density-working` main) changes, by that head room. - **Panel headings** (`page-authoring.md`, "Reading cost"). A `section.panel` heading is set in small capitals, which read as a region's name. So the heading names the region in a few words, and the panel's first line states the finding. - **An applied playground** (`authoring-revisions.md`). An applied playground becomes a record. Each control is authored at the chosen value, so the preview, Reset and the page's account agree. The playground stays open beside its evidence. - **The note.** It adds the campaign's retained and rejected changes, with their numbers, to `notes/agent-usability-evals.md`. ## Known regression: the dashboard at a short window At a 900x600 window, the branch lost the dashboard 2 of 2, one sample per arm. The guidance steers a dashboard to a sidebar page. Main's author wrote a workspace with a compact header and independently scrolling columns, and that did better at that height. The other short-window tasks went to the branch on configuration (2 of 2) and split on the queue (1 of 2), so the branch took 3 of 6 at 900x600, against 17 of 24 at 1600x1000. A likely next step is for the dashboard bullet to prefer a workspace when the reader's window is short. That hasn't been tried. ## Measured effect All authors were fresh Opus 5.5 Claude Code sessions at 1600x1000, with Sol live and pair judges, and base = main. Window guidance and theme: - Dashboard first versions were 2667-3390px tall on main (median about 3020, n=6) and 1704-1947px with the change (median about 1790, n=6). - Across the dashboard runs, all 5 candidate authors put `density-working` on the page and fitted regions, metrics, chart and decision in the first window. Of 4 base authors, none fitted them all. - Pair judgments against main went 7 of 8 for the change. Against HTML, the change took 4 of 4, where the baseline had lost 2 of 2. HTML's decision control didn't record a choice, and the judge still credited HTML's use of space. - Configuration first versions, before the user stated a window, were 1454 and 1944px with all six alerts or three in the window. On main they were 3332 and 2124px with one. Both arms reached a fitting page once the user stated the window, and the later pairs went 1 of 4 for the change, with the judges preferring base's final-record details. - A document control kept its reading column and document type. The live judges passed every candidate sample (9 of 9). Panel headings: - 7 of 7 earlier Leaf dashboards with panels had at least one panel heading over 40 characters, up to 129. - The 2 authors given the line wrote 9 panel headings, the longest 20 characters, each followed by its finding. Applied playground: - Candidate authors authored every control at the chosen value with the tuner open 2 of 2 times, and base 0 of 2. Across every later configuration run, authors with the line did so 7 of 8 times, authors on main 0 of 4. - Pairs went 4 of 4 for the candidate against base. Against the earlier HTML controls, the candidate took 1 of 4, up from 0 of 4; HTML still won on its separate final table and aligned rows. End state: - The campaign branch against main won 17 of 24 judgments, with two samples per task: configuration 4/4, dashboard 4/4, queue 4/4, latency 3/4, document 2/4, patch review 0/4. The patch review losses were on content: which diff the page showed and how it recorded approval. - The live judges passed 10 of 12 samples on each arm. The defects were content. - Codex authors (Sol 6.1) wrote working-density dashboards on both arms, so the guidance changes nothing there. Their configuration and queue pairs went to main 4 of 4, for causes outside these changes: a browser user's wrong click, and an item the author left open. That is n=1 per task. That branch also carried the playground label-choice fix (#3953), the queue summary size (#3955) and the diff fix (#3951). Evidence (local, in the campaign worktree `/Users/maximilian/workspace/leaf.agent-a10f091f355e3a600`): - Dashboard: `.tmp/overnight/c2/` (base-1, base-2, cand-1, cand-2, html). - Dashboard and configuration with the final wording: `.tmp/overnight/c3/`. - Page heights: `.tmp/overnight/c3/heights.tsv`. - Configuration final records: `.tmp/overnight/c4/config-final-{base,cand}-*.png`. - Panel-heading counts: `.tmp/overnight/panelheads.py`. - Cycle log: `.tmp/overnight/page-quality.md`. - Runs: under `.tmp/eval/`. ## Checks These ran on this branch cherry-picked onto current main. - `tests/browser/widgets/test_workspaces_and_bounds.py`, `tests/browser/test_render_gate.py`, `tests/browser/margin/test_rail.py` and `tests/browser/widgets/test_tabs.py` with `-k "workspace or sidebar or wide or release_page or working_prose_density or page_form_decides or title"`: 43 passed, 1 failed. - The failure is `test_a_release_page_is_wide_and_keeps_the_log_on_its_newest_line` (`lp-steps` right edge 1531, expected 1536). It fails the same way on main, so this change doesn't cause it. - `tests/model/test_interact_layer.py` and `tests/model/test_delivery.py` with `-k "skill or reference"`: 4 passed. - `pnpm run test:runtime`: 550 passed. - `pnpm run check:browser` passes (the generated `browser/theme.css` matches its source). - pre-commit passes. No open PR changes the same guidance or theme rules. #3898, #3913 and #3923 also append sections to `notes/agent-usability-evals.md`, so whichever lands second resolves that conflict by keeping both sections. > _This was written by Claude Code on behalf of max-sixty_ --------- Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
|
@leaf-agent The overlap with #3952 is real, and it resolves at whichever PR lands second: both edit the same
|
|
Approved this head; I found no blocker in its own diff. Both focused browser tests passed (narrow preset labels and rich candidate interaction), and the pinned CI poll was green. The head-pinned squash merge was refused by GitHub with HTTP 405: “Pull Request has merge conflicts.” The approval stands; updating the branch and resolving the conflict is required before it can land. #3952 merged while this review was running, so #3953 is now the second PR to land; its conflict resolution should keep the wrapping-label interface chosen here. |
…oice columns #3952 had plain label choices read `--playground-choice-columns` on their grid, and this branch turns that grid into a wrapping row, where the property has no effect. The resolution keeps the row: label choices wrap between whole labels with nothing for the author to set, which removes the workaround #3952's authors reached the property for. Rich candidates keep the property. author.md says the property arranges rich choices and that plain label choices take no columns, so an author who sets it on a row of thresholds is told why nothing changes. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
#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]>
A playground's label choices (
kind="choice"with no preview) sat in equal grid cells, so any label longer than its share of the row wrapped inside itself. In a fresh Opus 5.5 configuration page at 1600x1000, on an alert card about 450px wide, "over 1% (today)", "over 800 ms (today)" and "Page on-call (today)" each broke onto two lines while half the card stood empty. The author first tried--playground-choice-columns, which reaches only rich candidates, and in its next revision overrode the cells withdisplay: flexin adata-controlssheet to get one-line labels.Label choices now run in a wrapping row, as a form's radios do, and wrap between labels. A label wider than the whole row still wraps on its own. Rich candidates keep their grid. In the rail, two short choices now sit together at the start instead of at the rail's two halves.
Evidence (local, in the campaign worktree
/Users/maximilian/workspace/leaf.agent-a10f091f355e3a600):.tmp/overnight/c1/config-choices-base.pngand.tmp/overnight/c1/config-choices-after.pngshow the saved configuration page on main's runtime and on this change's..tmp/stills/run-dp1pi0c2.Checks, on this branch cherry-picked onto current main:
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": 8 passed.pnpm run test:runtime: 550 passed.#3952, which landed first, had plain label choices read
--playground-choice-columnson their grid. That grid is now this change's wrapping row, where the property has no effect, so the merge keeps the row and drops #3952's plain-choice columns: rich candidates keep the property, andpackages/playground/instructions/author.mdnow says the property arranges rich choices and that plain label choices take no columns. #3898 also editspackages/playground/theme.css, but not the choice rules.