* refactor: make DataTableProvider framework-agnostic by requiring tableIdentifier
- Remove Next.js usePathname dependency from DataTableProvider
- Make tableIdentifier a required prop instead of optional
- Update all usages to provide explicit tableIdentifier values
- This makes DataTableProvider usable in non-Next.js contexts
Co-Authored-By: eunjae@cal.com <hey@eunjae.dev>
* refactor: use usePathname at usage sites instead of hardcoding tableIdentifier
- Add validation in DataTableProvider for empty/nullish tableIdentifier
- Use usePathname() in Next.js apps to pass pathname as tableIdentifier
- Use descriptive identifiers for non-Next.js package components
- This keeps DataTableProvider framework-agnostic while allowing Next.js apps to use pathname
Co-Authored-By: eunjae@cal.com <hey@eunjae.dev>
* use pathname instead of hard-coded identifiers
* change type of tableIdentifier
* simplify
---------
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2025-10-23 15:32:16 +02:00
Eunjae LeeGitHubDevin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
* refactor: extract bookings list and calendar views with nuqs state management
- Extract list-related code into BookingsListView component
- Create empty BookingsCalendarView component for future implementation
- Add nuqs query param state management for view toggle (defaults to list)
- Update bookings-listing-view to conditionally render views
- No visible changes to users (list view remains default)
Co-Authored-By: eunjae@cal.com <hey@eunjae.dev>
* refactor: move data fetching logic to parent component
- Keep useFilterValue calls, trpc query, columns, flatData, bookingsToday, finalData, and table setup in parent component
- BookingsListView now receives data as props instead of fetching it
- This allows both list and calendar views to share the same data source
Co-Authored-By: eunjae@cal.com <hey@eunjae.dev>
* fix: add customView column back to render booking items
The customView column was inadvertently removed during refactoring. This column is crucial as it renders the actual BookingListItem components, the "today" header, and the "next" header for the bookings list.
Co-Authored-By: eunjae@cal.com <hey@eunjae.dev>
* refactor: rename files for better clarity
- Renamed bookings-listing-view.tsx → bookings-view.tsx (parent view)
- Renamed bookings-list-view.tsx → BookingsList.tsx (list component)
- Renamed bookings-calendar-view.tsx → BookingsCalendar.tsx (calendar component)
- Moved list and calendar components from views/ to components/ directory
- Updated all imports to reflect new structure
This creates a clearer hierarchy where -view is the orchestrator and components are the renderers.
Co-Authored-By: eunjae@cal.com <hey@eunjae.dev>
* clean up implementation
* clean up types
* revert unnecessary changes
* Update packages/features/data-table/GUIDE.md
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
---------
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
2025-10-21 11:09:47 +00:00
Eunjae LeeGitHubDevin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
* docs: add comprehensive DataTable usage guide
- Document DataTableProvider, DataTableWrapper, and DataTable components
- Cover filter system with all filter types and operators
- Explain segment system (system vs user segments)
- Document pagination modes (infinite vs standard)
- Include real-world usage examples from UserListTable, BookingsListingView, MemberList
- Add TypeScript types reference and best practices
Co-Authored-By: eunjae@cal.com <hey@eunjae.dev>
* docs: update DataTable guide to recommend standard pagination
- De-emphasize virtualized rendering and infinite mode
- Position standard pagination as the recommended approach
- Document known issues with infinite loading mode
- Reorder pagination section to prioritize standard mode
- Update best practices to recommend standard pagination
Co-Authored-By: eunjae@cal.com <hey@eunjae.dev>
* docs: add missing DataTable guide topics
- Document getFacetedUniqueValues for faceted filters with real examples
- Add useSegments prop requirement for filter segment enablement
- Enhance server-side filtering documentation with comprehensive patterns
- Include examples from useFacetedUniqueValues and useInsightsRoutingParameters
Co-Authored-By: eunjae@cal.com <hey@eunjae.dev>
* docs: add missing DataTable guide topics
- Document getFacetedUniqueValues for faceted filters with real examples
- Add useSegments prop requirement for filter segment enablement
- Enhance server-side filtering documentation with comprehensive patterns
- Include examples from useFacetedUniqueValues and useInsightsRoutingParameters
- Correct server-side vs client-side filtering rationale
Co-Authored-By: eunjae@cal.com <hey@eunjae.dev>
* docs: enhance DataTable guide with troubleshooting and testing
- Remove duplicate Key Hooks section (lines 783-803)
- Add visual ASCII diagrams for architecture and component hierarchy
- Add comprehensive troubleshooting section with 7 common issues and solutions
- Add testing patterns section with Vitest examples and best practices
- Update table of contents to include new sections
- Maintain existing high-quality documentation standards
Co-Authored-By: eunjae@cal.com <hey@eunjae.dev>
* remove some sections
---------
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>