Repository navigation
Let the author lay option cards across, and stand pictured options apart - #4777
Merged
Merged
Conversation
…ons apart Two changes to `lf-options` that the user chose on 29 October after a design review. The author decides whether a group's cards stand side by side. A new boolean `across` on `lf-options` sets the titled cards in one row where each gets at least 14rem, and stacks them where the row can't hold them all, as the old arrangement did. The content test in `ask.css` is gone: an `lf-ask` with a figure before its options no longer lays them across on its own, and a group with no `across` reads down whatever it holds. That rule was re-decided four times in 23 days (#1724, #2634, #3609, #4517), because whether pictures still read at a card's share of the row depends on the pictures, which only the author sees. The `--lf-options-across` property the holder set is gone with it; the attribute is read where the arrangement is drawn. The goal for choosing it is in the `lf-options` instructions and in `authoring-on-me.md`, "On the page". `alert-review`, the feature gallery's figure-framed question and the `thread-choice-hints` fixture, whose cards the content rule had laid across, now say `across`. A live choice whose options hold a picture (an image, drawing, table, video or `x-visual` widget anywhere in an option, not counting runtime controls) draws its options as standalone cards 16px (`--sp-3`) apart, instead of joining them into one framed control with 1px hairlines. Joined, the hairline was the only boundary between one option's picture and the next option's title. Joined or apart decides only the frame: the group's frame and hairlines, or each card's border, radius and gap. Every live cell keeps the same state faces either way, so a pick still fills the card with the ok tint and rings it in green, and the pointer or keyboard deepens its ground; `options.css` states each face once over every live cell. The add field takes a card's frame, and a bare row, which draws no frame standing alone, takes one too; Done keeps its press's own frame. Groups of words are unchanged. The joined frame applies to groups without pictures and the apart frame is stated on its own, so neither undoes the other, and the add cell's pre-upgrade reserve includes the cards' border, so the page holds still on upgrade. The settled group's hover wash now names `settled`, the only case it was true of. Tests: - `test_an_obligation_framing_a_figure_lays_its_options_across` becomes `test_options_marked_across_lay_across`, and adds the same figure-framed obligation without `across`, whose cards now read down. - `test_options_holding_pictures_read_down` becomes `test_options_holding_pictures_stand_apart`: each pictured group, bare rows included, draws no frame of its own, frames every option and its add field, and sets them `--sp-3` apart, across or down, while a titled group of words keeps its frame and hairlines; a picked pictured card wears the same fill and ring as a picked word cell. - The other `across` tests mark their groups `across`.
# Conflicts: # packages/default/styles/options.css
leaf-agent
approved these changes
Oct 30, 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.
Options that each hold pictures were hard to tell apart: in the joined control, a 1px hairline was the only boundary between one option's capture and the next option's title. Reviewers in three head-to-head rounds read such groups more easily as separate cards, and the user chose that, plus leaving side by side to the author.
Pictured groups stand apart. A live
choosegroup whose options hold an image, figure, SVG, table, video or adata-lf-visualwidget anywhere inside them draws each option as its own bordered card, 16px apart. Groups of words stay one joined control with hairlines. Hover, keyboard and picked faces are shared by both, so only the frame differs; two variables,--lf-cell-gapand--lf-cell-edge, carry that difference (options.css).The author lays cards across.
ask.cssno longer decides from an lf-ask's content whether its options lie across, and--lf-options-acrossis gone. Leaf had re-decided that rule four times in 23 days (#1724, #2634, #3609, #4517), each version suiting the pages that prompted it and failing the next. The new booleanacrossonlf-optionsgives the same arrangement: one row where each card gets at least 14rem, all stacked otherwise, and always stacked at seven or more. The row's width now counts the gaps between cards. Thelf-optionregistry entry andauthoring-on-me.md("On the page") say when to use it: when each option's pictures, or the evidence above the list, still read at a card's share of the row and the question then fits the window.Pages that relied on the automatic layout now stack until they say
across. In this tree that wasalert-review.html(three groups), the feature gallery's question around a chart and thethread-choice-hintsfixture, which now say it.Testing: two tests in
tests/browser/widgets/test_obligations.pychanged to assert the new behavior (test_options_holding_pictures_stand_apart,test_options_marked_across_lay_across), and the focused option tests pass. Stills in light, dark and phone show text-only groups measuring as on main. Thedecision-options-fit-the-windoweval, three routes whose options hold captures, fit every option in one desktop window in 3/3 candidate runs, each of which wroteacross, against 2/3 on main.