Repository navigation
Translate: keep the stable gutter without a :has() over the chat thread - #18315
Conversation
Codex Review Summary: ✅ CompletedThis 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 |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. 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". |
|
@codex review |
|
Codex Review: Didn't find any major issues. 🎉 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". |
Translate: keep the stable gutter without a :has() over the chat thread
The long-thread composer gate,
tests/studio/playwright_long_thread_gate.py, fails onmainsince #18293. It fails on every PR that runs it, for example #18062 and #18108, acrossFrontend build + bundle sanity,Frontend unit tests (Windows)andComposer:Cause
#18293 added this rule so a classic scrollbar does not narrow the Translate panes:
The
<main>it matches is the layout's scroll container, and on the chat page that element holds the whole thread. An unanchored:has()there makes Chromium re-walk every descendant on each keystroke. The gate measures exactly that cost, and it grows with the chat.Fix
The intent is unchanged: while Translate is open, its layout
<main>keeps a stable gutter. Only the way that element is selected changes.translate-page.tsx: a layout effect marks the layout<main>that holds.translate-pagewithdata-translate-pagewhile the page is mounted, and removes it on unmount. The page's own root is also a<main>, so the effect starts from its parent.index.css:main:has(.translate-page)becomesmain[data-translate-page].An attribute selector costs nothing per keystroke, and the Translate page renders the same.
Verification
Long-thread gate, run locally on the same host:
:has()at 40 turns:has()at 200 turnsmainOther checks:
tests/translate-page.test.ts: 27 passed.npm run typecheck: no errors.Screenshots
Translate page at 1366x768, before (
main) and after (this PR). Each side was built from its own isolated Studio install. Both render the same page, and on both the layout<main>reportsscrollbar-gutter: stable. The page width is 1076 px on both sides.