Skip to content

Give a page whose subject is a playground the window - #3141

Merged
max-sixty merged 9 commits into
mainfrom
diagnose-playground-layout
Oct 18, 2026
Merged

max-sixty merged 9 commits into
mainfrom
diagnose-playground-layout

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

A design-review page put its main item, a playground sketching the redesigned panel, in a reading column as a breakout among the review's prose. Its edges matched nothing above it and the review pushed it down. The shipped guidance sent it there: "Composing a page" listed a playground only as a block that breaks out of a column, the playground instructions led with that breakout, a workspace had no home for supporting reading, two of the three playground examples were column pages whose subject is the playground, and the eval graded the column page as the pass. In the plain-HTML comparison's configuration task, all 5 Leaf samples put the playground on a document Layout.

Guidance

  • page-authoring.md, "Composing a page": a playground that is the page's subject makes the page a workspace, the surface filling the window from the title's left edge; reading that supports it goes in page tabs after it. A breakout stays the arrangement for a figure a document cites. authoring-asks.md points there.
  • The playground's author instructions choose by the playground's role, and keep data-width="available" on the playground in both arrangements, since an Ask holds its children to the column otherwise.

Height reaches the playground

  • An Ask in a full-height workspace gives its last part what its heading and context leave, no longer only when nothing stands between heading and answer. The answer keeps at least its own height, so options below a long premise are not squeezed; a playground, which fits itself to any height, still shrinks to the window.
  • Page tabs in a full-height workspace give the open tab what the strip leaves, and pass the height to a tab that is one block, from the first paint (data-lf-opening) as well as after upgrade.
  • The playground's stage starts its artifacts at the top instead of centring them. Centring drew a bare band above the artifact whenever the rail held the stage taller (95px above the panel sketch, about 200px in data-explorer once a workspace gave it the window's height).

Examples and evals

  • data-explorer is a workspace whose body is the Ask; code-comparison is a workspace with Compare and Comment tabs.
  • New surface-page-takes-the-window reproduces the review page: base 0/9, candidate passes. It replaces playground-takes-the-room, a playground-only prompt base passed 6/9 that checked nothing the other case does not. New exhibit-playground-stays-in-the-column guards the document case (6/6 on both).
  • layouts.css records why the column Layout keeps breakouts centred: the layout sketches compared aligning a column page's title, headings or prose with a leading breakout, and all three add a rule to every column page.

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

max-sixty and others added 9 commits October 12, 2026 15:44
A design-review page (session e8a66e47) put its main item, a playground
sketching the redesigned panel, in a reading column as a breakout among
the review's prose. Its edges matched nothing above it and the review
pushed it down. The shipped guidance sent it there: "Composing a page"
listed a playground only as a block that breaks out of a column, the
playground instructions led with that breakout, a workspace had no home
for supporting reading, two of the three playground examples were
column pages whose subject is the playground, and
playground-takes-the-room graded the column page as the pass. In the
plain-HTML comparison's configuration task, all 5 Leaf samples put the
playground on a document Layout.

## Guidance

- page-authoring.md, "Composing a page": a playground that is the
  page's subject makes the page a workspace, the surface filling the
  window from the title's left edge; reading that supports it goes in
  page tabs after it. A breakout stays the arrangement for a figure a
  document cites. authoring-questions.md points there.
- Playground author instructions choose by the playground's role, and
  keep data-width="available" on the playground in both arrangements,
  since an Ask holds its children to the column otherwise.

## Height reaches the playground

- An Ask in a full-height workspace now gives its last part what its
  heading and context leave, no longer only when nothing stands between
  heading and answer. The answer keeps at least its own height, so
  options below a long premise are not squeezed; a playground, which
  fits itself to any height, still shrinks to the window. The browser
  test of a three-part Ask now also covers a playground below a premise.
- Page tabs in a full-height workspace give the open tab what the strip
  leaves, and pass the height to a tab that is one block, from the
  first paint (data-lf-opening) as well as after upgrade.
- The playground's stage starts its artifacts at the top instead of
  centring them. Centring drew a bare band above the artifact whenever
  the rail held the stage taller (95px above the panel sketch, about
  200px in data-explorer once a workspace gave it the window's height).

## Examples and evals

- data-explorer is a workspace whose body is the Ask; code-comparison
  is a workspace with Compare and Comment tabs. The design-comment test
  and the code-reader-feedback stills state open the Comment tab first.
- playground-takes-the-room now expects the workspace (base 4/6,
  candidate 6/6). New surface-page-takes-the-window reproduces the
  review page (base 0/6, candidate 6/6); new
  exhibit-playground-stays-in-the-column guards the document case (6/6
  on both).

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
# Conflicts:
#	evals/playground-takes-the-room/case.yaml
#	skills/leaf/assets/layouts.css
#	skills/leaf/packages/default/styles/ask.css
#	skills/leaf/packages/playground/instructions/author.md
#	skills/leaf/references/authoring-questions.md
#	skills/leaf/references/module-authoring.md
#	skills/leaf/references/page-authoring.md
surface-page-takes-the-window reproduces the failure (base 0/9) and its
rubric already accepts the Ask as the workspace's body and requires
data-width="available" on the playground, so playground-takes-the-room,
a playground-only prompt that base passed 6/9, checked nothing the other
case does not. exhibit-playground-stays-in-the-column remains the guardrail.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
# Conflicts:
#	tests/browser/test_render_widgets.py
The layout sketches compared aligning a column page's title, headings or
prose with a leading breakout. All three add a rule to every column page,
and the page that motivated them is now a workspace, so the column keeps
today's centred breakouts. The header names when to reconsider.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@max-sixty
max-sixty merged commit 1383fd3 into main Oct 18, 2026
3 checks passed
@max-sixty
max-sixty deleted the diagnose-playground-layout branch October 18, 2026 07:26
max-sixty added a commit that referenced this pull request Oct 18, 2026
main brought the playground-as-workspace change (#3141), which put a
playground's supporting reading in page tabs inside a full-height workspace
and taught page tabs to pass that height to a one-block tab. This branch
removes page tabs, so the merge drops those height rules, and the guidance,
the playground's author instructions and code-comparison put the reading in
views of its own: the Compare view is the workspace, with density-working on
its own box, and the reading view is a column at the column's type.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent added a commit that referenced this pull request Oct 18, 2026
The new first-paint height rule for a workspace page tab made unrelated
chrome insertion restyle code-copy controls across a document. In [the
failing main
run](https://github.com/max-sixty/leaf/actions/runs/39107676892),
`test_code_copy_reads_sources_before_positioning_many_controls` measured
680 style invalidations with 60 controls versus 225 with one. The result
reproduces on main and disappears when the new opening-tab rule is
removed.

The opening view now marks its sole content block during the existing
prepaint pass. The height rule selects that marker instead of a
structural child selector. This keeps the full-height page tab behavior
introduced by #3141, including before the runtime upgrades, while the
original performance assertion passes. A browser test holds the runtime
script and checks that the opening block fills its tab from first paint.

Verification: the failing browser test and new first-paint test pass;
the workspace and code-comparison cases pass; `pnpm run check` and
pre-commit pass. A served `code-comparison` startup comparison has 54
requests on both arms before presentation, with 102 more bytes on this
branch and the same recorded layout shifts.

Co-authored-by: leaf-agent <[email protected]>
max-sixty added a commit that referenced this pull request Oct 20, 2026
With controls beside each item in the preview (#2711), a playground's
stage can run several windows tall, as `alert-thresholds` does. On a
column page the rail beside it, which holds the page-wide controls, the
instruction and the submit button, scrolled away above the stage. At
1024x768 the submit button sat 1,800px above the window once the user
reached the last alert. A workspace playground (#3141) already fits the
window, so only a stage that runs past the window lost its rail.

The rail now sticks as a sidebar page's track block does (#2636),
through the same rule rather than a copy of it. The playground wraps its
controls and instruction panes in one generated box marked
`data-lf-track`, and the Layout's "Sticking blocks" rule now covers a
widget's track as well as a column's margin sidebar and a sidebar page's
track block. The track sticks below the head room, takes at most the
window's height and scrolls what it holds beyond that. The playground
registers the rail as a reading region, since it may scroll.

A sticking block flows with its holder wherever `--lf-track-posture:
flow` holds:

- Where the playground stacks the rail with its stage, below 43.5rem and
on a phone, as a stacked sidebar track flows. The rail then draws no
box.
- Inside a box that scrolls on its own (`[data-lf-scrolls]`) or inside
another sticking block. The block's height is the window's, so inside a
shorter scroller its foot, and the submit button, would be cut off until
the stage ended. A workspace playground's rail flows for this reason
too, since its workspace already bounds it.

Two changes to the shared rule reach the existing sticking blocks as
well:

- Its height now subtracts the top it sticks at, so under a page tab
strip its foot no longer runs behind Leaf's floating row by the strip's
height.
- It declares `--lf-holds-height: 1`, since it holds the window's height
on purpose; the widget quality check named the rail otherwise.

`module-scroll-and-motion.md` states the contract for package authors.

Measured with `leaf-dev probe` on `alert-thresholds`, scrolled to the
middle of the stage:

- 1440x900: base controls top -988, submit -562; now 24 and 450.
- 1024x768: base controls top -1537, submit -1038; now 24 and 523.
- 1024x500: the rail is bounded to 380px, scrolls its 581px, and
focusing the submit button scrolls the rail to show it.
- 1024x500 under a 48px strip: the rail runs 72 to 404, above the
floating row at 428.
- The Ask made a 420px scroller: the rail flows, as on base.
- 390x844: unchanged, with the rail after the stage.

The workspace playgrounds (`data-explorer`, `notification-playground`,
`code-comparison`) keep identical region geometry at 1440x900, 1024x768
and 800x520. A sidebar page's track block and a column page's margin
sidebar still stick at 24px, in Chrome and Firefox. `leaf package check
--render` on the playground package reports no findings. A new `leaf-dev
stills` state, `playground-tall-stage`, shows the rail beside the last
alert where base shows empty space.

Behavior changes in tests: a new test holds the rail and submit button
in the window while the user works the last alert, with the rail flowing
at phone width. It fails without the track rule. The notification
playground's flowing workspace, at 1100x300, now scrolls the controls
and instruction in the rail beside the stage rather than in the page.

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

Co-authored-by: Claude Opus 5.5 (1M context) <[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