Skip to content

Studio: centre the chat column under classic scroll bars in WebKit - #15392

Merged
shimmyshimmer merged 4 commits into
mainfrom
studio-composer-column-verify
Oct 27, 2026
Merged

shimmyshimmer merged 4 commits into
mainfrom
studio-composer-column-verify

Conversation

@shimmyshimmer

@shimmyshimmer shimmyshimmer commented Oct 26, 2026 •

Copy link
Copy Markdown
Member

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-edges puts 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

  • WKWebView host (the engine Tauri uses on macOS) with classic scroll bars, window widths 900 to 2560 and page zoom 50 to 200%, loaded at that zoom and changed live (including rapid steps): composer and column edges match (0px), column centre within 0.3px of the pane centre. Before: 13px left of centre at 100%.
  • Same host with overlay scroll bars: no shift applied, layout identical to main.
  • Playwright Chromium with real 13px scroll bars: no shift applied, aligned and centred. Playwright WebKit with forced scroll bars: shift applied, aligned and centred, including the late-shift case above.
  • Real Desktop build (Tauri) driven through the interface zoom store from 67% to 200% and back: composer matches the column at every step (overlay scroll bars on that machine).
  • New 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:

before and after

Not tested here: a signed Desktop build, WebKitGTK on Linux, and Safari itself (the WebKit engine behaviour was confirmed in WKWebView and Playwright WebKit).

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
@shimmyshimmer

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-27T02:46:05.847298Z 8c8b8e5 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: 8c8b8e5913

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

@shimmyshimmer
shimmyshimmer merged commit 8d0a5aa into main Oct 27, 2026
0 of 42 checks passed
@shimmyshimmer
shimmyshimmer deleted the studio-composer-column-verify branch October 27, 2026 03:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant