Repository navigation
Studio: centre the chat column under classic scroll bars in WebKit - #15392
Merged
Merged
Conversation
WebKit puts the left half of a flex scroller's scrollbar-gutter: stable both-edges on the right, so with classic scroll bars (a mouse attached, or Show scroll bars: Always) the message column and composer sat one scrollbar width (13px) left of centre in the macOS Desktop app and Safari. When that is detected, the thread viewport switches to a one-sided gutter plus matching left padding, and the composer dock re-measures since the column moves without resizing.
shimmyshimmer
added a commit
to shimmyshimmer/unsloth-staging-4
that referenced
this pull request
Oct 26, 2026
Member
Author
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Can't wait for the next one! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
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.
What changed
With classic scroll bars (a mouse attached, or "Show scroll bars: Always") the chat column and the composer sat 13px left of centre in the macOS Desktop app and in Safari. The composer stayed lined up with the column; both were just off-centre in the pane.
The cause is a WebKit quirk: on a flex scroll container,
scrollbar-gutter: stable both-edgesputs the left gutter on the right side, next to the scroll bar. The thread viewport is a flex column, so its content box started flush at the left padding and ended two scroll bar widths short of the right edge. Block containers are not affected, and Chromium (browser, WebView2) reserves one gutter per side as intended.The thread viewport now checks for this once with a small flex probe. When WebKit misplaces the gutter and a classic scroll bar is showing, the viewport switches to a one-sided gutter plus the same width of extra left padding, which puts the column back on the pane's centre line. Overlay scroll bars, Chromium and RTL are untouched.
The composer dock already lines itself up from the column's measured box (#13965). The shift moves the column without resizing it, which no ResizeObserver reports, so the gutter watcher fires an event and the dock re-measures. Without that the composer could end up 13px off the column when the shift lands after the dock's first measurement (reproduced in Playwright WebKit).
Padding rather than a transparent border: WebKit snaps border widths to device pixels at fractional zoom, which left the composer up to 1px off the column at 150%.
Verification
main.tests/thread-gutter.test.ts.npm run typecheck,npm test(14063 pass),npm run build; biome reports no new findings in the changed lines.Before and after in a WKWebView host at 100% zoom with classic scroll bars. Before, the column and composer sit 13px left of the pane centre (wider gap on the right). After, both are centred and still line up:
Not tested here: a signed Desktop build, WebKitGTK on Linux, and Safari itself (the WebKit engine behaviour was confirmed in WKWebView and Playwright WebKit).