Repository navigation
fix(design): a frame's page never loses width to its own scrollbar - #106
Merged
flowtricks merged 3 commits intoNov 27, 2026
Merged
Conversation
On a Mac that draws classic scrollbars (System Settings → Appearance → Show scroll bars: Always, or Automatic with a mouse connected), a Design mode frame whose page is taller than the frame's 30,000 px cap scrolls inside itself and shows Chromium's scrollbar. The page is then laid out 15 px narrower than the width on the frame's label: 781 px in a frame labelled 796. A phone-width frame makes a page much taller, so an ordinary long page can reach the cap there. The same narrowing is why designModeUnlinkSoak fails on such a Mac ("f1 drawn 796 pixels wide … last observed: 781") and passes with "Show scroll bars: When scrolling".
The editor canvas already hides the page's own scrollbar and gives every frame its whole width (canvasScrollbar.ts), but it does so through a message that a script in the frame applies, and Design mode frames run no script. Each frame's document now gets the same rule, CANVAS_SCROLLBAR_CSS, when it loads and before its height is measured. Nothing is lost: the canvas takes every pointer, so a frame is never scrolled from inside.
A new test checks that the rule is written once into the frame's <head> and keeps the page's own styles; designModeUnlinkSoak holds the width itself on a Mac with classic scrollbars.
Once a frame's page keeps its whole width on a Mac with classic scrollbars, designModeUnlinkSoak reaches its pixel comparison there, and on an M1 Pro it failed every run with "the unlinked element is painted the same (largest channel difference 2)". The before and after captures of the probe differed in 16 pixels only, all on the anti-aliased edge of the scoped card's two left corners, 15 of them by one level and one by two; text, fills and every straight edge were identical, as were the boxes and computed styles the soak compares exactly. A GPU blends a curved edge slightly differently from one draw to the next, and the steady difference depends on the machine, so a one-level limit on every pixel cannot hold everywhere. The element check now allows up to 16 pixels past that level, each within the 8 levels the whole frame is already held to, and every other pixel within one level. A changed look still fails: shifting the same card's colour by 12 levels puts 452,144 pixels past the level. A failure now reports the largest difference and how many pixels were past it, and the report keeps both.
The gate's own rule puts suites that measure timing or drive a real window in the alone phase, one at a time with nothing else running. Four Design mode soaks and the screen recording probe were in the shared pool instead. On a 10-core, 16 GB M1 Pro, the default full gate (four Electron windows at once among nine suites) failed designModeSoak, designModeControlsSoak, designModePagesSoak and designModeUnlinkSoak in two runs, on waits that ran out (a frame never drawn within 30 s, a page that never finished opening, a copy not drawn within 100 ms), and each passed on its own. With --electron-jobs=1 the three that had no other fault passed in three runs out of three. screenRecordingElectron failed the same way under load: its frame-rate checks fail outside CI, and e355e30 records a loaded macOS runner at 0.8 fps. They now run alone. CI's Linux and Windows runners skip all five (macOS only), so CI time does not change. On a Mac the alone phase grows by about 8 to 10 minutes (designModePagesSoak alone took 234 s), so a full gate there takes roughly 22 to 24 minutes, under the push hook's 30-minute bound. designModeResizeSoak and designModeCrashSoak passed in every run and stay in the pool. Four of those entries name Design mode's test files, so scripts/gate/testSuites.ts becomes one of its integration points: designModeBoundary lists it with its four lines, and docs/design-mode/REMOVE.md says to remove them with the feature.
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.
In Design mode, a frame whose page is taller than 30,000 px showed Chromium's own scrollbar on Macs that draw classic scrollbars (Show scroll bars: Always, or Automatic with a mouse). The page was then laid out 15 px narrower than the frame's label says (781 in a frame labelled 796).
Each frame's document now gets the editor canvas's existing rule (CANVAS_SCROLLBAR_CSS) when it loads. Design mode frames run no script, so the canvas's message never reached them.
Why it matters
The unlink soak's pixel check
With the width fixed, the soak reaches its pixel comparison on such a Mac, where it failed every run with "largest channel difference 2". The before and after captures differed in 16 pixels only, all on the anti-aliased edge of the scoped card's two left corners (15 by one level, one by two); boxes and computed styles were identical. The element check now allows up to 16 pixels past one level, each within the 8 levels the frame is already held to. A real change still fails: shifting the card's colour by 12 levels puts 452,144 pixels past the level.
Design mode soaks and screen recording run alone
On a 10-core, 16 GB M1 Pro, the default full gate failed four Design mode soaks and screenRecordingElectron on waits and frame rates that ran out while other Electron windows shared the CPU; each passed on its own. testSuites.ts already says suites that measure timing or drive a real window run alone, so these five now do. CI skips them (macOS only), so CI time is unchanged; on a Mac the gate grows by a few minutes (about 17 minutes in total here). The four new entries name Design mode tests, so designModeBoundary and docs/design-mode/REMOVE.md list testSuites.ts as an integration point.
Tests