feat: add pageSize persistence to ControlledDataTable #174

Closed
opened 2026-04-05 17:02:00 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @LaurenceJJones on 3/1/2026

Community Contribution License Agreement

By creating this pull request, I grant the project maintainers an unlimited,
perpetual license to use, modify, and redistribute these contributions under any terms they
choose, including both the AGPLv3 and the Fossorial Commercial license terms. I
represent that I have the right to grant this license for all contributed content.

Description

  • ControlledDataTable now persists pageSize to localStorage (default: true)
  • Refactored DataTable to use shared storage hooks
  • Exported getStoredPageSize/setStoredPageSize from useStoredPageSize
  • Exported getStoredColumnVisibility/setStoredColumnVisibility from useStoredColumnVisibility
  • Unified storage key format: datatable-{tableId}-page-size, datatable-{tableId}-column-visibility

How to test?

Page sizes or column visibility across data-table and controlled-data-table are now using the same hooks for persistence to local storage, this ensures storage naming schemes across the tables stay consistent, instead of each component owning the process. When altering the page size or column visibility on any data table this should be stored within local storage to ensure navigating away or coming back stays consistent.

The only issue we will have that previous data-table local storage items will be stale and not used since the newer scheme was datatable-${tableid} prefix, let me know if we should handle an automatic migration?

*Originally created by @LaurenceJJones on 3/1/2026* ## Community Contribution License Agreement By creating this pull request, I grant the project maintainers an unlimited, perpetual license to use, modify, and redistribute these contributions under any terms they choose, including both the AGPLv3 and the Fossorial Commercial license terms. I represent that I have the right to grant this license for all contributed content. ## Description - ControlledDataTable now persists pageSize to localStorage (default: true) - Refactored DataTable to use shared storage hooks - Exported getStoredPageSize/setStoredPageSize from useStoredPageSize - Exported getStoredColumnVisibility/setStoredColumnVisibility from useStoredColumnVisibility - Unified storage key format: datatable-{tableId}-page-size, datatable-{tableId}-column-visibility ## How to test? Page sizes or column visibility across data-table and controlled-data-table are now using the same hooks for persistence to local storage, this ensures storage naming schemes across the tables stay consistent, instead of each component owning the process. When altering the page size or column visibility on any data table this should be stored within local storage to ensure navigating away or coming back stays consistent. The only issue we will have that previous data-table local storage items will be stale and not used since the newer scheme was `datatable-${tableid}` prefix, let me know if we should handle an automatic migration?
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/pangolin#174