Skip to content

Conversation

@luizhf42
Copy link
Member

This pull request introduces a user preference feature that allows the number of items displayed per page in various data tables to be persisted on a per-table basis using localStorage. This ensures that when users revisit a table, their preferred items-per-page setting is retained. The implementation is integrated across both admin and user-facing tables, and comprehensive tests have been added to verify the new behavior.

  • Added a new composable, useTablePreference, which provides getItemsPerPage and setItemsPerPage functions to store and retrieve the user's preferred items-per-page for each table using localStorage. This includes robust error handling for localStorage failures.
  • Updated the DataTable component to accept a new optional tableName prop. When provided, the component loads the initial items-per-page value from localStorage and persists any changes to it.
  • Passed the new table-name prop to all relevant table components (e.g., SessionList, DeviceList, UserList, FirewallRulesList, etc.), both in the admin and user interfaces, with unique names for each table. [
  • Added a dedicated test suite for the new persistence logic in DataTable.spec.ts, covering loading from localStorage, saving changes, and error handling.
  • Updated relevant test snapshots to reflect the addition of the table-name prop and minor changes in the rendered markup.

@luizhf42 luizhf42 self-assigned this Dec 15, 2025
@luizhf42 luizhf42 added the kind/feature New feature or request label Dec 15, 2025
@luizhf42 luizhf42 requested a review from a team as a code owner December 15, 2025 20:59
@gustavosbarreto gustavosbarreto merged commit 47eb88a into master Dec 15, 2025
16 checks passed
@gustavosbarreto gustavosbarreto deleted the feat/persistent-items-per-page branch December 15, 2025 21:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants