Skip to content

fix(app-shell): toast actions are clickable under an open Radix modal, and the click stays the toast's (objectui#11723) - #11738

Merged
objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/issue-11723-toast-clicks-under-modal
Oct 6, 2026
Merged

objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/issue-11723-toast-clicks-under-modal

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Fixes #11723

Clause-②: no

What changed

With the record drawer (or any Radix modal) open, a toast's Undo and close buttons now take the click, the drawer stays open, and a click on a toast reaches nothing under it. Both halves live in packages/app-shell/src/chrome/ConsoleToaster.tsx; no drawer host and no Shadcn primitive changed. Read the source diff with git diff -w: wrapping Sonner in one element re-indents its 60 lines.

The defect had two mechanisms. The dispatch's hypothesis that the drawer needs both was measured, not assumed (table below):

  1. The toast was not hit-testable. A Radix modal sets pointer-events: none on the body element and re-enables only its own layer; the toaster inherited none. Each toast now carries pointer-events-auto (in toastOptions.classNames.toast). The toast, not the toaster: the toaster's own box is 356 by 0 px (measured), so a pointer beside a toast is not inside it and the objectui#7482 dismiss timer keeps running. A plain utility on purpose: sonner's pointer-events: none on a toast hidden beyond visibleToasts is unlayered CSS and outranks a Tailwind v4 utility, while a group-[...] form would outrank sonner and make hidden toasts clickable.
  2. A click on the toast was an outside click to the modal. Radix's DismissableLayer hears pointerdown on document; a toast is outside the modal's content, so the click that ran Undo also closed the drawer. A toast's pointerdown now stops at the toaster: ConsoleToaster wraps Sonner in a display: contents element whose React onPointerDown calls stopPropagation(). React delegates at its root, so this runs after sonner's own handlers (swipe, the pause while a toast is pressed) and before the event reaches document. One place covers every Radix layer: the record drawer, centred dialogs, the other sheets, popovers.

Routes not taken.

  • Radix's own answer for toasts, DismissableLayerBranch. A branch registers in the module state of @radix-ui/react-dismissable-layer, which @radix-ui/react-dialog 1.1.23 pins exactly (1.1.19). App-shell importing its own copy (a new dependency) works only while both resolve to one module instance; in a consumer install where they differ, the branch silently does nothing.
  • Each modal host's onInteractOutside (usePopperAwareInteractOutside, used by NavigationOverlay and MobileDialogContent). It covers only the hosts that use that hook, and every new modal host would have to remember the toaster.

Real-layout pin and measurement (Chromium)

The card's pin is e2e/toast-under-modal.spec.ts, under playwright.config.ts, which the Build & E2E job runs as pnpm test:e2e --project=chromium. It bundles the real ConsoleToaster, ThemeProvider and NavigationOverlay (Shadcn Sheet and Dialog on @radix-ui/react-dialog) from source with Vite, compiles real Tailwind for their class strings, serves both from a routed origin, and clicks with the real pointer. Fixtures, as the file header lists them: @object-ui/i18n and @object-ui/react are stubs; the overlay content is a RecordDetailView stand-in (title, Approve, Reject, filler, every control logging its clicks); theme colours are not compiled; reduced motion is on.

Four configurations, each reading its objectui#11685 path back off the toaster: 1440 sm drawer (beside), 1024 md drawer (below header), 390 phone drawer (below header), 1440 centred dialog (corner). In each: Undo is the hit-test target, runs, and the modal stays open; the close button dismisses only the toast; a click on the toast body logs nothing and the modal stays open. Plus the objectui#7482 pair on the below-header path: with the pointer on the toast it is still up past its 4 s, and with the pointer 8 px beside it, it goes.

Local runs used /opt/pw-browsers/chromium (Chromium 141) through a scratch config with no webServer: the spec starts nothing and reads no console build.

tree result
base toaster blob (ade5562, as at 834c559) swapped in, spec as at HEAD 13 failed: 12 at the hit test (6 hit the overlay: beside and centred dialog; 6 hit the drawer: below header and phone), and the objectui#7482 control (past its 4s while the pointer is on it: false, because under a modal the base toast cannot even be hovered)
only the pointer-events-auto half (first spec version, 3 drawer configurations, 10 tests) hit tests pass and Undo runs, but every toast interaction closes the drawer: 9 failed, log undo:Approved then drawer:close; close and body clicks log drawer:close
HEAD e46b9a9 13 passed

Region readings (one-off, two toasts raised):

  • 1440 sm, beside: toaster ol at x 196, y 24, 356 wide, 0 high; toasts at y 24 to 82 and 96 to 154. 5 px and 14 px above the front toast hit the toast (sonner's 15 px gap bridge, an ::after); 20 px above, and 5 px left, right or below, hit the overlay.
  • 1024 md, below header: ol at x 644, y 69, 356 by 0; the same pattern, and the points beside hit the drawer.

Tests

  • packages/app-shell/src/chrome/ConsoleToaster.underModal-11723.test.tsx (unit lane, happy-dom, the real NavigationOverlay drawer): a control (a press outside both closes the drawer, so Radix's listener is armed), Undo runs and the drawer stays open, the close button dismisses only the toast, a body press reaches no outside-click handler, and each toast carries pointer-events-auto (a class echo only; happy-dom has no hit testing, and the file says so).
  • The objectui#7482 pins (ConsoleToaster.autoDismiss-7482, consoleToasterAnchor.ratchet-7482) and the objectui#11685 pin (ConsoleToaster.drawerClearance-11685) are unchanged and green.

Ablations, each from a committed tree, mutated through ablation-replace.mjs (anchor must hit, 1 to 0), restored from HEAD, blob verified (d76d47836c74 equals HEAD, git diff HEAD empty):

mutation unit file e2e (spec version with 10 tests)
drop onPointerDown={stopAtToaster} 3 failed, 2 passed: Undo, close and body red; control and class echo green 9 failed, 1 passed: each on "drawer:close"; the objectui#7482 leg green
drop pointer-events-auto from the toast class 1 failed, 4 passed: only the class echo (dispatched events ignore hit testing, as the file documents) 9 failed, 1 passed: each at the hit test (3 overlay, 6 drawer)

The objectui#7482 leg in that version was green on the base tree and in both ablations, so it could not show the pause was observable at all. It now has a control half (pointer on the toast holds it past 4 s), which is red on the base tree.

Gates (local; the union ran on e46b9a9)

command exit verdict
pnpm --workspace-concurrency=2 --filter '@object-ui/app-shell^...' build 0 VERDICT command-exit 0, scope 29 of 47 projects (app-shell's dependencies, which this branch does not touch; ran one commit earlier, before the changeset)
pnpm exec vitest run --maxWorkers=2 packages/app-shell/src/chrome/ plus the 10 files named below 0 Test Files 20 passed (20), Tests 114 passed (114)
pnpm exec playwright test on e2e/toast-under-modal.spec.ts (chromium) 0 13 passed
pnpm --filter @object-ui/app-shell type-check 0 VERDICT command-exit 0; tsc -p tsconfig.test.json --listFiles reads 5042 files, the new test among them
pnpm type-check:e2e 0 tsc -p tsconfig.e2e.json, no diagnostics
pnpm exec vitest run on the 8 script tests that read e2e/ (e2e-type-check, ci-cd-pipeline-doc, check-test-path-roots, and 5 more) 0 Test Files 8 passed (8), Tests 214 passed (214)
pnpm check:control-bytes 0 OK (scanned 7680 tracked text file(s); skipped 85 binary)
pnpm check:test-path-roots 0 check-test-path-roots: OK
pnpm check:changeset-claims 0 No pending changeset names a file this change touches.
pnpm check:pending-changeset-literals 0 No test source names a pending changeset.
pnpm check:vi-mock-specifiers 0 check-vi-mock-specifiers: OK
pnpm check:new-line-citations 0 0 new citation(s)
pnpm check:unreferenced-sources 0 Every shipped source file in every covered package is reachable.
pnpm check:phantom-deps 0 Every in-scope import is declared by the package that publishes it.
pnpm check:esm-specifiers 0 no un-ledgered package emits an extensionless relative specifier
node scripts/check-changeset-presence.mjs, -no-major, -fixed, -overwrite 0 each each prints its OK line

Declared narrowing. The full pnpm --filter @object-ui/app-shell test holds the shared verify lock for about 30 minutes, so it is NOT MEASURED locally; CI runs it. The narrowed run covered the whole chrome/ directory; every test file outside it that names ConsoleToaster (the four console App tests, which mock it, and WizardForm.outcomeToastSupersede); and the drawer host's own suites in packages/components (navigation-overlay-9299, navigation-overlay-chrome-i18n, navigation-overlay-close-i18n, mobile-dialog-content, chrome-i18n-no-provider-fallback). ConsoleToaster's export and props type are byte-unchanged and it has no import-time side effect, so only a test that renders the real component can observe the change.

The repo-wide pnpm lint belongs to CI. eslint on the three touched source files, --no-inline-config --format json: 3 files, 0 errors, 0 warnings. eslint.config.js sets no parserOptions.project, so the lint is not type-aware and this diff cannot move an untouched file's verdict.

Acceptance notes

  • A toast that appears under a resting pointer pauses until the pointer moves. This is sonner's hover pause on the toast itself, as anywhere without a modal; under a modal it could not happen before, because nothing could hover a toast. It matters on the objectui#11685 below-header path, where a toast covers the record's first row: click Approve, and the success toast can land under the pointer. Measured at 1024 md: still showing at 6 s with the pointer parked where the toast landed, gone 4.2 s after the pointer moved 8 px off it. The objectui#7482 failure was a toast over a place the pointer rests for long (the composer, while typing); here the pause ends when the pointer moves, not at the close button. The card's bound, that the timer must not stall while the pointer is merely near the region, holds and is pinned: a pointer 8 px beside the toast does not pause it.
  • The gap bridge. Sonner draws a 15 px hover bridge (::after) above each expanded toast. With expand on, the front toast's bridge sits above it and, under a modal, now takes clicks too: at 1024 md the strip from y 54 to 69 (the drawer header ends at 45). That is the same as without a modal; left as sonner draws it.
  • A toast blocks what it covers for its lifetime. That is the card's direction (a click on a toast never reaches what is under it). On the below-header path the record's first-row actions under a toast are unreachable for up to 4 s, or until the toast is dismissed.
  • Focus. Pressing a toast button moves focus to it and the modal's focus trap moves it back; the click still lands (the Chromium pin's Undo runs). Keyboard users still cannot Tab from a modal into a toast; untouched here.
  • examples/console-starter mounts sonner's own Toaster (at bottom-right), which has the same click-through under any modal. A private example, not measured here; noted, not filed.
  • Docs: no guide page describes toast clickability or placement (content/docs/guide/notifications.md names ConsoleToaster only as where toasts go), so none changed.
  • Changeset: .changeset/11723-toast-clicks-under-modal.md, @object-ui/app-shell patch. No export, prop, type member or locale key added.

Session: https://claude.ai/code/session_01CGZy1BGCjdN5cXqL9cnvB8


Generated by Claude Code

claude added 4 commits October 6, 2026 16:43
…, and the click stays the toast's (objectui#11723)

While the record drawer (or any Radix modal) was open, a toast's Undo and
close buttons were dead and the click went through to whatever lay under
the toast. Two mechanisms, two answers, both in ConsoleToaster:

- Radix sets pointer-events: none on body; the toaster inherited it. Each
  toast now carries pointer-events-auto (the toast, not the toaster, so a
  pointer beside a toast does not pause objectui#7482's dismiss timer).
- A toast that takes the click is still outside the modal, so Radix's
  document-level outside-pointerdown closed the drawer. A toast's
  pointerdown now stops at the toaster.

e2e/toast-under-modal.spec.ts pins it in Chromium with the real toaster,
the real NavigationOverlay drawer and real Tailwind.

Claude-Session: https://claude.ai/code/session_01CGZy1BGCjdN5cXqL9cnvB8
Co-authored-by: Claude <noreply@anthropic.com>
…t an outside click (objectui#11723)

Dispatched-event pin in the unit lane, against the real NavigationOverlay
drawer: Undo runs and the drawer stays open, close dismisses only the toast,
a press on the toast body reaches no outside-click handler, with a control
showing the drawer's outside-click listener is armed. The hit-test half is
pinned in Chromium by e2e/toast-under-modal.spec.ts.

Claude-Session: https://claude.ai/code/session_01CGZy1BGCjdN5cXqL9cnvB8
Co-authored-by: Claude <noreply@anthropic.com>
… clearance path back, and give the objectui#7482 leg its control (objectui#11723)

The timer leg was green on the base tree too, so it could not show that
sonner's pause is observable in the harness at all. It now holds a toast
past its 4s with the pointer on it before showing the timer runs with the
pointer beside it.

Claude-Session: https://claude.ai/code/session_01CGZy1BGCjdN5cXqL9cnvB8
Co-authored-by: Claude <noreply@anthropic.com>
…l (objectui#11723)

Claude-Session: https://claude.ai/code/session_01CGZy1BGCjdN5cXqL9cnvB8
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

✅ Console Performance Budget

Metric Value Budget
Eager closure (gzip, 331 chunks) 3325.9 KB 3330.4 KB
Main entry chunk (gzip) 154.3 KB 350 KB
Entry file index-DsQmrVe4.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) 17.82KB 6.58KB
app-shell (runtime-config.js) 22.52KB 7.86KB
app-shell (types.js) 0.01KB 0.04KB
app-shell (urlParams.js) 10.11KB 3.87KB
auth (ActiveOrganizationStorage.js) 27.95KB 10.04KB
auth (AuthContext.js) 0.31KB 0.24KB
auth (AuthGuard.js) 2.07KB 1.00KB
auth (AuthProvider.js) 40.22KB 10.61KB
auth (AuthShell.js) 3.49KB 1.40KB
auth (ForgotPasswordForm.js) 12.21KB 3.45KB
auth (LoginForm.js) 18.15KB 5.40KB
auth (PreviewBanner.js) 0.90KB 0.50KB
auth (RegisterForm.js) 6.72KB 2.24KB
auth (SocialSignInButtons.js) 9.70KB 3.93KB
auth (UserMenu.js) 3.39KB 1.21KB
auth (auth-gate-events.js) 1.29KB 0.66KB
auth (authStyles.js) 5.04KB 1.72KB
auth (createAuthClient.js) 40.70KB 10.94KB
auth (createAuthenticatedFetch.js) 8.54KB 3.46KB
auth (index.js) 3.63KB 1.64KB
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) 11.08KB 4.58KB
collaboration (CommentThread.js) 27.11KB 7.97KB
collaboration (LiveCursors.js) 3.17KB 1.27KB
collaboration (PresenceAvatars.js) 6.28KB 2.60KB
collaboration (PresenceProvider.js) 2.79KB 1.13KB
collaboration (index.js) 1.68KB 0.73KB
collaboration (useCollaborationTranslation.js) 6.50KB 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) 578.98KB 139.21KB
core (index.js) 10.00KB 3.96KB
create-plugin (index.js) 27.94KB 9.51KB
data-objectstack (index.js) 233.72KB 64.83KB
fields (index.js) 263.36KB 66.69KB
i18n (LocalizationContext.js) 1.76KB 0.96KB
i18n (builtinAggregateLabels.js) 0.86KB 0.49KB
i18n (currency.js) 2.59KB 1.22KB
i18n (fallbackInterpolation.js) 6.25KB 2.77KB
i18n (i18n.js) 8.87KB 3.64KB
i18n (index.js) 5.52KB 2.39KB
i18n (pickLocalized.js) 9.86KB 3.95KB
i18n (provider.js) 39.35KB 12.88KB
i18n (translateFn.js) 0.20KB 0.18KB
i18n (useDisplayLocale.js) 3.52KB 1.76KB
i18n (useObjectLabel.js) 37.51KB 10.04KB
i18n (useSafeTranslation.js) 7.14KB 2.92KB
layout (index.js) 41.18KB 11.71KB
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.99KB 0.87KB
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) 6.62KB 2.45KB
mobile (useResponsive.js) 0.72KB 0.42KB
mobile (useSpecGesture.js) 5.52KB 2.10KB
mobile (useTouchTarget.js) 1.01KB 0.54KB
permissions (MePermissionsProvider.js) 13.86KB 5.00KB
permissions (PermissionContext.js) 0.31KB 0.25KB
permissions (PermissionGuard.js) 0.89KB 0.45KB
permissions (PermissionProvider.js) 6.52KB 2.26KB
permissions (discardProofCache.js) 1.04KB 0.55KB
permissions (evaluator.js) 8.33KB 3.07KB
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) 16.04KB 3.92KB
plugin-calendar (index.js) 53.39KB 15.52KB
plugin-charts (index.js) 84.26KB 23.05KB
plugin-chatbot (index.js) 198.81KB 47.14KB
plugin-dashboard (index.js) 143.75KB 38.87KB
plugin-designer (index.js) 231.46KB 48.87KB
plugin-detail (index.js) 247.28KB 65.06KB
plugin-editor (index.js) 2.23KB 1.05KB
plugin-form (index.js) 177.09KB 45.89KB
plugin-gantt (index.js) 179.16KB 45.06KB
plugin-grid (index.js) 238.51KB 65.53KB
plugin-kanban (index.js) 52.17KB 16.37KB
plugin-list (index.js) 116.85KB 29.12KB
plugin-map (index.js) 25.60KB 8.62KB
plugin-markdown (index.js) 13.88KB 4.80KB
plugin-report (index.js) 44.12KB 12.29KB
plugin-timeline (index.js) 38.90KB 11.74KB
plugin-tree (index.js) 15.07KB 5.33KB
plugin-view (index.js) 90.23KB 22.73KB
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.81KB 3.58KB
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) 120.63KB 39.56KB
react (data-invalidation.js) 5.05KB 2.08KB
react (index.js) 4.50KB 2.06KB
react (schema-input.js) 4.31KB 2.07KB
react (spec-input.js) 0.20KB 0.18KB
sdui-parser (body-dialect.js) 4.50KB 1.99KB
sdui-parser (codegen.js) 9.45KB 3.76KB
sdui-parser (dashboard-widget-options.js) 3.08KB 1.30KB
sdui-parser (index.js) 7.30KB 3.12KB
sdui-parser (input-type.js) 2.84KB 1.40KB
sdui-parser (parse.js) 25.28KB 7.80KB
sdui-parser (provenance.js) 3.84KB 1.90KB
sdui-parser (types.js) 0.28KB 0.23KB
sdui-parser (validate.js) 23.87KB 7.83KB
types (ai.js) 4.39KB 2.17KB
types (api-types.js) 0.20KB 0.18KB
types (app.js) 4.12KB 1.61KB
types (authoring-nodes.js) 0.20KB 0.19KB
types (base.js) 0.20KB 0.18KB
types (blocks.js) 0.20KB 0.18KB
types (cloud.js) 0.20KB 0.18KB
types (complex.js) 4.44KB 2.07KB
types (crud.js) 0.20KB 0.18KB
types (dashboard-filter-alias.js) 6.23KB 2.74KB
types (dashboard-widget-layout.js) 2.06KB 0.96KB
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 (expression.js) 0.20KB 0.18KB
types (feedback.js) 0.20KB 0.18KB
types (field-types.js) 1.13KB 0.65KB
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) 5.78KB 2.70KB
types (layout.js) 0.20KB 0.18KB
types (managed-by.js) 0.19KB 0.18KB
types (mobile.js) 5.00KB 2.39KB
types (navigation.js) 0.20KB 0.18KB
types (node-slots.js) 7.18KB 2.34KB
types (objectql.js) 0.20KB 0.18KB
types (overlay.js) 0.20KB 0.18KB
types (permissions.js) 2.52KB 1.31KB
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 (select-option.js) 0.20KB 0.19KB
types (spec-report.js) 4.99KB 1.96KB
types (spec-ui-namespace.js) 0.20KB 0.19KB
types (strict-authoring-face.js) 19.93KB 7.25KB
types (system-fields.js) 3.33KB 1.54KB
types (theme.js) 6.28KB 2.87KB
types (ui-action.js) 8.11KB 3.32KB
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

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review October 6, 2026 17:23
@objectstack-fleet
objectstack-fleet Bot enabled auto-merge October 6, 2026 17:23
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Oct 6, 2026
Merged via the queue into main with commit 5a2a6ab Oct 6, 2026
45 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-11723-toast-clicks-under-modal branch October 6, 2026 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

console: toast actions (Undo, close) cannot be clicked while a drawer or dialog is open — the click goes through the toast to whatever is under it

2 participants