Skip to content

feat(ui): TableView component aligned with React-Spectrum S2#18

Merged
MatchaScript merged 2 commits into
mainfrom
feat/table-view
May 11, 2026
Merged

feat(ui): TableView component aligned with React-Spectrum S2#18
MatchaScript merged 2 commits into
mainfrom
feat/table-view

Conversation

@MatchaScript
Copy link
Copy Markdown
Owner

Summary

Adds a TableView component with a markup-compositional API mirroring React-Spectrum S2 (<TableView.Root> / Header / Body / Column / Row / Cell).

  • Selection / sort / column visibility / filters with controlled / uncontrolled lock-in. Once a consumer passes a defined value, the component stays controlled for its lifetime.
  • 2D keyboard navigation via a pure-function TableKeyboardDelegate: row mode, cell mode (ArrowRight to enter, ArrowLeft / Esc to exit), and column-header mode. Page Up / Down, Home / End, typeahead all follow RAC semantics.
  • Per-column filter menu (text / number / enum) anchored to the column header via CSS anchor positioning.
  • Linked rows with a stretched <a>::after so cmd / middle / right-click context-menu and SvelteKit client-side nav all flow through a real anchor.
  • Loading / empty states and onLoadMore infinite scroll.
  • Live-region announcements for selection / sort / filter changes through the shared announcer utility.
  • Focus styling centralised on the root to match S2's cellFocus (2 px focus ring, 6 px corner radius); row leading-edge accent rendered as a real element inside the leading cell so it survives Svelte's per-component CSS scope hashing.

Test plan

  • Storybook stories cover basic, selection (single / multiple), sort, link rows, column hide / filter, loading / empty states, density and quiet variants
  • Keyboard: Tab into table, ArrowDown / Up between rows, ArrowRight enters cell mode, ArrowLeft / Esc leaves, ArrowUp from first row escapes to column header, Page Up / Down, Home / End, typeahead, Space toggles selection, Enter activates onAction / link, Ctrl/Cmd+A selects all
  • Screen reader announcements fire on selection / sort / filter (NVDA + VoiceOver)
  • Focus ring appears on cells, column headers, checkbox cell + header in both selection modes and on tables without a checkbox column
  • Linked rows: cmd / middle / right-click and Enter all open the link; checkbox column still selects without navigating

🤖 Generated with Claude Code

- Markup-compositional API (Root / Header / Body / Column / Row / Cell).
  Columns and rows register on mount via context; no data-via-props
  alternative.
- Selection (none / single / multiple) and sort with controlled /
  uncontrolled lock-in. Once a consumer passes a defined value the
  component stays controlled for its lifetime — sort cycling (asc → desc →
  undefined) and other state cycles can't quietly fall back to internal
  state on later clicks.
- 2D keyboard nav via a pure-function TableKeyboardDelegate. Row mode,
  cell mode (ArrowRight to enter, ArrowLeft / Esc to exit), and
  column-header mode (ArrowDown into the cell grid, Enter / Space to
  toggle sort). Page Up / Down, Home / End, typeahead all follow RAC
  semantics.
- Column visibility and per-column filters via a chevron-anchored menu.
  Filter UI dispatches on filterType: text (contains), number (between),
  enum (in). Filter state participates in the same controlled /
  uncontrolled lock-in.
- Linked rows render a stretched `<a>::after` over the rowheader cell,
  so cmd / middle / right-click context-menu and SvelteKit client-side
  nav all flow through a real anchor. `linkBehavior='override'` — plain
  click on a linked row does not toggle selection.
- Loading / empty states (loading, loadingMore, renderEmptyState
  snippet) and onLoadMore infinite scroll via a 50 px threshold.
- Live-region announcements for selection / sort / filter changes piped
  through the shared announcer utility.
- Focus styling centralised on `<TableView.Root>` to match S2's
  cellFocus (2 px focus-ring inset -2, 6 px border-radius). Row
  leading-edge accent rendered as a real element inside the leading
  cell so it survives Svelte's CSS scope hashing across components.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 11, 2026

Open in StackBlitz

npm i https://pkg.pr.new/@matchalatte/ssp-color-editor@18
npm i https://pkg.pr.new/@matchalatte/ssp-theme@18
npm i https://pkg.pr.new/@matchalatte/ssp-ui@18

commit: 3bcbe2c

@MatchaScript MatchaScript merged commit b351298 into main May 11, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant