Uh oh!
There was an error while loading. Please reload this page.
fix(master-detail): reliable submit + durable live e2e harness - #1521
Merged
Conversation
The "click Create, nothing happens" report was an intermittent submit: MasterDetailForm.handleSave called requestSubmit() synchronously inside the click handler right after setSaving(), and the nested submit event was often dropped before react-hook-form's onSubmit ran — so only the occasional click actually submitted. handleSave now defers the submit to a macrotask and re-queries the live <form>, which fires every time. Surfaced + verified by a new LIVE Playwright harness that drives the real stack with real browser input (the only thing that makes Radix Select + react-hook-form actually bind): - playwright.live.config.ts (targets console :5180 + backend :3000) - e2e/live/global-setup.ts (better-auth API login → storageState) - e2e/live/helpers.ts (selectOption / fillLookup / addLineItem / expectToast) - e2e/live/master-detail.spec.ts (drives Radix+lookup+grid, submits, asserts the form resets — 6/6 across repeats) - pnpm test:e2e:live Stable data-testids so automation has deterministic hooks: select-trigger-* / select-option-* (SelectField), lookup-trigger-* (LookupField), line-items-add (GridField), md-form-submit / md-form-cancel (MasterDetailForm). Also dedupe react/react-dom/sonner in the console vite config — the monorepo resolved two React patch versions (19.2.6 vs 19.2.7), duplicating React and sonner. (A complete fix for missing toasts also needs plugin-form/components to externalize sonner; tracked as follow-up.) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
This was referenced Jun 6, 2026
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
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Why
"我填了表单,点最下面的创建还是没反应" — clicking Create on the master-detail form did nothing. This turned out to be an intermittent submit, not a no-op:
MasterDetailForm.handleSavecalledform.requestSubmit()synchronously inside the click handler right after asetSaving()state update, and the nested submit event was frequently dropped before react-hook-form'sonSubmitran. Only the occasional click actually submitted (which is why earlier testing produced a few duplicate records from many clicks).More importantly, this kept being un-verifiable because synthetic DOM automation can't make Radix Select + react-hook-form bind. So this PR also lands a durable live browser e2e harness that drives the real stack with real input — the long-term fix for "I can't verify my own UI work."
The fix
MasterDetailForm.handleSavedefers the submit to a macrotask and re-queries the live<form>, so RHF'sonSubmitfires every time. Verified 6/6 across repeats.Durable live e2e harness (the bigger deliverable)
playwright.live.config.ts— drives the running console (:5180) + backend (:3000), separate from the mocked CI smoke config.e2e/live/global-setup.ts— logs in via the better-auth API and injects astorageState(no fragile UI login).e2e/live/helpers.ts— reusable real-input drivers:selectOption(Radix Select),fillLookup(reference picker),addLineItem(grid),expectToast.e2e/live/master-detail.spec.ts— fills parent (name + lookup + status) and a child task row, submits, asserts the form resets (the reliable end-to-end success signal). 6/6 green across repeats.pnpm test:e2e:live.Stable
data-testidsselect-trigger-{field}/select-option-{value}(SelectField),lookup-trigger-{field}(LookupField),line-items-add(GridField),md-form-submit/md-form-cancel(MasterDetailForm) — so automation and future e2e have deterministic hooks.Also (partial)
Dedupe
react/react-dom/sonnerin the console vite config — the monorepo resolved two React patch versions (19.2.6 vs 19.2.7), duplicating React and (downstream) sonner, sotoast()and<Toaster>bound to different sonner instances and success toasts never rendered. This dedupes React for the build; a complete toast fix also needsplugin-form/componentsto externalizesonnerrather than inline it — flagged as a follow-up.Findings (no action needed here)
POST /api/v1/batch. The atomic cross-object batch wire is already covered by@object-ui/plugin-formunit tests + the framework REST e2e.Testing
@object-ui/plugin-formunit suite: 65 passing.master-detail× 3 repeats) against the real console + backend.🤖 Generated with Claude Code