Skip to content

fix(web): keep portaled dialogs above the sidebar - #64650

Closed
stussysenik wants to merge 2 commits into
anomalyco:devfrom
stussysenik:dialog-zorder-fix
Closed

stussysenik wants to merge 2 commits into
anomalyco:devfrom
stussysenik:dialog-zorder-fix

Conversation

@stussysenik

@stussysenik stussysenik commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Issue for this PR

Closes #63541

Type of change

  • Bug fix

What does this PR do?

On Linux Firefox, the Delete session dialog stayed in the DOM but the dimmed backdrop and sidebar painted over it after a pointer move. The sidebar panel had contain: layout style paint, so Firefox composited it above the dialog layers. Limiting it to contain: style keeps its clipping and fixes the paint order. The product change is one class.

How did you verify your code works?

  • Headed Firefox 159 on Xvfb, screen grabbed from the real X display, with the original dev file and with this branch. Dialog pixel at (1000,300): 255 on base, 153 with the fix.
  • Re-ran the reporter's file-preview case with a real file open. With the base file the sidebar stays undimmed (pixel (100,400) = 250); with the fix it sits under the backdrop (150). The file preview itself is dimmed (153) in both, so contain-strict in side-region.tsx and panels.tsx needs no change.
  • No e2e assertion added. A computed-CSS check cannot detect paint order and would break on unrelated containment edits, so it was dropped in review. Screen capture is the only reliable seam here.
  • With no dialog open, rendering is pixel-identical: 0 of 1,024,000 pixels differ. bun run check 35/35, strict tsc 33/33, oxlint clean; shell-panel-spacing.spec.ts 10/10.

Screenshots / recordings

Same dialog and pointer move in each pair.

Sidebar, no file preview:

Before After
Before: dialog and backdrop missing after pointer move After: dialog and backdrop still painted

File preview open:

Before After
Before: sidebar drawn over the dimmed backdrop After: sidebar dimmed with the backdrop

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@opencodejr opencodejr Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The change looks safe, but I couldn't verify it here: this sandbox has no Firefox or X server, so I couldn't run the headed-Firefox screen-capture reproduction from #63541 on either the base or this branch. tsc passes for packages/app.

From the code, dropping layout and paint containment on vertical-tabs-panel changes very little else. overflow-clip still clips the panel (with the divider bleed margin). The mount inside it is still contain-strict, so its layout stays isolated. content-visibility:hidden still adds its own containment while the panel is hidden.

Public API: unchanged.

Two points:

  • The new e2e case only checks that the class's CSS value is style. It can't detect the paint-order bug, and any rewrite of that class would break it. For a one-class fix it can be dropped so the change stays minimal.
  • The reporter saw the dialog slip behind the side file preview. The side panels in runtime/plugin/side-region.tsx and runtime/plugin/panels.tsx still use contain-strict, the same pattern this PR blames. Could you re-run your Xvfb capture with the file preview open and share the before/after for that case too?

await expect(page.getByRole("heading", { name: fixture.expected.targetTitle })).toBeVisible()

// Layout or paint containment here makes Firefox composite the panel over dialogs after a pointer move.
await expect(page.locator('[data-slot="vertical-tabs-panel"]')).toHaveCSS("contain", "style")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This only checks the CSS value of the class rather than how the dialog is drawn, so it can't catch the regression and would break on any unrelated containment change. For a one-class fix I'd drop this case (and the seed import).

@stussysenik

Copy link
Copy Markdown
Contributor Author

Both points addressed:

  • Dropped the computed-containment e2e case and its seed import. The PR is now one class in shell.tsx.
  • Re-ran the headed Firefox/Xvfb capture with AGENTS.md open in the file preview. On the base file the sidebar stays undimmed (pixel at 100,400 = 250) after the pointer moves; with the fix it sits under the backdrop (150). The preview itself is dimmed (153) in both, so no change is needed in side-region.tsx or panels.tsx. Before/after shots are in Screenshots / recordings.

@opencodejr

opencodejr Bot commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

Thanks. I checked b66789f: it only removes the containment e2e case and the seed import, so the change against dev is now just the one class in shell.tsx. That covers my first point.

Your file-preview capture covers the second: in your runs the preview stays dimmed on both base and fix, and only the sidebar changes. I still can't run headed Firefox here, so I'm relying on your captures for the paint-order result. I have nothing else to raise.

@opencodejr opencodejr Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The brittle containment e2e case and its seed import are gone, so the change is now the one class in shell.tsx. I still can't run headed Firefox in this sandbox, so I'm relying on your Xvfb captures, file-preview case included, for the paint-order result. Public API: unchanged. Nothing else to raise.

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.

Delete popup disappears when I attempt to hover the mouse over it

1 participant