Replace the single "Online only" toggle on /relays with filter tabs, each showing its own count, so paid/auth/writable are first-class views instead of just inline badges.
Tabs
All · Online · Writable (acceptsEvents) · Paid (requiresPayment) · Auth (requiresAuth) — active tab filters the table; each shows a live count.
Changes
- db
relaysDirectory({filter, sort, limit}): one $facet aggregation returns per-category counts (all/online/writable/paid/auth), the freshest lastChecked, and the filtered+sorted page. filter ∈ those keys (default online).
- server:
/api/relays-directory?filter=…&sort=…&limit=….
- UI: render tabs from
counts; clicking refetches that filter; keep column sort + the freshness caveat. Drop the old toggle.
Acceptance
- Each tab shows the right count and filters the table.
npm test green. Counts are one round-trip.
Replace the single "Online only" toggle on
/relayswith filter tabs, each showing its own count, so paid/auth/writable are first-class views instead of just inline badges.Tabs
All · Online · Writable (
acceptsEvents) · Paid (requiresPayment) · Auth (requiresAuth) — active tab filters the table; each shows a live count.Changes
relaysDirectory({filter, sort, limit}): one$facetaggregation returns per-category counts (all/online/writable/paid/auth), the freshestlastChecked, and the filtered+sorted page.filter∈ those keys (defaultonline)./api/relays-directory?filter=…&sort=…&limit=….counts; clicking refetches that filter; keep column sort + the freshness caveat. Drop the old toggle.Acceptance
npm testgreen. Counts are one round-trip.