Skip to content

Add pagination and sorting to the Activity log page #252

Description

@Lakes41

Difficulty: Intermediate
Type: Feature

Background
The /activity route renders the audit/activity log sourced from mock data and, per the README, live webhook-driven events (member.joined, member.left, pass.activated, pass.expired, guild.updated). As the log grows, rendering the full list in one page becomes impractical and doesn't reflect how a real, long-running guild's activity feed would behave.

Problem
The activity list currently has no pagination or sorting controls. There's no way to jump to older events, control page size, or sort by event type/date, so the page will not scale past a small number of mock entries and gives a poor preview of real production behavior.

Expected outcome
The /activity page supports cursor- or offset-based pagination (Next/Previous or "Load more"), plus sorting by timestamp (newest/oldest) and optional filtering by event type. Pagination state should be reflected in the URL (query params) so links are shareable and refresh-safe.

Suggested implementation

  • Add pagination params to the activity data-fetching function/API route (e.g. ?page=, ?pageSize=, ?sort=).
  • Update the mock data layer to slice/sort results server-side rather than returning the full array to the client.
  • Add UI controls (page size selector, next/prev buttons, sort dropdown) using existing Tailwind patterns.
  • Keep this compatible with both DASHBOARD_STORAGE_MODE=mock and future durable mode by keeping the pagination contract in the API route, not baked into the mock array directly.

Acceptance criteria

  • /activity no longer renders the entire mock dataset in a single unpaginated list.
  • Pagination and sort selections persist across a page refresh via the URL.
  • Loading, error, and empty states are handled for the paginated view (per repo's PR quality expectations).
  • pnpm --filter @guildpass/dashboard test and pnpm typecheck pass.
  • New/updated tests cover pagination boundaries (first page, last page, empty result set).

Likely affected files/directories
apps/dashboard/app/activity/, apps/dashboard/lib/mock-data.ts, apps/dashboard/app/api/activity/ (or equivalent API route), associated component/test files.

Metadata

Metadata

Assignees

Labels

GrantFox OSSGrantFox Open Source Sponsorship program tagMaybe RewardedIssue may qualify for a reward upon successful completion per campaign rulesOfficial Campaign | FWC26Official FWC26 campaign issue — eligible for campaign scoring and rewardsdashboardAutomatically createdenhancementNew feature or requestgood first issueGood for newcomers

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions