From 5c91613e00e918f1cfbc9a4449fc9ae02c0f33a3 Mon Sep 17 00:00:00 2001 From: shin-core <153108882+shin-core@users.noreply.github.com> Date: Sun, 12 Jul 2026 01:39:31 +1000 Subject: [PATCH] fix(ui): surface shared ErrorState for GapsPanel fetch failures (#3961) --- apps/ui/src/routes/subnets.$netuid.tsx | 107 ++++++++++++------------- 1 file changed, 50 insertions(+), 57 deletions(-) diff --git a/apps/ui/src/routes/subnets.$netuid.tsx b/apps/ui/src/routes/subnets.$netuid.tsx index 5140e49b8..035d2f372 100644 --- a/apps/ui/src/routes/subnets.$netuid.tsx +++ b/apps/ui/src/routes/subnets.$netuid.tsx @@ -1300,74 +1300,67 @@ function CandidatesPanel({ netuid }: { netuid: number }) { } function GapsPanel({ netuid, compact }: { netuid: number; compact?: boolean }) { - const { data: gapsResult, isLoading, error } = useQuery(subnetGapsQuery(netuid)); + // Match the seven sibling tabs on this page: a genuine fetch error surfaces the + // shared red-bordered ErrorState (with retry) via QueryErrorBoundary, rather + // than reusing the success-case EmptyState look. Loading is the Suspense fallback. + return ( + + + }> + + + + + ); +} + +function GapsList({ netuid }: { netuid: number }) { + const { data: gapsResult } = useSuspenseQuery(subnetGapsQuery(netuid)); const gaps = gapsResult?.data; const missing = gaps?.missing_kinds ?? []; const notes = gaps?.gap_notes ?? []; - if (isLoading) { - return ( - - - - ); - } - if (error) { - return ( - - - - ); - } if (missing.length === 0 && notes.length === 0) { return ( - - - + ); } return ( - -
- {missing.length > 0 ? ( -
-
Missing kinds
-
- {missing.map((k) => ( - - {k} - - ))} -
-
- ) : null} - {notes.length > 0 ? ( -
    - {notes.map((n, i) => ( -
  • · {n}
  • +
    + {missing.length > 0 ? ( +
    +
    Missing kinds
    +
    + {missing.map((k) => ( + + {k} + ))} -
- ) : null} -
- Help close these gaps by opening a PR against the public registry repo. +
+ ) : null} + {notes.length > 0 ? ( + + ) : null} +
+ Help close these gaps by opening a PR against the public registry repo.
-
+ ); }