Skip to content

fix(site): keep workspace sharing usable at 320px - #31408

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

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

Conversation

@chrifro

@chrifro chrifro commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator

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.

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
Sharing settings page

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.

Implementation plan and decision log

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> (fix(site/src): render the compact workspace sharing list as one table #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).

🤖 Generated by Coder Agents on behalf of @chrifro.

At a 320px-wide viewport (1280px at 400% zoom), the Share popover was a
fixed 580px, and the add member row and the members table's Role and
menu columns ended up off screen, failing WCAG 1.4.10 Reflow.

Follow ChatSharingPopover: size the popover to the viewport below sm,
stack the add form, let the role select shrink and member names wrap,
and render the compact view as one table with a sticky header so the
header and rows scroll together.

Fixes DEQ-539.
@chrifro
chrifro temporarily deployed to main November 17, 2026 14:17 — with GitHub Actions Inactive
@chrifro
chrifro temporarily deployed to main November 17, 2026 14:18 — with GitHub Actions Inactive
…-or-functionality-is-unavailable-at-320px-width

# Conflicts:
#	site/src/modules/workspaces/WorkspaceSharingForm/UserOrGroupAutocomplete.tsx
#	site/src/modules/workspaces/WorkspaceSharingForm/WorkspaceSharingForm.tsx
#	site/src/pages/WorkspacePage/WorkspaceActions/ShareButton.stories.tsx
#	site/src/pages/WorkspacePage/WorkspaceActions/ShareButton.tsx
@chrifro
chrifro temporarily deployed to main November 17, 2026 14:29 — with GitHub Actions Inactive
@chrifro
chrifro temporarily deployed to main November 17, 2026 14:31 — with GitHub Actions Inactive
@chrifro
chrifro marked this pull request as ready for review November 17, 2026 15:02
@chrifro
chrifro temporarily deployed to main November 17, 2026 15:02 — with GitHub Actions Inactive
…when read-only

Limit the member cell nowrap to small screens so long names wrap again
in the 580px Share popover, and make the read-only table's scroll area
focusable on the settings page too, where it now overflows at 320px.
Share the long-name fixture and add a narrow read-only story.

🤖 Generated by Coder Agents on behalf of @jeremyruppel.

@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.

Approving. The 320px fix works: in Storybook at 320px the add row stacks within the viewport, the table scrolls inside its own container, Tab never puts focus off-screen, and axe finds nothing new.

I pushed d932211 on top to fix three things that came from the new whitespace-nowrap. Each is explained in an inline note. Biome, tsc and the ShareButton and WorkspaceSharingPageView story tests (17/17) pass locally.

Non-blocking nits I left alone:

  • The w-full parts of w-full sm:w-80, w-full sm:w-40 and w-full sm:w-auto do nothing, since Autocomplete and SelectTrigger are already full width. Keeping them so the classes match ChatSharingPopover is fine.
  • The description says the PR follows ChatSharingPopover. That's true for the popover and the form, but ChatSharingPopover replaces the table with a list on small screens, while this PR scrolls the table.

🤖 Generated by Coder Agents on behalf of @jeremyruppel.

{workspaceACL.group.map((group) => (
<TableRow key={group.id}>
<TableCell className="py-2 w-[50%]">
<TableCell className="py-2 w-[50%] max-sm:whitespace-nowrap">

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.

Changed whitespace-nowrap to max-sm:whitespace-nowrap here and at :319. Without the prefix, long names also stopped wrapping on desktop: in the 580px Share popover at 1280px, the long-name data made the table content 611px wide in a 546px container, so the ⋮ menu was hidden until you scrolled sideways. With the prefix it fits (546 of 546px), and the 320px behavior is unchanged.

// Without row controls, keyboard users need the scroll area itself to be focusable.
wrapperProps={
isCompact && !canShareWorkspace
!canShareWorkspace

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.

Dropped isCompact &&. Now that names don't wrap, the read-only table on the settings page overflows at 320px when a name is long. Its rows have no controls, so keyboard users couldn't scroll it, and axe flagged scrollable-region-focusable in the new NarrowViewportReadOnly story. With this change the scroll area gets tabIndex=0 and role="region" and axe passes.

role: "use",
};

export const MockWorkspaceUserLongName: TypesGen.WorkspaceUser = {

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.

Moved the long-name user both stories defined inline into a shared mock. The old username was 39 characters, over the 32-character limit (codersdk/name.go:45). This one is exactly 32, and it also has a long display name, because the subtitle wraps too.

},
};

export const NarrowViewportReadOnly: Story = {

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.

Added a narrow read-only story so Pixel and the story tests cover the case fixed at WorkspaceSharingForm.tsx:384.

@jeremyruppel
jeremyruppel merged commit 8d5ad46 into main Nov 18, 2026
26 checks passed
@jeremyruppel
jeremyruppel deleted the christin/deq-539-info-or-functionality-is-unavailable-at-320px-width branch November 18, 2026 15:45
@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 — d9322117 Deployed Nov 18, 2026 by jeremyruppel via cla #259640
docs-preview — d9322117 Deployed Nov 18, 2026 by jeremyruppel via cleanup #211
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.

2 participants