Skip to content

fix(ui): publish native modal open changes synchronously - #176896

Merged
steipete merged 1 commit into
mainfrom
solid2/w-zero-component-modal-open-sync
Oct 19, 2026
Merged

steipete merged 1 commit into
mainfrom
solid2/w-zero-component-modal-open-sync

Conversation

@steipete

Copy link
Copy Markdown
Contributor

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 open properties 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

Check Result
UI typecheck pnpm tsgo:ui passed with default tsrs
Focused modal tests 15/15 passed under the default pinned Bun runtime, --maxWorkers=1
Format / scoped UI lint / diff check Passed; lint has only existing empty-component warnings in tests
Base/head builds Passed, once per side
Native Chromium proof Three before/after states; identical rendered PNGs and retained draft/focus behavior
Startup JS gzip 337,709 → 337,714 B; startup CSS requests 1 → 1
Full production Knip Same three non-UI unused exports on base/head; exact output match
Independent review Full-context review completed with no actionable P0–P2 findings

The 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, and RequesterSettleWakeBatchCallbacks. 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.

Scoped Solid checklist Before After
Production LOC 615 614
Test LOC 268 302
createEffect 1 0
createRenderEffect, untrack, direct listeners 0 0
querySelector 1 1
Controller patterns, manual class strings, flush, owner escapes 0 0

The existing [autofocus] query at ui/src/components/modal-dialog.ts:204 remains 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.

Native modal opening, vetoed close, and callback close; before left, after right

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 5ec30bfc7216adeb622700464db6dccae368e17e and dirty:true. The emitted modal source-map source exactly matches the committed production blob 3c03e0287cb866fd9cf791ccd6a6e97e1f12e1a7 (SHA256 8f0a0e47911eace3faf2758297d9ecab074b22f130b85d9e27bb3961e0f1ffd6); the test blob is 2f2ef6958f73280803bf3d4ef84a747a16518ee6. Candidate commit: 788594b57c36134b891adfc3586f77f9b7f6e0f1. Before publication the single commit was rebased onto 20e1fea8998df8e0e4db76a40a785fc41d6ba47e as 83107ca1172b0f9097bcfa7406f484abb698b46d and 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.

@steipete steipete added the ci:full Keep ordinary native-locale CI selection on the next PR run. label Oct 19, 2026
@clawsweeper

clawsweeper Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@chatgpt-codex-connector

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review 🔄 Running since 2026-10-19T04:09:03.152013Z 83107ca PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. labels Oct 19, 2026
@clawsweeper

clawsweeper Bot commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR publishes accepted modal open-state changes synchronously through the existing bridge property hook.

Example: An onOpenChange(true) callback immediately sets modal.open = false.

  • Before: Immediately after show(), callback publications are [true].
  • After: Immediately after show(), callback publications are [true, false], while native closing animation remains intact.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A narrow, correct repair with useful native browser evidence, distinct regression cases, and successful exact-head CI; the image demonstrates preserved presentation while callback ordering is reported separately.
Proof confidence 🐚 platinum hermit (4/6) This maintainer-authored PR is outside the ordinary contributor proof gate; its native Chromium fixture reports synchronous callback publication, and the inspected screenshots show retained autofocus, vetoed-close drafts, and return focus.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: A modal caller can request a close from its opening callback but receive stale accepted visibility until a later reactive update.
Reason: The maintainer-authored change restores synchronous caller semantics using existing owners and preserves cancellation, presentation, and focus behavior.

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
Reviewed head: 83107ca1172b0f9097bcfa7406f484abb698b46d

Before merge

None.

Findings

None.

Agent review details

How this fits together

Control 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]
Loading

Technical review

Best 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

  • Native modal publication and property synchronization keeps the original intent (b68c44c: The native-overlay migration preserved imperative callers while making one lifecycle owner responsible for accepted visibility, cancellation, and focus.)
  • Accepted visibility callback consumption keeps the original intent (ecd1acd: File preview began observing accepted modal visibility, while modal open-state synchronization was explicitly retained as follow-up work.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit b68c44c adds ui/src/components/modal-dialog.ts:19 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: b68c44ca8f3c; files: ui/src/components/modal-dialog.ts)
  • Val Alexander: Raw commit e5a5ea1 adds ui/src/ui/components/modal-dialog.ts:277 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: e5a5ea10722e; files: ui/src/ui/components/modal-dialog.ts)

PR surface

Source -1, Tests +34. Total +33 across 2 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 14 15 -1
Tests 1 34 0 +34
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 48 15 +33

Review metrics

Metric Value Why it matters
Production versus test LOC Production −1 net line; tests +34 lines The fix removes a synchronization effect and adds two distinct public-boundary regression cases without introducing another owner.

Labels

Label changes:

  • add P2: This fixes a bounded modal callback-ordering defect without evidence of a broadly blocked user workflow.
  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: This fixes a bounded modal callback-ordering defect without evidence of a broadly blocked user workflow.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 19, 2026, 12:23 AM ET / 04:23 UTC.

@steipete
steipete merged commit 48cdd31 into main Oct 19, 2026
101 of 103 checks passed
@steipete
steipete deleted the solid2/w-zero-component-modal-open-sync branch October 19, 2026 04:30
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui ci:full Keep ordinary native-locale CI selection on the next PR run. P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant