Skip to content

Site Audit hub: empty state flashes while loading; failures and missing brand render as "no audits yet" #613

Closed

Description

@gkhngyk

Problem

The Site Audit hub has no loading state at all. history initializes to [] and the page renders history.length === 0 immediately, so on every visit the "empty state" card flashes first and is then replaced by the real list once the fetch resolves. Two adjacent gaps in the same effect:

  • load failures are swallowed into console.error — the user is left on the (false) empty state with no error or retry;
  • with no active brand the effect returns early and the page again just shows the empty state; the noBrand message only appears as a toast after clicking Run.

Evidence

Suggested fix

Add a loading flag set around the fetch, render Skeleton blocks for the history card while it's true, show a toast + error state (with the empty card suppressed) on failure, and render an explicit "select a brand" state when there is no active brand — matching the sibling pages.

Acceptance criteria

  • No flash of the empty-state card while data is loading.
  • A failed load is visibly an error, not "no audits yet".
  • Without an active brand the page says so instead of showing the generic empty state.

Activity

  1. added
    bug
    good first issue
    on Aug 3, 2026
  2. Pavel-glitch-ui commented on Aug 3, 2026

    @Pavel-glitch-ui

    Hello! Could you let me do this?

  3. gkhngyk commented on Aug 3, 2026

    @gkhngyk
    ContributorAuthor

    Assigned to you — thanks for picking it up! The issue body has file/line pointers for all three gaps (loading flash, swallowed errors, missing brand guard) plus sibling pages to copy the Skeleton and brand-guard patterns from. Feel free to ask here if anything is unclear.

  4. Pavel-glitch-ui commented on Aug 3, 2026

    @Pavel-glitch-ui

    Assigned to you — thanks for picking it up! The issue body has file/line pointers for all three gaps (loading flash, swallowed errors, missing brand guard) plus sibling pages to copy the Skeleton and brand-guard patterns from. Feel free to ask here if anything is unclear.

    It's done. Could you review my fix please

  5. gkhngyk commented on Aug 3, 2026

    @gkhngyk
    ContributorAuthor

    Reviewed — see the comment on #624: the functionality covers everything this issue asked for, and the only blocker is the Prettier check failing on audit/page.tsx. Run yarn format from web/ and push, and it should go green — I'll approve right after.

  6. gkhngyk commented on Aug 8, 2026

    @gkhngyk
    ContributorAuthor

    @Pavel-glitch-ui checking in — are you still working on this? No pressure if plans changed; just let us know either way. If we don't hear back in a few days we'll unassign so someone else can pick it up.

  7. Pavel-glitch-ui commented on Aug 9, 2026

    @Pavel-glitch-ui

    @gkhngyk you've already merged my fix, so I think the issue should be closed.

  8. gkhngyk commented on Aug 9, 2026

    @gkhngyk
    ContributorAuthor

    You're right — #624 merged on Aug 4 and covers all three gaps (skeleton for the loading flash, the error state + card, and the no-brand guard). It just never auto-closed because the PR description didn't carry a Closes #613 line. Closing now — thanks again for the fix, and sorry for the unnecessary ping!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

buggood first issue

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions