Skip to content

feat: add generic toolbar - #559

Merged
IzumiSy merged 4 commits into
mainfrom
feat/core/generic-toolbar
Sep 29, 2026
Merged

IzumiSy merged 4 commits into
mainfrom
feat/core/generic-toolbar

Conversation

@IzumiSy

@IzumiSy IzumiSy commented Sep 28, 2026

Copy link
Copy Markdown
Contributor

Motivation

DataTable.Toolbar combines a layout container with DataTable-specific controls. That leaves its fixed placement model unusable for other list presentations and action bars.

The agreed direction is a generic toolbar that owns layout only. DataTable controls then compose with it like controls from any other feature. The generic API requires an explicit justify="between" for the conventional leading/trailing layout, so the docs and runnable examples provide that canonical scaffold rather than leaving it implicit.

This change provides the migration path; it does not deprecate DataTable.Toolbar yet.

Design Decision

One generic layout primitive

Toolbar.Root stacks Toolbar.Row elements. Toolbar.Group keeps related controls together, Toolbar.Separator divides them, and justify="between" distributes the outer groups across a row.

DataTable composition

DataTable.ColumnSettings is available as a placeable control. When a generic toolbar is a direct child of DataTable.Root, the table owns the outer frame and the toolbar supplies only the divider below its rows.

Keyboard navigation

Buttons, inputs, selects, comboboxes, and tabs automatically register with their containing toolbar row. Plain controls support row-level Arrow/Home/End navigation; composite controls retain their own directional-key behavior.

Summary

  • Add the public Toolbar component, documentation, tests, and a runnable example.
  • Compose generic toolbar layouts with DataTable filters and column settings.
  • Preserve DataTable.Toolbar while documenting Toolbar as the choice for new custom layouts.

@IzumiSy
IzumiSy force-pushed the feat/core/generic-toolbar branch from f765b35 to 2cf963d Compare September 29, 2026 02:13
@IzumiSy
IzumiSy marked this pull request as ready for review September 29, 2026 02:13
@IzumiSy
IzumiSy requested a review from a team as a code owner September 29, 2026 02:13
@IzumiSy
IzumiSy force-pushed the feat/core/generic-toolbar branch from 2cf963d to 467b535 Compare September 29, 2026 03:10
@IzumiSy

IzumiSy commented Sep 29, 2026

Copy link
Copy Markdown
Contributor Author

@copilot fix the CI error by fixing docs.

Co-authored-by: IzumiSy <982850+IzumiSy@users.noreply.github.com>

Copilot AI commented Sep 29, 2026

Copy link
Copy Markdown
Contributor

@copilot fix the CI error by fixing docs.

Fixed in a937622. The DataTable authored docs now describe generic toolbar composition; regenerated outputs and pnpm docs:check pass.

@IzumiSy

IzumiSy commented Sep 29, 2026

Copy link
Copy Markdown
Contributor Author

@copilot Move docs/components/toolbar.md under docs-src to be aligned with other component docs.

Co-authored-by: IzumiSy <982850+IzumiSy@users.noreply.github.com>

Copilot AI commented Sep 29, 2026

Copy link
Copy Markdown
Contributor

@copilot Move docs/components/toolbar.md under docs-src to be aligned with other component docs.

Moved it to the authored source in 89e9de3. docs/components/toolbar.md is now regenerated from docs-src/components/toolbar.docs.outline.md; pnpm docs:check passes.

@IzumiSy
IzumiSy merged commit 820ddb3 into main Sep 29, 2026
8 checks passed
@IzumiSy
IzumiSy deleted the feat/core/generic-toolbar branch September 29, 2026 05:39
itsprade added a commit that referenced this pull request Sep 29, 2026
Brings the prototype up to date with main (58 commits, incl. the generic
Toolbar #559 and the docs-src pipeline #396). main moved every demo page
under pages/showcase/ (#513), so the prototype moves with them, unchanged:
/data-table-selection -> /showcase/data-table-selection, listed in the
sidebar's Showcase group.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
itsprade added a commit that referenced this pull request Sep 29, 2026
…rows are selected

With selectionActions set and at least one row selected, the footer becomes
the bulk-action bar (#1738): the count, the actions, and Clear, with the
footer's own children (usually Pagination) kept alongside. Tables without
selectionActions render exactly as before.

- Built on the generic Toolbar (#559): the bar is a Toolbar.Row, so it gets
  role=toolbar and Arrow/Home/End navigation between its buttons.
- The first three actions render as buttons; the rest collapse into a
  "More actions" menu that opens upward. An action with appliesTo shows its
  eligible count ("Activate (6)") and disables at zero.
- Surface: bg-accent, which stays soft in every theme and both modes. A
  display:contents wrapper re-points --accent and --muted-foreground so hover
  states and secondary text stay visible on the tinted bar.
- Sticky while open, so on a page-scrolling table the bar rides the bottom of
  the viewport until the table's end scrolls into view. The DataTable root
  moves from overflow-hidden to overflow-clip for this: both clip to the
  rounded frame, but hidden also makes the root a scroll container, which
  trapped the sticky footer inside the table.
- Pagination hides its own "N selected" text while the bar is up and shares
  the line with it, dropping to a second line only when it doesn't fit.
- A persistent polite live region announces the count from the first tick;
  when the bar closes with focus inside it, focus returns to the header
  checkbox. Labels in en and ja.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
itsprade added a commit that referenced this pull request Sep 29, 2026
Every typed column can now be edited in place:

- `text` / `link` with `edit.options`: a dropdown of choices. The column
  stores a choice's value and every cell shows its label.
- `badge`: a dropdown whose choices are the same badges; defaults to the
  entries of `typeOptions.badgeLabelMap`, else the enum filter options.
- `date`: a calendar popover (plus a time field for `datetime`), with
  `min` / `max` bounds and Clear unless `required`.

Picks commit straight away through the same `onCommit` / pending /
revert path as typed cells; `validate` can reject a pick with a tooltip.
Tab moves between all editable cells.

Also:
- Date-only "YYYY-MM-DD" values now render as that day in every time
  zone (they showed the previous day west of UTC).
- Navigation no longer relies on ref cleanups, which `Input` and
  `Select.Trigger` drop since #559 merged their refs; cells that left the
  page are skipped.
- Docs, demo (supplier dropdown, status badge dropdown, expected date)
  and changeset updated.

Refs tailor-inc/platform-planning#1750

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

3 participants