feat(waitlist): filter the queue by the Guard's advice

Merged
KM
7d ago
+160-70

What

The waitlist queue on /admin/waitlist gets filters with counts: Guard says let in · Unsure · Guard says reject · Not checked yet. It opens on "let in" and shows the newest 100 in each.

Why: we're backfilling about 840 applications from the old email-only waitlist form (Feb–Nov). The page used to show the oldest 200 pending, so the newest real applications would have dropped off it.

  • admin.pendingApplications takes { verdict } (default approve) and returns { counts, items, pageSize }.
  • Counts come from a groupBy on guardVerdict, and items are filtered by verdict, newest first.
  • Decide some, and the next ones appear.

Verification

  • admin-waitlist tRPC tests: 9 passed, including new tests for filter, order and counts.
  • Full suite and production build: run locally, results below.

Migration

None.

Ask Polylane for an impact assessment of this pull request:

Assess with Polylane


Summary by cubic

Adds verdict filters with counts to the waitlist queue on /admin/waitlist so applications can be reviewed by the Guard's advice, and keeps the filters visible while data loads.

The page previously showed the oldest 200 pending applications, which would have hidden the newest applications while we backfill about 840 from the old email-only form.

  • admin.pendingApplications takes a verdict filter (default approve) and returns { counts, items, pageSize }.
  • Counts come from a groupBy on guardVerdict; items are filtered by verdict, newest first, 100 at a time.
  • A notice appears when more applications match than are currently shown; deciding some makes the next ones appear.
  • Empty states now distinguish between "everything has been checked" and "nothing in this filter".

Bug Fixes

  • Filters stay on screen while the next filter's data loads, so counts don't flash or disappear.

Summary by CodeRabbit

  • New Features
    • Added filters for approving, rejecting, reviewing, or viewing unchecked waitlist applications.
    • Each filter shows its application count, alongside the total number waiting.
    • Added inline loading and error states, with an option to retry after an error.
  • Improvements
    • Applications appear newest first, with up to 100 results per filter. A notice indicates when more applications match than are shown.
    • Empty states clarify whether all applications have been checked or the selected category has no applications.