refactor(extension): remove redundant panel state dispatch - #411
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: needs maintainer review before merge. Reviewed September 4, 2026, 10:45 PM ET / September 5, 2026, 02:45 UTC. ClawSweeper reviewWhat this changesSimplifies browser-extension state updates by removing action-dispatch plumbing and updating summary, chat, navigation, slide handling, tests, and architecture documentation. Merge readiness✅ Ready for maintainer review Keep open: the cleanup is not present on the reviewed main or captured latest release, and no actionable correctness findings were found. Owner authorship and the repository’s conservative review policy also preclude cleanup closure. Priority: P3 Review scores
Verification
How this fits togetherThe browser extension’s sidepanel receives user actions, background messages, and summary or slide results. Its shared state coordinates rendering, chat, active-tab navigation, and restoration of cached results. flowchart TD
A[User actions] --> D[Sidepanel state]
B[Background messages] --> D
C[Summary and slide results] --> D
D --> E[Lifecycle transitions]
E --> F[Summary chat and slide views]
E --> G[Cache snapshots and restoration]
G --> D
Before mergeNone. Agent review detailsSecurityNone. Review metrics
Technical reviewBest possible solution: Maintain one panel-owned state object with snapshot-preserving nested updates and explicit coupled lifecycle transitions, without changing persisted settings or cache formats. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR proposes an internal refactor rather than a reported failure, and source comparison found no concrete introduced regression. Is this the best way to solve the issue? Yes: the removed dispatcher only translated actions into assignments on the same mutable root; direct updates and named transitions remove that indirection while preserving nested snapshots and lifecycle rules. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 589c6c2876f0. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
What changed
Delete the sidepanel action union, pure reducer, mutable wrapper store, optional dispatch dependencies, and repeated fallback dispatchers. They were translating plain state updates into action objects, constructing immutable root copies, then copying those copies straight back into one mutable root.
PanelState is now the single data owner. Scalars update directly; a typed nested-slice patch preserves captured snapshots; named transitions retain coupled phase/error, attach/restore, and reset behavior. No compatibility dispatcher remains.
This removes 463 production lines and 520 lines overall. Navigation, pending runs, chat, settings hydration, retained summaries, and omitted-versus-null slide restoration retain their behavior.
Proof
A separate standalone extension tsc invocation reports the extension's extensionless-import/NodeNext configuration errors; that configuration is unchanged. The supported extension build and browser tests above pass.
Before and after
Both synthetic captures have the same SHA-256, so the same uploaded image represents their identical content.
Before:
After: