Repository navigation
fix(canvas): hide the page's scrollbar before the first paint - #107
Merged
flowtricks merged 1 commit intoNov 27, 2026
Merged
Conversation
Opening a project showed Chromium's scrollbar in each canvas frame for a moment before the canvas's own bar replaced it. The app tells a frame to hide its bar on the iframe's load, which fires after every picture and font, so on a Mac with classic scrollbars the page first painted with Chromium's bar and 15 px less width. A canvas frame now hides the bar itself as its preload starts. Its URL already says it is the canvas's (#avb-design, as markFrameMode reads it), and every canvas frame has the canvas's own bar beside it (SizedFrame.tsx, CanvasView.tsx), so no page is left without one. The rule goes into the document's adopted style sheets: no element is added to the page, so the column guide, the outlines and the canvas patcher see no change, and a document whose <html> does not exist yet takes it too. A frame that is not the canvas's keeps Chromium's bar until the app's word, and a document without adopted style sheets (jsdom) waits for it as before. In Studio the preview client is a module script, so it hides the bar once the page is parsed rather than before the first paint, still earlier than on load. canvasScrollbarChromium now holds, in a real Electron window, that a canvas frame has hidden its bar and lays a 320 px page out at 320 px before the app's word, and that a frame without the canvas's mark keeps Chromium's bar; frameScrollbar.test.js holds that the rule adds no element to the page and is adopted once.
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.
Opening a project showed Chromium's scrollbar in each canvas frame for a moment before the canvas's own bar replaced it. The app tells a frame to hide its bar on the iframe's load, which fires after every picture and font, so on a Mac with classic scrollbars the page first painted with Chromium's bar and 15 px less width.
A canvas frame now hides the bar itself as its preload starts. Its URL already says it is the canvas's (#avb-design, as markFrameMode reads it), and every canvas frame has the canvas's own bar beside it (SizedFrame.tsx, CanvasView.tsx), so no page is left without one.
How
Tests