Repository navigation
fix(ui): publish native modal open changes synchronously - #176896
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 publishes accepted modal open-state changes synchronously through the existing bridge property hook. Example: An onOpenChange(true) callback immediately sets modal.open = false.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR provides a focused fix for synchronous modal state publication; no actionable defects were found, and exact-head CI now passes. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherControl UI callers write modal properties or call show/hide; the bridge forwards requests to the modal policy, which uses the shared overlay lifecycle to control native dialogs and publish accepted visibility. flowchart LR
A[Modal callers] --> B[Solid bridge properties]
B --> C[Modal policy]
C --> D[Overlay lifecycle]
D --> E[Native dialog]
D --> C
C --> F[Open change callback]
Technical reviewBest possible solution: Use the existing bridge hook and modal policy to publish accepted state synchronously while retaining the shared overlay lifecycle. Do we have a high-confidence way to reproduce the issue? The base's deferred props.open effect explains the delayed callback publication, and the supplied native fixture reports the matching before/after sequence; this read-only review did not execute a reproduction. Is this the best way to solve the issue? This is the smallest complete fix: the existing synchronous bridge hook forwards requests to the existing policy, publication bookkeeping precedes reentry, and the superseded effect is removed. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against a7a019aa0f66. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource -1, Tests +34. Total +33 across 2 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 Reviewed October 19, 2026, 12:23 AM ET / 04:23 UTC. |
|
Merged via squash.
|
What Problem This Solves
A modal's open callback can immediately request a close, but the deferred property effect does not publish that accepted close synchronously.
User Impact
Modal callers receive the accepted open/close state immediately, including when a close is vetoed. Native closing animations, draft retention, autofocus, and return focus keep their existing behavior. No migration or user action is required.
Why This Change Was Made
Route changed
openproperties to the existing modal policy through the bridge's synchronous property hook. Record publication state before writing back to the host because that write reenters the policy. This removes the mirroring effect without adding another state owner.Evidence
pnpm tsgo:uipassed with default tsrs--maxWorkers=1The reentrant-close fixture records the changed contract immediately after
show(): callback publications are[true]on base and[true,false]on head. On both, the native dialog remains open during its closing animation and eventually closes and restores focus. The new unit cases also cover veto correction without duplicate publication.Production Knip exits 1 on both base and head with identical names:
settleInterruptedRestartRecovery,StateDatabaseAccessError, andRequesterSettleWakeBatchCallbacks. These are outside the two changed UI files; no new unused export is introduced.The strict performance checker exits 1 on both base and head for the same pre-existing route limits: chat boot 1,493,007 → 1,493,013 B against 1,490,000, and new-session boot 1,050,644 → 1,050,653 B against 1,050,000. Startup passes; no new imports or lazy boundaries. The measured proof base is
5ec30bfc7216adeb622700464db6dccae368e17e.createEffectcreateRenderEffect,untrack, direct listenersquerySelectorflush, owner escapesThe existing
[autofocus]query atui/src/components/modal-dialog.ts:204remains for the separate initial-focus cutover. This checkpoint changes only open-state synchronization and its regression test.Before is the left column; after is the right. All six frames are inspected synthetic fixtures.
Review and build provenance
The corrected independent review received both complete changed files plus the unchanged bridge, overlay lifecycle/types, and modal test helper. It found no actionable P0–P2 issues; the earlier incomplete-context assessment was not used as the completion gate.
The head build was captured from the reviewed candidate before commit. Its metadata correctly records base
5ec30bfc7216adeb622700464db6dccae368e17eanddirty:true. The emitted modal source-map source exactly matches the committed production blob3c03e0287cb866fd9cf791ccd6a6e97e1f12e1a7(SHA2568f0a0e47911eace3faf2758297d9ecab074b22f130b85d9e27bb3961e0f1ffd6); the test blob is2f2ef6958f73280803bf3d4ef84a747a16518ee6. Candidate commit:788594b57c36134b891adfc3586f77f9b7f6e0f1. Before publication the single commit was rebased onto20e1fea8998df8e0e4db76a40a785fc41d6ba47eas83107ca1172b0f9097bcfa7406f484abb698b46dand the frozen install passed. Both changed blobs are identical to the reviewed/built candidate; intervening main changes do not touch these components or their reactive/test helpers. The existing proof is reused without extra builds/tests for disjoint base drift.