Skip to content

Commit 784b89a

Browse files
authored
fix(ui): avoid empty-state flicker on suite detail page (#200)
## Summary `useIndex()`'s `isLoading` wasn't consumed on the suite detail page, so while the index was still loading, `suiteRunsAll` was empty and the "No runs found for this suite" message briefly flashed before the real runs rendered. Now: - While the index is still loading and no runs are available yet → show a spinner. - Once the index has resolved → either render the runs table, or (if genuinely zero runs for the suite) show the empty-state message. ## Test plan - [x] TypeScript + ESLint clean - [ ] Manual: hard-reload a suite detail page, confirm no "No runs found" flash — spinner appears instead until the runs load - [x] Manual: navigate to a suite that has genuinely zero runs, confirm the empty-state message still appears
1 parent 60b338c commit 784b89a

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

ui/src/pages/SuiteDetailPage.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ export function SuiteDetailPage() {
286286
const labelFilters = parseLabelFilters(search.labels)
287287
const { data: suite, isLoading, error, refetch } = useSuite(suiteHash)
288288
const { data: suiteStats, isLoading: suiteStatsLoading } = useSuiteStats(suiteHash)
289-
const { data: index } = useIndex()
289+
const { data: index, isLoading: indexLoading } = useIndex()
290290
const { data: liveRuns } = useLiveRuns()
291291
const [runsPage, setRunsPage] = useState(1)
292292
const [runsPageSize, setRunsPageSize] = useState(DEFAULT_PAGE_SIZE)
@@ -903,7 +903,11 @@ export function SuiteDetailPage() {
903903
</TabList>
904904
<TabPanels className="mt-4">
905905
<TabPanel>
906-
{suiteRunsAll.length === 0 ? (
906+
{indexLoading && suiteRunsAll.length === 0 ? (
907+
<div className="flex justify-center py-8">
908+
<Spinner size="md" />
909+
</div>
910+
) : suiteRunsAll.length === 0 ? (
907911
<p className="py-8 text-center text-sm/6 text-gray-500 dark:text-gray-400">
908912
No runs found for this suite.
909913
</p>

0 commit comments

Comments
 (0)