From 4e82a34246b02b558c56f2fb87a735b44500bfc9 Mon Sep 17 00:00:00 2001 From: Bartek Gatz Date: Thu, 26 Nov 2026 10:50:20 +0100 Subject: [PATCH] fix(site/src/modules/dashboard/DeploymentBanner): let pointer input reach the health tooltip (#32762) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The deployment banner's health tooltip set `pointer-events-none` on its content. Once #32747 caps tooltips to the viewport height and lets them scroll, a long list of health errors gets clipped, and with that class the wheel and pointer can't reach the list. Low-vision users at 400% zoom can't read the hidden errors. This PR removes the class. Radix tooltips are hoverable by default, so the tooltip stays open while the pointer moves from the trigger into the content (WCAG 1.4.13). The class dates back to the original MUI styles (#10193), carried over unchanged in #19477. No reason is recorded, and nothing in the current Radix tooltip depends on it. The redundant `border` class goes too, because the base tooltip styles already include it. The `WithHealthIssues` story now moves the pointer onto the tooltip content after opening it. That step throws "element has `pointer-events: none`" on the old code, so the story guards the fix. It replaces a play-function `toBeInTheDocument` assertion (FE1). A Vitest test can't catch this regression, because jsdom doesn't load Tailwind CSS. Depends on #32747 for the short-viewport scroll. This PR is the last piece of the ticket. Closes DEQ-660 | Ticket | UI surface | Screenshots | |---|---|---| | DEQ-660 | Deployment banner health tooltip (`modules/dashboard/DeploymentBannerView`, `WithHealthIssues`) | pending | **Dropped review findings** - Make the tooltip `interactive`: dropped. The trigger is a RouterLink to `/health`, and an interactive tooltip's trigger click calls `preventDefault` and pins the tooltip open. `Tooltip.tsx` documents not to use it on link triggers. The content has nothing focusable, so `interactive` wouldn't help keyboard users either. - Add a health fixture with several errors and a short-viewport story: dropped. This PR doesn't change the rendered UI, and #32747's `TallerThanViewport` story already covers the capped, scrolling tooltip. - Vitest test for hovering the content: dropped. It would pass on the old code (test-audit gate), because jsdom doesn't apply `pointer-events`. **Notes (pre-existing, out of scope)** - axe `link-name` (serious): the health trigger link with errors is icon-only and has no accessible name. - Once #32747 is merged, a clipped health tooltip becomes a scroll region with no focusable content (`scrollable-region-focusable`). Keyboard users can still reach the full list through the trigger, which links to `/health`.
Decision log - Based on `main` rather than stacked on #32747: removing `pointer-events-none` is correct on its own, and together with #32747 the clipped list becomes scrollable. - Kept the plain Radix tooltip instead of `` or a Popover. That keeps the `/health` link on the trigger and its focus-shows-description behavior, and Radix already keeps the content open on hover. - Verified: the `WithHealthIssues` story fails with `pointer-events-none` restored and passes without it. With the pointer resting on the content, the tooltip is still open 1 s later, so Pixel still captures it. An axe-core 4.11.1 run on the hovered state found only the pre-existing `link-name` note above. - Checks: `pnpm check`, `pnpm lint`, `pnpm format`, `pnpm lint:types`, Vitest and story tests for `DeploymentBanner`.
🤖 Generated by Coder Agents on behalf of @bartekgatzcoder. --- .../DeploymentBanner/DeploymentBannerView.stories.tsx | 5 ++--- .../dashboard/DeploymentBanner/DeploymentBannerView.tsx | 7 +------ 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/site/src/modules/dashboard/DeploymentBanner/DeploymentBannerView.stories.tsx b/site/src/modules/dashboard/DeploymentBanner/DeploymentBannerView.stories.tsx index bc5f85ed188..42feb0e4292 100644 --- a/site/src/modules/dashboard/DeploymentBanner/DeploymentBannerView.stories.tsx +++ b/site/src/modules/dashboard/DeploymentBanner/DeploymentBannerView.stories.tsx @@ -137,9 +137,8 @@ export const WithHealthIssues: Story = { const canvas = within(canvasElement); const trigger = canvas.getByTestId("deployment-health-trigger"); await userEvent.hover(trigger); - await waitFor(() => - expect(screen.getByRole("tooltip")).toBeInTheDocument(), - ); + // The content must accept pointer input so a clipped error list can scroll. + await userEvent.hover(await screen.findByRole("tooltip")); }, }; diff --git a/site/src/modules/dashboard/DeploymentBanner/DeploymentBannerView.tsx b/site/src/modules/dashboard/DeploymentBanner/DeploymentBannerView.tsx index 594dac84c85..6fcf1e40f64 100644 --- a/site/src/modules/dashboard/DeploymentBanner/DeploymentBannerView.tsx +++ b/site/src/modules/dashboard/DeploymentBanner/DeploymentBannerView.tsx @@ -136,12 +136,7 @@ export const DeploymentBannerView: React.FC = ({ )} - + {healthErrors.length > 0 ? ( <>