Skip to content

fix(site): keep floating content within the viewport at 320px - #31348

Merged
jeremyruppel merged 6 commits into
mainfrom
christin/deq-588-info-or-functionality-is-unavailable-at-320px-width
Nov 18, 2026
Merged

jeremyruppel merged 6 commits into
mainfrom
christin/deq-588-info-or-functionality-is-unavailable-at-320px-width

Conversation

@chrifro

@chrifro chrifro commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator

At a 320px-wide viewport (1280px at 400% zoom), shared floating UI clipped its content, failing WCAG 1.4.10 Reflow. Menus had overflow-hidden and no height limit, Select had a fixed max-h-96, and Popover and Tooltip had no width limit, so items and text ended up past the viewport edge where neither scrolling nor the keyboard could reach them.

Each primitive is now capped to the available space that Radix reports (--radix-popper-available-*), and menus scroll instead of hiding overflow:

  • DropdownMenu/ContextMenu (menuClasses.ts): max-w from the available width (the height cap and scrolling landed separately in fix(site/src/components): scroll menus that do not fit the viewport #32385). min-w is min(12rem, available width) so it can't override the cap on submenus.
  • Popover: max-w from the available width, so fixed widths such as the ports popover's w-[404px] shrink to fit.
  • Select: max-h is now min(24rem, available height), plus max-w from the available width.
  • Tooltip: max-w from the available width, plus wrap-break-word.

tailwind-merge drops the base cap when a caller passes its own max-w, so callers wider than 320px now use max-w-[min(<size>,var(--radix-popper-available-width))] (SessionTimeline, IdpUnseenClaimWarning, AgentLogs, UserGroupsCell, workspace Notifications). Interactive tooltips add 8px collision padding, so InfoTooltip and AgentStatus (max-w-xs) use the same form. MobileMenu is full width by design, so it opts out of the width cap with max-w-none. New NarrowViewport stories for the four primitives run on Pixel's phone viewport. Each story overflows without the fix.

Closes DEQ-588, DEQ-492, DEQ-339, DEQ-346, DEQ-6
Refs DEQ-168 (Login type select only)

Before / after (320×256 CSS viewport)

Surface Before After
Filters menu (DEQ-588)
Mobile header menu, sections expanded (DEQ-492)
Login type select (DEQ-168)
Footer "Deployment status" tooltip (DEQ-339)
Ports popover (DEQ-6, Storybook)

Playwright measurements of the same scenarios (the surface's bottom or right edge against the 256px-tall, 320px-wide viewport):

Surface Before After
Filters menu bottom 314px fits, scrolls
Mobile menu, sections expanded bottom 518px fits, scrolls
Login type select bottom 274px fits
Deployment status tooltip right 428px fits
Ports popover right 420px fits

Not covered here: DEQ-125 (the toast already fits at 320px, and the report points at the dialog overlay, so it needs a licensed repro), the DEQ-168 organization picker (not reproduced), and the DEQ-539 sharing form and DEQ-443 notifications inbox, whose page layouts are planned as separate PRs.

Implementation plan and decision log

Grouping. Eight Deque 1.4.10 Reflow issues (DEQ-588, 539, 492, 443, 346, 339, 168, 125, 6) were grouped by root cause. Most trace to five shared floating primitives (menus, tooltip, select, popover, toast), so fixing those once resolves most issues. DEQ-539 (sharing form row and table) and DEQ-443 (inbox header and rows) are page layout problems and get separate PRs.

Approach. Cap every primitive to the Radix available-space CSS variables, let text wrap, and scroll rather than clip.

Decisions

  • Used --radix-popper-available-*, which the popper wrapper sets and content inherits, so one variable works for menu, popover, and tooltip.
  • Select keeps its 24rem ceiling through min(24rem, var(--radix-select-content-available-height, 24rem)), so item-aligned mode, where the variable is unset, still behaves as before.
  • Tooltip collisionPadding stays at Radix's default of 0. About 25 tooltip callers pass max-w-xs (320px), which tailwind-merge keeps over the base cap. With padding 0 they still fit a 320px viewport, but an 8px padding would have pushed them over.
  • Callers with an explicit max-w wider than 320px got the min(...) form instead of a wholesale codemod.
  • MobileMenu uses max-w-none. The new cap left a 15px gap on this full-width menu.
  • Reverted a toast max-w-full change: sonner already switches to full width below 600px, so the toast fit before and after.
  • Reverted an organization picker change from truncation to wrapping, because the clipping could not be reproduced.

Verification

  • Playwright at 320×256 in the dev app (./scripts/develop.sh), plus Storybook for license-gated or workspace-gated surfaces. The before runs had the changes stashed.
  • Biome and tsc pass, and make pre-commit passes.
  • Related Vitest suites pass. WorkspacePage.test.tsx fails the same way without these changes.
  • frontend-deep-review (all eight roles) was run, and its should-fix findings (story coverage, story play cleanup, the extra callers) are addressed.

Review follow-up (@jeremyruppel)

  • InfoTooltip (with-link story) measured right edge 356px at 320px before, 297px after.
  • min-w-48 beat the new max-w on submenus, where available width is only the space beside the sub-trigger.
  • *-100 callers kept as 25rem rather than 400px so they still scale with root font size.
  • Not changed: tooltip height is still uncapped, so tall interactive tooltips (prompt origin) can overflow a 256px-tall viewport when they flip below the trigger.

🤖 Generated by Coder Agents on behalf of @chrifro, with review fixes on behalf of @jeremyruppel.

Menus, popovers, selects, and tooltips clipped their content when the
viewport was 320px wide (1280px at 400% zoom), failing WCAG 1.4.10 Reflow.

Cap each primitive to the Radix-provided available width and height and
scroll vertically instead of hiding overflow. Callers that set their own
max-width now take the smaller of that width and the available space, and
the full-width mobile menu opts out of the width cap.

Fixes DEQ-588, DEQ-492, DEQ-339, DEQ-346, DEQ-168, DEQ-6.
@linear-code

linear-code Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

@chrifro
chrifro marked this pull request as ready for review October 28, 2026 10:56
@chrifro
chrifro requested a review from aqandrew October 28, 2026 10:56
@bartekgatzcoder

Copy link
Copy Markdown
Collaborator

@chrifro this PR now conflicts with main (GitHub reports CONFLICTING), and its last update was Oct 28. Could you rebase it on main and resolve the conflicts? Once it's up to date and CI is green, I'll review it. That will close DEQ-6, DEQ-339, DEQ-346, DEQ-492 and DEQ-588.

🤖 Generated by Coder Agents on behalf of @bartekgatzcoder.

…-or-functionality-is-unavailable-at-320px-width

# Conflicts:
#	site/src/components/DropdownMenu/menuClasses.ts
#	site/src/components/Popover/Popover.tsx
#	site/src/components/Select/Select.stories.tsx
#	site/src/components/Tooltip/Tooltip.tsx
#	site/src/modules/users/UserGroupsCell.tsx
#	site/src/pages/AIBridgePage/SessionThreadsPage/SessionTimeline/SessionTimeline.tsx
#	site/src/pages/WorkspacePage/WorkspaceNotifications/Notifications.tsx
@chrifro
chrifro temporarily deployed to main November 10, 2026 13:41 — with GitHub Actions Inactive
…-or-functionality-is-unavailable-at-320px-width
@chrifro
chrifro temporarily deployed to main November 10, 2026 13:46 — with GitHub Actions Inactive
…-or-functionality-is-unavailable-at-320px-width

# Conflicts:
#	site/src/components/DropdownMenu/menuClasses.ts
#	site/src/components/Select/Select.tsx
#	site/src/components/Tooltip/Tooltip.tsx
#	site/src/modules/dashboard/Navbar/MobileMenu.tsx
@chrifro
chrifro temporarily deployed to main November 11, 2026 09:18 — with GitHub Actions Inactive
jeremyruppel added a commit that referenced this pull request Nov 18, 2026
At a 320px-wide viewport (1280px at 400% zoom), workspace sharing lost
functionality, failing WCAG 1.4.10 Reflow. The Share popover was a fixed
580px wide, and in both the popover and the sharing settings page, the
add row (member search, role select, **Add member**) and the members
table's Role and menu columns fell off screen.

This follows the pattern `ChatSharingPopover` already uses for the same
layout:

- Share popover: `w-[calc(100vw-2rem)] p-3 sm:w-145 sm:p-4`.
- Add form: stacks below `sm` with a full-width search, role select, and
button. The `UserOrGroupAutocomplete` default width becomes `w-full
sm:w-80`.
- Table: member names stay on one line (`whitespace-nowrap`), and the
table scrolls horizontally inside its own container when it is wider
than the popover or page. The Role and menu cells use `max-sm:px-1`.
- Phone-width stories for the popover and the settings page include a
long username.

Desktop layout is unchanged. Fixes
[DEQ-539](https://linear.app/codercom/issue/DEQ-539).

## Before / after (320px wide, Storybook)

"Before" is the first revision of this PR, which wrapped names character
by character to fit the column.

| | Before (names wrap) | After (table scrolls) | After, scrolled right
|
|---|---|---|---|
| Share popover |
![](https://github.com/coder/coder/blob/929f04db6ba84d24b3cd5bdca1625250b695423b/scroll-before-share-popover.png?raw=true)
|
![](https://github.com/coder/coder/blob/929f04db6ba84d24b3cd5bdca1625250b695423b/scroll-after-share-popover.png?raw=true)
|
![](https://github.com/coder/coder/blob/929f04db6ba84d24b3cd5bdca1625250b695423b/scroll-after-share-popover-scrolled.png?raw=true)
|
| Sharing settings page |
![](https://github.com/coder/coder/blob/929f04db6ba84d24b3cd5bdca1625250b695423b/scroll-before-sharing-page.png?raw=true)
|
![](https://github.com/coder/coder/blob/929f04db6ba84d24b3cd5bdca1625250b695423b/scroll-after-sharing-page.png?raw=true)
|
![](https://github.com/coder/coder/blob/929f04db6ba84d24b3cd5bdca1625250b695423b/scroll-after-sharing-page-scrolled.png?raw=true)
|

These are Playwright measurements at 320×640.

| | Before | After |
|---|---|---|
| Page width (document scroll width) | 305px, no page scroll | 305px, no
page scroll |
| Members table (scroll / visible width) | 262/262px, names wrapped to
up to 20 lines | 579/262px, scrolls inside the table container |
| Long username line height | 480px | 24px (one line) |
| 1280px desktop | | unchanged |

Only the table scrolls, not the page, which 1.4.10 permits for data
tables. Also checked on a real workspace page in a local dev deployment
at 320px: 525/262px table scroll, no page overflow.

<details>
<summary>Implementation plan and decision log</summary>

**Context.** This is the second of three PRs for the Deque 1.4.10 Reflow
issues. PR #31348 fixes the shared floating primitives (menus, popover,
select, tooltip). This PR covers the page-specific sharing layout
(DEQ-539), and DEQ-443 (notifications inbox) follows.

**Decisions**

- Reused `ChatSharingPopover`'s responsive classes instead of a new
pattern, for consistency and reviewability.
- The first revision wrapped member names with `wrap-anywhere`, which
split names like `TestUser` across several lines at 320px. Review
feedback asked for scrolling instead, so names are `whitespace-nowrap`,
the role select keeps its fixed `w-40`, and the `Table` wrapper's
existing `overflow-auto` scrolls the table on both axes. In the compact
view, `max-h-60` caps the height.
- `max-sm:px-1` on the Role and menu columns keeps the scroll distance
short at 320px, and desktop padding is unchanged.
- Merged `main`, which in the meantime landed the single compact table
with a sticky `<thead>` (#31941), the exported `workspaceACLKey`, and
fuller `ShareButton` stories. This PR now only adds the responsive
classes and a `NarrowViewport` story on top of those.
- Kept a table instead of `ChatSharingPopover`'s separate mobile card
list, which would duplicate the rows and role select controls.

**Verification**

- Playwright at 320×640 and 1280×800 against the new stories, and at
320px against a real workspace in a local `./scripts/develop.sh`
deployment.
- `pnpm check`, `pnpm lint`, and `pnpm format` pass. The `ShareButton`
and `WorkspaceSharingPageView` story tests pass (16/16).

</details>

---

🤖 Generated by Coder Agents on behalf of @chrifro.

---------

Co-authored-by: Jeremy Ruppel <[email protected]>
Co-authored-by: Jeremy Ruppel <[email protected]>

@aqandrew aqandrew left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Having some trouble running locally, but the code+screenshots look sound. Thanks for this!

Interactive tooltips with max-w-xs overflowed by their collision padding,
and menu min-w-48 overrode the new max-w on submenus.
…-or-functionality-is-unavailable-at-320px-width

# Conflicts:
#	site/src/components/DropdownMenu/DropdownMenu.stories.tsx
#	site/src/components/DropdownMenu/menuClasses.ts

@jeremyruppel jeremyruppel left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed at 7a31d22. Shared floating primitives (menus, popover, select, tooltip) now stay within a 320px viewport; verified the DEQ-6, DEQ-339, DEQ-346, DEQ-492, and DEQ-588 surfaces at 320x256 in Storybook. Review fixes (InfoTooltip/AgentStatus width caps, submenu min-w cap) were pushed in 12ee6a6. Nit, not addressed: tooltips have no height cap, so tall ones can overflow a 256px-tall viewport.

🤖 Generated by Coder Agents on behalf of @jeremyruppel.

@jeremyruppel
jeremyruppel merged commit c9e8f2c into main Nov 18, 2026
30 checks passed
@jeremyruppel
jeremyruppel deleted the christin/deq-588-info-or-functionality-is-unavailable-at-320px-width branch November 18, 2026 23:28
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 18, 2026

This branch had an error being deployed

1 failed and 1 inactive deployments
main — 7a31d229 Deployed Nov 18, 2026 by jeremyruppel via cla #259965
docs-preview — 7a31d229 Deployed Nov 18, 2026 by jeremyruppel via cleanup #236
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants