mirror of
https://github.com/pocket-id/pocket-id.git
synced 2025-12-06 09:13:19 +03:00
[PR #961] feat: pagination improvements #526
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/pocket-id/pocket-id/pull/961
Author: @stonith404
Created: 9/18/2025
Status: 🔄 Open
Base:
main← Head:feat/pagination-improvements📝 Commits (4)
d185be9feat(pagination): persist items per page and remember page on back navigationee3ca8bremember page on back navigation over the UI3b5bfbfmake loading animations smoother if data loads fast5f64126Merge branch 'main' into feat/pagination-improvements📊 Changes
40 files changed (+536 additions, -709 deletions)
View changed files
📝
backend/internal/utils/paging_util.go(+10 -6)📝
frontend/src/lib/components/advanced-table.svelte(+146 -81)📝
frontend/src/lib/components/audit-log-list.svelte(+15 -12)📝
frontend/src/lib/components/signup/signup-token-list-modal.svelte(+3 -20)📝
frontend/src/lib/components/signup/signup-token-modal.svelte(+5 -8)➕
frontend/src/lib/components/ui/skeleton/index.ts(+7 -0)➕
frontend/src/lib/components/ui/skeleton/skeleton.svelte(+17 -0)📝
frontend/src/lib/components/user-group-selection.svelte(+12 -29)📝
frontend/src/lib/services/api-key-service.ts(+11 -13)📝
frontend/src/lib/services/api-service.ts(+6 -8)📝
frontend/src/lib/services/app-config-service.ts(+46 -57)📝
frontend/src/lib/services/audit-log-service.ts(+17 -26)📝
frontend/src/lib/services/custom-claim-service.ts(+6 -6)📝
frontend/src/lib/services/oidc-service.ts(+36 -44)📝
frontend/src/lib/services/user-group-service.ts(+14 -20)📝
frontend/src/lib/services/user-service.ts(+48 -60)📝
frontend/src/lib/services/version-service.ts(+9 -17)📝
frontend/src/lib/services/webauthn-service.ts(+29 -38)📝
frontend/src/routes/settings/+layout.ts(+2 -1)📝
frontend/src/routes/settings/admin/api-keys/+page.svelte(+3 -9)...and 20 more files
📄 Description
This PR introduces several improvements to pagination:
To enable these improvements, data fetching has been moved into the
AdvancedTablecomponents. Previously, fetching was handled at the page level. Although I generally prefer fetching data as high as possible in the component tree, this is no longer possible because only theAdvancedTablecomponent is aware of its pagination state.Additionally, I had to convert all service methods into arrow functions to avoid issues with
thisbinding. For example, consider this code:3b5bfbf183/frontend/src/routes/settings/admin/users/user-list.svelte (L99)If
userService.listwere defined as a regular method, the value ofthisinside the function would refer to theAdvancedTablecomponent instead of theUserServiceinstance. As a result, accessingthis.apiwould throw an error:Cannot read properties of undefined (reading 'get')becausethis.apidoesn’t exist onAdvancedTable.Closes #825
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.