Repository navigation
fix(preview): canvas frames keep the breakpoint's whole width - #95
Merged
flowtricks merged 3 commits intoNov 24, 2026
Merged
Conversation
A canvas frame drew Chromium's own scrollbar, which takes about 15px of the page on a computer with classic scrollbars, so a 320px phone frame laid its page out in 305px while its media queries still read 320, and text wrapped where it never does on a phone. Frames now draw no root scrollbar: the page gets the frame's whole width at every breakpoint, as on a real phone or tablet. The canvas draws its own thin scrollbar instead, as Webflow does: a solid 5px thumb 2px outside the frame, always visible and draggable, never over the page. Desktop's frame keeps a 9px gutter on each side for it, and the toolbar and the style panel read the page width that remains. Settings > Editor > Canvas can give Chromium's real scrollbar back from a breakpoint up: "Laptop and wider", "Desktop and wider" or any wider breakpoint the project has, by its own name. Tablets and phones are not offered, since their own scrollbar floats over the page. Desktop starts one pixel past the widest narrower breakpoint, so the choices follow the project's breakpoints however many there are. The preference's parser is a module of its own, so the IPC contract graph grows by one module rather than by the whole scrollbar module. Tests that pinned Desktop at the pane's full width now expect the width less the two gutters.
On a Retina Mac, capturePage returns the magenta toolbar (#ff00ff) as 255, 3, 255: the display's colour conversion moves green by 3, past the check's 2-unit tolerance, so the whole-window capture read as having no toolbar and every scenario failed locally. The toolbar is now recognised as clearly magenta (red and blue high, green low), which no such conversion turns into the white stage or an outline colour.
The fluid Desktop frame leaves a 9px gutter on each side for the canvas's scrollbar, but the overlay layer above it (outlines, column guides, drop indicators) kept the pane's full width. Both are centred, so every overlay drew 9px left of the page and 18px too wide. The frame and its overlay layer now take one width, FLUID_FRAME_WIDTH, in the app and in Studio, and a test pins that the layer covers exactly the fluid frame.
Contributor
Author
|
CI: all checks pass except macOS shard 1/4 (and the test (macos-latest) summary job that reports it). The one failing suite is electron/documents/pageEdit, in "an edit that sets a value the source already holds writes nothing at all": the folder watcher heard a late rename index.astro left over from the previous test, a macOS file-event timing issue unrelated to this PR. The previous run of this branch passed it, and Ubuntu and Windows pass it here. A re-run of that job should go green. |
flowtricks
added a commit
that referenced
this pull request
Nov 24, 2026
The owner does not want a scrollbar setting. Settings > Editor > Canvas (the "Chromium scrollbar" breakpoint choice from #95) is gone with its section, setting key, IPC/preload contract, defaults, 18 translations, docs and Studio vendoring. There is one behaviour: every canvas frame hides the page's own scrollbar and gets its breakpoint's whole width, and the canvas draws its thin bar outside the frame. A classic bar from some width up would lay pages out narrower than the breakpoint shown. An old `canvasScrollbar` value in settings.json is never read. A damaged value of a convenience preference (track/review changes, code chips, language) now falls back to its own default instead of resetting every setting; privacy and trust fields stay strict. Also, from the #95 review: - The all-breakpoints canvas now tells each frame to hide its bar and draws the canvas bar beside a frame whose page scrolls; before, its frames kept Chromium's bar and lost ~15px. CanvasScrollbar accepts zoom above 1 there (scale must be positive and finite). - A page that scrolls <body> instead of <html> is hidden, read and scrolled through <body>; scroll is captured on the document. - Side resize handles of a scaled frame sit 12 screen px out at any zoom, so they no longer cover the bar at mid-height. - The bar sits at the frame's inline end (logical positioning). Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
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.
A canvas frame drew Chromium's own scrollbar, which takes about 15px of the page on a computer with classic scrollbars, so a 320px phone frame laid its page out in 305px while its media queries still read 320, and text wrapped where it never does on a phone. Frames now draw no root scrollbar: the page gets the frame's whole width at every breakpoint, as on a real phone or tablet.
The canvas draws its own thin scrollbar instead, as Webflow does: a solid 5px thumb 2px outside the frame, always visible and draggable, never over the page. Desktop's frame keeps a 9px gutter on each side for it, and the toolbar and the style panel read the page width that remains.
Settings > Editor > Canvas can give Chromium's real scrollbar back from a breakpoint up: "Laptop and wider", "Desktop and wider" or any wider breakpoint the project has, by its own name. Tablets and phones are not offered, since their own scrollbar floats over the page. Desktop starts one pixel past the widest narrower breakpoint, so the choices follow the project's breakpoints however many there are.
The preference's parser is a module of its own, so the IPC contract graph grows by one module rather than by the whole scrollbar module. Tests that pinned Desktop at the pane's full width now expect the width less the two gutters.
The second commit makes
canvasCaptureOutlinesChromiumtolerate a display's colour conversion: on a Mac with a wide-gamut display, capturePage returns the magenta toolbar (#ff00ff) as 255, 3, 255, so every scenario failed locally and blocked the pre-push gate. Drop it if you'd rather fix it another way.How to check