Skip to content

feat(data-table): sticky columns, column settings, and accessible row navigation#382

Draft
itsprade wants to merge 4 commits into
mainfrom
feat/data-table-columns-and-row-nav
Draft

feat(data-table): sticky columns, column settings, and accessible row navigation#382
itsprade wants to merge 4 commits into
mainfrom
feat/data-table-columns-and-row-nav

Conversation

@itsprade

Copy link
Copy Markdown
Contributor

Summary

Adds column controls and accessible row navigation to DataTable, driven by the "too many columns / constant scroll-right to reach the View button" feedback in platform-planning#1489.

  • Pinned/sticky columnspin: "left" | "right" on a Column (requires width). Selection auto-pins left, row-actions auto-pins right, with a scroll-aware freeze shadow that only appears once content scrolls under the edge.
  • DataTable.ColumnSettings — a "Columns" toolbar popover with three drop zones (Fixed left / Scrollable / Fixed right): show/hide via checkboxes, drag to reorder, and drag between zones to pin/unpin.
  • Persisted column layout — pass a stable tableId to persist each user's visibility/order/pinning to localStorage (per-user preference; not URL). Omit for in-memory only.
  • rowHref — accessible whole-row navigation. The primary cell renders as a real <Link> (keyboard/SR reachable, cmd/middle-click → new tab); the whole row is still clickable. Replaces per-row "View" buttons. onClickRow retained for non-navigation side effects.
  • Table.Root gains an optional containerRef.

Docs (docs/components/data-table.md), the catalogue skill (list-dense-scan, components.md → regenerated app-shell-patterns), a demo DataTable Lab page, tests, and a minor changeset are included.

Try it

Run pnpm devDataTable Lab in the sidebar. Scroll a table horizontally to see pinned columns + freeze shadow; open Columns to drag/pin/hide; click a row to navigate.

🙋 Open question for the team (persistence)

Column layout is currently persisted to localStorage per tableId — treated as a per-user preference, deliberately not in the URL like filters/sort/pagination. Before we commit to this, I'd like to align:

  • Is column layout a user-level setting (localStorage / eventually a user-prefs backend) or an app/URL-level setting (shareable, like filters)?
  • If user-level, should it eventually move from localStorage to a persisted user-settings store rather than the browser?

The current localStorage approach is good enough for the prototype; flagging so we pick the long-term direction intentionally.

Notes / follow-ups (not in this PR)

  • Keyboard reorder/pin: ColumnSettings reorder + pin are drag-only (mouse). Deferred per discussion; visibility checkboxes remain keyboard-accessible.
  • The hand-built dashboard/orders example still uses a "View" button — separate cleanup.

🤖 Generated with Claude Code

… navigation

Adds three DataTable capabilities driven by the "too many columns / hard to
reach the View button" feedback (platform-planning#1489):

- Pinned/sticky columns via `pin: "left" | "right"` (selection auto-pins left,
  row-actions auto-pins right) with a scroll-aware freeze shadow.
- `DataTable.ColumnSettings` popover: show/hide, drag-reorder, and pin columns
  by dragging between Fixed left / Scrollable / Fixed right zones.
- Per-user column layout (visibility, order, pinning) persisted to localStorage
  via a new `tableId` option.
- `rowHref` for accessible whole-row navigation (primary cell as a real <Link>),
  replacing per-row "View" buttons; `onClickRow` kept for non-navigation.

Also: `Table.Root` gains an optional `containerRef`; docs, catalogue skill, and
a demo lab page updated; changeset added.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@itsprade itsprade requested a review from a team as a code owner July 13, 2026 09:28
itsprade and others added 3 commits July 13, 2026 15:27
…e dragging

The insertion line was a flow element, so inserting it shifted the rows under
the cursor, which recomputed the drop target on every reflow — a flicker loop.
Draw the indicator as an inset box-shadow on the row instead (no reflow), and
remove the inter-row gap so the end-of-section handler no longer fires as the
cursor passes between rows. Empty zones get a dashed placeholder.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Hovering a column's checkbox shows "Hide column" (when visible) or
"Show column" (when hidden). Adds showColumn/hideColumn i18n keys (en + ja).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@itsprade itsprade marked this pull request as draft July 13, 2026 10:39
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