Skip to content

[toast] Keep viewport expanded while touch swiping - #4411

Merged
atomiks merged 7 commits into
mui:masterfrom
atomiks:codex/toast-touch-swipe-expand
Mar 24, 2026
Merged

atomiks merged 7 commits into
mui:masterfrom
atomiks:codex/toast-touch-swipe-expand

Conversation

@atomiks

@atomiks atomiks commented Mar 23, 2026

Copy link
Copy Markdown
Contributor

Touch swiping on mobile could let the toast viewport collapse while the gesture was still active if a stray mouseleave fired underneath the interaction.

Changes

  • Keep the toast viewport expanded while an active touch swipe is in progress.
  • Reuse the shared toast store state so timer pausing and viewport expansion stay in sync.
  • Add regression coverage for the touch-swipe hold case and keep the existing swipe tests green.

@atomiks atomiks added type: bug It doesn't behave as expected. component: toast Changes related to the toast component. mobile Targets mobile platform. labels Mar 23, 2026
@pkg-pr-new

pkg-pr-new Bot commented Mar 23, 2026 •

Copy link
Copy Markdown
  • base-ui-tanstack-start

  • vite-css-base-ui-example

    pnpm add https://pkg.pr.new/mui/base-ui/@base-ui/react@4411
    
    pnpm add https://pkg.pr.new/mui/base-ui/@base-ui/utils@4411
    

commit: 1d13dc8

@mui-bot

mui-bot commented Mar 23, 2026 •

Copy link
Copy Markdown

Bundle size report

Bundle Parsed size Gzip size
@base-ui/react 🔺+360B(+0.08%) 🔺+102B(+0.07%)

Details of bundle changes


Check out the code infra dashboard for more information about this PR.

@netlify

netlify Bot commented Mar 23, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for base-ui ready!

Name Link
🔨 Latest commit 1d13dc8
🔍 Latest deploy log https://app.netlify.com/projects/base-ui/deploys/69c214ab48c45500085458d7
😎 Deploy Preview https://deploy-preview-4411--base-ui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@atomiks
atomiks marked this pull request as ready for review March 23, 2026 09:33
@atomiks
atomiks force-pushed the codex/toast-touch-swipe-expand branch from 589558e to 1d13dc8 Compare March 24, 2026 04:35
@atomiks

atomiks commented Mar 24, 2026 •

Copy link
Copy Markdown
Contributor Author

Codex Review (GPT-5.4)

This is a bug-fix PR with secondary tags tests and react-ui, focused on touch swipe cancellation and deferred viewport collapse for toast interactions on mobile. I reviewed the full rebased branch against fresh upstream/master and reran the relevant toast suites in both JSDOM and Chromium; I did not find any remaining branch-relevant issues.

1. Remaining Bugs / Issues (None)

2. Root Cause & Patch Assessment

Area Assessment Notes
Root swipe cleanup Improved ToastRoot now resets swipe-local state on pointercancel, which addresses the previously reported stuck data-swiping / opacity state.
Viewport deferred collapse Improved ToastViewport now distinguishes between touch end/cancel and an actually deferred mouseleave, so it no longer collapses too aggressively after the earlier follow-up.
Scope control Good The final fix remains localized to ToastRoot and ToastViewport without reintroducing broader shared state.

Merge Confidence Score

Overall merge confidence is 5/5. I reran the relevant toast viewport and root suites in both JSDOM and Chromium, and I did not find any remaining branch-relevant issues in the current rebased diff. This looks good to merge.

@atomiks
atomiks merged commit 7b81722 into mui:master Mar 24, 2026
7 checks passed
@atomiks
atomiks deleted the codex/toast-touch-swipe-expand branch March 24, 2026 04:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: toast Changes related to the toast component. mobile Targets mobile platform. type: bug It doesn't behave as expected.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants