Skip to content

Area42#105

Merged
f3-jolt merged 5 commits intostagingfrom
area42
Apr 2, 2026
Merged

Area42#105
f3-jolt merged 5 commits intostagingfrom
area42

Conversation

@f3-jolt
Copy link
Copy Markdown
Collaborator

@f3-jolt f3-jolt commented Apr 2, 2026

👋 TL;DR

Adds an Achievements card to region pages showing upcoming PAX milestones (posts, Qs, FNG anniversaries within 14 days), and extends the unified search bar to support filtering inactive regions, AOs, and PAX.

🔎 Details

Achievements Card (src/components/region/AchievementsCard.tsx)

A new card on region pages surfaces approaching milestones for regional leadership to act on:

  • Post milestones — PAX within 5 posts of a threshold (25, 50, 100, 200 … 1000), shown with longevity context from FNG date
  • Q milestones — PAX within 3 Qs of a threshold, shown with Q rate
  • FNG anniversaries — PAX whose F3 anniversary falls within the next 14 days (min 25 region posts to filter very new members)

Scope toggle (Region / Nation) adjusts which post/Q counts determine milestone proximity. Anniversaries are scope-independent.
Type filter tabs (All / Posts / Qs / Anniversaries) narrow the list.

The underlying data is computed in a single BigQuery CTE block added to getPageData in src/lib/bq/regions.ts. Milestone thresholds, anniversary dates, and urgency scores are all derived server-side. Anniversary math uses DATE_ADD (not EXTRACT YEAR) to handle Feb 29 FNG dates safely.

Search Enhancements

  • Include Inactive toggle added to the search modal (src/components/search-modal.tsx) — passes includeInactive=true to the API when enabled
  • /api/search route (src/app/api/search/route.ts) unified into a single searchAll() call backed by src/lib/bq/search.ts, replacing separate per-entity queries
  • searchRegionsByName in src/lib/bq/regions.ts now accepts includeInactive and conditionally omits the is_active = TRUE filter

✅ How to Test

Achievements Card

  1. Navigate to any region page that has active PAX.
  2. Confirm the Achievements card appears below the existing cards.
  3. Toggle the Region / Nation scope — post and Q counts should update; anniversary rows should remain unchanged.
  4. Use the All / Posts / Qs / Anniversaries tabs to filter rows.
  5. For a PAX within 5 posts of a threshold, confirm the row appears with longevity text (e.g., "4 posts away from 50 · PAX for 2 years, 3 months").
  6. For a PAX with an anniversary ≤ 14 days away and ≥ 25 region posts, confirm the anniversary row appears with the correct date and days-until label.

Search — Inactive Toggle

  1. Open the unified search bar (navbar).
  2. Search for a name that belongs to an inactive region or AO.
  3. Confirm the result does not appear by default.
  4. Enable the Include Inactive toggle.
  5. Re-run the same search and confirm the inactive result now appears.

🥜 GIF

lack-of-hustle

@f3-jolt f3-jolt merged commit eb3492d into staging Apr 2, 2026
6 checks passed
@f3-jolt f3-jolt deleted the area42 branch April 2, 2026 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant