Repository navigation
fix(ui): keep typing focus when the GitHub reader opens - #157202
Conversation
Keep document opening, loading, and navigation passive while preserving scroll-to-comment behavior and explicit new-tab address focus. Cover embedded and standalone opening, delayed responses, errors, and address editing.
|
🦞👀 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: needs maintainer review before merge. Reviewed September 24, 2026, 9:48 AM ET / 13:48 UTC (Revision 4). ClawSweeper reviewWhat this changesThe PR makes the Control UI link reader preserve typing focus while documents open, load, or fail, adds focus tests and documentation, and removes a stale animation assertion. Merge readiness✅ Ready for maintainer review Keep open: current main still has the reported focus theft, and this coherent PR provides a distinct fix. No blocking patch defect was found. Priority: P2 Review scores
Verification
How this fits togetherThe Control UI routes supported links from chat into a reader panel, which requests document details through the Gateway and renders them beside the conversation. The panel also controls scrolling and keyboard focus as results arrive. flowchart LR
A[Chat link] --> B[Reader tab]
B --> C[Gateway detail request]
C --> D{Document loaded?}
D -->|Yes| E[Render and scroll document]
D -->|No| F[Show reader error]
E --> G[Keep typing focus]
F --> G
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource -1, Tests +39, Docs +3. Total +41 across 4 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Land the reader-owned focus correction while preserving scrolling to document anchors and address focus for explicitly created tabs. Do we have a high-confidence way to reproduce the issue? Yes. Current main calls focus() on reader content during updates; opening a supported link while the composer is active reaches that path. The PR body also reports a before-and-after Chrome observation. Is this the best way to solve the issue? Yes. The reader owns both focus requests and document positioning, and the patch changes that owner while retaining explicit new-tab address focus. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 34757eb29845. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (3 earlier review cycles) |
The 180 ms entry class is retired on animation completion, so counting it after asynchronous browser calls races correct cleanup. Keep image continuity and stable row identity proof; dedicated motion and lifecycle tests own animation behavior.
|
Merged via squash.
|
* commit '9ccfc7d1bea21e34da48edbd54afd2e1be57db40': (89 commits) fix(exec): avoid gateway stalls during background task writes (#157177) test(cli): isolate preaction title setter state fix(test): synchronize Git backoff cancellation readiness (#157315) fix: validate Codex model references in Docker (#157175) fix(state): tolerate brief WAL coordinator contention (#157121) fix: unblock conversations after recovery preparation fails (#157214) test(telegram): avoid wall-clock pacing in HTTP conformance (#157281) fix: keep independent database work responsive under load (#157230) refactor(sqlite): centralize WAL checkpoint execution (#157263) improve(android): show tool outcomes in collapsed work (#156950) fix: remove tracked release scratch blocking source capture (#157308) test(update): remove legacy probe stream ordering race fix: preserve steering across reconnects and show queued input (#157135) fix(ui): keep typing focus when the GitHub reader opens (#157202) fix(ios): keep screenshot logs outside capture evidence test(codex): await startup teardown in lifecycle fixtures chore(ui): refresh control ui locales (#157311) refactor(memory): deslop memory plugins (#156867) refactor(test): share CLI diagnostics fixture setup (#157201) fix(release): retry notarization submit/wait on transport failures and name the resume command (#157116) ...
) * fix(ui): keep typing focus when the GitHub reader opens Keep document opening, loading, and navigation passive while preserving scroll-to-comment behavior and explicit new-tab address focus. Cover embedded and standalone opening, delayed responses, errors, and address editing. * test(ui): remove stale image-handoff animation assertion The 180 ms entry class is retired on animation completion, so counting it after asynchronous browser calls races correct cleanup. Keep image continuity and stable row identity proof; dedicated motion and lifecycle tests own animation behavior.
What Problem This Solves
Fixes the native GitHub side panel stealing keyboard focus when it opens or finishes loading after the user has returned to typing in chat.
User Impact
Users can keep typing while a GitHub document opens, loads, or fails. Explicitly creating a new reader tab still focuses its address bar. Document navigation and comment scrolling remain available.
Why This Change Was Made
The shared link reader repeatedly focused its content until a successful response arrived; failures left that focus request active indefinitely. Its implicit embedded tab also focused an empty address bar before receiving the pending URL. Document positioning now uses a scroll-only intent, and implicit mounting leaves keyboard focus alone.
Evidence
pnpm test ui/src/components/link-reader-panel.test.ts --maxWorkers=1..lr-contentafter loading. The fix kept the composer active through delayed module mounting and detail completion, receiving the complete textKeep typing through opening and loading. Deferred failure also preserves typing.04925b2d391e3a9971f7186dbb1d3bbeb8d5fb4f: run 36004199202.CI follow-up
The first CI attempt was intentionally deferred while Full Release Validation held runner priority. After that hold cleared, run 35985705750 attempt 2 passed all selected checks except an unrelated image-handoff E2E assertion: it counted a temporary animation class after the 180 ms animation could already have finished. Commit
03405c36ecadhad intentionally made animation completion remove that class. This PR removes the stale duplicate assertion; the image payload, loaded-image frame continuity, stable row identity, and authoritative-history handoff assertions remain intact. Dedicated browser motion tests record actual animation events, and lifecycle unit tests protect cleanup and no replay.The original 79-file shard was replayed locally with the CI include list and shard selection. Its image test passed, but two unrelated microphone-lifetime cases remained in
connecting; both also fail alone locally and both passed in hosted CI. Captured diagnostics show native microphone acquisition remained pending before any provider session creation, with a connected Gateway and no browser errors. The local cause remains unproven; this is not claimed as passing proof. No microphone code or assertions changed.After the cleanup: all eight image-handoff/motion browser cases and all eight animation lifecycle tests passed. The changed image-handoff file alone passed all five cases in 21.87 seconds runner wall time (20.02 seconds Vitest duration). Its original CI file cost was 26.826 seconds. The correction passed fresh independent P0–P2 review and all selected changed-file checks.
Recovery-run limits
GitHub returned
startup_failurefor the corrected head before creating ordinary PR CI jobs. The native manual recovery run 35998578972 selected the full repository suite. Its runtime-topology job received a runner shutdown signal; the advisory SDK-diff report failed with a DataView bounds error; a Windows ACP argv case exceeded its unchanged 5000 ms startup budget. That timeout covers lease-store admission, process launch, ACP initialization, and Windows descendant discovery, so the log cannot identify the blocked stage. All three unleased command variants passed. Read-only source/history investigation found no safe bounded repair; no budgets, assertions, mocks, dependencies, or ACP behavior were changed. These broader diagnostic failures remain recorded here. The ordinary PR run was restored through a draft-to-ready transition on the same PR and head, and passed all selected gates without changing their scope or assertions.Hosted test cost on the final ordinary PR run: the 32 reader unit cases used 1.947 seconds of test execution; the five image-handoff E2E cases passed in 15.208 seconds.