Repository navigation
refactor(ui): simplify chat side panels and cards - #174739
Conversation
Derive local panel intent and secret visibility, keep textarea sizing with the input, and pair native event cleanup with its owner. Preserve request fences, retained panel state, focus, and lazy imports. Consolidate attachment admission refs and CI presentation observation.
|
🦞👀 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 simplifies Solid chat-panel state, attachment previews, DOM refs, and listener cleanup while preserving existing behavior. Example: A pending question offers Comfortable, Compact, and a free-text answer.
Review scores
ProductKind: Refactor · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open as useful maintainer-directed cleanup: the earlier ref-lifetime finding is resolved, and inspection found no new blocking defect. Priority: P3 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe Control UI chat components consume Gateway and session-owner state, render panels and cards, and forward user actions to the existing domain owners. flowchart LR
A[Gateway and session owners] --> B[Reactive projections]
B --> C[Chat panels and cards]
C --> D[Owned DOM refs and listeners]
D --> E[Native controls and overlays]
E --> F[Existing domain actions]
Technical reviewBest possible solution: Retain this focused refactor with the restored mount-time ref snapshots and transition-only focus handling. Do we have a high-confidence way to reproduce the issue? This is a refactor; source comparison confirms the previously reported ref callback defect is repaired, without executing tests during this read-only review. Is this the best way to solve the issue? The changes use existing Solid and domain owners, preserve deliberate equality and lifetime boundaries, and avoid adding configuration or parallel implementations. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 297448e524f0. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
PR surfaceSource -5, Tests +24. Total +19 across 40 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 16, 2026, 6:45 PM ET / 22:45 UTC (Revision 2). |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Merged via squash.
|
* refactor(ui): simplify chat panel state and lifecycles Derive local panel intent and secret visibility, keep textarea sizing with the input, and pair native event cleanup with its owner. Preserve request fences, retained panel state, focus, and lazy imports. Consolidate attachment admission refs and CI presentation observation. * refactor(ui): tidy chat panel cleanup callbacks * fix(ui): preserve sidebar ref lifetime and menu focus * test(ui): return void from sidebar timer cleanup
What Problem This Solves
Chat side panels and cards still carry imperative rendering state and lifecycle wiring after the Solid migration.
User Impact
No intended visual or behavioral change. Existing host tags, classes, selectors, lazy boundaries, retained panels, and request-admission contracts remain intact.
Why This Change Was Made
Use writable derivations for panel intent and secret visibility, an async memo for attachment posters, owned refs for question controls, and owned listener cleanup. CI checks consume their parent's presentation state instead of subscribing twice. Keep domain owners in plain TypeScript and preserve memo equality boundaries that prevent unrelated prop replacement from restarting automation inventory.
Remaining effects name their external synchronization (DOM geometry/focus, imperative integrations, or owner subscriptions). Retained snapshots preserve request admission or lifetime identity. Raw listeners belong to FileReader, MessagePort/window transport, and IndexedDB lifetimes; queries cross component or native-island boundaries. No dependencies were added.
Evidence
pnpm tsgo:uipnpm deadcode:knippnpm ui:build, including strict performance checkci:fullrun38978903914passed, including UI units, Control UI E2E, browser-extension, real-Gateway, lint, types, and performanceThe question and summary files were rerun only after fixing failures. Build/screenshots cover the substantive refactor. CI corrections restore mount-time ref snapshots and restrict focus transfer to lock transitions, preserving baseline behavior; failed sidebar cases pass locally, with mobile user flows covered by the replacement full CI run. Baseline:
0af4818bca861078e143316e06d74a4435d76fb4. No full local suite or parity matrix was run.Solid refactor checklist — 39 touched production files
createEffectcreateRenderEffectuntrackaddEventListenerflushCounts use the skill's line-based patterns. Its query pattern excludes generic TypeScript calls, so the unchanged query count does not represent all removed own-DOM queries. Owner captures remain at foreign DOM mount boundaries. Net production LOC: −5.
Initial CI run
38973661190exposed two regressions that are corrected in the replacement head: file-search ref callbacks read a narrowed Show accessor outside its rendering scope, and same-lock sidebar refreshes transferred focus out of active mobile menus. The existing sidebar/browser cases and a new focus regression cover these contracts. Replacement run38976832310cleared the UI unit and mobile regressions. It found one test-only cleanup return-type error, now corrected and checked withtest/tsconfig/tsconfig.core.test.ui-chat.json. The separatelink-hover-preview.e2e.test.tscase “keeps title hints when the optional hover runtime cannot load” also fails on scheduled main runs38969675015and38976134677, with the identical initial-roster timeout; it was inherited. Final run38978903914is fully green, including that test; no CI exception is needed.The attached before/after captures contain synthetic fixtures only.