Skip to content

Hide a quoted playground's boxes that hold only controls - #3276

Merged
max-sixty merged 2 commits into
mainfrom
agent-aa1612d231a28b51d
Oct 20, 2026
Merged

max-sixty merged 2 commits into
mainfrom
agent-aa1612d231a28b51d

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

A playground quoted in a static sample hides its controls, those written beside items in its preview included (#2711), but the box the page wrote around an item's controls kept its border, padding and height and stood empty beside the item.

The playground's initial drawing (initial/lf-playground.js) now marks, in a quoted playground only, each preview element that holds nothing but controls, blank text and other such boxes, at any depth, and theme.css hides it with the controls. A box that also holds words or another element keeps them. The rule is !important because the page's own stylesheet outranks the package layer and usually sets that box's display, as .alert-settings does; a settled option's collapse uses !important for the same reason. A live playground marks nothing and is unchanged (the playground-controls still is identical).

tests/fixtures/pages/quoted-playground.html quotes an alert playground with a settings box beside each alert: one with a sentence before its control, one with each control in a field of its own. It joins the corpus and backs a new quoted-playground stills state. The new browser test fails on the base with the latency box visible.

A page whose grid gives the settings box a fixed track, as examples/alert-thresholds.html does, keeps that track empty when quoted; Leaf can't know the page's grid, and the fixture's flex row lets the evidence take the width.

Reviewed by Codex in two rounds: the first, of a pure-CSS :has() version, found that bare text beside a control was hidden with its box and that a box nesting control wrappers stayed empty; this version fixes both, and the second round found nothing.

This was written by Claude Code on behalf of max-sixty

max-sixty and others added 2 commits October 20, 2026 00:02
A playground quoted in a static sample hides its controls, those written
beside items in its preview included (#2711), but the box the page wrote
around an item's controls kept its border, padding and height and stood
empty beside the item.

The playground's initial drawing now marks, in a quoted playground, each
element of the preview that holds nothing but controls, blank text and
other such boxes, at any depth, and the theme hides it with the controls.
A box that also holds words or another element keeps them. The rule is
important because the page's own stylesheet outranks the package layer
and usually sets that box's display, as `.alert-settings` does; a settled
option's collapse uses `!important` for the same reason. A live
playground marks nothing and is unchanged.

`tests/fixtures/pages/quoted-playground.html` quotes an alert playground
with a settings box beside each alert: one with a sentence before its
control, one with each control in a field of its own. It joins the
corpus and backs the `quoted-playground` stills state, and the new
browser test fails on the base with the latency box visible.

A page whose grid gives the settings box a fixed track, as
`examples/alert-thresholds.html` does, keeps that track empty when
quoted; the fixture's flex row lets the evidence take the width.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@max-sixty
max-sixty merged commit a25250d into main Oct 20, 2026
3 of 4 checks passed
@max-sixty
max-sixty deleted the agent-aa1612d231a28b51d branch October 20, 2026 07:20
max-sixty added a commit that referenced this pull request Oct 20, 2026
A quoted playground's stage kept the live stage's 18rem minimum height,
so below its artifacts it stood empty. The corpus's "Alert settings
page, as first proposed" (`tests/fixtures/pages/quoted-playground.html`)
showed 111px of empty stage under its last alert at 1400x900, after
#3276 had removed the empty settings boxes beside each alert. A quoted
stage shows what was authored and never changes, so it now takes its
artifacts' height. A live stage keeps the minimum.

The quoted-playground test now also checks that the stage ends below its
last artifact, and fails without the rule.

Found by the overnight UI sweep.

> _This was written by Claude Code on behalf of max-sixty_

---------

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent added a commit that referenced this pull request Oct 28, 2026
The quoted-playground test now checks rendered text with
`use_inner_text=True`. #4545 moved initial delivery and live updates
onto a shared Lit view; it retains option labels beneath hidden
controls, so the old `textContent` assertion reads words that occupy no
visible box. This preserves that renderer and the quotation behavior
introduced by #3276.

The original assertion reproduces the reported failure locally. Browser
inspection confirms the control has `display: none`, a zero-sized
rectangle, and no contribution to the settings box's `innerText`; the CI
failure screenshot also shows only the expected sentence. With the
corrected reading, the reported test and the related static-preview test
pass (2 passed). All control-visibility, empty-box and stage-spacing
assertions remain.

Closes #4567 — automated triage

Co-authored-by: leaf-agent <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants