Skip to content

fix: lower toast z-index so dropdowns render above toasts#2288

Open
maxktz wants to merge 1 commit intopingdotgg:mainfrom
maxktz:fix/toast-z-index
Open

fix: lower toast z-index so dropdowns render above toasts#2288
maxktz wants to merge 1 commit intopingdotgg:mainfrom
maxktz:fix/toast-z-index

Conversation

@maxktz
Copy link
Copy Markdown

@maxktz maxktz commented Apr 22, 2026

Closes #2287

What Changed

Lowered the toast viewport z-index from z-100 to z-40 in apps/web/src/components/ui/toast.tsx.

Why

Menus and popovers use z-50, so when a toast is visible and a user opens a dropdown (e.g. "Open" or "Commit & push" in the toolbar), the dropdown renders behind the toast. Interactive overlays should take priority over passive notifications.

UI Changes

result.mp4

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

Note

Low Risk
Low risk CSS-only stacking change; main risk is :has() selector support/behavior differences potentially affecting toast layering in some browsers.

Overview
Adjusts toast stacking so interactive overlays (menus/selects/popovers/comboboxes/autocomplete) render above notifications.

Adds a body:has(...) CSS rule in index.css that lowers [data-slot="toast-viewport"] to z-index: 40 when an overlay is open, while keeping existing layering when a dialog/sheet/alert backdrop is present.

Reviewed by Cursor Bugbot for commit 14dc47c. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Lower toast z-index when dropdowns are open so they render above toasts

Adds a CSS rule in index.css that sets [data-slot="toast-viewport"] to z-index: 40 when any menu, select, popover, combobox, or autocomplete positioner is open and no dialog backdrop is present. This prevents toasts from overlapping dropdowns outside of dialog contexts.

Macroscope summarized 14dc47c.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 22, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 1d9c54ce-1adc-4bd8-a6c0-3009459637db

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added size:XS 0-9 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list. labels Apr 22, 2026
macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Apr 22, 2026
@macroscopeapp
Copy link
Copy Markdown
Contributor

macroscopeapp Bot commented Apr 22, 2026

Approvability

A prior Macroscope approval was dismissed. Re-evaluating 14dc47c

Copy link
Copy Markdown
Member

@juliusmarminge juliusmarminge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

40 will put them under dialogoverlays so if e.g. command palette is open and triggers a toast that toast won't be shown/interactible cause it will be covered by the overlay

@maxktz maxktz force-pushed the fix/toast-z-index branch from f44cbb1 to 958b495 Compare April 22, 2026 19:59
@github-actions github-actions Bot added size:S 10-29 changed lines (additions + deletions). and removed size:XS 0-9 changed lines (additions + deletions). labels Apr 22, 2026
@maxktz
Copy link
Copy Markdown
Author

maxktz commented Apr 22, 2026

40 will put them under dialogoverlays so if e.g. command palette is open and triggers a toast that toast won't be shown/interactible cause it will be covered by the overlay

Agreed, then a smart css selector with exception could do the trick, I made changes

Cap.2026-04-22.at.23.58.16.mp4

@macroscopeapp macroscopeapp Bot dismissed their stale review April 22, 2026 20:05

Dismissing prior approval to re-evaluate 958b495

macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Apr 22, 2026
@juliusmarminge juliusmarminge enabled auto-merge (squash) April 23, 2026 04:21
Use CSS :has() to conditionally drop toast viewport z-index from 100
to 40 when a menu, select, popover, combobox, or autocomplete is open.
This prevents toasts from covering dropdown menus. When a dialog is
also open, the toast stays at z-100 so it remains visible above the
dialog overlay.
auto-merge was automatically disabled April 23, 2026 06:36

Head branch was pushed to by a user without write access

@maxktz maxktz force-pushed the fix/toast-z-index branch from 958b495 to 14dc47c Compare April 23, 2026 06:36
@macroscopeapp macroscopeapp Bot dismissed their stale review April 23, 2026 06:38

Dismissing prior approval to re-evaluate 14dc47c

@maxktz maxktz requested a review from juliusmarminge April 24, 2026 07:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Toast and dropdown overlap

2 participants