Skip to content

Add an honest freshness label to the subnet page (realtime block tier vs daily metagraph tier) #3376

Description

@JSONbored

Context

apps/ui/src/routes/subnets.$netuid.tsx (ProfileShell, line 194 and line 220) reads exactly one freshness value — meta?.generated_at from subnetProfileQuery (the /api/v1/subnets/{netuid}/profile envelope, a daily registry-build snapshot) — and threads it into the single FreshnessIndicator rendered in SubnetMasthead (apps/ui/src/components/metagraphed/subnet-masthead.tsx:294). That one dot is shown regardless of which tab the user has open, including panels backed by materially fresher, chain-derived queries: subnetEventsQuery (Activity tab, STALE_SHORT, apps/ui/src/lib/metagraphed/queries.ts:2683), MetagraphTableLoader/ValidatorsTableLoader (live metagraph snapshot), and EconomicsPanel (the live KV-tier economics route). Each of those already returns its own res.meta.generated_at independent of the profile snapshot, but nothing in the masthead or tab chrome tells the user "this tab reflects a live/near-realtime chain read" vs. "this tab reflects the last ~6h registry snapshot" — the page silently implies one freshness for everything.

Requirement

Add an honest, per-context freshness label to the subnet detail page that distinguishes the realtime/chain-derived data tier (events, metagraph, validators, live economics) from the daily registry/metagraph-snapshot tier (profile, surfaces, endpoints, candidates), so a viewer can tell which timestamp actually describes what they're looking at. This is a small UI-truthfulness fix, not a new panel or new endpoint — no backend change is required since every relevant query already carries its own generated_at.

Deliverable

  • File(s) to change: apps/ui/src/routes/subnets.$netuid.tsx (ProfileShell, OverviewPanel, ActivityPanel/MetagraphPanel call sites) and apps/ui/src/components/metagraphed/subnet-masthead.tsx (the FreshnessIndicator usage at line 294). Reuse the existing FreshnessIndicator (apps/ui/src/components/metagraphed/freshness.tsx) and formatFreshness/formatFreshnessAbsolute helpers (apps/ui/src/lib/metagraphed/freshness.ts) — do not invent a second formatter.
  • Exact anchor: ProfileShell (subnets.$netuid.tsx:190-280) currently derives stale from meta?.generated_at alone (line 194) and passes only that single value into SubnetMasthead (line 220) and StaleBanner (line 226); SubnetMasthead renders it via the one FreshnessIndicator at subnet-masthead.tsx:294. Tab-scoped panels like ActivityTableLoader (line 476-488) already receive data.meta?.generated_at from their own query but never label it as a different tier from the masthead's stamp.
  • What "done" looks like concretely: each realtime/chain-derived panel (Activity, Metagraph, Validators, Economics) surfaces a short qualifier — e.g. "live chain read" / "realtime" — next to its own freshness stamp, visually distinct from a "daily registry snapshot" qualifier used for the masthead/profile-driven stamp and for Surfaces/Endpoints/Candidates. No new query is added; this only labels timestamps the app already fetches. Reasonable implementation: a small tier prop/variant on FreshnessIndicator (or a thin wrapper) that renders a realtime/daily badge alongside the existing relative-time text, driven by which query's meta.generated_at is being shown.
  • Coordination note: part of the 🎨 Wave 3 — Frontend explorer enrichment (LIVE — 219 issues filed) #2542 Wave 3 tracker alongside sibling items Fetch the subnet-scoped overview artifact in the subnet Overview tab #3346/Fix subnet Evidence tab to fetch the subnet-scoped evidence route #3347/Fix subnet Gaps tab to fetch the subnet-scoped gaps route #3348 (which fetch subnet-scoped Overview/Evidence/Gaps artifacts) — this issue is purely about labeling freshness truthfully on data the page already has; it does not overlap with those routing/fetch fixes.

Acceptance criteria

  • apps/ui/src/routes/subnets.$netuid.tsx and apps/ui/src/components/metagraphed/subnet-masthead.tsx appear in the diff
  • The realtime/chain-derived tabs (Activity, Metagraph, Validators, Economics) render a freshness label that is visibly distinct (copy and/or styling) from the label shown for the daily registry-snapshot tier (masthead, Surfaces, Endpoints, Candidates)
  • The distinction is driven by each panel's own already-fetched meta.generated_at (e.g. subnetEventsQuery's envelope) — no new API call or endpoint is introduced
  • FreshnessIndicator (or a thin wrapper around it) is reused rather than a second freshness component being built from scratch
  • Existing staleness behavior (the stale banner driven by isStaleFreshness) is preserved unchanged for the daily tier
  • apps/ui/src/lib/metagraphed/freshness.test.ts (or an added test alongside it) covers the new tier-labeling logic

Non-goals

Size

Size: S — keep this PR small (aim for ≤10 files / ≤1000 LOC).

Part of #2542.

Metadata

Metadata

Assignees

No one assigned

    Labels

    gittensor:featureGittensor-scored feature linked to a feature issue — scores a 0.25x multiplier.

    Projects

    Status
    Todo

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions