Repository navigation
refactor: keep chat keyboard admission with surface owners - #176390
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 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. |
|
Codex review: needs maintainer review before merge. What this changesThis PR replaces cross-renderer keyboard and focus queries with composer refs, live menu registrations, and modal-surface registrations. Example: Rename the session “Synthetic keyboard review” from its header menu.
Review scores
ProductKind: Refactor · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this maintainer-directed ownership refactor remains useful, all four earlier findings are repaired, and no new actionable defect was found. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherControl UI document-key handlers consult menu and modal ownership before transferring printable input to the Chat or New Session composer. flowchart TD
A[Keyboard event] --> B[Chat or New Session]
B --> C[Surface registrations]
C --> D[Menu shortcut admission]
C --> E[Modal keyboard ownership]
B --> F[Composer textarea ref]
D --> G[Lazy menu activation]
Technical reviewBest possible solution: Retain this owner-based cutover and handle the documented inherited performance failure through the existing landing workflow. Do we have a high-confidence way to reproduce the issue? This is a behavior-preserving refactor; source inspection verifies the earlier fixture repairs, and no target code was executed during review. Is this the best way to solve the issue? The change uses existing composer, menu-binding, and overlay owners, removes their competing query paths, and preserves a still-used selector until its separate consumer cutover. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 79e99f033c46. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +110, Tests +44. Total +154 across 24 files. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
Reviewed October 19, 2026, 3:23 AM ET / 07:23 UTC (Revision 2). |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 829c57b484
ℹ️ 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".
| events?: ReturnType<typeof createRegistryEvents>; | ||
| }; | ||
| const registries = new WeakMap<Document, OverlayRegistry>(); | ||
| const modalSurfaces = new Set<HTMLElement>(); |
There was a problem hiding this comment.
Reduce production LOC for this Solid refactor
This behavior-preserving refactor adds 149 net production lines, primarily through the new global modal/shortcut registries and per-surface registration plumbing. The required checklist for refactoring existing Solid code explicitly requires production LOC to decrease, so this cutover should be consolidated into the existing overlay/modal owners or otherwise simplified before landing.
AGENTS.md reference: ui/AGENTS.md:L3-L5
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Declining this LOC-only finding under the explicit wave-zero assignment: “LOC: prefer smaller; growth needed for correctness or the idiom is fine — report it, never stop for it.”
The final keyboard-only change is 6,623 → 6,733 production lines (+110), with the assigned cross-renderer queries reduced 6 → 0. The growth publishes and releases renderer-owned references and live menu items while preserving shortcut admission across the chat/New Session loading boundary. The PR body records these counts and the simplification pass. This finding identifies no behavioral defect.
The earlier fixture findings are repaired; final-head run 39212569092 passed every unit, UI E2E, and real-Gateway job. Its only substantive failure is the separately documented New Session bundle threshold, which also fails on the exact paired base.
6a3f333 to
ada1b9d
Compare
ada1b9d to
b280e78
Compare
1274cff to
b7bbc6f
Compare
|
The earlier popover-shim and fixture cutover findings are fixed on the current head. Final-head CI 39212569092 passes every unit, UI E2E, and real-Gateway job; the remaining New Session bundle failure and exact-base reproduction are recorded in the body. The LOC-only finding is declined under the explicit wave-zero instruction allowing necessary, reported growth. @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
b7bbc6f to
7532474
Compare
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
…176390) * refactor: keep chat keyboard admission with surface owners * fix(ui): keep menu shortcut activation behind chat loading * refactor(ui): remove retired composer selector
What Problem This Solves
Chat keyboard handoff and rename discover elements owned by other renderers through selectors. This change passes the composer ref, reads live menu-item registrations, and lets the rename input own focus and selection.
User Impact
Printable input still transfers to the composer, enabled menu shortcuts retain priority, and modal surfaces keep keyboard ownership. Rename opens focused with its text selected and preserves disabled-action and native IME handling. Tags, CSS classes, and routes are unchanged.
Implementation
Menu shortcuts consume the existing focus owner's live items. The legacy model picker publishes its filtered rows to the same reader. Modal surfaces register with the existing overlay owner. Shortcut admission stays shared with New Session; activation stays in the lazy chat bundle and checks the owned surface followed by registered event-path surfaces.
Main #176586 removed the final sharing caller. This change integrates that verified merge and removes the retired
CHAT_COMPOSER_TEXTAREA_SELECTORexport.The branch preserves main's memo-based sidebar status, Solid Portal confirmation rendering, stronger background-refresh focus test, model-picker lazy lookup, and disabled rename guards. Main #177006 now owns the public transcript-reader repair; the two redundant test commits have been dropped.
Evidence
Candidate:
75324743662a1f4b5c4cf555488bb4d249cabdb8; branch merge base:99f5d0f8e4e0b1f8bee63b631620439069ac3003. Current CI tests mergeb876496cdc7adca82d8647af2da73fa87cdaab08, whose ordered parents are protected mainacb98dbf5bc37b7ae9598615aed158c4144e640eand this candidate.The two retained keyboard commits are patch-identical to the independently reviewed
1274cffcandidate. Main #176586 merged cleanly; its sentinel/element registrations are preserved. The only additional production edit removes the now-unused selector export. The final linear rebase has the identical source tree (1841a58a7e1508b0f991925635bea1914df561f3) as the tested integrated candidate;git diff --exit-code ffb2b7026dc4 HEADpassed.git diff --checkpassed1274cffpass correct at 0.85; final range-diff confirms unchanged patchesCurrent-head CI 39217482613, performance job 117945118161, built the candidate and base together using Node 24.21.0. The strict budgets are unchanged:
The sole performance violation is
new boot JS gzip. Latest completed scheduled main 39213328992, job 117931610693, fails that exact metric at 1,050,257 B. An independent strict run on exact CI baseacb98dbf5bc3also fails only this metric at 1,050,568 B (Node 24.22.0; canonical build passed). The PR adds 265 B in the paired CI build; that increment is recorded, not labeled inherited. No budget or exception changed.Core test-typecheck job 117945717667 fails only
src/gateway/server-methods/control-ui.test.ts(485,7): TS2353: 'load' does not exist in type 'SubscriptionDeps'. Running the same gateway-methods type leaf on exact CI baseacb98dbf5bc3reproduces that exact error and exit 2. The failing test and subscription owner have identical Git blobs in the base and tested merge. Latest completed scheduled main predates this error; it is not claimed as matching typecheck evidence.Assigned keyboard-ref scope (
chat-pane-shared.ts,chat-pane-session-menu.ts), counting typed and untyped calls:createEffectcreateRenderEffectuntrackaddEventListenerquerySelector(All)Across 16 coupled production files, queries fall 29 → 21; two effects and two initial snapshots remain in the menu owner. Direct listeners and render effects are zero. Production LOC is 6,626 → 6,735 (+109); eight test files are 2,104 → 2,148 (+44). The growth publishes and releases renderer-owned references and preserves shortcut admission across two loading boundaries. The simplification pass found no smaller complete cutover.
Unchanged patterns in coupled owners outside the assigned keyboard-ref scope
solid/menu.tsx:180,293.solid/menu.tsx:164,415.solid/menu.tsx:194,220,234,310;chat-model-picker-search.ts:13,28,29,39,51,57,82,88,129,142,148,182,189,203,212,307,318.These existing patterns remain with their owner lanes. No target pattern survives in the assigned keyboard-ref files.
Synthetic captures verify the unchanged menu and rename layout: