Repository navigation
Studio: line the composer up with the chat column in the macOS Desktop app - #13965
Conversation
|
@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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 19af82ab11
ℹ️ 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".
| } | ||
| const dockRect = dock.getBoundingClientRect(); | ||
| const inset = footer | ||
| ? composerInsetFromColumn(footer.getBoundingClientRect(), dockRect) |
There was a problem hiding this comment.
Ignore horizontal scroll when measuring the footer
When .aui-thread-viewport is horizontally scrolled—which this component permits via overflow-x-auto—the footer's getBoundingClientRect() is shifted by scrollLeft. A later ResizeObserver callback, such as when attachments or multiline input resize the dock, then treats those shifted edges as the column geometry and changes the composer padding, moving or narrowing the composer even though the column width did not change. Normalize the measurement for the viewport's horizontal scroll offset, or measure a non-scrolling proxy.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 35fe59a: the footer's edges are offset by the viewport's scrollLeft, so a sideways-scrolled thread no longer moves the composer.
|
@codex review |
1 similar comment
|
@codex review |
|
Codex Review: Didn't find any major issues. What shall we delve into next? 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". |
…13991) ## Summary `Frontend build + bundle sanity` is red on main again. #13969 merged with it red, and its run reported `over the startup budget: transfer 1995.0 KB > 1994.7 KB, raw 6633.8 KB > 6632.7 KB`. Main at 6106de9 measures 6,796,799 B raw / 2,044,202 B transfer, against limits of 6,792,425 / 2,042,777. Measured commit by commit (one machine and build, Node 24, 95 chunks throughout, `rm -rf dist` before each build): | commit | raw B | transfer B | |---|---|---| | 1790106 (#13983, last raise from me) | 6,791,768 | 2,042,404 | | 7d33eff (#13965) | 6,792,034 | 2,042,515 | | cc0cb59 (#13966) | 6,792,447 | 2,042,693 | | 7bee02d (#13969) | 6,793,737 | 2,043,138 | | ce83dee (#13973) | 6,796,298 | 2,044,201 | | 6106de9 (main, after #13974, #13972, #13951, #13945) | 6,796,799 | 2,044,202 | The two largest steps: - Inline chat markdown tables with hover controls and the expand dialog (#13973): +2,561 B raw / +1,063 B transfer, in the eager chat chunk. - Latest Unsloth Models ranking (#13969): +1,290 B raw / +445 B transfer. #13945 already raised the budget for its own 497 B. ## Change The budget is set to the measured build plus the margin main had at 1790106 (160 B raw, 189 B transfer), with the per-commit numbers recorded beside the limits as in the earlier raises. If #13973's expand dialog should be lazy-loaded instead, that is a follow-up for its owner. This only gets main and every open PR off a red that none of them caused. ## Testing - `npm run build && npm run bundle:check` on main with this change: within budget (0.2 KB transfer, 0.2 KB raw to spare). Without it: over by 4,374 B raw / 1,425 B transfer. - `tests/bundle-budget-cli.test.ts` and `tests/bundle-budget-closure.test.ts`: 43 passed. - `prettier --check scripts/check-bundle-budget.ts`: clean.
…15392) ## 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:  Not tested here: a signed Desktop build, WebKitGTK on Linux, and Safari itself (the WebKit engine behaviour was confirmed in WKWebView and Playwright WebKit).
What changed
In the macOS Desktop app the chat column sat about 13 px left of the composer whenever the system shows classic scroll bars (a mouse attached, or "Show scroll bars: Always"). The text, headings and list bullets started left of the composer's edge and ended short of its right edge.
The cause is WebKit's
scrollbar-gutter: stable both-edgeson the thread viewport. It reserves the gutter twice on the right side, whileclientWidthonly counts it once. The dock worked out the column's box from those numbers (#13675), so in WKWebView it centred the composer 13 px to the right of the real column. Chromium (browser, WebView2) reserves one gutter per side and was already correct.The dock now reads the column's edges straight from the viewport footer. That footer is a full-width child of the thread viewport, so its box is the box the messages are laid out in, whatever the engine does with the gutter. It is mounted whenever the dock is. The computed box stays as the fallback until the footer is in the DOM.
Verification
mainthe message column was at x=475..1219 and the composer at 488..1232. With this change both edges match (0 to 0.1 px) at page zoom 50, 67, 80, 100, 125, 150, 175 and 200% and window widths 900, 1440 and 1920.mainacross widths 390 to 1920 px, emulated zoom 50 to 200% and interface scale 50 to 200%. This change does not alter those (same footer box).tests/composer-column-inset.test.ts.npm run typecheck,npm test,npm run build.biome checkreports no new findings in the changed files.Before and after in a WKWebView host at 100% zoom with classic scroll bars. Before, the text starts 13 px left of the composer. After, both edges line up:
Not tested here: a signed Desktop build itself, and WebKitGTK on Linux.