Repository navigation
Set an Ask's options beside its figure on a wide window - #1724
Conversation
An Ask whose evidence includes a figure ran past the window when stacked: on alert-review the options sat below the chart they turn on. When such an Ask is 46rem wide or more, its option list now stands in a 16rem track beside the premise and evidence and sticks while they scroll, so the question, the figure and every option share one window. The playground for #42 compared this against today's stack and a selection-and-detail form, and the user picked it. The form follows from the content: an lf-ask whose heading comes first, a chart, image or table after it, and one lf-options last. An Ask of words alone stays stacked, since its context is shorter than the list at 16rem. Narrower than 46rem the Ask is plain block flow and lays out as before, measured equal to the base on every alert-review section at 1200px. The Ask is the size container its children query. It can't restyle itself, so in the wide form the context floats into a start column and the list, left in flow, sticks beside it, with the Ask's ::after clearing the floats. Being a container also stops its edge margins collapsing and re-bases cqi; the theme drops the smaller margin of each edge pair and hands the Ask's children the room their parent would have resolved, so a breakout inside the Ask still measures the shell. A reading column is 720px, so a column page grants the room with data-width="wide" on the lf-ask, which authoring-asks.md now says. guidance-eval, 5 runs a side, with a new grader for that attribute on both record-Ask cases: | case | base | candidate | |---|---|---| | record-asks-hold-their-premise | 0 of 5 | 5 of 5 | | record-asks-hold-their-table | 0 of 5 | 4 of 5 | | approach-page-leaves-the-choice-open | 3 of 5 | 4 of 5 | The base fails only the new grader (0 of 10); the judgment passed 12 of 15 on base and 13 of 15 on the candidate. alert-review now keeps each alert's evidence inside its Ask, as authoring-asks.md asks, and gains a chart for the canary and 3-D Secure alerts, so three of its nine Asks take the track and the rest stay stacked. The feature gallery's Decisions tab gains a scenario for the form; the corpus is regenerated. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
# Conflicts: # examples/alert-review.html # examples/corpus.html
At 46rem the track could leave an Ask's evidence 456px; at 50rem it keeps at least 32rem (520px), which a chart and a short table still read at. A 720px reading column still stacks either way. alert-review's queue took a third of a 1440px window as a 1fr track, which left the evidence beside the new track 557px. Capped at 22rem, the queue keeps all but two of its rows on one line, and the evidence gets 639px. At 1200px the detail pane is under 50rem, so its Asks stack there. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
main put every package stylesheet inside a native @scope around the package's widgets (#1591), so the options track names the Ask as `:scope:is(lf-ask)`. The block before an Ask is outside that scope, so the gated Ask no longer takes the previous block's end margin; it moves its heading's start margin onto itself at `--sp-4`, which collapses with the margin before it as the heading's would have. alert-review's h4 Ask headings stood at 22.6px and now stand at 24px. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
# Conflicts: # evals/record-asks-hold-their-premise/case.yaml # evals/record-asks-hold-their-table/case.yaml
#1614 moved the full-height Ask rule onto the scope root, `:scope:is(lf-ask)`, under `@container style(--lf-full-height: 1)`. `--lf-full-height` inherits, so that query holds for every Ask anywhere in a workspace, and every Ask held in a pane became a flex column: alert-review's Asks lost their margin collapsing, and the options track's floats stopped applying, putting the canary Ask's options 200px below its chart instead of beside it. Only the Ask that is main's child is the workspace's body, so the rule names it as `:scope:is(main > lf-ask)`; inside the scope, `:is()` reads the ancestor outside it. The document-flow test now also holds an Ask in a workspace pane to block flow; it fails with the broad selector. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
main lets an answering widget carry its own question without an `lf-ask` (#1654), so the Asks guide's options-track paragraph now names the `lf-ask` framing it applies to, ahead of main's paragraph on writing Asks. main's plain-CSS eval arm (arrangement_plain.py) strips `data-width` from the instructions an author reads; it now also replaces the options-track paragraph's `data-width="wide"` advice with page CSS. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
main replaced the plain-CSS eval arm with ordinary static HTML tooling (#1680), so the vocabulary-stripping edit this branch added for the options-track paragraph has nothing left to patch; take main's arrangement_plain.py. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The options-track section sat in the core surfaces, so its Ask came between the first decision and the suggestion examples in `a` order, and the margin-binding test's second `a` landed on it instead of the suggestions. It now sits just before the side list, after the width examples it illustrates. The corpus is regenerated. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
alert-review is main's one-alert-at-a-time queue now, with each alert's evidence moved inside its Ask, as the options track reads it. Main's working-density option rows keep cards in a group too narrow for a row, such as the options track, where a row broke the title around its chips. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The options track moves its heading's start margin onto the Ask, and said it at the Ask's full specificity, so inside a frame that trims its first block's start margin, as alert-review's tab panels now are, the Ask kept 24px above it and the render gate named the trapped margin. The moved margin is now said at zero specificity, so the frame's trim wins as it would have over the heading's. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
left a comment
There was a problem hiding this comment.
The wide Ask query breaks valid nested Asks by applying the outer Ask's layout inside their narrow option cards. The inline comment identifies the leaking query.
The track's container rules were written as `:scope:is(lf-ask) > ...` under the named `lf-ask` container, so an ordinary Ask held inside a qualifying one (among its evidence, or in an option) found the outer Ask's container and floated its own children into a track. The rules now nest inside the qualifying Ask's own rule, so they reach only its children. A new test sets an Ask's options beside its table at 1440px, stacks them at 700px, and keeps a nested ordinary Ask in block flow; it fails on the unbound rules. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
left a comment
There was a problem hiding this comment.
The new scoped rules fix the nested Ask layout, but three selectors end in an unkeyed target after the qualifying Ask's :has(): > *, > :not(...):nth-child(n), and > :nth-child(2). On ordinary runtime writes, Chrome can restyle the whole document for these selectors. tests/test_interact_layer.py::test_no_has_rule_restyles_the_whole_document fails on this head and I reproduced it locally. Please give the descendant targets a key or choose a structure that avoids this ancestor :has() pattern while preserving the nested Ask behavior.
CI failed: the new Ask selectors fail test_no_has_rule_restyles_the_whole_document.
Nesting the track's container rules under the qualifying Ask's `:has()` selector gave each one a `:has()` subject with an open target, which restyles the whole document on any change. The qualifying Ask now says so with a non-inheriting `--lf-ask-track`, and each rule asks its parent with a style query, so a nested ordinary Ask's children, whose parent never says so, keep their flow. The leaking rules also stopped the feature gallery's upgrade from settling; it renders again. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The workspace-density round (#1697, #1722, #1724) settled three owners that never read each other: a Layout (`layouts.css`) places boxes, a style (the kernel `theme.css`) sets type, spacing and form under a class such as `density-working`, and widgets and chrome read only their own box and the theme's tokens. Nothing wrote that down. - `skills/leaf/assets/AGENTS.md` states the three axes and the one way they meet: the owner sets a token saying what the box is (`--lf-full-height`, `--lf-wide-page`, `--lf-resident`, `--lf-density`), and the reader keys on it with a style query. - `skills/leaf/references/packages.md` tells widget authors the same. - A Layout takes the room between boxes from the theme's spacing tokens, so `density-working` tightens a sidebar's or tiles' gaps with everything else; the contract says so. - `test_layout_style_and_widgets_never_read_each_other` fails when a Layout class is named outside `layouts.css`, a style class outside the kernel theme, or `layouts.css` sets type. Planting each violation fails it. - `TODO.md` keeps the round's last proposal, a visible active pane and a key to move between panes, under Etc with its trigger. - `content-layout.js` comments named `theme.css` as `--lf-resident`'s home; #1722 moved it to `layouts.css`. > _This was written by Claude Code on behalf of max-sixty_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
…art (#4777) 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 `choose` group whose options hold an image, figure, SVG, table, video or a `data-lf-visual` widget 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-gap` and `--lf-cell-edge`, carry that difference (`options.css`). **The author lays cards across.** `ask.css` no longer decides from an lf-ask's content whether its options lie across, and `--lf-options-across` is 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 boolean `across` on `lf-options` gives 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. The `lf-option` registry entry and `authoring-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 was `alert-review.html` (three groups), the feature gallery's question around a chart and the `thread-choice-hints` fixture, which now say it. Testing: two tests in `tests/browser/widgets/test_obligations.py` changed 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. The `decision-options-fit-the-window` eval, three routes whose options hold captures, fit every option in one desktop window in 3/3 candidate runs, each of which wrote `across`, against 2/3 on main. > _This was written by Claude Code on behalf of max-sixty_
On a wide window, an Ask built around a figure now sets its options beside the figure, so the question, its evidence and every option fit in one window. Stacked, they outran it: alert-review's canary decision put its options under a 200px chart, below the fold. This settles the TODO entry "Fit an Ask and what it turns on into one window", which the PR removes.
The options track (default package
theme.css).lf-askwhose first child is a heading, which holds a figure (figure,img,svg,table,lf-chart,lf-shot), and whose last child is onelf-options. The form comes from the markup, with no attribute.--lf-room) once and hands it on, so a breakout inside it still measures the shell rather than the Ask.--lf-ask-track: 1, and each track rule asks its parent with a style query. An ordinary Ask held among the evidence or inside an option finds the same named container, but its children's parent never sets the marker, so they keep their own flow. Unbound, those rules also kept the feature gallery's upgrade from settling.alert-review. Each alert's evidence (facts, prose and, for three alerts, a chart) moves inside its Ask, so the canary decision's options stand beside its chart in the open tab.
Authoring.
authoring-asks.mddescribes the form.record-asks-hold-their-premiseandrecord-asks-hold-their-tablegain an assertion that an Ask built around wide evidence takesdata-width="wide". The feature gallery adds an options-track example beside the width examples.Tests.
test_an_ask_framing_a_figure_sets_its_options_beside_itsets an Ask's options beside its table at 1440px, stacks them at 700px, and keeps a nested ordinary Ask in block flow; it fails on unbound rules. The Ask and options tests pass, and every example passes the render gate locally (the gate runs nightly, not in this PR'stestjob). An ordinary two-part Ask, including one in a workspace pane, keeps block flow.test_dragging_an_edge_preserves_user_stateerrors on this branch as it does in main's last full run.🤖 Generated with Claude Code