Skip to content

Paginate game activity page#465

Merged
tudddorrr merged 1 commit intodevelopfrom
paginate-game-activity
Feb 18, 2026
Merged

Paginate game activity page#465
tudddorrr merged 1 commit intodevelopfrom
paginate-game-activity

Conversation

@tudddorrr
Copy link
Collaborator

No description provided.

@tudddorrr tudddorrr added the enhancement New feature or request label Feb 18, 2026
@claude
Copy link

claude bot commented Feb 18, 2026

PR Review: Paginate game activity page


🟡 Potential Bugs

Page state not reset on game switch

Activity.tsx uses useState(0) for the page, but this does not reset when activeGame changes. If a user navigates to page 3 of Game A's activity feed and then switches to Game B, the hook fetches page 3 for Game B — which may return an empty list. The user would need to manually click back to page 1.

Fix: add a useEffect to reset on game change:

useEffect(() => {
  setPage(0)
}, [activeGame.id])

🔵 Minor Issues

isLastPage is returned but never used

useGameActivities validates and exposes isLastPage, but Activity.tsx does not destructure it and Pagination does not accept it as a prop (it computes last-page status from count / itemsPerPage internally). This adds an unnecessary field to the Zod schema and the hook return type.

Either remove it from the schema and return value, or pass it to Pagination if it was intended to be used.


No test coverage for pagination rendering

All existing tests respond with count: 3, itemsPerPage: 25, which causes Pagination to return null (since totalPages = 1). There is no test that verifies the pagination UI actually renders when count > itemsPerPage, or that changing the page triggers a new fetch.


Overall the implementation is straightforward and follows existing patterns, but the game-switch page reset and the unused isLastPage field are worth addressing before merge.

@tudddorrr tudddorrr force-pushed the paginate-game-activity branch from 1dd4005 to 95dc5ce Compare February 18, 2026 23:10
@tudddorrr tudddorrr force-pushed the paginate-game-activity branch from 95dc5ce to 13ce67f Compare February 18, 2026 23:11
@tudddorrr tudddorrr merged commit 9439a55 into develop Feb 18, 2026
5 checks passed
@tudddorrr tudddorrr deleted the paginate-game-activity branch February 18, 2026 23:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant