Repository navigation
Overview: Space no longer scrolls the window into blank space - #304
Merged
Merged
Conversation
Each page scrolls in its own layer (shell/Pages.tsx), and that layer was
not positioned. An absolutely positioned element with no positioned
ancestor takes the whole window as its containing block, so the layer
neither clipped it nor carried it along: it sat at its place in the flow,
below the bottom of the window, and made the document taller than the
window. On the Overview the screen-reader hints after each breakdown row
("View in Traffic", "View in the security log") are such elements; once
the charts and rows render, the document grew from 720 to about 1600 px.
Space with nothing focused then scrolled the document, and Space after
clicking into the page scrolled the layer to its end and went on into the
document. Either way the whole right column, toolbar included, slid up
and left half a window of blank space below it.
The layer is now `relative`, so it is the containing block for those
elements on every page. It already was for the 250 ms of the page-enter
animation (its transform), and stopped being one when the animation
ended. A test renders the content area for every page, linked and not,
and checks the layer stays positioned.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Problem
On the Overview, with the charts shown, pressing Space a few times slid the whole right column (toolbar included) up and left about half a window of blank space below it.
Root cause
Every page scrolls in its own layer in
src/shell/Pages.tsx(themotion-pagediv withoverflow-y-auto). That layer was not positioned. An absolutely positioned element with no positioned ancestor takes the window (the initial containing block) as its containing block, and a scroll container only clips and carries the absolutely positioned elements whose containing block is the container itself or inside it. So such elements kept their place in the flow below the bottom of the window, unclipped, and made the document taller than the window.On the Overview these are the screen-reader hints after each breakdown row (
<span className="sr-only">insrc/overview/parts.tsx, "View in Traffic" / "View in the security log"). Before the data arrives the document is 720 px tall; once the charts and rows render it grows to about 1,600 px in a 1100×720 window (Chromium: 1,622; WKWebView: 1,614). The lowest hint, in the security section, sets the height.Two ways Space then reached the document:
The layer already was a containing block for the 250 ms of the page-enter animation (its
transform), and stopped being one when the animation ended.Fix
The page layer is now
relative, so it is the containing block for those elements on every page (all pages share this layer). The document is no longer taller than the window on any page.I considered also setting
overflow: hiddenon the document, but did not do it. It would not stop programmatic scrolls such asscrollIntoView, and the update and connection-picker windows use the same stylesheet and fit their height to their content, so the rule would have to be limited to the main window. With nothing overflowing, the document has nothing to scroll.Verification
Harness:
.claude/preview/full,page=dashboard&platform=macos, window 1100×720.keyboard.press)scrollHeight1622 againstinnerHeight720.<body>scrolled the document by 680, then to 902.scrollHeightis 720 andscrollTopstays 0 under Space ×6 (focus on body, after a click into the page, after hovering a chart) and under PageDown/ArrowDown/End/Home.slow) and withempty.NSEventkey presses: Space 49, PageDown, arrows, End, Home)static, the bug reproduces:pnpm typecheck,pnpm test(96 files, 985 tests) andpnpm buildpass locally.src/shell/Pages.test.tsxrenders the content area for every page, linked and not, and checks that the layer isrelative. It fails without the fix.Not changed: with nothing focused and no click into the page, Space now does nothing; before, it scrolled the document into blank space. It does not scroll the page layer, the same as pages that never overflowed.
🤖 Generated with Claude Code