Repository navigation
Open every text document in a fixed box from first paint - #3454
Merged
Merged
Conversation
Undoing a playground's submission now withdraws only the decision. The controls keep the values the user left, ready to adjust and send again, and Reset still returns them to the authored defaults. Before, undo replaced the working values with the previous choice's values or, when none was left, the authored defaults, so on alert-thresholds a page budget raised from 10 to 12, sent and undone jumped back to 10. A newly chosen action, from this tab or another, still replaces the working values. The playground tells it from an earlier choice an undo makes current again by log order: a choice replaces the values only when it is pending or its seq is past every choice the tab has drawn. A refused choice now behaves like an undo, leaving the values the user sent in the controls. This reverses the rule in lf-playground.js's header, "a newly chosen action or its undo must replace them", which the header now states the other way. Tests: the alert-thresholds case is new; the contributor-draft test and the structured-data explorer journey now expect undo and refusal to keep the edits and Reset to restore the defaults. Max's decision #26b on the overnight report. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Every `lf-text-document` now scrolls its listing in a box `--lf-bound` tall (28rem by default), the same box a preview document's Source tab uses, and the page keeps that size from its first paint. Before, a document without `preview` was as tall as its text. The text arrives with the state answer after first paint, so the listing grew when it landed and pushed the rest of the page down. A short document now shows empty room under its last line, and a long one reads by scrolling inside the box rather than at full length in the page. The change is in the widget's registry entry and theme: - `lf-text-document` declares `x-bound: start`, so delivery marks every document as a bounded block, which makes its listing a reading region whether or not the author wrote `data-bound`. The listing's `max-block-size` becomes a fixed `block-size`. - Until the module draws the figure, the empty host wears the figure's frame, draws its label (or its source name) as the caption with the caption's rule, so it wraps the same way, and reserves the tab strip and the box. Its first box equals its drawn one in Chromium and Firefox, at 1440px and 390px, with and without a preview (483.4px and 530.4px). Measured with `leaf-dev probe` on a page that opens with a 20-line document and a paragraph under it: on main the paragraph moves from 114px to 547px at 1440px wide (0.018 layout shift) and off the screen at 390px (0.030); on this branch nothing moves at either width (0). On a page with three documents, one of them a 3-line one, the only shift left is inside a listing (0.12 at 1440px): the module draws an empty listing under "· no data" before the text arrives, then widens its gutter. TODO.md carries that as "Draw a text document's listing once its text has arrived". The widget-quality report no longer finds `keeps-first-box` on `lf-text-document`, so its entry leaves `tests/known_widget_findings.py`, and the TODO entry for this defect is gone. In the code-review test, reopening a card anchored to the whole document now opens over the document's box rather than under it, so the test accepts either. Max's decision #4 on the overnight report, option C with the fixed height. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
approved these changes
Oct 21, 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.
Every
lf-text-documentnow scrolls its listing in a box--lf-boundtall(28rem by default), the same box a preview document's Source tab uses, and the
page keeps that size from its first paint. Before, a document without
previewwas as tall as its text. The text arrives with the state answer after first
paint, so the listing grew when it landed and pushed the rest of the page down.
A short document now shows empty room under its last line, and a long one reads
by scrolling inside the box rather than at full length in the page.
The change is in the widget's registry entry and theme:
lf-text-documentdeclaresx-bound: start, so delivery marks every documentas a bounded block, which makes its listing a reading region whether or not
the author wrote
data-bound. The listing'smax-block-sizebecomes a fixedblock-size.draws its label (or its source name) as the caption with the caption's rule,
so it wraps the same way, and reserves the tab strip and the box. Its first box
equals its drawn one in Chromium and Firefox, at 1440px and 390px, with and
without a preview (483.4px and 530.4px).
Measured with
leaf-dev probeon a page that opens with a 20-line document anda paragraph under it: on main the paragraph moves from 114px to 547px at 1440px
wide (0.018 layout shift) and off the screen at 390px (0.030); on this branch
nothing moves at either width (0). On a page with three documents, one of them a
3-line one, the only shift left is inside a listing (0.12 at 1440px): the
module draws an empty listing under "· no data" before the text arrives, then
widens its gutter. TODO.md carries that as "Draw a text document's listing once
its text has arrived".
The widget-quality report no longer finds
keeps-first-boxonlf-text-document, so its entry leavestests/known_widget_findings.py, andthe TODO entry for this defect is gone. In the code-review test, reopening a
card anchored to the whole document now opens over the document's box rather
than under it, so the test accepts either.
Max's decision #4 on the overnight report, option C with the fixed height.