fix(web): render dropdowns above toasts - #6165
Conversation
Toast notifications sat at z-index 100 while menus, popovers, selects, comboboxes and autocompletes sat at 50-60, so any toast painted over an open dropdown. Because the toast viewport also captures pointer events, a click aimed at a covered menu item hit the toast (or its dismiss button) instead of the item. Move the five popup positioners to z-index 130. Toasts stay above every normal surface, including dialogs and sheets, but the menu the user is actively holding open now wins -- it is the focused interaction, while a toast is ambient and dismisses itself a few seconds later. 130 clears the theme inspector cluster (100-120) as well, so dropdowns opened from the theme editor keep working. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
ApprovabilityVerdict: Approved 7649f65 A simple CSS z-index fix ensuring dropdown components render above toast notifications (z-100 → z-[130]). The change is purely visual with no logic impact. You can customize Macroscope's approvability policy. Learn more. |
## What's Changed * feat(web): make environment artwork theme aware by @juliusmarminge in pingdotgg/t3code#6183 * fix(shared): normalize a bare Windows drive root the same as C:\ / C:/ by @arhxam in pingdotgg/t3code#6189 * fix(shared): detect Azure DevOps SSH remotes (ssh.dev.azure.com) by @arhxam in pingdotgg/t3code#6187 * feat(web): add back buttons for the pull requests and usage pages in the sidebar footer by @UtkarshUsername in pingdotgg/t3code#6031 * fix(web): render dropdowns above toasts by @Brechard in pingdotgg/t3code#6165 * fix(web): thread error banner dismiss survives reconnect and rerenders by @myacoub91 in pingdotgg/t3code#6123 * fix(web): use a clearer pull action icon by @extoci in pingdotgg/t3code#6194 * feat(web): use OKLCH for theme palettes by @StiensWout in pingdotgg/t3code#6036 ## New Contributors * @extoci made their first contribution in pingdotgg/t3code#6194 **Full Changelog**: pingdotgg/t3code@v0.0.34-nightly.20260811.1068...v0.0.34-nightly.20260811.1069 Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.34-nightly.20260811.1069
Problem
A toast that arrives while a dropdown is open paints straight over it.
The toast viewport sits at
z-index: 100(apps/web/src/components/ui/toast.tsx:562), while the popup positioners sit well below it:So every toast outranks every dropdown. The
z-[calc(9999-var(--toast-index))]on the individual toasts only orders them against each other inside the viewport's stacking context — the viewport'sz-100is what beats the menu.It isn't only cosmetic: the toast viewport also takes pointer events, so a click aimed at a covered menu item lands on the toast (or its dismiss button) and fires the wrong thing.
Fix
Move the five popup positioners to
z-index: 130.Toasts keep their place above every ordinary surface, dialogs and sheets included — a toast usually reports the result of something you did inside one. The single exception is now the dropdown the user is actively holding open: that is the focused interaction, while a toast is ambient and dismisses itself a few seconds later. The transient thing should yield to the interactive one.
130 also clears the theme inspector cluster (
index.css:1203spotlight 100,:1230hover 101,ThemeEditorPanel.tsx:1036panel 110,index.css:1213its popovers 120), so dropdowns opened from the theme editor keep working.Resulting order: dialog/sheet 50 → toast 100 → theme editor 110/120 → dropdowns 130.
Before / After
The toast covers the editor list and swallows clicks meant for it; afterwards the menu sits on top and the toast tucks in behind.
Notes
select.tsx:146and:166keep theirz-50. Those are the scroll-up/down arrows inside the popup, scoped to the popup's own stacking context.[data-slot="menu-positioner"]computes toz-index: 130, and hit-testing a point inside the overlap now returns the menu item rather than the toast.Note
Low Risk
CSS-only z-index tweaks on overlay positioners; no logic, auth, or data changes, with a small chance of unexpected overlap with other high z-index UI.
Overview
Raises popup stacking so open dropdowns stay above the toast layer (
z-100) and remain clickable when a toast appears.The positioner
classNameon autocomplete, combobox, menu, popover, and select changes fromz-50/z-[60]toz-[130], putting active menus above toasts while still below nothing critical beyond the theme-editor cluster described in the PR. Scroll arrows inside select popups keep their localz-50.Reviewed by Cursor Bugbot for commit 7649f65. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Render dropdowns above toasts by raising z-index to 130
Increases the
z-indexof positioner elements in autocomplete, combobox, menu, popover, and select components fromz-50/z-[60]toz-[130], ensuring dropdowns render above toast notifications.Macroscope summarized 7649f65.