Skip to content

fix: build the auto-filename title bar at render time - #95

Merged
mcanouil merged 7 commits into
mainfrom
fix/auto-bar-render-time
Nov 20, 2026
Merged

mcanouil merged 7 commits into
mainfrom
fix/auto-bar-render-time

Conversation

@mcanouil

Copy link
Copy Markdown
Owner

A code block without a filename used to get its title bar from the injected script, after the first paint.
Every section below the block then moved down by the height of the bar, about 38px, on every page load.

Quarto turns filename into its window while it reads the document, before any pre-quarto filter runs, so the name the filter derived arrived too late.
The filter now returns the same DecoratedCodeBlock node itself, and Quarto renders the bar exactly as it does for a named block, annotations included.
A small new filter at post-render moves the cw-auto marker onto the wrapper as code-window-auto, so themes that style that class keep working.
The script no longer builds wrappers.
It still adds the style decorations, the fold and the lines chip.

A block with an empty filename now keeps the single window Quarto gives it, rather than gaining a second one.

On a test page in Brave at 1440px, the cumulative layout shift drops from 0.163 to 0, and the final layout is the same.
tests/run.sh passes (58 checks), with new checks for HTML and Reveal.js output.

@mcanouil mcanouil added the Type: Bug 🐛 Issues related to bugs, errors, or mistakes label Nov 20, 2026
@mcanouil mcanouil self-assigned this Nov 20, 2026
@mcanouil
mcanouil marked this pull request as ready for review November 20, 2026 10:43
@mcanouil
mcanouil merged commit 874ea57 into main Nov 20, 2026
4 checks passed
@mcanouil
mcanouil deleted the fix/auto-bar-render-time branch November 20, 2026 10:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type: Bug 🐛 Issues related to bugs, errors, or mistakes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant