Repository navigation
fix(site/src): render the compact workspace sharing list as one table - #31941
Conversation
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.
chrifro
left a comment
There was a problem hiding this comment.
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 = { |
There was a problem hiding this comment.
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/.
There was a problem hiding this comment.
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), |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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" }); |
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
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:
Tablegets an optionalwrapperPropspassthrough.WorkspaceSharingFormuses it only when the list is compact and read-only, withtabIndex={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 = ( | |||
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Leaving these as they are, per your note.
🤖 Generated by Coder Agents on behalf of @jeremyruppel.
…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.
bartekgatzcoder
left a comment
There was a problem hiding this comment.
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.
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).WorkspaceSharingFormnow renders one labelled table in compact mode too. The header is sticky inside themax-h-60scroll area, matchingChatSharingPopover. 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
Tests: a Vitest regression test asserts that the compact form renders one table holding the header and member rows (it fails on
mainwith two tables). NewShareButtonstories (EmptyACL,Loading,ReadOnly,OverflowingMembers) give Pixel coverage of the compact popover, which had no story.OverflowingMembersends scrolled so the sticky header is captured.workspaceACLKeyis exported so the stories can seed the ACL query, andMockWorkspaceUserandMockWorkspaceUserAdminmove totestHelpersfor 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 onmain). Since this PR moves that container, it now becomes a focusable, named region in that case. This adds an optionalwrapperPropspassthrough to the sharedTableprimitive, with this form as its only caller.Dropped review findings
tableHeaderandtableBodyvariables (SD1): this would re-indent about 110 unchanged lines for no behavior change.Grouping and decision log
table-data-multiple-combinedhas one eligible ticket, DEQ-387, so one PR with one root cause: theisCompactbranch ofWorkspaceSharingFormwrappedtableHeaderandtableBodyin separate<Table>elements.ChatSharingPopoverpattern (one table, sticky header, scroll wrapper onTable'swrapperClassName). Sticky classes go on<thead>once rather than on each cell.aria-labeladded becausesite/AGENTS.mdrequires every table to have one.th-has-data-cells(needs review onmain, on the header-only table): gone.main, 1 on this branch.aria-dialog-nameon the popover,empty-table-headeron the actions column,heading-orderin the empty state, and needs-reviewaria-valid-attr-valueandcolor-contrast(rows below the scroll fold).LoadingandReadOnlystories. TheReadOnlystory exposed the read-only keyboard scrolling gap, fixed withwrapperPropsset 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, theReadOnlyplay ends focused).🤖 Generated by Coder Agents on behalf of @jeremyruppel.