Build — Activity Tab Filters + Cache + Refresh
What Was Added
Name Filter
- Dropdown
<select> auto-populated with unique author names after data loads
- Sorted alphabetically, shows "All authors (N)" as default
- Filtering is instant — re-renders from cached data, no network call
- Count updates: "3 of 12 comments" when filtered, "12 comments" when all
Cache
- First visit: fetches all 28 sections from Firestore (one API call per section)
- Re-visits (switching tabs back): renders instantly from memory — zero network calls
- The
loadActivity function now checks loaded && allComments.length and skips fetch
Refresh Button
- ↻ button next to sort toggle — clears cache, re-fetches all sections
- Shows "..." while loading, re-enables when done
- Resets name filter to "All authors" on refresh
- Prevents double-click with
fetching guard
Files Changed
index.html — CSS for select/refresh, HTML controls, rewritten Activity Engine
Review
Verified
- Name filter dropdown present with onchange handler
- Refresh button present with onclick handler
populateNameFilter() called after every fetch completes
- Cache works:
loadActivity returns cached data on re-visit
refreshActivity clears allComments + loaded flag before re-fetch
- No ID conflicts with existing sort toggles
- CSS styled to match existing sort button aesthetic