Skip to content
This repository was archived by the owner on Nov 4, 2026. It is now read-only.

fix(form): a later submit outcome supersedes this form's earlier one - #7342

Merged
os-litant merged 1 commit into
mainfrom
claude/issue-7252-form-error-toast-supersede
Sep 2, 2026
Merged

os-litant merged 1 commit into
mainfrom
claude/issue-7252-form-error-toast-supersede

Conversation

@os-litant

@os-litant os-litant commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #7252

A refused submit raised an error toast that nothing ever retired, so the confirmation of a later, successful submit of the same form appeared beside the refusal of the earlier one. Every outcome toast a form raises now travels under one stable per-form id, so the later outcome supersedes the earlier one instead of stacking beside it.

Where the two toasts actually come from

The card's premise named apps/console/src/components/FormPage.tsx as the source of both toasts. That is not the reported flow, and reading the whole submit path is what showed it:

  • FormPage renders a flat form — its own sections and its own bare form element, no step machinery — and its success toast is the literal toast.success('Submitted'). It is the /f/:slug public-form and internal-form route, not the wizard the card describes (whose success toast read "Your new project is ready…", i.e. an authored successMessage).
  • The reported wizard runs ObjectForm → WizardForm (packages/plugin-form/src/WizardForm.tsx). WizardForm renders each step through the SDUI form renderer in @object-ui/components and hands it onSubmit: handleStepSubmit. That handler calls schema.onError and rethrows a rejected write, so the rejection surfaces in the renderer's catch — which sets the in-form banner and toasts (packages/components/src/renderers/form/form.tsx). The success toast is WizardForm's own.

So the refusal and the confirmation are raised by two different modules, which is exactly why neither could supersede the other on its own, and why the fix lands in the renderer rather than in WizardForm.

What was measured rather than assumed

The refusal toast is not sticky by configuration. ConsoleToaster sets toastOptions.duration: 4000 for every severity, @object-ui/components' own Toaster sets none (sonner 2.0.8's TOAST_LIFETIME is also 4000), and duration: Infinity appears nowhere on any form path in this repo — the only match in the tree is a test fixture in app-shell. Durations are therefore left exactly as they are: the defect is supersession, and it reproduces inside any lifetime, because the two toasts are simply unrelated.

The change

  • packages/components/src/renderers/form/form.tsx — one stable per-form id (React.useId(), scoped to this form instance so nothing takes unrelated toasts down with it). All three of this renderer's outcome toasts publish under it (the field-level rejection, an onAction error, a rejected write), and the previous attempt's toast is retired in the same place the previous attempt's in-form banner was already cleared. By the time a host can confirm a success, this form's last refusal is gone.
  • apps/console/src/components/FormPage.tsx — a bounded in-place fix of the same defect class, in the file the claim named. handleSubmit there already cleared its error banner at the top of every attempt but published its toast under sonner's auto-generated id, so a refused submit's toast survived into the confirmation of the retry — the card's Expected, violated in a single function. Its confirmation and its submit failure now share one id. Evidence that this is the same class and not a drive-by: the two toasts sit 85 lines apart in one handler whose first statements are setSubmitting(true); setError(null);, i.e. the identical banner-cleared/toast-not asymmetry. Scan boundary: every other toast.error call site in the repo was read; the only other member of this class found is MasterDetailForm.tsx (a separate renderer with its own submit path), reported to the PM rather than fixed here.

Deliberately excluded: the refused redirect destination (objectui#4190) keeps its own toast. The write succeeded there and only the declared destination is out of contract, so that refusal has to stay readable beside the confirmation it qualifies — folding it into the shared id would silently delete the confirmation of a write that really happened. The second FormPage test pins that.

Out of scope by the card's own text and untouched here: the state-machine refusal and its localisation (objectstack-ai/objectstack#14311 remains open), and deriving a create form's allowed initial values from stateMachine.

Does this need a rebase? Checked, not assumed — no

origin/main moved from this branch's fork point ebc05b4d6 to 2956d7af8 (11 commits) while the work was in flight. Neither file this PR edits moved. git diff --name-only ebc05b4d6..origin/main restricted to packages/components/src, packages/plugin-form/src and apps/console/src returns exactly four files, none of them mine:

apps/console/src/components/MetadataHmrReloader.tsx
apps/console/src/components/MetadataHmrReloader.test.tsx
packages/components/src/__tests__/page-header-title-width.test.tsx
packages/components/src/renderers/layout/containers.tsx

packages/plugin-form/src is untouched on main across that range, and git merge-tree against the current origin/main reports zero conflict markers. Deliberately not rebased or merged here — the merge queue rebuilds.

Tests

Both pins assert what remains on screen, not call counts — toast.error was called and toast.success was called is true before and after the fix, which is precisely the reading under which the defect looks fine. Each replaces the toast module with a registry modelling the one sonner behaviour the fix relies on: raising a toast under an id the registry already holds replaces that entry, and dismiss(id) removes exactly that one.

  • packages/plugin-form/src/WizardForm.outcomeToastSupersede.test.tsx — the card's flow end to end: last step Create refused with a 400, Back a step, forward, Create accepted; the assertion is that only the success toast remains. The navigation is load-bearing — it is what proves the renderer instance (and therefore the id) survives a step change. Plus: two consecutive refusals leave one toast, not two.
  • apps/console/src/components/FormPage.outcomeToast.test.tsx — refuse-then-accept on the public form path, and the guard that a refused redirect destination still shows beside the confirmation.

Run at dbed63dd3:

pnpm exec vitest run packages/plugin-form/           -> Test Files 82 passed (82) | Tests 823 passed | 8 skipped (831)
pnpm exec vitest run packages/components/src/renderers/form/  -> Test Files 57 passed (57) | Tests 386 passed (386)
pnpm exec vitest run apps/console/src/               -> Test Files 86 passed (86) | Tests 950 passed (950)
pnpm --filter @object-ui/components --filter @object-ui/console --filter @object-ui/plugin-form run type-check  -> exit 0

type-check covers the new tests, not just the sources: tsc --listFilesOnly on packages/plugin-form/tsconfig.test.json and on apps/console/tsconfig.json each resolve the new file (1 hit apiece).

Gate union re-run at dbed63dd3, each quoted from the gate's own verdict line:

check-changeset-presence  OK  4 source file(s) of 3 released package(s) changed, and this change declares 1 changeset(s)
check-changeset-no-major  OK  No changeset declares a `major` bump.
check-changeset-fixed     OK  All workspace packages are in the changeset fixed group.
check-changeset-overwrite OK  No pre-existing changeset was modified or deleted.
check:control-bytes       OK  check-control-bytes: OK (scanned 6027 tracked text file(s); skipped 85 binary).
check:vi-mock-specifiers  OK  check-vi-mock-specifiers: OK (4143 tracked source file(s) …)
check:vi-mock-inherit     OK  check-vi-mock-inherit: OK (4143 tracked source file(s) …)
check:phantom-deps        OK  Every in-scope import is declared by the package that publishes it.

Ablation (after the commit; both legs proved on disk, both restored by blob hash)

No dist is involved: the root vitest.config.mts aliases @object-ui/components to packages/components/src (line 415), so the pins resolve the edited source directly — which the red legs below confirm, since mutating src alone turned them red.

  • Leg A, dropping the id and the dismissal from the renderer: both wizard tests RED, and the failure is literally the card — expected [ { type: 'error', … }, …(1) ] to deeply equal [ { type: 'success', … } ], i.e. two outcomes on screen at once. Mutation proved by grep on the removed text (id: outcomeToastId → 0 occurrences, toast.dismiss(outcomeToastId) → 0, injected toast.error(errorMessage); → 1). Restored with git checkout HEAD -- ABSOLUTE_PATH; git diff HEAD empty and git hash-object back to the HEAD blob 5d01245f79d3418ff41c07d30e9f4eb15476f85b.
  • Leg B, dropping the shared id from FormPage: the supersession test RED (expected [ { type: 'error', … }, …(1) ] to deeply equal [ { type: 'success', … } ]) and the redirect-refusal guard GREEN — the predicted narrow change detector, since that guard never depended on the id. Restored the same way; blob back to 2de9ac81934deafcf6db36de4bc3ad32057c18a0, git status clean.

Narrowed lint, declared

Repo-wide eslint . is CI's run. Locally this was narrowed to the four changed .ts/.tsx files: 0 errors, 98 warnings, every warning a pre-existing pattern in these files (@typescript-eslint/no-explicit-any, react-refresh/only-export-components, one pre-existing unused type import) and no package here sets --max-warnings. The narrowing is safe to read as a measurement because (1) the linted population is **/*.{ts,tsx} minus **/dist, **/.next, **/node_modules, **/public, **/.source, read from eslint.config.js itself rather than guessed; (2) the file count is 4, read from --format json; (3) eslint.config.js configures no type-aware linting — no parserOptions.project and no projectService — so every rule is single-file and this diff cannot move the verdict of any file it did not touch.

🤖 Generated with Claude Code

https://claude.ai/code/session_01NRRumy89BYdW9ogbcdHTho

A refused submit raised an error toast that nothing ever retired, so the
confirmation of a later, successful submit of the same form appeared beside
the refusal of the earlier one — a wizard's last step showing "Invalid project
status transition." and "Your new project is ready…" at the same time.

The two toasts are raised by two different modules, which is why neither could
supersede the other on its own. The refusal comes from the form renderer in
@object-ui/components: WizardForm hands it `onSubmit: handleStepSubmit`, that
handler rethrows a rejected write, and the renderer's own catch sets the
in-form banner AND toasts. The success toast is WizardForm's.

Every outcome toast a form raises now travels under one stable per-form id:

- the renderer publishes its three outcome toasts (the field-level rejection,
  an `onAction` error and a rejected write) under that id, and retires the
  previous attempt's toast in the same place it already cleared the previous
  attempt's in-form banner — so by the time a host can confirm a success, this
  form's last refusal is gone;
- the console's FormPage publishes its confirmation and its submit failure
  under one id, closing the same asymmetry in a single function.

Measured, not assumed: the refusal toast is not sticky by configuration.
ConsoleToaster sets `duration: 4000` for every severity, @object-ui/components'
own Toaster sets none (sonner's default TOAST_LIFETIME is also 4000), and
`duration: Infinity` appears nowhere on any form path. Durations are therefore
untouched — the defect is supersession, and it reproduces inside any lifetime.

Deliberately excluded: the refused redirect DESTINATION keeps its own toast.
The write succeeded there and only the declared destination is out of contract,
so that refusal has to stay readable beside the confirmation it qualifies.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NRRumy89BYdW9ogbcdHTho
@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

✅ Console Performance Budget

Metric Value Budget
Eager closure (gzip, 48 chunks) 3165.6 KB 3191.4 KB
Main entry chunk (gzip) 142.6 KB 350 KB
Entry file index-BFae2kFt.js —
Status PASS —

The eager closure is every chunk the entry reaches through static imports — what the browser fetches and parses before the app renders. The entry chunk on its own is a small fraction of it.


📦 Bundle Size Report

Package Size Gzipped
app-shell (consoleActionDispatch.js) 0.20KB 0.19KB
app-shell (index.js) 15.33KB 5.59KB
app-shell (runtime-config.js) 20.68KB 7.36KB
app-shell (types.js) 0.01KB 0.04KB
app-shell (urlParams.js) 10.06KB 3.86KB
auth (ActiveOrganizationStorage.js) 25.05KB 9.16KB
auth (AuthContext.js) 0.31KB 0.24KB
auth (AuthGuard.js) 2.07KB 1.00KB
auth (AuthProvider.js) 40.18KB 10.59KB
auth (AuthShell.js) 3.49KB 1.40KB
auth (ForgotPasswordForm.js) 12.21KB 3.45KB
auth (LoginForm.js) 18.15KB 5.39KB
auth (PreviewBanner.js) 0.90KB 0.50KB
auth (RegisterForm.js) 6.65KB 2.22KB
auth (SocialSignInButtons.js) 9.61KB 3.89KB
auth (UserMenu.js) 3.41KB 1.23KB
auth (auth-gate-events.js) 1.29KB 0.66KB
auth (authStyles.js) 5.04KB 1.72KB
auth (createAuthClient.js) 40.21KB 10.80KB
auth (createAuthenticatedFetch.js) 8.46KB 3.43KB
auth (index.js) 3.19KB 1.44KB
auth (invitation-status.js) 1.22KB 0.70KB
auth (org-roles.js) 6.66KB 2.78KB
auth (phone-identifier.js) 1.11KB 0.66KB
auth (types.js) 0.59KB 0.35KB
auth (useAuth.js) 5.30KB 1.02KB
auth (useWorkspaceAdminStatus.js) 5.13KB 2.35KB
collaboration (CommentThread.js) 26.08KB 7.56KB
collaboration (LiveCursors.js) 3.17KB 1.27KB
collaboration (PresenceAvatars.js) 6.49KB 2.64KB
collaboration (PresenceProvider.js) 2.79KB 1.13KB
collaboration (index.js) 1.68KB 0.73KB
collaboration (useCollaborationTranslation.js) 6.05KB 2.52KB
collaboration (useCommentSearch.js) 1.98KB 0.88KB
collaboration (useConflictResolution.js) 7.75KB 1.86KB
collaboration (useMentionNotifications.js) 1.81KB 0.68KB
collaboration (usePresence.js) 6.33KB 1.84KB
collaboration (useRealtimeSubscription.js) 7.91KB 2.01KB
components (index.js) 514.57KB 117.39KB
core (index.js) 5.80KB 2.32KB
create-plugin (index.js) 10.08KB 3.26KB
data-objectstack (index.js) 178.20KB 49.60KB
fields (index.js) 244.25KB 61.73KB
i18n (LocalizationContext.js) 1.76KB 0.96KB
i18n (currency.js) 1.22KB 0.64KB
i18n (fallbackInterpolation.js) 6.25KB 2.77KB
i18n (i18n.js) 4.28KB 1.75KB
i18n (index.js) 3.44KB 1.39KB
i18n (pickLocalized.js) 7.62KB 3.26KB
i18n (provider.js) 26.89KB 9.04KB
i18n (useDisplayLocale.js) 2.85KB 1.45KB
i18n (useObjectLabel.js) 33.40KB 8.71KB
i18n (useSafeTranslation.js) 5.60KB 2.33KB
layout (index.js) 38.98KB 10.98KB
mobile (MobileProvider.js) 0.92KB 0.49KB
mobile (ResponsiveContainer.js) 0.94KB 0.38KB
mobile (breakpoints.js) 1.51KB 0.70KB
mobile (createOfflineDataSource.js) 5.61KB 1.75KB
mobile (index.js) 1.55KB 0.62KB
mobile (offlineQueue.js) 3.91KB 1.35KB
mobile (pwa.js) 0.97KB 0.49KB
mobile (serviceWorker.js) 1.48KB 0.62KB
mobile (serviceWorkerSource.js) 3.41KB 1.48KB
mobile (useBreakpoint.js) 1.54KB 0.65KB
mobile (useGesture.js) 6.96KB 1.98KB
mobile (useOfflineSync.js) 1.99KB 0.72KB
mobile (usePullToRefresh.js) 2.53KB 0.85KB
mobile (useResponsive.js) 0.72KB 0.42KB
mobile (useResponsiveConfig.js) 1.37KB 0.63KB
mobile (useSpecGesture.js) 4.32KB 1.64KB
mobile (useTouchTarget.js) 1.01KB 0.54KB
permissions (MePermissionsProvider.js) 11.71KB 4.29KB
permissions (PermissionContext.js) 0.31KB 0.25KB
permissions (PermissionGuard.js) 0.89KB 0.45KB
permissions (PermissionProvider.js) 6.24KB 2.16KB
permissions (discardProofCache.js) 1.04KB 0.55KB
permissions (evaluator.js) 5.12KB 1.74KB
permissions (index.js) 0.93KB 0.41KB
permissions (store.js) 0.91KB 0.42KB
permissions (useFieldPermissions.js) 1.28KB 0.53KB
permissions (usePermissions.js) 4.83KB 2.27KB
plugin-ai (index.js) 15.75KB 3.80KB
plugin-calendar (index.js) 47.00KB 12.97KB
plugin-charts (index.js) 70.02KB 19.44KB
plugin-chatbot (index.js) 193.26KB 45.80KB
plugin-dashboard (index.js) 132.63KB 34.56KB
plugin-designer (index.js) 212.87KB 43.19KB
plugin-detail (index.js) 250.63KB 63.90KB
plugin-editor (index.js) 2.46KB 1.10KB
plugin-form (index.js) 132.78KB 32.58KB
plugin-gantt (index.js) 166.93KB 40.82KB
plugin-grid (index.js) 208.88KB 56.59KB
plugin-kanban (index.js) 53.21KB 14.66KB
plugin-list (index.js) 113.51KB 27.67KB
plugin-map (index.js) 20.20KB 6.66KB
plugin-markdown (index.js) 13.72KB 4.69KB
plugin-report (index.js) 43.51KB 11.94KB
plugin-timeline (index.js) 29.15KB 8.40KB
plugin-tree (index.js) 8.98KB 3.08KB
plugin-view (index.js) 85.90KB 21.12KB
providers (DataSourceProvider.js) 0.75KB 0.39KB
providers (MetadataProvider.js) 1.37KB 0.59KB
providers (ThemeProvider.js) 1.90KB 0.85KB
providers (UploadProvider.js) 11.66KB 3.50KB
providers (index.js) 0.45KB 0.23KB
providers (types.js) 0.01KB 0.04KB
react-runtime (index.js) 5.62KB 2.34KB
react (LazyPluginLoader.js) 4.47KB 1.63KB
react (SchemaRenderer.js) 81.07KB 26.86KB
react (data-invalidation.js) 5.05KB 2.08KB
react (index.js) 3.11KB 1.48KB
react (schema-input.js) 2.32KB 1.24KB
react (spec-input.js) 0.20KB 0.18KB
sdui-parser (codegen.js) 5.41KB 2.34KB
sdui-parser (dashboard-widget-options.js) 3.08KB 1.30KB
sdui-parser (index.js) 4.93KB 2.24KB
sdui-parser (input-type.js) 2.84KB 1.40KB
sdui-parser (parse.js) 20.57KB 5.88KB
sdui-parser (provenance.js) 3.66KB 1.82KB
sdui-parser (types.js) 0.28KB 0.23KB
sdui-parser (validate.js) 10.35KB 3.60KB
types (ai.js) 0.20KB 0.17KB
types (api-types.js) 0.20KB 0.18KB
types (app.js) 2.87KB 0.99KB
types (base.js) 0.20KB 0.18KB
types (blocks.js) 0.20KB 0.18KB
types (complex.js) 2.74KB 1.41KB
types (crud.js) 0.20KB 0.18KB
types (dashboard-filter-alias.js) 6.23KB 2.74KB
types (data-display.js) 3.75KB 1.85KB
types (data-protocol.js) 0.20KB 0.19KB
types (data.js) 0.20KB 0.18KB
types (designer.js) 1.85KB 0.85KB
types (disclosure.js) 0.20KB 0.18KB
types (error-code.js) 1.54KB 0.88KB
types (feedback.js) 0.20KB 0.18KB
types (field-types.js) 0.20KB 0.18KB
types (form.js) 0.20KB 0.18KB
types (http-inflight.js) 8.87KB 3.73KB
types (http-retry.js) 4.32KB 2.02KB
types (icon-key-migration.js) 4.26KB 1.63KB
types (index.js) 4.72KB 2.24KB
types (layout.js) 0.20KB 0.18KB
types (managed-by.js) 0.19KB 0.18KB
types (mobile.js) 2.59KB 1.31KB
types (navigation.js) 0.20KB 0.18KB
types (objectql.js) 0.20KB 0.18KB
types (overlay.js) 0.20KB 0.18KB
types (permissions.js) 0.20KB 0.18KB
types (plugin-scope.js) 0.20KB 0.18KB
types (record-components.js) 0.20KB 0.19KB
types (record-semantics.js) 1.28KB 0.67KB
types (registry.js) 0.20KB 0.18KB
types (reports.js) 0.20KB 0.18KB
types (spec-report.js) 5.05KB 1.93KB
types (spec-ui-namespace.js) 0.20KB 0.19KB
types (system-fields.js) 3.33KB 1.54KB
types (theme.js) 6.28KB 2.87KB
types (ui-action.js) 3.40KB 1.71KB
types (views.js) 0.20KB 0.18KB
types (widget.js) 0.20KB 0.18KB

Size Limits

  • ✅ Core packages should be < 50KB gzipped
  • ✅ Component packages should be < 100KB gzipped
  • ⚠️ Plugin packages should be < 150KB gzipped

@os-litant
os-litant marked this pull request as ready for review September 2, 2026 11:55
@os-litant
os-litant added this pull request to the merge queue Sep 2, 2026
Merged via the queue into main with commit 4704aa4 Sep 2, 2026
31 checks passed
@os-litant
os-litant deleted the claude/issue-7252-form-error-toast-supersede branch September 2, 2026 12:10
os-litant pushed a commit that referenced this pull request Sep 2, 2026
…arlier one (#7345)

MasterDetailForm raised its two save outcomes as two unrelated toasts:
handleSaved's confirmation and handleError's refusal, each under sonner's
auto-generated id. Nothing held a handle on the previous attempt's toast, so a
save the server refused left its error on screen and the confirmation of the
corrected retry landed beside it — the form ending on a screen that asserted
both outcomes at once. This is the objectui#7252 defect class on a renderer
PR #7342 did not touch: its surface was the SDUI form renderer and the console's
FormPage, and both outcomes here are raised by this file, one line apart.

Both now travel under one stable per-form id (React.useId()-scoped,
"form-outcome:" + the id — the spelling #7342 landed), and each save attempt
dismisses that id before it starts. The two halves close two different paths:

- no host onSuccess (SDUI / embedded): the built-in confirmation is the
  fallback, and the shared id makes it supersede the refusal rather than stack
  beside it;
- host onSuccess (the console): the built-in confirmation is deliberately
  skipped, so a shared id alone would retire nothing — the dismissal is what
  stops a stale refusal from standing over a save that succeeded. Measured, not
  assumed: the pin fails on that path with the id alone.

Durations are untouched — the defect is supersession, and it reproduces inside
any lifetime.

Measured while pinning this and deliberately NOT changed here: a refused
master-detail save currently puts the same refusal on screen twice, because the
parent ObjectForm's renderer also toasts the write it re-threw. That is a
distinct defect from supersession and is filed separately; the pin is written so
its assertions do not depend on how many raisers report an outcome.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NRRumy89BYdW9ogbcdHTho
akarma-synetal pushed a commit to akarma-synetal/objectui that referenced this pull request Sep 9, 2026
…arlier one (objectstack-ai#7356)

* fix(plugin-form): a later master-detail save outcome supersedes the earlier one (objectstack-ai#7345)

MasterDetailForm raised its two save outcomes as two unrelated toasts:
handleSaved's confirmation and handleError's refusal, each under sonner's
auto-generated id. Nothing held a handle on the previous attempt's toast, so a
save the server refused left its error on screen and the confirmation of the
corrected retry landed beside it — the form ending on a screen that asserted
both outcomes at once. This is the objectui#7252 defect class on a renderer
PR objectstack-ai#7342 did not touch: its surface was the SDUI form renderer and the console's
FormPage, and both outcomes here are raised by this file, one line apart.

Both now travel under one stable per-form id (React.useId()-scoped,
"form-outcome:" + the id — the spelling objectstack-ai#7342 landed), and each save attempt
dismisses that id before it starts. The two halves close two different paths:

- no host onSuccess (SDUI / embedded): the built-in confirmation is the
  fallback, and the shared id makes it supersede the refusal rather than stack
  beside it;
- host onSuccess (the console): the built-in confirmation is deliberately
  skipped, so a shared id alone would retire nothing — the dismissal is what
  stops a stale refusal from standing over a save that succeeded. Measured, not
  assumed: the pin fails on that path with the id alone.

Durations are untouched — the defect is supersession, and it reproduces inside
any lifetime.

Measured while pinning this and deliberately NOT changed here: a refused
master-detail save currently puts the same refusal on screen twice, because the
parent ObjectForm's renderer also toasts the write it re-threw. That is a
distinct defect from supersession and is filed separately; the pin is written so
its assertions do not depend on how many raisers report an outcome.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NRRumy89BYdW9ogbcdHTho

* test(plugin-form): let the toast doubles inherit sonner's surface

Four fixtures replaced the whole `toast` export with a hand-listed object
carrying only `success` and `error`. The moment MasterDetailForm called one more
sonner method, every test that mounts it died with "toast.dismiss is not a
function" — 16 failures across 4 files, none of them about what those files
assert.

This is the check:vi-mock-inherit defect one level down: those factories already
spread the real module (`...actual`), but froze the export surface again inside
`toast`. Spreading `actual.toast` and overriding only the two methods each file
spies on closes the class rather than this one method — the next sonner call the
form makes cannot break them either. No assertion changes.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NRRumy89BYdW9ogbcdHTho

---------

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

2 participants