refactor(desktop): migrate workspace leave and ownership transfer onto the design system

Merged
CH
5d ago
+95-106

D22 of the design-system migration (Desktop stack, base feature/desktop-d21-workspace-linear-connections, #3400).

What

  • Settings › Workspace's last section, the way out, is @luke/ui's SettingsSection (untitled, as before), its LEAVE search anchor on a wrapper div, as Members, Invitations and Integrations do.
  • A member's or an admin's leave is a SettingsRow: label "Leave ‹workspace›", the line for what goes as its description, and Leave as the DANGER_OUTLINE Button (replacing toolbar-button bordered-button + data-danger), as Profile's Delete account is since D15.
  • The owner's leave is a SettingsRow saying a handover comes first, with Transfer ownership as the outline Button; with no admin to hand it to, the row says to make one first and offers nothing. The owner of the account's own workspace still sees no leave at all.
  • The handover dialog's New owner is a FormField over the barrel's field Chip (+ ChipName), replacing the window's CompatChip with a class and the hand-rolled .dialog-field. The label now names the chip (for → the chip's id); its aria-label "New owner: ‹name›" is unchanged. The chip's 220px floor is a container (.workspace-heir), not a class on the control.
  • Behaviour is unchanged: the leave and the transfer ask first through ConfirmDialog, the leave names what stays and stops (the reader's automations by name where the service says whose), a refusal stays in the dialog, and Transfer sends WORKSPACE_TRANSFER for the admin chosen (the first unless another is).

Selectors

  • Removed: .dialog-field, .dialog-field-label, .workspace-heir .luke-chip-face > svg:last-child (the field look already puts the chevron at the end), and the page's private RowCopy.
  • .workspace-heir is now the chip's container (grid, min-width: 220px); .leave-consequences moved onto --luke-* tokens.
  • The ../chip import is gone from this page (chip.tsx stays for its other callers).

Visible changes

  • Leave / Transfer ownership use the shared button faces (weight 500), as Delete account and Connect do.
  • The rows' label and description use the label (13/18, 500) and caption (12/16) roles, matching the sections above.
  • The section's card is the shared section's.
  • New owner's label is the label role (13/18, 500, text colour) rather than 12px/600 secondary.
  • The consequences list is set in the body role (13/20, was 12.5px/1.5), the dialog body's size above it, in the muted ink.
  • The dialog's parts now stand at the dialog's own 8px gap: the field and the consequences list lose the extra 12px above them.
  • Below a 380px row, the button drops below the words, per the shared row contract.

Tests

  • workspace-page.test.ts: the three leave tests read a row's line through the file's existing rowWords/ROWS helpers (a new leaveLine) instead of the old row's small and .settings-row. What they assert is unchanged. Everything else passes as is (53/53).
  • No new tests: no user-visible behaviour changed.
  • pnpm check:affected exits 0.

Evidence

Captured on Linux with headless Chrome at 1280×840, animations held still. The real WorkspacePage was rendered in jsdom by a throwaway, uncommitted copy of the page's test, with synthetic workspaces. Its leave section and dialogs were placed in the built desktop stylesheet inside the SettingsPage frame. The small grey captions over each card label the case and are not part of the app.

LightDark
Rows: member/admin; owner with an admin; owner with none
Leave dialog (admin, one automation of theirs named)
Transfer ownership dialog

Not verified on a Mac

  • SF Pro rendering of the rows, the dialog and the chip
  • Leaving or transferring against a live workspace, which only the tests cover
  • The search-result ring landing on the leave section in the real window

🤖 Generated with Claude Code