Skip to content

fix(my-space): hide page size selector when table has 20 rows or fewer#3165

Merged
Viczei merged 2 commits intoalphafrom
fix/hide-page-size-selector-when-few-rows
Apr 8, 2026
Merged

fix(my-space): hide page size selector when table has 20 rows or fewer#3165
Viczei merged 2 commits intoalphafrom
fix/hide-page-size-selector-when-few-rows

Conversation

@Viczei
Copy link
Copy Markdown
Contributor

@Viczei Viczei commented Apr 8, 2026

Summary

  • Hide the « Nombre de lignes par page » selector in the my-space declarations table when the total number of rows is ≤ 20 (the option to change page size is irrelevant for small tables).
  • Add a PAGE_SIZE_SELECTOR_THRESHOLD constant for the threshold.
  • Update unit tests to cover both branches (selector hidden ≤ 20, visible > 20).

Closes #3156

Test plan

  • pnpm test — 1062/1062 passed
  • pnpm typecheck — 0 errors
  • pnpm lint:check / pnpm format:check — clean
  • Visual check on review env: small table (≤ 20 rows) hides the selector, large table (> 20 rows) shows it

@Viczei Viczei requested a review from a team as a code owner April 8, 2026 07:52
@revu-bot revu-bot Bot requested a review from revu-bot April 8, 2026 07:52
Copy link
Copy Markdown
Collaborator

@revu-bot revu-bot left a comment

Choose a reason for hiding this comment

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

Review Summary

The PR correctly implements the feature described in issue #3156: hiding the page-size selector when the table has ≤ 20 rows. The logic is straightforward and the tests cover both branches. A few issues worth addressing:

File Lines Severity Issue
DeclarationsSection.tsx ~146 IMPORTANT Threshold is off-by-one: > 20 hides selector at exactly 20 rows but the spec says "≤ 20 rows should hide it" — these are equivalent, but the constant name implies the boundary is inclusive, making > vs >= confusing
DeclarationsSection.tsx ~65–68 IMPORTANT totalRows double-counts: it sums lengths of two already-filtered arrays instead of using declarations.length directly
DeclarationsSection.test.tsx ~155–165 IMPORTANT Missing boundary test at exactly 20 rows — the "does not render" test uses only 3 rows (the default fixture), leaving the boundary value untested
DeclarationsSection.tsx ~146 MINOR Selector is hidden but pageSize state still defaults to 10; if the table later grows past the threshold the first visible page size will be 10 regardless of what was previously selected — this is acceptable but worth noting

Overall the change is clean and well-scoped. The main actionable items are the boundary test gap and the totalRows calculation.

@Viczei Viczei self-assigned this Apr 8, 2026
@Viczei Viczei temporarily deployed to build-review-auto April 8, 2026 08:15 — with GitHub Actions Inactive
@tokenbureau
Copy link
Copy Markdown

tokenbureau Bot commented Apr 8, 2026

@Viczei Viczei merged commit 8a1b6c1 into alpha Apr 8, 2026
15 checks passed
@Viczei Viczei deleted the fix/hide-page-size-selector-when-few-rows branch April 8, 2026 08:38
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.

Nombre de lignes max du tableau dans mon-espace

3 participants