Skip to content

test(site/src/modules/workspaces): cover version picker stacking - #28154

Open
david-fraley wants to merge 1 commit into
mainfrom
dfraley/eng-3175-version-picker-stacking
Open

test(site/src/modules/workspaces): cover version picker stacking#28154
david-fraley wants to merge 1 commit into
mainfrom
dfraley/eng-3175-version-picker-stacking

Conversation

@david-fraley

Copy link
Copy Markdown
Collaborator

🤖 This PR was written by Coder Agents on behalf of @david-fraley.

Closes ENG-3175 on main.

Context

ENG-3175 reports that the Change version dialog's picker is unusable, hidden behind the dialog backdrop. The report is accurate for 2.36.0, but main is already fixed. This PR adds the regression guard that was missing, rather than a redundant fix.

What happened: the picker is a Radix popover that portals to document.body with z-50. #24276 swapped this dialog's MUI Autocomplete for that popover on 2026-07-14, while the surrounding dialog was still @mui/material/Dialog at z-index: 1300. Two body-level portals, 50 loses to 1300, so the options painted under the dialog surface. #27506 moved all dialogs onto Radix on 2026-07-31, which fixed the stacking incidentally, but it landed after the 2.36 branch cut. So 2.36.0 shipped broken and main did not.

Why nothing caught it: the dialog has four stories, and none of them open the picker. Even if they did, a plain userEvent.click on an option succeeds while the popover is layered behind the dialog, because testing-library does not hit test.

Change

Adds a SelectVersion story that opens the picker, hit tests an option against document.elementFromPoint, then selects it and confirms. Storybook stories run in real Chromium via the storybook vitest project, so the hit test is meaningful in CI.

Validation

The guard was run against both trees to confirm it detects the reported bug rather than just passing.

Tree vitest run --project=storybook ChangeWorkspaceVersionDialog.stories.tsx
main (this branch) 5 passed
v2.36.0 (story cherry-picked in) 4 passed, 1 failed at the hit test

Measured in a headless Chromium against each tree's Storybook, with the picker open:

v2.36.0 main
dialog container z-index 1300 (MUI) 50 (Radix)
popover z-index 50 50
element at popover center div.css-az7ti9 (the dialog) the popover contents
click an option timed out, intercepted selected

Also ran biome check and tsc clean on the changed file.

Screenshots

Screenshots of both trees with the picker open are attached in the originating chat: on v2.36.0 the dialog is unchanged after clicking the trigger (the list is behind it), on main the list renders above the dialog.

Note on 2.36.x

This PR does not fix released 2.36. Customers on 2.36.0 still hit this. A backport would be a one-line z-index bump on ComboboxContent in that dialog. Backporting #27506 itself is not advisable, it touches ~30 dialogs.

The Change version dialog's picker is a popover that portals to the
document body, outside the dialog. In 2.36.0 it painted underneath the
MUI dialog surface, so the options were visible to queries but could not
be clicked. Existing stories never opened the picker, so nothing caught
it.

Add a SelectVersion story that opens the picker, hit tests an option
against document.elementFromPoint, then selects it and confirms. The hit
test is the part that matters: a plain click passes even when the
popover is layered behind the dialog.
@linear-code

linear-code Bot commented Aug 13, 2026

Copy link
Copy Markdown

ENG-3175

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant