Skip to content

Relays page: filter tabs (All/Online/Writable/Paid/Auth) with per-category counts #21

@melvincarvalho

Description

@melvincarvalho

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions