Skip to content

Conversation

@oidt
Copy link
Contributor

@oidt oidt commented Oct 10, 2025

Description

The rows per page on the overview page for example Products you can change it with 10,20,30,40 and 50.
When you change that the URI is changed. #3845

This pull request improves the handling and validation of pagination settings across the dashboard, ensuring a consistent and user-friendly experience. The main focus is on centralizing pagination logic, validating user preferences, and syncing page size settings throughout the application.

Pagination logic and validation improvements:

  • Added a new utility function validatePerPageValue in pagination.ts to ensure that only allowed per-page values are used, defaulting to DEFAULT_PER_PAGE if an invalid value is provided.
  • Updated the DataTablePagination and DataTable components to use ALLOWED_PER_PAGE_VALUES and DEFAULT_PER_PAGE from constants, and to validate and sync pagination state based on user settings and URL parameters.

User settings enhancements:

  • Extended the UserSettings context and provider to include a global itemsPerPage preference, with validation and proper initialization from both local storage and server settings.

Page and table integration:

  • Updated the ListPage component to use the new validated itemsPerPage setting, ensuring consistency between URL parameters, user preferences, and table state. The page change handler now updates the global itemsPerPage instead of per-table settings.

These changes together ensure that pagination is robust, user preferences are respected and validated, and the UI remains consistent across navigation and reloads.

Breaking changes

Not that I know of

Summary by CodeRabbit

  • New Features

    • Persistent user preference for "Rows per page" with validated allowed options and a sensible default.
  • Bug Fixes

    • Validates and bounds page and per-page values to prevent invalid or out-of-range pagination.
    • Keeps pagination state synchronized across UI, URL, and user settings to avoid mismatches.
  • Style

    • More compact "Rows per page" selector and tighter page indicator layout.

@vercel
Copy link

vercel bot commented Oct 10, 2025

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

Project Deployment Preview Updated (UTC)
docs Ready Ready Preview Oct 15, 2025 7:41am

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 10, 2025

Walkthrough

Add pagination constants and validators, validate and bound page/per-page values, persist items-per-page in user settings, and propagate validated per-page values through list pages and table components; UI per-page options and pagination UI sizing are updated to use the new constants.

Changes

Cohort / File(s) Summary
Constants
packages/dashboard/src/lib/constants.ts
Add DEFAULT_PER_PAGE and ALLOWED_PER_PAGE_VALUES exports.
Pagination utilities
packages/dashboard/src/lib/utils/pagination.ts
Add validatePerPageValue(value: number): number and validatePageValue(value: number): number using the new constants.
User settings
packages/dashboard/src/lib/providers/user-settings.tsx
Replace pageSize with itemsPerPage on UserSettings; initialize with DEFAULT_PER_PAGE; validate on load/merge/update; expose setItemsPerPage in context.
Data table core
packages/dashboard/src/lib/components/data-table/data-table.tsx
Compute safe totalPages using DEFAULT_PER_PAGE/totalItems; bound requested page to [1, totalPages]; initialize and synchronize internal pagination state via useEffect.
Data table pagination UI
packages/dashboard/src/lib/components/data-table/data-table-pagination.tsx
Replace hard-coded per-page options with ALLOWED_PER_PAGE_VALUES; update SelectTrigger class to h-8 max-w-20; change page-indicator container to max-w-28; import constants.
Framework list page
packages/dashboard/src/lib/framework/page/list-page.tsx
Use validatePageValue/validatePerPageValue to derive page/itemsPerPage; persist per-page changes via setItemsPerPage.
Shared paginated list
packages/dashboard/src/lib/components/shared/paginated-list-data-table.tsx
Validate page/itemsPerPage at start; use validated values for query keys, take/skip (capped), and DataTable props.
Route tables (multiple components)
packages/dashboard/src/app/routes/.../*-table.tsx
Many table components now import useUserSettings and validatePerPageValue, initialize pageSize from validated settings.itemsPerPage, and call setItemsPerPage(perPage) on page-size change (e.g., collections, customers, products, zones, facets, customer-groups, orders, product variants, etc.).

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor U as User
  participant LP as ListPage
  participant USP as UserSettingsProvider
  participant DT as DataTable
  participant PU as pagination.util

  Note over LP,USP: Initial load
  LP->>USP: request settings (itemsPerPage)
  USP->>PU: validatePerPageValue(itemsPerPage)
  PU-->>USP: validated perPage
  LP->>DT: props { page, itemsPerPage, totalItems }
  DT->>DT: compute totalPages, bound page/pageSize
  DT-->>U: render table with pagination

  Note over U,PU: User changes "Rows per page"
  U->>DT: select perPage option
  DT-->>LP: onPageChange(perPage, page)
  LP->>PU: validatePerPageValue(perPage)
  PU-->>LP: validated perPage
  LP->>USP: setItemsPerPage(validated perPage)
  USP-->>LP: persist + update context
  LP->>DT: updated props (itemsPerPage)
  DT->>DT: sync internal pagination via useEffect
  DT-->>U: re-render with new page size
Loading
sequenceDiagram
  autonumber
  participant SRV as Server settings
  participant USP as UserSettingsProvider
  participant PU as pagination.util

  Note over SRV,USP: Settings hydration/merge
  SRV-->>USP: server-provided settings
  USP->>PU: validatePerPageValue(server.itemsPerPage)
  PU-->>USP: validated itemsPerPage
  USP-->>USP: merge with defaults and local storage (validated)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Pre-merge checks and finishing touches

❌ 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%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The title indicates that this PR fixes dashboard pagination by limiting perPage values and handling page URI changes, which aligns with the key updates to pagination validation and synchronization. It references the relevant context and issue number, making it connected to the changeset. However, the phrasing could be made clearer to reflect the validation and syncing focus.
Description Check ✅ Passed The description includes a comprehensive summary of changes with an issue link, breaks down enhancements under clear headings, and provides a Breaking changes section. It aligns with the repository’s description template even though the optional Screenshots and Checklist sections are not included. Overall, it is mostly complete and informative.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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

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

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
packages/dashboard/src/lib/components/data-table/data-table-pagination.tsx (1)

31-31: Consider testing the max-width constraints.

Changing from fixed widths (w-[70px], w-[100px]) to max-widths (max-w-20, max-w-28) improves responsive behavior but could cause layout shifts if content exceeds the constraint. Verify that text truncation or wrapping works as expected for all supported locales and page sizes.

Also applies to: 44-44

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1ec91d9 and 9158e8a.

📒 Files selected for processing (5)
  • packages/dashboard/src/lib/components/data-table/data-table-pagination.tsx (3 hunks)
  • packages/dashboard/src/lib/components/data-table/data-table.tsx (3 hunks)
  • packages/dashboard/src/lib/framework/page/list-page.tsx (3 hunks)
  • packages/dashboard/src/lib/providers/user-settings.tsx (7 hunks)
  • packages/dashboard/src/lib/utils/pagination.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (4)
packages/dashboard/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/dashboard.mdc)

packages/dashboard/src/**/*.{ts,tsx}: Use TanStack Query (useQuery or useMutation) for data fetching; do not use Apollo Client.
When creating useQuery calls, follow the provided pattern: import { api } from '@/graphql/api.js'; import { graphql } from '@/graphql/graphql.js'; use useQuery with queryKey, staleTime, and queryFn using api.query.
When performing mutations, follow the provided useMutation pattern: use graphql() for the mutation document, api.mutate for mutationFn, and do not pass variables at declaration.

Files:

  • packages/dashboard/src/lib/utils/pagination.ts
  • packages/dashboard/src/lib/components/data-table/data-table.tsx
  • packages/dashboard/src/lib/components/data-table/data-table-pagination.tsx
  • packages/dashboard/src/lib/providers/user-settings.tsx
  • packages/dashboard/src/lib/framework/page/list-page.tsx
packages/dashboard/src/**/*.{tsx,ts}

📄 CodeRabbit inference engine (.cursor/rules/dashboard.mdc)

React component props objects should be typed as Readonly<...>.

Files:

  • packages/dashboard/src/lib/utils/pagination.ts
  • packages/dashboard/src/lib/components/data-table/data-table.tsx
  • packages/dashboard/src/lib/components/data-table/data-table-pagination.tsx
  • packages/dashboard/src/lib/providers/user-settings.tsx
  • packages/dashboard/src/lib/framework/page/list-page.tsx
packages/dashboard/src/**/*.{tsx,jsx}

📄 CodeRabbit inference engine (.cursor/rules/dashboard.mdc)

packages/dashboard/src/**/*.{tsx,jsx}: Use React for all UI components in the dashboard package.
Prefer re-using components from /src/lib/components, especially Shadcn components from /src/lib/components/ui.
Prefer using the FormFieldWrapper component for forms over raw Shadcn components.
All labels or user-facing messages should use localization via the Trans component or useLingui().

Files:

  • packages/dashboard/src/lib/components/data-table/data-table.tsx
  • packages/dashboard/src/lib/components/data-table/data-table-pagination.tsx
  • packages/dashboard/src/lib/providers/user-settings.tsx
  • packages/dashboard/src/lib/framework/page/list-page.tsx
packages/dashboard/src/lib/components/**/*.{tsx,jsx}

📄 CodeRabbit inference engine (.cursor/rules/dashboard.mdc)

Use Shadcn UI and Tailwind CSS for UI components.

Files:

  • packages/dashboard/src/lib/components/data-table/data-table.tsx
  • packages/dashboard/src/lib/components/data-table/data-table-pagination.tsx
🧬 Code graph analysis (3)
packages/dashboard/src/lib/components/data-table/data-table-pagination.tsx (1)
packages/dashboard/src/lib/components/ui/select.tsx (3)
  • SelectTrigger (181-181)
  • SelectValue (182-182)
  • SelectContent (174-174)
packages/dashboard/src/lib/providers/user-settings.tsx (1)
packages/dashboard/src/lib/utils/pagination.ts (1)
  • validatePerPageValue (7-12)
packages/dashboard/src/lib/framework/page/list-page.tsx (1)
packages/dashboard/src/lib/utils/pagination.ts (1)
  • validatePerPageValue (7-12)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (19)
  • GitHub Check: unit tests (24.x)
  • GitHub Check: unit tests (22.x)
  • GitHub Check: build (24.x)
  • GitHub Check: unit tests (20.x)
  • GitHub Check: build (22.x)
  • GitHub Check: build (20.x)
  • GitHub Check: publish_install (macos-latest, 24.x)
  • GitHub Check: publish_install (macos-latest, 22.x)
  • GitHub Check: publish_install (windows-latest, 24.x)
  • GitHub Check: publish_install (macos-latest, 20.x)
  • GitHub Check: publish_install (ubuntu-latest, 22.x)
  • GitHub Check: publish_install (ubuntu-latest, 24.x)
  • GitHub Check: publish_install (ubuntu-latest, 20.x)
  • GitHub Check: publish_install (windows-latest, 20.x)
  • GitHub Check: publish_install (windows-latest, 22.x)
  • GitHub Check: publish_install (ubuntu-latest, 22.x)
  • GitHub Check: publish_install (ubuntu-latest, 24.x)
  • GitHub Check: publish_install (windows-latest, 24.x)
  • GitHub Check: publish_install (windows-latest, 22.x)
🔇 Additional comments (7)
packages/dashboard/src/lib/components/data-table/data-table-pagination.tsx (1)

7-7: LGTM! Centralized per-page values.

The use of ALLOWED_PER_PAGE_VALUES from constants ensures consistency across pagination components and aligns with the PR's goal of standardizing pagination behavior.

Also applies to: 35-39

packages/dashboard/src/lib/framework/page/list-page.tsx (1)

490-490: LGTM! Global itemsPerPage now persisted.

The change from per-table settings to a global itemsPerPage preference via setItemsPerPage ensures consistent pagination across all list pages, which aligns with the PR objectives.

Also applies to: 568-568

packages/dashboard/src/lib/components/data-table/data-table.tsx (2)

125-134: LGTM! Safe pagination with bounds checking.

The safe page calculation ensures the requested page stays within [1, totalPages], preventing invalid pagination states. The initialization with safePage and validated pageSize is correct.


184-195: LGTM! Pagination state synchronized with props.

The useEffect correctly syncs internal pagination state when safePage or pageSize changes, ensuring the table reflects validated prop-driven pagination values. The dependency array is correct to avoid infinite loops.

packages/dashboard/src/lib/utils/pagination.ts (1)

1-12: LGTM! Centralized pagination validation.

The validatePerPageValue utility provides consistent validation across all pagination-related components. The type cast as (typeof ALLOWED_PER_PAGE_VALUES)[number] is necessary for TypeScript's type narrowing and the fallback to DEFAULT_PER_PAGE ensures robustness.

packages/dashboard/src/lib/providers/user-settings.tsx (2)

30-30: LGTM! ItemsPerPage integrated into user settings.

The addition of itemsPerPage to the UserSettings interface, default settings, and context type is consistent with the existing settings structure and supports the PR's goal of global pagination preferences.

Also applies to: 45-45, 66-66


90-95: LGTM! Consistent validation across all settings paths.

validatePerPageValue is correctly applied when loading from localStorage (lines 90-95), merging server settings (lines 157-164), and updating via setItemsPerPage (line 228), ensuring itemsPerPage always contains a valid value regardless of the source.

Also applies to: 157-164, 228-228

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (2)
packages/dashboard/src/lib/framework/page/list-page.tsx (1)

28-28: Remove unused import.

The DEFAULT_PER_PAGE constant is imported but not used anywhere in this file. After addressing the previous review comment that removed the redundant ?? DEFAULT_PER_PAGE fallback, this import became unnecessary.

Apply this diff:

-import { DEFAULT_PER_PAGE } from '@/vdb/constants.js';
packages/dashboard/src/lib/providers/user-settings.tsx (1)

83-83: Wrap component props in Readonly.

Per coding guidelines, React component props objects should be typed as Readonly<...>.

As per coding guidelines

Apply this diff:

-export const UserSettingsProvider: React.FC<UserSettingsProviderProps> = ({ queryClient, children }) => {
+export const UserSettingsProvider: React.FC<Readonly<UserSettingsProviderProps>> = ({ queryClient, children }) => {
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9158e8a and 50b9904.

📒 Files selected for processing (3)
  • packages/dashboard/src/lib/constants.ts (1 hunks)
  • packages/dashboard/src/lib/framework/page/list-page.tsx (3 hunks)
  • packages/dashboard/src/lib/providers/user-settings.tsx (8 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
packages/dashboard/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/dashboard.mdc)

packages/dashboard/src/**/*.{ts,tsx}: Use TanStack Query (useQuery or useMutation) for data fetching; do not use Apollo Client.
When creating useQuery calls, follow the provided pattern: import { api } from '@/graphql/api.js'; import { graphql } from '@/graphql/graphql.js'; use useQuery with queryKey, staleTime, and queryFn using api.query.
When performing mutations, follow the provided useMutation pattern: use graphql() for the mutation document, api.mutate for mutationFn, and do not pass variables at declaration.

Files:

  • packages/dashboard/src/lib/constants.ts
  • packages/dashboard/src/lib/providers/user-settings.tsx
  • packages/dashboard/src/lib/framework/page/list-page.tsx
packages/dashboard/src/**/*.{tsx,ts}

📄 CodeRabbit inference engine (.cursor/rules/dashboard.mdc)

React component props objects should be typed as Readonly<...>.

Files:

  • packages/dashboard/src/lib/constants.ts
  • packages/dashboard/src/lib/providers/user-settings.tsx
  • packages/dashboard/src/lib/framework/page/list-page.tsx
packages/dashboard/src/**/*.{tsx,jsx}

📄 CodeRabbit inference engine (.cursor/rules/dashboard.mdc)

packages/dashboard/src/**/*.{tsx,jsx}: Use React for all UI components in the dashboard package.
Prefer re-using components from /src/lib/components, especially Shadcn components from /src/lib/components/ui.
Prefer using the FormFieldWrapper component for forms over raw Shadcn components.
All labels or user-facing messages should use localization via the Trans component or useLingui().

Files:

  • packages/dashboard/src/lib/providers/user-settings.tsx
  • packages/dashboard/src/lib/framework/page/list-page.tsx
🧬 Code graph analysis (2)
packages/dashboard/src/lib/providers/user-settings.tsx (2)
packages/dashboard/src/lib/constants.ts (1)
  • DEFAULT_PER_PAGE (19-19)
packages/dashboard/src/lib/utils/pagination.ts (1)
  • validatePerPageValue (7-12)
packages/dashboard/src/lib/framework/page/list-page.tsx (1)
packages/dashboard/src/lib/utils/pagination.ts (1)
  • validatePerPageValue (7-12)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (20)
  • GitHub Check: e2e tests (20.x, postgres)
  • GitHub Check: codegen / codegen
  • GitHub Check: unit tests (24.x)
  • GitHub Check: unit tests (20.x)
  • GitHub Check: build (24.x)
  • GitHub Check: build (22.x)
  • GitHub Check: build (20.x)
  • GitHub Check: publish_install (ubuntu-latest, 24.x)
  • GitHub Check: publish_install (windows-latest, 22.x)
  • GitHub Check: publish_install (ubuntu-latest, 22.x)
  • GitHub Check: publish_install (macos-latest, 22.x)
  • GitHub Check: publish_install (windows-latest, 24.x)
  • GitHub Check: publish_install (ubuntu-latest, 24.x)
  • GitHub Check: publish_install (ubuntu-latest, 20.x)
  • GitHub Check: publish_install (windows-latest, 24.x)
  • GitHub Check: publish_install (windows-latest, 22.x)
  • GitHub Check: publish_install (macos-latest, 24.x)
  • GitHub Check: publish_install (windows-latest, 20.x)
  • GitHub Check: publish_install (macos-latest, 20.x)
  • GitHub Check: publish_install (ubuntu-latest, 22.x)
🔇 Additional comments (6)
packages/dashboard/src/lib/constants.ts (1)

16-21: LGTM! Well-defined pagination constants.

The constants are appropriately scoped and the as const assertion on ALLOWED_PER_PAGE_VALUES ensures type safety by creating a readonly tuple with literal types.

packages/dashboard/src/lib/framework/page/list-page.tsx (2)

493-497: Pagination logic is well-validated and safe.

The validation approach correctly handles edge cases:

  • Number.parseInt returning NaN is safely handled by validatePerPageValue
  • Route parameters take precedence over user settings
  • Fallback to user settings ensures a valid value is always used

568-568: Global itemsPerPage persistence aligns with PR objectives.

The change from per-table settings to global setItemsPerPage ensures consistent pagination behavior across all list pages, as intended by the PR.

packages/dashboard/src/lib/providers/user-settings.tsx (3)

89-94: Validation is correctly applied during localStorage initialization.

The validatePerPageValue ensures that even if corrupted or outdated data exists in localStorage, only valid per-page values are loaded into the application state.


157-163: Server settings merge handles validation properly.

The validation during server settings merge ensures consistency between client and server state, preventing invalid values from propagating through the system.


227-227: Setter applies validation at the right boundary.

Validating in the setter function ensures that no invalid values can be persisted, regardless of the caller's input.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 50b9904 and 72769bc.

📒 Files selected for processing (1)
  • packages/dashboard/src/lib/framework/page/list-page.tsx (3 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
packages/dashboard/src/**/*.{tsx,jsx}

📄 CodeRabbit inference engine (.cursor/rules/dashboard.mdc)

packages/dashboard/src/**/*.{tsx,jsx}: Use React for all UI components in the dashboard package.
Prefer re-using components from /src/lib/components, especially Shadcn components from /src/lib/components/ui.
Prefer using the FormFieldWrapper component for forms over raw Shadcn components.
All labels or user-facing messages should use localization via the Trans component or useLingui().

Files:

  • packages/dashboard/src/lib/framework/page/list-page.tsx
packages/dashboard/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/dashboard.mdc)

packages/dashboard/src/**/*.{ts,tsx}: Use TanStack Query (useQuery or useMutation) for data fetching; do not use Apollo Client.
When creating useQuery calls, follow the provided pattern: import { api } from '@/graphql/api.js'; import { graphql } from '@/graphql/graphql.js'; use useQuery with queryKey, staleTime, and queryFn using api.query.
When performing mutations, follow the provided useMutation pattern: use graphql() for the mutation document, api.mutate for mutationFn, and do not pass variables at declaration.

Files:

  • packages/dashboard/src/lib/framework/page/list-page.tsx
packages/dashboard/src/**/*.{tsx,ts}

📄 CodeRabbit inference engine (.cursor/rules/dashboard.mdc)

React component props objects should be typed as Readonly<...>.

Files:

  • packages/dashboard/src/lib/framework/page/list-page.tsx
🧬 Code graph analysis (1)
packages/dashboard/src/lib/framework/page/list-page.tsx (1)
packages/dashboard/src/lib/utils/pagination.ts (1)
  • validatePerPageValue (7-12)
🔇 Additional comments (2)
packages/dashboard/src/lib/framework/page/list-page.tsx (2)

492-494: LGTM! Past issue resolved.

The redundant fallback has been removed, and both branches correctly use validatePerPageValue. The validation function handles invalid input (including NaN) by returning DEFAULT_PER_PAGE, ensuring itemsPerPage is always a valid number.


567-567: LGTM! Centralized pagination preference.

Calling setItemsPerPage(perPage) for all page changes correctly centralizes the per-page preference at the global level, aligning with the PR's goal to ensure pagination is validated, consistent, and synchronized across navigation and reloads.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
packages/dashboard/src/lib/utils/pagination.ts (1)

18-23: Consider removing redundant NaN check.

The function correctly validates page numbers and handles edge cases. However, the !Number.isNaN(value) check is redundant because Number.isFinite(value) already returns false for NaN.

Apply this diff to simplify:

 export function validatePageValue(value: number): number {
-    if (Number.isFinite(value) && !Number.isNaN(value) && value >= 1 && Number.isInteger(value)) {
+    if (Number.isFinite(value) && value >= 1 && Number.isInteger(value)) {
         return value;
     }
     return 1;
 }
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 72769bc and 4a953ed.

📒 Files selected for processing (2)
  • packages/dashboard/src/lib/framework/page/list-page.tsx (3 hunks)
  • packages/dashboard/src/lib/utils/pagination.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
packages/dashboard/src/**/*.{tsx,jsx}

📄 CodeRabbit inference engine (.cursor/rules/dashboard.mdc)

packages/dashboard/src/**/*.{tsx,jsx}: Use React for all UI components in the dashboard package.
Prefer re-using components from /src/lib/components, especially Shadcn components from /src/lib/components/ui.
Prefer using the FormFieldWrapper component for forms over raw Shadcn components.
All labels or user-facing messages should use localization via the Trans component or useLingui().

Files:

  • packages/dashboard/src/lib/framework/page/list-page.tsx
packages/dashboard/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/dashboard.mdc)

packages/dashboard/src/**/*.{ts,tsx}: Use TanStack Query (useQuery or useMutation) for data fetching; do not use Apollo Client.
When creating useQuery calls, follow the provided pattern: import { api } from '@/graphql/api.js'; import { graphql } from '@/graphql/graphql.js'; use useQuery with queryKey, staleTime, and queryFn using api.query.
When performing mutations, follow the provided useMutation pattern: use graphql() for the mutation document, api.mutate for mutationFn, and do not pass variables at declaration.

Files:

  • packages/dashboard/src/lib/framework/page/list-page.tsx
  • packages/dashboard/src/lib/utils/pagination.ts
packages/dashboard/src/**/*.{tsx,ts}

📄 CodeRabbit inference engine (.cursor/rules/dashboard.mdc)

React component props objects should be typed as Readonly<...>.

Files:

  • packages/dashboard/src/lib/framework/page/list-page.tsx
  • packages/dashboard/src/lib/utils/pagination.ts
🧬 Code graph analysis (2)
packages/dashboard/src/lib/framework/page/list-page.tsx (1)
packages/dashboard/src/lib/utils/pagination.ts (2)
  • validatePerPageValue (7-12)
  • validatePageValue (18-23)
packages/dashboard/src/lib/utils/pagination.ts (1)
packages/dashboard/src/lib/constants.ts (2)
  • ALLOWED_PER_PAGE_VALUES (20-20)
  • DEFAULT_PER_PAGE (19-19)
🔇 Additional comments (7)
packages/dashboard/src/lib/framework/page/list-page.tsx (5)

20-20: LGTM!

The import statement correctly brings in the validation utilities needed for pagination handling.


492-494: LGTM!

The itemsPerPage calculation correctly validates both the URL parameter and the user settings fallback. The validation handles invalid input (including NaN from Number.parseInt) by returning DEFAULT_PER_PAGE.


496-496: LGTM!

The page calculation correctly validates the URL parameter using validatePageValue, which handles invalid input (including NaN, negative values, and non-integers) by returning 1.


500-501: LGTM!

The pagination object correctly uses the validated page and itemsPerPage values.


566-569: LGTM!

The onPageChange handler correctly persists the pagination state to the URL and updates the global itemsPerPage setting. This change aligns with the PR objective to centralize pagination handling across the dashboard.

packages/dashboard/src/lib/utils/pagination.ts (2)

1-1: LGTM!

The import statement correctly brings in the pagination constants needed for validation.


7-12: LGTM!

The function correctly validates that the per-page value is in the allowed list, defaulting to DEFAULT_PER_PAGE for invalid values (including NaN). The type assertion is necessary for the includes check to work with the const array type.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4a953ed and 5fc3e31.

📒 Files selected for processing (10)
  • packages/dashboard/src/app/routes/_authenticated/_collections/components/collection-contents-preview-table.tsx (3 hunks)
  • packages/dashboard/src/app/routes/_authenticated/_collections/components/collection-contents-table.tsx (3 hunks)
  • packages/dashboard/src/app/routes/_authenticated/_customer-groups/components/customer-group-members-table.tsx (3 hunks)
  • packages/dashboard/src/app/routes/_authenticated/_customers/components/customer-order-table.tsx (2 hunks)
  • packages/dashboard/src/app/routes/_authenticated/_facets/components/facet-values-table.tsx (3 hunks)
  • packages/dashboard/src/app/routes/_authenticated/_products/components/product-options-table.tsx (3 hunks)
  • packages/dashboard/src/app/routes/_authenticated/_products/components/product-variants-table.tsx (3 hunks)
  • packages/dashboard/src/app/routes/_authenticated/_zones/components/zone-countries-table.tsx (3 hunks)
  • packages/dashboard/src/lib/components/shared/paginated-list-data-table.tsx (6 hunks)
  • packages/dashboard/src/lib/utils/pagination.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (6)
packages/dashboard/src/**/*.{tsx,jsx}

📄 CodeRabbit inference engine (.cursor/rules/dashboard.mdc)

packages/dashboard/src/**/*.{tsx,jsx}: Use React for all UI components in the dashboard package.
Prefer re-using components from /src/lib/components, especially Shadcn components from /src/lib/components/ui.
Prefer using the FormFieldWrapper component for forms over raw Shadcn components.
All labels or user-facing messages should use localization via the Trans component or useLingui().

Files:

  • packages/dashboard/src/app/routes/_authenticated/_collections/components/collection-contents-table.tsx
  • packages/dashboard/src/lib/components/shared/paginated-list-data-table.tsx
  • packages/dashboard/src/app/routes/_authenticated/_products/components/product-options-table.tsx
  • packages/dashboard/src/app/routes/_authenticated/_customer-groups/components/customer-group-members-table.tsx
  • packages/dashboard/src/app/routes/_authenticated/_customers/components/customer-order-table.tsx
  • packages/dashboard/src/app/routes/_authenticated/_products/components/product-variants-table.tsx
  • packages/dashboard/src/app/routes/_authenticated/_collections/components/collection-contents-preview-table.tsx
  • packages/dashboard/src/app/routes/_authenticated/_zones/components/zone-countries-table.tsx
  • packages/dashboard/src/app/routes/_authenticated/_facets/components/facet-values-table.tsx
packages/dashboard/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/dashboard.mdc)

packages/dashboard/src/**/*.{ts,tsx}: Use TanStack Query (useQuery or useMutation) for data fetching; do not use Apollo Client.
When creating useQuery calls, follow the provided pattern: import { api } from '@/graphql/api.js'; import { graphql } from '@/graphql/graphql.js'; use useQuery with queryKey, staleTime, and queryFn using api.query.
When performing mutations, follow the provided useMutation pattern: use graphql() for the mutation document, api.mutate for mutationFn, and do not pass variables at declaration.

Files:

  • packages/dashboard/src/app/routes/_authenticated/_collections/components/collection-contents-table.tsx
  • packages/dashboard/src/lib/components/shared/paginated-list-data-table.tsx
  • packages/dashboard/src/app/routes/_authenticated/_products/components/product-options-table.tsx
  • packages/dashboard/src/app/routes/_authenticated/_customer-groups/components/customer-group-members-table.tsx
  • packages/dashboard/src/app/routes/_authenticated/_customers/components/customer-order-table.tsx
  • packages/dashboard/src/app/routes/_authenticated/_products/components/product-variants-table.tsx
  • packages/dashboard/src/lib/utils/pagination.ts
  • packages/dashboard/src/app/routes/_authenticated/_collections/components/collection-contents-preview-table.tsx
  • packages/dashboard/src/app/routes/_authenticated/_zones/components/zone-countries-table.tsx
  • packages/dashboard/src/app/routes/_authenticated/_facets/components/facet-values-table.tsx
packages/dashboard/src/app/routes/**/*.tsx

📄 CodeRabbit inference engine (.cursor/rules/dashboard.mdc)

Use TanStack Router for all routing and navigation in the dashboard app.

Files:

  • packages/dashboard/src/app/routes/_authenticated/_collections/components/collection-contents-table.tsx
  • packages/dashboard/src/app/routes/_authenticated/_products/components/product-options-table.tsx
  • packages/dashboard/src/app/routes/_authenticated/_customer-groups/components/customer-group-members-table.tsx
  • packages/dashboard/src/app/routes/_authenticated/_customers/components/customer-order-table.tsx
  • packages/dashboard/src/app/routes/_authenticated/_products/components/product-variants-table.tsx
  • packages/dashboard/src/app/routes/_authenticated/_collections/components/collection-contents-preview-table.tsx
  • packages/dashboard/src/app/routes/_authenticated/_zones/components/zone-countries-table.tsx
  • packages/dashboard/src/app/routes/_authenticated/_facets/components/facet-values-table.tsx
packages/dashboard/src/app/routes/**

📄 CodeRabbit inference engine (.cursor/rules/dashboard.mdc)

Do not create new directories or files in /src/app/routes/ that do not fit the pattern: route files (except those in /components, /hooks, or ending with .graphql.ts).

Files:

  • packages/dashboard/src/app/routes/_authenticated/_collections/components/collection-contents-table.tsx
  • packages/dashboard/src/app/routes/_authenticated/_products/components/product-options-table.tsx
  • packages/dashboard/src/app/routes/_authenticated/_customer-groups/components/customer-group-members-table.tsx
  • packages/dashboard/src/app/routes/_authenticated/_customers/components/customer-order-table.tsx
  • packages/dashboard/src/app/routes/_authenticated/_products/components/product-variants-table.tsx
  • packages/dashboard/src/app/routes/_authenticated/_collections/components/collection-contents-preview-table.tsx
  • packages/dashboard/src/app/routes/_authenticated/_zones/components/zone-countries-table.tsx
  • packages/dashboard/src/app/routes/_authenticated/_facets/components/facet-values-table.tsx
packages/dashboard/src/**/*.{tsx,ts}

📄 CodeRabbit inference engine (.cursor/rules/dashboard.mdc)

React component props objects should be typed as Readonly<...>.

Files:

  • packages/dashboard/src/app/routes/_authenticated/_collections/components/collection-contents-table.tsx
  • packages/dashboard/src/lib/components/shared/paginated-list-data-table.tsx
  • packages/dashboard/src/app/routes/_authenticated/_products/components/product-options-table.tsx
  • packages/dashboard/src/app/routes/_authenticated/_customer-groups/components/customer-group-members-table.tsx
  • packages/dashboard/src/app/routes/_authenticated/_customers/components/customer-order-table.tsx
  • packages/dashboard/src/app/routes/_authenticated/_products/components/product-variants-table.tsx
  • packages/dashboard/src/lib/utils/pagination.ts
  • packages/dashboard/src/app/routes/_authenticated/_collections/components/collection-contents-preview-table.tsx
  • packages/dashboard/src/app/routes/_authenticated/_zones/components/zone-countries-table.tsx
  • packages/dashboard/src/app/routes/_authenticated/_facets/components/facet-values-table.tsx
packages/dashboard/src/lib/components/**/*.{tsx,jsx}

📄 CodeRabbit inference engine (.cursor/rules/dashboard.mdc)

Use Shadcn UI and Tailwind CSS for UI components.

Files:

  • packages/dashboard/src/lib/components/shared/paginated-list-data-table.tsx
🧠 Learnings (1)
📚 Learning: 2025-07-23T07:05:04.344Z
Learnt from: CR
PR: vendure-ecommerce/vendure#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-23T07:05:04.344Z
Learning: Applies to packages/dashboard/src/**/*.{ts,tsx} : When creating useQuery calls, follow the provided pattern: import { api } from '@/graphql/api.js'; import { graphql } from '@/graphql/graphql.js'; use useQuery with queryKey, staleTime, and queryFn using api.query.

Applied to files:

  • packages/dashboard/src/app/routes/_authenticated/_customer-groups/components/customer-group-members-table.tsx
🧬 Code graph analysis (10)
packages/dashboard/src/app/routes/_authenticated/_collections/components/collection-contents-table.tsx (1)
packages/dashboard/src/lib/utils/pagination.ts (1)
  • validatePerPageValue (7-12)
packages/dashboard/src/lib/components/shared/paginated-list-data-table.tsx (1)
packages/dashboard/src/lib/utils/pagination.ts (2)
  • validatePageValue (18-23)
  • validatePerPageValue (7-12)
packages/dashboard/src/app/routes/_authenticated/_products/components/product-options-table.tsx (1)
packages/dashboard/src/lib/utils/pagination.ts (1)
  • validatePerPageValue (7-12)
packages/dashboard/src/app/routes/_authenticated/_customer-groups/components/customer-group-members-table.tsx (1)
packages/dashboard/src/lib/utils/pagination.ts (1)
  • validatePerPageValue (7-12)
packages/dashboard/src/app/routes/_authenticated/_customers/components/customer-order-table.tsx (1)
packages/dashboard/src/lib/utils/pagination.ts (1)
  • validatePerPageValue (7-12)
packages/dashboard/src/app/routes/_authenticated/_products/components/product-variants-table.tsx (2)
packages/dashboard/src/lib/hooks/use-local-format.ts (1)
  • useLocalFormat (27-175)
packages/dashboard/src/lib/utils/pagination.ts (1)
  • validatePerPageValue (7-12)
packages/dashboard/src/lib/utils/pagination.ts (1)
packages/dashboard/src/lib/constants.ts (2)
  • ALLOWED_PER_PAGE_VALUES (20-20)
  • DEFAULT_PER_PAGE (19-19)
packages/dashboard/src/app/routes/_authenticated/_collections/components/collection-contents-preview-table.tsx (1)
packages/dashboard/src/lib/utils/pagination.ts (1)
  • validatePerPageValue (7-12)
packages/dashboard/src/app/routes/_authenticated/_zones/components/zone-countries-table.tsx (1)
packages/dashboard/src/lib/utils/pagination.ts (1)
  • validatePerPageValue (7-12)
packages/dashboard/src/app/routes/_authenticated/_facets/components/facet-values-table.tsx (1)
packages/dashboard/src/lib/utils/pagination.ts (1)
  • validatePerPageValue (7-12)
🪛 Biome (2.1.2)
packages/dashboard/src/app/routes/_authenticated/_facets/components/facet-values-table.tsx

[error] 8-8: Shouldn't redeclare 'useUserSettings'. Consider to delete it or rename it.

'useUserSettings' is defined here:

(lint/suspicious/noRedeclare)


[error] 43-43: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (20)
  • GitHub Check: e2e tests (20.x, mysql)
  • GitHub Check: e2e tests (20.x, mariadb)
  • GitHub Check: e2e tests (20.x, postgres)
  • GitHub Check: build (20.x)
  • GitHub Check: unit tests (22.x)
  • GitHub Check: unit tests (20.x)
  • GitHub Check: build (22.x)
  • GitHub Check: publish_install (ubuntu-latest, 24.x)
  • GitHub Check: publish_install (ubuntu-latest, 22.x)
  • GitHub Check: publish_install (windows-latest, 24.x)
  • GitHub Check: publish_install (windows-latest, 22.x)
  • GitHub Check: publish_install (macos-latest, 24.x)
  • GitHub Check: publish_install (macos-latest, 20.x)
  • GitHub Check: publish_install (windows-latest, 24.x)
  • GitHub Check: publish_install (ubuntu-latest, 22.x)
  • GitHub Check: publish_install (ubuntu-latest, 20.x)
  • GitHub Check: publish_install (macos-latest, 22.x)
  • GitHub Check: publish_install (ubuntu-latest, 24.x)
  • GitHub Check: publish_install (windows-latest, 20.x)
  • GitHub Check: publish_install (windows-latest, 22.x)
🔇 Additional comments (16)
packages/dashboard/src/app/routes/_authenticated/_collections/components/collection-contents-preview-table.tsx (1)

6-7: LGTM - Pagination persistence correctly implemented.

The changes properly integrate validated per-page settings from the user context. The pattern of initializing with validatePerPageValue(settings.itemsPerPage) and persisting via setItemsPerPage(perPage) aligns with the PR's goal of centralizing pagination validation.

Also applies to: 42-42, 45-45, 112-112

packages/dashboard/src/app/routes/_authenticated/_collections/components/collection-contents-table.tsx (1)

5-6: LGTM - Consistent pagination handling.

The implementation correctly follows the established pattern for validated per-page persistence.

Also applies to: 34-34, 37-37, 70-70

packages/dashboard/src/app/routes/_authenticated/_products/components/product-options-table.tsx (1)

5-6: LGTM - Per-page persistence correctly integrated.

The validated pagination initialization and persistence align with the PR's centralized approach.

Also applies to: 38-38, 41-41, 61-61

packages/dashboard/src/app/routes/_authenticated/_customers/components/customer-order-table.tsx (1)

9-10: LGTM - Pagination validation properly applied.

The changes integrate validated user settings for per-page values as intended.

Also applies to: 17-17, 19-19, 84-84

packages/dashboard/src/app/routes/_authenticated/_zones/components/zone-countries-table.tsx (1)

12-13: LGTM - Validated pagination integrated.

The implementation correctly follows the per-page persistence pattern.

Also applies to: 33-33, 35-35, 64-64

packages/dashboard/src/app/routes/_authenticated/_customer-groups/components/customer-group-members-table.tsx (1)

10-11: LGTM - Per-page handling properly implemented.

The validated pagination initialization and persistence are correctly applied.

Also applies to: 47-47, 50-50, 83-83

packages/dashboard/src/app/routes/_authenticated/_products/components/product-variants-table.tsx (1)

18-19: LGTM - Pagination persistence correctly added.

The changes properly integrate validated per-page settings and persistence.

Also applies to: 32-32, 35-35, 108-108

packages/dashboard/src/app/routes/_authenticated/_facets/components/facet-values-table.tsx (1)

43-43: LGTM after fixing the duplicate hook call.

Once the duplicate useUserSettings() call is resolved, the pagination validation and persistence logic will work correctly.

Also applies to: 73-73

packages/dashboard/src/lib/utils/pagination.ts (2)

7-12: LGTM! Clear validation logic.

The function correctly validates that the per-page value is in the allowed list and falls back to the default when invalid. The type assertion for TypeScript narrowing is appropriate.


18-23: LGTM! Robust page validation.

The validation correctly checks for finite numbers, positive values, and integers. Returning 1 as the default is the right choice for invalid page numbers.

packages/dashboard/src/lib/components/shared/paginated-list-data-table.tsx (6)

19-19: LGTM! Correct import.

The validation utilities are properly imported for use in pagination validation.


402-411: LGTM! Clean filter construction.

The filter construction logic correctly handles both single values and arrays, mapping them to the appropriate filter format. The _and wrapper ensures multiple filters are combined correctly.


450-451: LGTM! Consistent use of validated values in query key.

Using validated pagination values in the query key ensures cache consistency and prevents issues with invalid values affecting query caching.


464-465: LGTM! Validated values used correctly in query variables.

The validated pagination values are properly used for take (with a sensible 100 cap) and skip calculation. This ensures the backend receives valid pagination parameters.


490-491: LGTM! DataTable receives validated pagination state.

Passing validated values to the DataTable ensures the UI displays the correct pagination state consistent with the query and prevents rendering issues from invalid values.


383-385: Verify parent pagination state synchronization
The table’s validatePageValue and validatePerPageValue guard its display, but parent state may still hold invalid inputs. Confirm that:

  • ListPage and other parents sanitize incoming page/itemsPerPage props and call their state setters with the validated values
  • Their onPageChange handlers propagate the corrected page and itemsPerPage back to parent state
  • URL query parameters are updated to match the sanitized pagination values

@sonarqubecloud
Copy link

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
packages/dashboard/src/app/routes/_authenticated/_facets/components/facet-values-table.tsx (1)

67-73: Consider defensive validation of perPage before persistence.

While the perPage value is likely already validated by the parent component and/or the setItemsPerPage function, wrapping it with validatePerPageValue would add an extra layer of robustness consistent with the PR's validation goals.

                onPageChange={(table, page, perPage) => {
                    if (pageId) {
                        setPageSize(perPage);
                        setPage(page);
-                       setItemsPerPage(perPage);
+                       setItemsPerPage(validatePerPageValue(perPage));
                    }
                }}
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5fc3e31 and 372ad91.

📒 Files selected for processing (1)
  • packages/dashboard/src/app/routes/_authenticated/_facets/components/facet-values-table.tsx (3 hunks)
🧰 Additional context used
📓 Path-based instructions (5)
packages/dashboard/src/**/*.{tsx,jsx}

📄 CodeRabbit inference engine (.cursor/rules/dashboard.mdc)

packages/dashboard/src/**/*.{tsx,jsx}: Use React for all UI components in the dashboard package.
Prefer re-using components from /src/lib/components, especially Shadcn components from /src/lib/components/ui.
Prefer using the FormFieldWrapper component for forms over raw Shadcn components.
All labels or user-facing messages should use localization via the Trans component or useLingui().

Files:

  • packages/dashboard/src/app/routes/_authenticated/_facets/components/facet-values-table.tsx
packages/dashboard/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/dashboard.mdc)

packages/dashboard/src/**/*.{ts,tsx}: Use TanStack Query (useQuery or useMutation) for data fetching; do not use Apollo Client.
When creating useQuery calls, follow the provided pattern: import { api } from '@/graphql/api.js'; import { graphql } from '@/graphql/graphql.js'; use useQuery with queryKey, staleTime, and queryFn using api.query.
When performing mutations, follow the provided useMutation pattern: use graphql() for the mutation document, api.mutate for mutationFn, and do not pass variables at declaration.

Files:

  • packages/dashboard/src/app/routes/_authenticated/_facets/components/facet-values-table.tsx
packages/dashboard/src/app/routes/**/*.tsx

📄 CodeRabbit inference engine (.cursor/rules/dashboard.mdc)

Use TanStack Router for all routing and navigation in the dashboard app.

Files:

  • packages/dashboard/src/app/routes/_authenticated/_facets/components/facet-values-table.tsx
packages/dashboard/src/app/routes/**

📄 CodeRabbit inference engine (.cursor/rules/dashboard.mdc)

Do not create new directories or files in /src/app/routes/ that do not fit the pattern: route files (except those in /components, /hooks, or ending with .graphql.ts).

Files:

  • packages/dashboard/src/app/routes/_authenticated/_facets/components/facet-values-table.tsx
packages/dashboard/src/**/*.{tsx,ts}

📄 CodeRabbit inference engine (.cursor/rules/dashboard.mdc)

React component props objects should be typed as Readonly<...>.

Files:

  • packages/dashboard/src/app/routes/_authenticated/_facets/components/facet-values-table.tsx
🧬 Code graph analysis (1)
packages/dashboard/src/app/routes/_authenticated/_facets/components/facet-values-table.tsx (1)
packages/dashboard/src/lib/utils/pagination.ts (1)
  • validatePerPageValue (7-12)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (20)
  • GitHub Check: e2e tests (22.x, mariadb)
  • GitHub Check: e2e tests (20.x, sqljs)
  • GitHub Check: e2e tests (20.x, mariadb)
  • GitHub Check: unit tests (24.x)
  • GitHub Check: build (20.x)
  • GitHub Check: unit tests (22.x)
  • GitHub Check: build (22.x)
  • GitHub Check: publish_install (macos-latest, 22.x)
  • GitHub Check: publish_install (ubuntu-latest, 22.x)
  • GitHub Check: publish_install (windows-latest, 24.x)
  • GitHub Check: publish_install (macos-latest, 20.x)
  • GitHub Check: publish_install (ubuntu-latest, 24.x)
  • GitHub Check: publish_install (windows-latest, 20.x)
  • GitHub Check: publish_install (macos-latest, 24.x)
  • GitHub Check: publish_install (ubuntu-latest, 20.x)
  • GitHub Check: publish_install (windows-latest, 22.x)
  • GitHub Check: publish_install (ubuntu-latest, 22.x)
  • GitHub Check: publish_install (ubuntu-latest, 24.x)
  • GitHub Check: publish_install (windows-latest, 22.x)
  • GitHub Check: publish_install (windows-latest, 24.x)
🔇 Additional comments (2)
packages/dashboard/src/app/routes/_authenticated/_facets/components/facet-values-table.tsx (2)

6-8: Past duplicate import issue has been resolved.

The duplicate import of useUserSettings mentioned in previous reviews has been successfully fixed.


39-42: Past duplicate useUserSettings() call issue has been resolved.

The code now correctly uses a single useUserSettings() call and properly initializes pageSize with the validated per-page value. No variable shadowing or redeclaration issues remain.

@michaelbromley
Copy link
Member

Hi,
Since you made this PR, I added some extra logic to limit the max items per page that will be fetched.

Do you want to bring this PR up to date with current master?

One thing I notice is that it looks like you move the perPage from the table-specific setting into a global value. Is that right? What's the idea behind that?

@oidt
Copy link
Contributor Author

oidt commented Oct 27, 2025

I’ll look into that.

The perPage global setting was more my own expected behavior. When I change it on one place to 25 I expected it to be 25 everywhere. I don’t usually spend much time in dashboards like this, so if the per-table setup is the intended behavior, that makes sense. Let me know.

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