You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Return the Product Create mutation's completion promise through handleSubmit to the existing Wizard contract. Create stays busy and Back stays disabled until the real write settles, so a repeat cannot overlap the original request.
Block dialog dismissal while the mutation is pending, matching the existing form-dialog policy. Escape, the close control and other close requests cannot discard the draft while its completion still owns it.
Keep ordinary refusal repair and healthy-success close/reset behavior unchanged; add deferred-response regressions with the real form, Wizard/Footer, useCreateProduct, useBackendMutation and TanStack Query. Only the create adapter, invalidation, upload hook and toast sink are controlled; no file is uploaded.
Record the coverage and pending policy in the manual automation register.
Verification
Current-main baseline 0592b64a9a02e44a442ef66bef0ca2781c011dc6: new regression suite fails 3 cases (early reenabled Create, pending dismissal, overlapping repeat); healthy-success control passes.
Scoped jsdom tests: 48/48 across Product Create (existing + pending), product CRUD, product mutation hooks and session-lapse draft recovery. Final pending suite rerun: 4/4.
Error-detail and single-failure-toast guards: 75/75.
No new user-facing copy (EN/DE/FR unchanged), schema/migration, authorization, backend duplicate-name policy, image-upload behavior or shared Wizard changes. Existing accessible busy/disabled controls are reused. Product docs still match the restored create behavior.
Local browser/visual analysis is deferred under the dispatch's light-only resource restriction. CI owns browser-mode suites; independent reviewer should verify the actual pending interaction/focus/transition behavior. No visual-score or backend-integration claim.
Method: one read-only source reviewer, whose claims I cross-checked, plus my own runs.
Runtime (mine)
Negative control: with main's product-create-dialog.tsx, the head's product-create-dialog.pending.test.tsx fails 3 of 4. The healthy-success control passes. At the head it passes 4/4.
CI at this head is terminal: 50 success, 12 skipped by design, Trivy neutral. UI ran from a cache miss (571 files).
Verified from source
The write promise reaches the Wizard.handleSubmit(onSubmit) now waits for the returned create promise (react-hook-form 7.72.1, index.esm.mjs:2272, :2306).
The Wizard stays busy for the whole write. It holds 'submitting' and ignores a re-entrant click (wizard.tsx:145-170). Create is disabled and loading, and Back is disabled.
A refusal can't escape unhandled. It resolves through .then(onOk, onErr) (product-create-dialog.tsx:223-245), so there is no unhandled rejection. The draft is kept for repair.
Every dismissal path is guarded. Escape, an outside click and the X all go through onOpenChange, and :267 refuses them while the write is pending, matching FormDialog.
A healthy success closes and resets exactly once, with one toast.
The image upload is unchanged.
Mutants caught:return reverted to void, dropping the pending close guard, dropping the reset, and resetting on a refusal.
LOW (follow-ups)
After a success, the next draft validates on every keystroke.
The reset now runs inside the promise handleSubmit awaits. RHF then writes isSubmitted: true after it (index.esm.mjs:2319-2325), and the dialog stays mounted.
On reopening, clearing Product name shows "Name is required" before blur, against the app-wide onTouched policy.
This contradicts the body's "healthy-success close/reset behavior unchanged".
Fix: close and reset after handleSubmit settles.
Test: success, reopen, type then clear Name: no error until blur.
A write that never settles keeps the modal open with no way out. This happens when offline (TanStack's default networkMode: 'online' pauses the mutation) or on a stalled POST. That matches FormDialog's policy, but it's new here and untested.
INFO:
The X stays enabled while ignoring clicks, and there is no live "creating" announcement. Both predate the PR.
A permission flip during a pending create could close a newly remounted draft. This is a hypothesis.
Merge: squash with --match-head-commit through my gate, which does a dry run first.
REQUEST CHANGES — independent review at exact head d816f036d877d2fba38e5df559e700d2ba85601f
The focused suite covers repeat Create blocking, pending Back/Escape/close, refusal draft retention, and one success reset. I found one remaining gap against TALE-343’s explicit late-response requirement:
product-create-dialog.tsx still has an unconditional handleClose() in the mutation promise success callback. The new onOpenChange guard blocks Radix dismissal only while this mounted dialog instance reports isSubmitting.
If the parent externally changes isOpen to false and then true while the write is pending (for example, a route/context-driven close followed by reopen), the same component instance can receive the old response after the newer draft is entered. The old callback then resets that newer draft and calls onClose.
Please scope the response callback to the submission/draft generation (or otherwise invalidate it on external close/reopen), and add a regression that closes/reopens externally while the deferred write is pending, enters a new draft, resolves the old write, and asserts the new draft remains.
Evidence inspected: exact PR head and diff, product-create-dialog.pending.test.tsx, Wizard/WizardFooter submitting guard, and Dialog close wiring. The targeted jsdom test was attempted locally but could not start because this checkout has no installed @tanstack/react-query dependency (Cannot find package '@tanstack/react-query'); terminal exact-head CI was not rerun. No merge or push performed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
handleSubmitto the existing Wizard contract. Create stays busy and Back stays disabled until the real write settles, so a repeat cannot overlap the original request.Verification
0592b64a9a02e44a442ef66bef0ca2781c011dc6: new regression suite fails 3 cases (early reenabled Create, pending dismissal, overlapping repeat); healthy-success control passes.oxlint --threads 1 --type-aware --type-check: exit 0, no diagnostics; Oxfmt check: pass; manual-layer lint: pass; commit hooks: pass.Closes #3927