Repository navigation
fix(ui): preserve accents and quotes when typing starts outside composer - #138274
vyctorbrzezowski wants to merge 1 commit into
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: blocked before merge. Reviewed September 13, 2026, 1:48 AM ET / 05:48 UTC (Revision 4). ClawSweeper reviewWhat this changesThe PR lets dead keys move focus into the Chat and New Session composers and adds coverage for preserving accented text and quotes. Merge readiness⛔ Blocked before merge - 1 item remains This remains a useful, focused fix: current main and the latest release still reject dead keys before transferring focus. No introduced correctness defect was found, and the related merged menu refactor explicitly leaves this work separate. Priority: P2 Review scores
Verification
How this fits togetherThe Control UI routes page-level typing into the active message composer unless another control owns the key. This shared handler transfers focus, then leaves character insertion and composition to the browser. flowchart TD
A[Page keyboard input] --> B[Shared focus handler]
B --> C{Another control owns input?}
C -->|Yes| D[Keep existing focus]
C -->|No, printable or dead key| E[Focus active composer]
E --> F[Browser text composition]
F --> G[Message draft]
Before merge
Agent review detailsSecurityNone. PR surfaceSource 0, Tests +65. Total +65 across 3 files. View PR surface stats
Review metricsNone. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep one shared focus-transfer rule for both composers and preserve the browser's native composition pipeline without manually inserting characters. Do we have a high-confidence way to reproduce the issue? Yes, for the focus-transfer defect: current main necessarily rejects Dead before focusing the textarea. Native accent composition itself was not reproduced in this review. Is this the best way to solve the issue? Yes. Extending the existing shared guard is a narrow repair that preserves browser input handling and avoids separate Chat and New Session implementations. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 4f545c0dbf14. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
sylvesterkaczmarek
left a comment
There was a problem hiding this comment.
Treating Dead as an input-producing key without preventing the event is exactly what this focus-transfer owner needs. The bug is not composition itself; it is that the browser receives the dead key before the textarea owns focus. Moving focus during keydown preserves the native composition pipeline while retaining the existing Ctrl/Meta, modal, dropdown and active-IME exclusions. Covering both Chat and New Session is important because they share this owner and could otherwise drift.
f7a56f9 to
8a84abb
Compare
8a84abb to
8a7efde
Compare
|
Closing: the dead-key composer fix needs native keyboard proof that we cannot produce in the current harness, and the issue is not reproducible on current main in the mocked flow. Will reopen with a native reproduction if it resurfaces. |
Closes #138273
What Problem This Solves
Control UI users can lose a dead-key accent or quotation mark when typing starts outside the Chat or New Session composer. The initial dead key reaches the page before the textarea receives focus.
Reported by @mcaxtr.
User Impact
Dead keys now transfer focus to the composer before subsequent text input. Chat and New Session use the same rule, while focused inputs, active composition, shortcuts, menus, and modal dialogs retain their existing exclusions.
Why This Change Was Made
The shared focus-transfer owner recognizes
Dead, including its Alt-modified form, as an input-producing key. It focuses the textarea during keydown without preventing the browser default or inserting characters manually. Production changes remain limited to the existing guard and its comment (+4/-4).Evidence
Rebased without conflicts onto
bf3d877829d005bcd1e144e5f84d19983c4b9a7a. The patch is unchanged by the rebase. Rebased head:8a7efde47e261462a6d6fd9910b680d36b5528b8.Validation of the unchanged rebased source tree on Linux:
node scripts/run-vitest.mjs ui/src/pages/chat/chat-pane-keyboard-focus.test.ts ui/src/e2e/chat-composer-focus.e2e.test.ts: 52 unit tests and 7 browser tests passed.Deadevent through Chromium's debugging protocol, asserts focus transfer in Chat and New Session, then verifies accented text and quotes. It also checks the exactchat.sendmessage from Chat.node scripts/ui.js build: passed after restoring the frozen dependencies.node --import ./scripts/tsx.mjs scripts/check-control-ui-performance.mts: passed. Startup JavaScript is 355,213 B gzip against a 355,719 B limit; startup CSS is 46,081 B against a 51,200 B hard limit. CSS is 1 B above the advisory target.node scripts/check-changed.mjs --timed -- ui/src/e2e/chat-composer-focus.e2e.test.ts ui/src/pages/chat/chat-pane-keyboard-focus.test.ts ui/src/pages/chat/chat-pane-shared.ts: passed with exit 0.git diff --check: passed.The original regression was reported on
v2026.9.1and then-current main. Current main still returns before focus transfer forDeadbecause it rejects Alt-modified keys and keys whose names are longer than one character.Risk and coverage
The browser tests cover both consumers, menu and activation-key ownership, typing from the context menu, remote-control input exclusion, first-character preservation, and focus styling. The unit tests also verify that focus transfer does not prevent the browser default and that modal dialogs keep ownership.
The dead-key browser test proves focus transfer followed by preservation of completed text. It does not reproduce native keyboard-layout composition: Playwright inserts non-US-layout characters directly. Native macOS and Windows layout checks, including dead key plus base letter and dead key plus Space, remain unverified.
Matched before/after captures remain pending. The earlier screenshots used different fixtures and viewports, and the desktop after capture included the community invitation card; they are not presented here as equivalent visual proof. No new screenshots were captured during this rebase.