Skip to content

feat(toolbar): add a toolbar-end slot for consumer controls - #29

Merged
julien-f merged 1 commit into
mainfrom
toolbar-end-slot
Oct 4, 2026
Merged

julien-f merged 1 commit into
mainfrom
toolbar-end-slot

Conversation

@julien-f

@julien-f julien-f commented Oct 4, 2026

Copy link
Copy Markdown
Member

Why

  • A consumer (steam.isonoe.net) has "Share view" / "Reset view" buttons acting on the table's view state. Today they sit in their own row above the table, which costs ~36 px of height on a phone; the toolbar line is their natural home.
  • The only way to get them there now is appending DOM into .dt-toolbar after mount, which depends on internal markup and breaks silently.
  • Follows Feature request: option to hide the Columns/Sort/Search/Filter toolbar #25's precedent (showSearch/showColumns): a typed, per-adapter toolbar option instead of relying on internal class names.

API

Adapter API
Solid toolbarEnd?: JSXElement on DataTableView/DataTable
React toolbarEnd?: ReactNode on DataTableView/DataTable
Vue #toolbar-end slot (forwarded by <DataTable>)
Vanilla toolbarEnd?: Node | null option + setToolbarEnd(node)
  • Rendered as the last child of the action row, after "Clear all", in a .dt-toolbar-end wrapper (Vue: .dt__toolbar-end), right-aligned (margin-left: auto, dropped to 0 while "Clear all" is shown so the two sit together).
  • Absent (or null/false in React) → no wrapper rendered.
  • Solid uses JSXElement rather than JSX.Element: the latter fails vite:dts's type rollup ("Unable to follow symbol for JSX").
  • Design note in docs/toolbar.md ("Consumer toolbar content").
  • Demos: the persisted-table section of each demo now puts its "Copy share link"/"Reset" controls in the toolbar.

Tests

  • New tests per adapter: rendered as the last child of the action row, absent without content; Solid: built once and follows a reactive value; React: sits after "Clear all" with margin-left: 0, false renders nothing; vanilla: setToolbarEnd adds, replaces and removes the node.
  • npm run test: all pass (core 523, react 338, vue 336, solid 248, vanilla 270).
  • npm run type-check, npm run lint (0 problems), npm run format:check, npm run check:docs, npm run build and size for every package: pass. The four demo apps build.

🤖 Generated with Claude Code

Consumers wanting their own controls on the toolbar line (e.g. "Share
view"/"Reset view" acting on the table's view state) had to put them in
a separate row above the table — costly on a phone — or append DOM into
the internal `.dt-toolbar` after mount, which breaks silently on any
markup change.

Adds a public slot at the end of the toolbar's action row, mirroring how
Solid (JSXElement) and React (ReactNode), Vue's `#toolbar-end` slot, and
vanilla's `toolbarEnd` option plus `setToolbarEnd(node)`. It renders
right-aligned after "Clear all", and no wrapper at all when absent. The
demos' persisted-table section now shows its view controls there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
julien-f added a commit to julien-f/steam-common-games that referenced this pull request Oct 4, 2026
U30 waits on vatesfr/data-table#29 (toolbar slot), U50 on data-table's
own backlog U1 (checkbox names), U11 on its U5 (range bounds) and #30
(presets).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
julien-f added a commit that referenced this pull request Oct 4, 2026
A typed toolbar slot for consumer controls (PR #29, U9).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@julien-f
julien-f merged commit c6cbba4 into main Oct 4, 2026
1 check passed
@julien-f
julien-f deleted the toolbar-end-slot branch October 4, 2026 16:35
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