Skip to content

docs(floating-actions): add row-selection pattern with DataTable#747

Merged
paanSinghCoder merged 25 commits intomainfrom
docs/floating-actions-datatable
Apr 29, 2026
Merged

docs(floating-actions): add row-selection pattern with DataTable#747
paanSinghCoder merged 25 commits intomainfrom
docs/floating-actions-datatable

Conversation

@paanSinghCoder
Copy link
Copy Markdown
Contributor

@paanSinghCoder paanSinghCoder commented Apr 21, 2026

Screenshot 2026-04-21 at 9 13 53 AM

Summary

  • Adds a "Row selection" section to DataTable docs showing how to integrate FloatingActions with TanStack row selection (leading checkbox column + useDataTable() + dismissible count chip wired to table.resetRowSelection()).
  • Ships a live DataTableSelectionDemo registered in the Demo scope so the pattern is visible in the docs, not just copy-pasted code.
  • Cross-reference added in the FloatingActions docs pointing at the new section.
  • Small DataTable fix: horizontal padding on .toolbar so filter/display controls align with cell content.

Test plan

  • Visit /components/datatable → scroll to "Row selection" — live demo renders, clicking checkboxes updates the "N selected" chip; dismissing clears selection.
  • Visit /components/floating-actions → see cross-reference at "Use with DataTable".
  • Confirm toolbar padding shift looks fine across other DataTable demos.

🤖 Generated with Claude Code

paanSinghCoder and others added 7 commits April 20, 2026 16:03
A floating bar for surfacing contextual actions (bulk-action toolbar,
row hover actions, etc.). Position-agnostic visual primitive with a
matching vertical separator; composes freely with existing Chip, Button,
and IconButton.

- Component source, styles (--rs-shadow-lifted), and tests
- Docs page with preview, bulk-actions, and icon-only demos
- Playground example and examples/page.tsx section

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Keep the component, docs, and playground — the examples/page.tsx
scratch page is out of scope for this PR.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
FloatingActions.Separator now wraps `Separator` from the design system
with `orientation="vertical"` and `size="full"` defaults, instead of
re-implementing a local 1px×16px div. Drops the local `.separator`
CSS class and picks up proper `role="separator"` semantics, size/color
variants, and Base UI behavior for free.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The floating bar is horizontal-only, so the separator is always
vertical. `Omit<..., 'orientation'>` from the prop type and drop the
unused horizontal CSS rule. Scoped `.separator` class overrides the
Separator primitive's size variant to --rs-space-5 per the Figma spec.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds a new "Row selection" section in the DataTable docs showing the
recommended pattern for integrating FloatingActions with TanStack row
selection:
- leading checkbox column wired via row.toggleSelected / getIsSelected
- SelectionBar that reads useDataTable().table.getSelectedRowModel()
- FloatingActions overlay with dismissible count chip
  (onDismiss → table.resetRowSelection)

Ships a live demo (DataTableSelectionDemo) registered in the Demo
scope, plus a cross-reference from the FloatingActions docs. Also
adds matching horizontal padding on DataTable's toolbar so filter /
display controls align with cell content.

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

vercel Bot commented Apr 21, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
apsara Ready Ready Preview, Comment Apr 29, 2026 2:48am

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 21, 2026

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

This pull request introduces a row-selection pattern for the DataTable component across demo, documentation, and utility files. A new DataTableSelectionDemo client component demonstrates how to implement row selection using a non-interactive checkbox column, TanStack selection state, and a conditional SelectionBar that displays selected count and provides dismiss/action controls. The pattern is exported as rowSelectionDemo in demo metadata, integrated into the Demo component scope, and documented in the DataTable guide. Additionally, FloatingActions demos and documentation are refactored to present variants and placement options via tabbed code examples. A minor CSS adjustment updates toolbar padding behavior.

Suggested reviewers

  • rsbh
  • rohanchkrabrty
  • ravisuhag
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: adding a row-selection pattern documentation with DataTable and FloatingActions integration.
Description check ✅ Passed The description is directly related to the changeset, detailing the new row-selection documentation section, live demo component, cross-references, and toolbar padding fix.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
Review rate limit: 0/1 reviews remaining, refill in 60 minutes.

Comment @coderabbitai help to get the list of available commands and usage tips.

Comment thread apps/www/src/content/docs/components/datatable/demo.ts Outdated
@rohanchkrabrty
Copy link
Copy Markdown
Contributor

@paanSinghCoder Also the selection state should be handled internally from the DataTable. Right now the user is supposed to handle the selection model, which is not ideal. Let's think this through separately

cc @ravisuhag

paanSinghCoder and others added 3 commits April 27, 2026 09:06
Introduce variant, side, and align props so the component owns its
positioning instead of pushing it onto consumers. Floating is the
default and pins the bar to the viewport via position: fixed,
mirroring Toast's data-position pattern. Inline preserves the prior
in-flow behaviour for embedded contexts (cards, tables, docs demos).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Replace hand-rolled <div role="toolbar"> with Base UI Toolbar primitive
  to inherit roving focus, arrow-key navigation, and disabled cascade.
- Expose FloatingActions.Group wrapping Toolbar.Group.
- Move Object.assign out of the 'use client' file into a non-client
  index.ts (matches Field/Sidebar precedent), avoiding client/server
  boundary issues. Rename index.tsx -> index.ts (no JSX).
- Trim Anatomy intro to the standard "Import and assemble the
  component:" line used by peer docs.
- Document Separator's size and render props, and the Toolbar
  primitive props (disabled, orientation, loopFocus) on Root.
- Add a scrolling-context demo using transform: translateZ(0) so the
  floating bar is scoped to the demo container instead of the page.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
paanSinghCoder and others added 4 commits April 27, 2026 11:42
# Conflicts:
#	apps/www/src/components/demo/demo.tsx
…preview edges

Wrap each inline demo's bar in a div with paddingBlock so the rendered
preview shows visible breathing room above and below. Inline style keeps
the change scoped to floating-actions demos without leaking into other
component preview areas.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…context demo

- Collapse the separate ### Floating and ### Inline subsections into a
  single ## Variants section with a tabbed demo (matches the sidebar/
  navbar/tabs pattern).
- Floating tab is scoped to a 200px transform: translateZ(0) container
  so the bar pins to that area instead of the docs page.
- Scrolling-context demo: replace 20 dummy rows with a single dashed-
  border placeholder (sidebar precedent), make the scroll wrapper full
  width, drop the inner padding/border so rows go edge to edge.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
paanSinghCoder and others added 2 commits April 27, 2026 13:10
… API

FloatingActions accepts arbitrary children (Apsara Button, IconButton,
Chip, custom components) rather than wrapping them via a registered
Toolbar.Button-style subcomponent, so the Toolbar primitive's disabled
cascade only affected items that happened to register with the
primitive — not the typical children. Documenting it as "cascades to
every focusable item" was misleading.

Omit disabled from both FloatingActionsProps and
FloatingActionsGroupProps. Consumers can disable individual items
explicitly when needed.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…/floating-actions-datatable

# Conflicts:
#	apps/www/src/content/docs/components/floating-actions/index.mdx
Base automatically changed from feat/floating-actions to main April 29, 2026 02:35
# Conflicts:
#	apps/www/src/content/docs/components/floating-actions/demo.ts
#	apps/www/src/content/docs/components/floating-actions/index.mdx
@paanSinghCoder paanSinghCoder merged commit fddcf49 into main Apr 29, 2026
4 of 5 checks passed
@paanSinghCoder paanSinghCoder deleted the docs/floating-actions-datatable branch April 29, 2026 02:50
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.

2 participants