Repository navigation
refactor(ui): own composer suggestions in Solid stores - #174226
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 changes before merge. What this changesThis PR moves mention, emoji, and follow-up suggestion presentation into Solid stores and factories. Example: Type @casey in the Chat composer.
Review scores
ProductKind: Refactor · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Needs changes before merge - 3 items remain Keep this maintainer-authored refactor open; its direction is approved, but three introduced lifecycle and rendering defects need repair. Priority: P2 Before merge
Findings
Tests
Agent review detailsHow this fits togetherChat, New Session, and the command palette consume shared suggestion owners; textarea events and Gateway responses enter them, and menu presentation or selected draft text leaves them. flowchart LR
A[Textarea events] --> B[Suggestion factories]
C[Gateway directory and prediction responses] --> B
B --> D[Solid presentation stores]
D --> E[Composer suggestion views]
E --> F[Existing draft owners]
Technical reviewBest possible solution: Keep the Solid presentation cutover while preserving synchronous scope resets and separating live presentation updates from lifecycle disposal. Do we have a high-confidence way to reproduce the issue? The draft-route failure is recorded in exact-head CI, and source plus the pinned Solid runtime establishes the two owned-scope write paths; no target code was executed during this review. Is this the best way to solve the issue? The presentation-store direction fits the existing Solid migration, but the cutover must update retained lifecycle callers and preserve frame invalidation after synchronous owner changes. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 28f5f250e113. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceAcceptance criteria:
What I checked:
PR surfaceSource -5, Tests +21. Total +16 across 16 files. Added test files: 0. View PR surface stats
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 Reviewed October 16, 2026, 9:14 AM ET / 13:14 UTC. |
|
Merged via squash auto-merge.
|
* refactor(ui): own composer suggestions in Solid stores * fix(ui): preserve composer menu lifecycle ordering * fix(ui): release composer resources without publishing state * test(ui): keep emoji overlay spy bound
What Problem This Solves
Composer suggestions still used class-owned rendering state and manual host invalidation after the Solid migration.
User Impact
Preserves the existing mention, emoji, and next-message suggestion behavior, including keyboard selection, native undo, query caching, and stale-result cancellation. Chat, New Session, and the command palette share the migrated mention picker.
Why This Change Was Made
Moves suggestion presentation into Solid stores and factories, removes their host-update callbacks, and binds prediction cancellation to the component lifetime. Store draft updates preserve same-turn keyboard decisions without maintaining a second state copy. Retained pane/draft owners continue to own mention-cache disposal. External directory and geometry synchronization runs in effects; the remaining slash/skill and frame invalidation path is a separate cutover.
Evidence
pnpm tsgo:uipassespnpm deadcode:knippasses13349bd0005fpasses full CI run 38912959154, including all UI unit, UI E2E, WebKit, and real-Gateway shardsTouched production files: 5,235 → 5,233 LOC (−2). Controller-pattern references: 35 → 14; native listener registrations: 3 → 1; render effects: 3 → 1; effects: 3 → 9;
untrack: 10 → 13. Added effects synchronize external directory/search policy and popup geometry; untracked reads capture stable popup/palette identities and one-time placement. No startup import or lazy boundary changes.CI repair
The first CI run exposed a synchronous overlay-retirement loop during emoji acceptance, an unnecessary store reset during the palette's first render, and a plain skill-menu reset that did not notify the New Session view. The repair closes the emoji draft before retiring its overlay, skips resetting a fresh palette menu, and publishes the visible skill-menu closure. A browser probe confirms Tab inserts through the native editing command without errors.
The navigation/eviction failures in run 38904273398 are not claimed as inherited: the six shard-1 cases pass on scheduled main run 38902471699. The exact failing diagnostic-runtime route test reproduced a store write during pane eviction (
REACTIVE_WRITE_IN_OWNED_SCOPE/REACTIVITY_HALTED). Pane and New Session teardown now release emoji resources without writing presentation state. The same route test passes (1 case, 4 skipped), as do focused acceptance regressions. Replacement run 38908774669 passes all UI E2E and real-Gateway shards, all WebKit overlay/focus tests, and the composer regressions. Its remaining failures are the test-only unbound-method lint error corrected in this head and the independent native-fixture timeout described below.Replacement-run attribution
Run 38908774669 timed out in
control-ui-e2e-suite.test.tsatjoins scenario cleanup or retires the unsafe fork and retains its state: scenario-timeout. The retained unjoined child then caused seven deliberate guard failures: thescenario-noncooperative,scenario-late-close,scenario-close-failure,resources-success,resources-close-failure,resources-late-setup, andresources-browser-failurecases. The fixture mocks Chromium and uses a synthetic server; it does not import the composer. Its test, suite helper, managed-child shutdown helper, isolated-state owner, cleanup helper, and diagnostic sources are byte-identical between this PR's base and head.Those eight exact cases pass in scheduled main run 38908699969, but main uses Node while the failing invocation uses Bun. This is source-unrelated native-fixture timeout evidence, not a claim of the same failure reproduced on main. The underlying Bun delay remains unproven. A focused test-spy correction fixes this PR's separate
typescript(unbound-method)lint error; type-aware lint and both affected Chat/New Session acceptance cases pass locally.Final head
13349bd0005f16602ef9305a78c32810ee28e8aapassed full run 38912959154 without exceptions. The native workflow merged that exact head as3ca8c08ef47ca567bd844f969f6b6b24611ce5d1; the unrelated Bun fixture timeout did not recur. No CI rerun or admin bypass was used.