Skip to content

Expect a page code block's code-line padding in the Copy journey - #5233

Merged
leaf-agent merged 1 commit into
mainfrom
fix/issue-5175
Nov 3, 2026
Merged

leaf-agent merged 1 commit into
mainfrom
fix/issue-5175

Conversation

@leaf-agent

Copy link
Copy Markdown
Collaborator

#4738 deliberately gave every page code block a code line above and below its code (padding: var(--code-line) … in browser/styles/components/reading.css, 20px at the top), so a fence's source revealed under the composer's caret moves nothing. Its description says this "gives every code block 8px more room above its code". The nightly journey test_code_copy_keeps_source_and_stays_beside_scrolling_and_revised_blocks still pinned the old 12px for every block, so it has failed since that merge.

The test now expects 20px for the page blocks, both on desktop and for the plain block on a phone. The numbered lf-code widget keeps its own 12px inset (--lf-code-inset-block in packages/default/styles/code.css), which #4738 didn't touch. The assertion still protects what #1541 added it for: Copy overlays the block and takes no room from it. No product code changes.

The journey failed on current main with the same '20px' == '12px' assertion as the nightly run, and passes with this change (uv run pytest tests/journeys/test_render_anchors.py::test_code_copy_keeps_source_and_stays_beside_scrolling_and_revised_blocks --run-nightly).

Closes #5175 — automated triage

#4738 gave every page code block a code line (20px) above its code, so
revealing a fence's source in the composer moves nothing. The Copy journey
still pinned the old 12px for every block, including the plain block on a
phone. Page blocks now expect 20px; the numbered lf-code widget keeps its
own 12px inset, which #4738 didn't change. The assertion still protects
#1541's behavior that Copy reserves no room in the block.

Closes #5175
@leaf-agent
leaf-agent merged commit 4b20812 into main Nov 3, 2026
5 checks passed
@leaf-agent
leaf-agent deleted the fix/issue-5175 branch November 3, 2026 19:53
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.

Code copy test reads 20px padding where it expects 12px

1 participant