Skip to content

fix(site/src): render the compact workspace sharing list as one table - #31941

Merged
bartekgatzcoder merged 6 commits into
mainfrom
a11y/table-data-multiple-combined
Nov 10, 2026
Merged

bartekgatzcoder merged 6 commits into
mainfrom
a11y/table-data-multiple-combined

Conversation

@jeremyruppel

@jeremyruppel jeremyruppel commented Nov 9, 2026 •

Copy link
Copy Markdown
Collaborator

The workspace Share popover rendered its members list as two tables: a header-only table and a scrolling body table. Screen readers could not associate the Member and Role headers with the data cells (Deque table-data-multiple-combined, WCAG 1.3.1).

WorkspaceSharingForm now renders one labelled table in compact mode too. The header is sticky inside the max-h-60 scroll area, matching ChatSharingPopover. The compact branch, which duplicated the non-compact layout, is gone.

Visible side effects: the header and body columns now line up (the Role header was offset about 8px), and the 240px scroll area now includes the 32px header, so about half a row less is visible before scrolling.

Closes DEQ-387

Ticket UI surface Screenshots
DEQ-387 Workspace page, Share popover, members table Before/after, read-only focus

Tests: a Vitest regression test asserts that the compact form renders one table holding the header and member rows (it fails on main with two tables). New ShareButton stories (EmptyACL, Loading, ReadOnly, OverflowingMembers) give Pixel coverage of the compact popover, which had no story. OverflowingMembers ends scrolled so the sticky header is captured. workspaceACLKey is exported so the stories can seed the ACL query, and MockWorkspaceUser and MockWorkspaceUserAdmin move to testHelpers for both sharing story files.

Read-only scroll area: when the viewer can't edit sharing, the compact list has no focusable controls, so keyboard users couldn't scroll it (axe scrollable-region-focusable, also on main). Since this PR moves that container, it now becomes a focusable, named region in that case. This adds an optional wrapperProps passthrough to the shared Table primitive, with this form as its only caller.

Dropped review findings

  • Inline the single-use tableHeader and tableBody variables (SD1): this would re-indent about 110 unchanged lines for no behavior change.
  • Replace the Vitest test with the story screenshot (TS2, TS5): one table and two tables render identically, so a screenshot cannot catch this regression.
Grouping and decision log
  • Batch table-data-multiple-combined has one eligible ticket, DEQ-387, so one PR with one root cause: the isCompact branch of WorkspaceSharingForm wrapped tableHeader and tableBody in separate <Table> elements.
  • Fix follows the existing ChatSharingPopover pattern (one table, sticky header, scroll wrapper on Table's wrapperClassName). Sticky classes go on <thead> once rather than on each cell.
  • aria-label added because site/AGENTS.md requires every table to have one.
  • axe-core 4.11 on both stories, dark and light themes, 1280px and 320px, before and after:
    • th-has-data-cells (needs review on main, on the header-only table): gone.
    • Table count: 2 on main, 1 on this branch.
    • Unchanged and pre-existing, out of scope: aria-dialog-name on the popover, empty-table-header on the actions column, heading-order in the empty state, and needs-review aria-valid-attr-value and color-contrast (rows below the scroll fold).
  • Keyboard tab order through the popover is unchanged.
  • Self-review: frontend-review, frontend-deep-review (8 roles, 2 rounds), frontend-accessibility. All blocking and should-fix findings fixed except the two dropped above.
  • Round 2 (reviewer feedback): shared fixtures, scrolled story, Loading and ReadOnly stories. The ReadOnly story exposed the read-only keyboard scrolling gap, fixed with wrapperProps set only when compact and read-only (no extra tab stop when row controls exist). Tab reaches the region, End scrolls it, and the default focus ring is visible. Third deep-review round: remaining findings fixed (region name now matches the table, the ReadOnly play ends focused).

🤖 Generated by Coder Agents on behalf of @jeremyruppel.

The Share popover split the members table into a header table and a
scrolling body table, so screen readers could not associate header and
data cells (DEQ-387). Use one table with a sticky header inside the
scroll area, matching ChatSharingPopover.
@linear-code

linear-code Bot commented Nov 9, 2026

Copy link
Copy Markdown

DEQ-387

@jeremyruppel
jeremyruppel temporarily deployed to main November 9, 2026 21:31 — with GitHub Actions Inactive
@jeremyruppel
jeremyruppel temporarily deployed to main November 9, 2026 21:31 — with GitHub Actions Inactive
@jeremyruppel
jeremyruppel temporarily deployed to main November 9, 2026 21:33 — with GitHub Actions Inactive
@jeremyruppel
jeremyruppel marked this pull request as ready for review November 9, 2026 21:42
@jeremyruppel
jeremyruppel temporarily deployed to main November 9, 2026 21:43 — with GitHub Actions Inactive

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

Clean fix. Deleting the duplicated compact branch is simpler than the code it replaces. I checked in Storybook at 1280px and 320px: the popover has one table named "Shared workspace members and groups", and after scrolling the sticky header stays at the top of the 240px area. DEQ-387 is addressed.

2 should-fix and 2 nits across 4 inline comments, both should-fix in the new stories. Bounced as round 1 on DEQ-387.

Follow-ups filed for problems that predate this PR: DEQ-616 (Share popover dialog has no accessible name) and DEQ-615 (empty actions header and unlabelled loading, error, and disabled tables). Dropped after cross-check: the CD2 comment finding (the comment states a real constraint that stops someone splitting the table again) and the TS2/TS5 findings on the Vitest table-count test (the outcome is non-visual and Pixel can't see it, as you said).

🤖 Generated by Coder Agents on behalf of @chrifro.

shareable_workspace_owners: "everyone",
};

const mockWorkspaceUserAdmin: 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.

Should-fix mockWorkspaceUserAdmin and mockWorkspaceUser copy the fixtures in WorkspaceSharingPageView.stories.tsx:18-32 field for field (Reuse RO1, Tests TS3, FE9)

Could these move to site/src/testHelpers/entities.ts as MockWorkspaceUser and MockWorkspaceUserAdmin, imported by both story files, with the local copies deleted? That's a small change, all under site/.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Done in 8231998. MockWorkspaceUser and MockWorkspaceUserAdmin now live in site/src/testHelpers/entities.ts, and both ShareButton.stories.tsx and WorkspaceSharingPageView.stories.tsx import them. The local copies are deleted.

🤖 Generated by Coder Agents on behalf of @jeremyruppel.

{ key: workspaceACLKey(MockWorkspace.id), data: mockOverflowingACL },
],
},
play: ({ canvasElement }) => openSharing(canvasElement),

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.

Should-fix OverflowingMembers never scrolls, so Pixel never captures the new sticky header (Tests TS1)

At scrollTop 0, a sticky header and a non-sticky one render the same, so a regression in the one new visual state would pass. Your Linear screenshots show the scrolled state, but the story doesn't. Could the play scroll the last row into view after opening, for example by calling scrollIntoView() on the last row?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Done in 8231998. The OverflowingMembers play now scrolls the last row into view, so the story ends at scrollTop 171 of 171 with the header pinned. I confirmed this in Storybook.

🤖 Generated by Coder Agents on behalf of @jeremyruppel.

await userEvent.click(
within(canvasElement).getByRole("button", { name: "Share" }),
);
await screen.findByRole("columnheader", { name: "Member" });

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.

Nit Both queries are seeded, so the findByRole("columnheader") mostly waits for the popover portal (Tests TS1)

That's fine. You could also inline the click into each play and drop openSharing. Neither new story has a loading or read-only (canShareWorkspace: false) variant, which would be cheap to add (TS7).

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Added Loading and ReadOnly stories in 8231998. I kept openSharing, since four stories use it now.

The ReadOnly story surfaced a pre-existing axe scrollable-region-focusable (serious) violation: without row controls, keyboard users couldn't scroll the list. main has the same issue. This PR moves that scroll container, so I fixed it here:

  • Table gets an optional wrapperProps passthrough.
  • WorkspaceSharingForm uses it only when the list is compact and read-only, with tabIndex={0}, role="region", and the table's name.

A Vitest test covers Tab reaching the region, and the ReadOnly play ends with the region focused, so Pixel captures the focus ring. This adds a small new API to a core component, so please flag it if you'd rather coordinate that separately. (ee5ed36)

🤖 Generated by Coder Agents on behalf of @jeremyruppel.

@@ -224,7 +225,9 @@ export const WorkspaceSharingForm: React.FC<WorkspaceSharingFormProps> = ({
);

const tableHeader = (

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.

Nit tableHeader and tableBody are now each used once (Simplicity SD1)

I lowered this from should-fix: the constants already existed, and inlining them would re-indent about 110 unchanged lines, as you said. Fine to leave.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Leaving these as they are, per your note.

🤖 Generated by Coder Agents on behalf of @jeremyruppel.

@chrifro
chrifro marked this pull request as draft November 10, 2026 08:34
…ple-combined

# Conflicts:
#	site/src/modules/workspaces/WorkspaceSharingForm/WorkspaceSharingForm.test.tsx
Share the WorkspaceUser fixtures through testHelpers, scroll the
overflowing story so Pixel captures the sticky header, add loading and
read-only stories, and make the read-only compact list focusable so
keyboard users can scroll it.
@jeremyruppel
jeremyruppel temporarily deployed to main November 10, 2026 14:29 — with GitHub Actions Inactive
@jeremyruppel
jeremyruppel temporarily deployed to main November 10, 2026 14:30 — with GitHub Actions Inactive
@jeremyruppel
jeremyruppel marked this pull request as ready for review November 10, 2026 14:48
@jeremyruppel
jeremyruppel temporarily deployed to main November 10, 2026 14:49 — with GitHub Actions Inactive
@jeremyruppel
jeremyruppel temporarily deployed to main November 10, 2026 14:49 — with GitHub Actions Inactive

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

Round 2 resolves both round-1 findings: the mock users are shared from testHelpers, and OverflowingMembers ends scrolled. I verified in Storybook that the popover renders one labelled table whose sticky header stays pinned and matches the popover background, the read-only list is a focusable named region that End scrolls, and axe reports no table or scrollable-region violations. Vitest, tsc, and biome pass. Nits: in read-only mode the region and the table share the name "Shared workspace members and groups", so screen readers announce it twice; the ReadOnly story's Tab loop stops silently after 10 tries. Follow-ups: added 320px overflow evidence (ShareButton.tsx:33, fixed w-145) to DEQ-539; DEQ-615 and DEQ-616 remain open from round 1.

🤖 Generated by Coder Agents on behalf of @bartekgatzcoder.

@bartekgatzcoder
bartekgatzcoder merged commit 5543b31 into main Nov 10, 2026
41 checks passed
@bartekgatzcoder
bartekgatzcoder deleted the a11y/table-data-multiple-combined branch November 10, 2026 16:30
@bartekgatzcoder
bartekgatzcoder temporarily deployed to main November 10, 2026 16:30 — with GitHub Actions Inactive
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 10, 2026

This branch was previously deployed

1 inactive deployment
main — ee5ed36a Deployed Nov 10, 2026 by bartekgatzcoder via cla #253553
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.

3 participants