Skip to content

fix: show the last page instead of an empty list when the page is out of range - #3711

Merged
AlexAndBear merged 2 commits into
mainfrom
fix/page-clamp
Oct 14, 2026
Merged

AlexAndBear merged 2 commits into
mainfrom
fix/page-clamp

Conversation

@AlexAndBear

@AlexAndBear AlexAndBear commented Oct 12, 2026 •

Copy link
Copy Markdown
Member

Description

  • Pagination: usePagination clamps the page to the last existing one, so a page beyond the end (e.g. after deleting or restoring the items of the last page, or ?page=9) shows the last page instead of an empty list without pagination.
  • Trash bin: the empty state and the "Empty trash bin" button are based on all items instead of the current page.
  • Admin settings spaces list: removed its own route-based "jump to last page" watcher, which the clamp now covers.
  • Admin settings groups list: removed the page reset from the group delete action. It counted all groups instead of the filtered ones; the clamp now shows the last page of the filtered list.

Related Issue

How Has This Been Tested?

  • test environment: unit tests (Vitest)
  • test case 1: usePagination with a page greater than the total returns the last page and its items
  • test case 2: removing the only space of the last page in the admin settings spaces list shows the previous page's spaces
  • test case 3: filtered groups list with 1 group per page on page 2: removing the group there shows the group of page 1

Types of changes

  • Bugfix
  • Enhancement (a change that doesn't break existing code or deployments)
  • Breaking change (a modification that affects current functionality)
  • Technical debt (addressing code that needs refactoring or improvements)
  • Tests (adding or improving tests)
  • Documentation (updates or additions to documentation)
  • Maintenance (like dependency updates or tooling adjustments)

@AlexAndBear
AlexAndBear merged commit 75d4d65 into main Oct 14, 2026
27 checks passed
@AlexAndBear
AlexAndBear deleted the fix/page-clamp branch October 14, 2026 06:58
@openclouders openclouders mentioned this pull request Oct 14, 2026
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

2 participants