Skip to content

Reserve code block scrollbar clearance before upgrade - #3752

Merged
leaf-agent merged 2 commits into
mainfrom
fix/ci-39942183901-code-first-box
Oct 23, 2026
Merged

leaf-agent merged 2 commits into
mainfrom
fix/ci-39942183901-code-first-box

Conversation

@leaf-agent

Copy link
Copy Markdown
Collaborator

#3670 made scrollbar clearance part of every code block's first layout, but a numbered lf-code block now grows 8 px when it upgrades. This change gives the clearance one shared CSS value and reserves it in the authored code box, so the numbered rows keep the first box's height. It preserves #3670's always-present scrollbar room.

The nightly main CI run reports keeps-first-box findings for the bracket-walk example in column and workspace layouts. A bisect identified #3670 as the first commit that produces those findings. The selected widget-quality test fails before this change and passes after it. Focused code wrapping and scrollbar checks pass too. A leaf-dev probe --base comparison of pr-walkthrough shows no extra startup requests or JS bytes; the CSS adds 426 bytes before upgrade, and the completed code blocks have the same heights.

The nightly run has other independent failures that this PR does not claim to repair.

@leaf-agent
leaf-agent merged commit fb5b56b into main Oct 23, 2026
4 checks passed
@leaf-agent
leaf-agent deleted the fix/ci-39942183901-code-first-box branch October 23, 2026 13:39
max-sixty pushed a commit that referenced this pull request Nov 1, 2026
The default widget-quality check reproduces both first-presentation
regressions on main. `lf-code` adds scrollbar clearance in its
pre-upgrade padding even though the native `pre::after` already supplies
it; removing that duplicate inset keeps the authored and numbered boxes
equal. `lf-text-document` gives its caption and pre-upgrade caption
pseudo-element the same `--font-small`, so changing the host from source
typography to page typography no longer changes the caption's leading.

This preserves the scrollbar room intended by #3752 and the authored
Markdown preview introduced in #4861. On screen, code loses 8 px of
excess room before upgrade; completed code stays the same. Document
captions use the interface's small-font leading before and after
upgrade; the preview and source viewports keep their existing bounds.

The existing default-package quality test failed before and passes after
in column and workspace layouts, without changing its findings
allowance. Focused wrapping, Markdown/source switching, viewport/scroll
retention, and interface-font checks pass. All 737 runtime tests and
pre-commit pass. A feature-gallery startup comparison reaches
presentation with the same 75 code requests and 71 JavaScript requests;
JavaScript bytes are unchanged and CSS is 142 bytes smaller.

<details><summary>Visual comparison</summary>

The Markdown preview caption changes from inherited 18.4 px leading to
the shared 16.675 px small-font leading. Source-capture captions take
the same rule; completed code has no pixel difference in the native-code
state.

Before:

![Document caption
before](https://github.com/user-attachments/assets/cece71e5-09ca-467c-a3fc-c5e56e3ae25c)

After:

![Document caption
after](https://github.com/user-attachments/assets/9008080f-019b-4d9a-971e-5777eb81de8a)

</details>

Closes #4948 — 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.

1 participant