-
Notifications
You must be signed in to change notification settings - Fork 2
Implement new DataTable #77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
BREAKING CHANGE: DataTable has been completely rewritten
|
Caution Review failedThe pull request is closed. WalkthroughThe DataTable component undergoes architectural refactoring from an inline React Table implementation to a store-based, context-driven design. Zustand store management centralizes table state; modular sub-components handle head, body, controls, pagination, and empty states. Test infrastructure updates remove global zustand mocking. DestructiveActionDialog and RowActionsDropdown components are removed. Changes
Sequence DiagramsequenceDiagram
participant App as Application
participant DT as DataTable
participant Store as DataTableStore<br/>(Zustand)
participant Ctx as DataTableContext
participant Controls as DataTableControls
participant Head as DataTableHead
participant Body as DataTableBody
participant Hooks as Custom Hooks
App->>DT: Render with props
DT->>Store: createDataTableStore(params)
DT->>Ctx: Provide store context
Ctx->>Controls: Render (with context)
Ctx->>Head: Render (with context)
Ctx->>Body: Render (with context)
Controls->>Hooks: useDataTableStore()
Hooks->>Store: Read globalFilter, setGlobalFilter
Controls->>Controls: Render SearchBar + Toggles
Head->>Hooks: useDataTableHandle('headerGroups')
Hooks->>Store: Access memoized headerGroups
Head->>Head: Render headers with sticky pins
Body->>Hooks: useDataTableHandle('rows')
Hooks->>Store: Access memoized rows
Body->>Body: Render rows with cells
Controls->>Store: Update global filter on search
Store->>Store: Invalidate memoized handles
Hooks-->>Head: Re-derive headerGroups
Hooks-->>Body: Re-derive rows
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Poem
✨ Finishing touches
📜 Recent review detailsConfiguration used: Organization UI Review profile: CHILL Plan: Pro ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (23)
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. Comment |
|
🎉 This PR is included in version 5.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Summary by CodeRabbit
Release Notes
New Features
Refactor
Tests
Chores
✏️ Tip: You can customize this high-level summary in your review settings.