Skip to content

fix: show persistent error state on audit detail load failure - #678

Merged
gkhngyk merged 3 commits into
ansvisor:mainfrom
BharadwajKanneveti:fix/audit-detail-error-state
Aug 9, 2026
Merged

gkhngyk merged 3 commits into
ansvisor:mainfrom
BharadwajKanneveti:fix/audit-detail-error-state

Conversation

@BharadwajKanneveti

Copy link
Copy Markdown
Contributor

Summary

  • Add persistent error handling to the Site Audit detail page.
  • Display an error card instead of a blank page when loading an audit fails.
  • Add a Retry button that re-runs the existing loadAndPoll flow.
  • Preserve the existing loading and polling behavior for successful audit loads.
  • Surface the server's 404 message ("Audit not found") to the user.

Related issue

Closes #666

Type of change

  • feat — New feature
  • fix — Bug fix
  • chore — Maintenance / dependencies
  • docs — Documentation only
  • refactor — Code change that neither fixes a bug nor adds a feature
  • test — Adding or updating tests

Checklist

@gkhngyk gkhngyk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The core of this is right — error state, the retry card, surfacing the 404 message, and setLoading(true) at the top of loadAndPoll so Retry shows the loading card. Two things before merge:

  1. Unrelated styling change: the timed-out card lost its flex flex-col items-center gap-3 wrapper and the text-sm font-medium on the message — that's a visual change outside this issue's scope. Please restore the original markup there (the () => void loadAndPoll() handler change is fine to keep).

  2. Hardcoded strings: "Couldn't load this audit" and "Retry" are hardcoded, but your own #673 just moved the audit UI onto i18n keys — audit.retry already exists in en.json, so use t('retry') and add a key for the title (e.g. audit.loadFailed).

Happy to approve once those are in.

@gkhngyk

gkhngyk commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Both requested changes are in — the timed-out card styling is restored and the error card is on i18n keys now. One leftover from the merge with main: audit.retry is defined twice in en.json (your new line ~64, plus the one #673 already added at ~96). JSON.parse silently keeps the last one, and CI can't catch it (#683). Please drop the newly added line and rely on the existing key — then this is good to go.

@BharadwajKanneveti
BharadwajKanneveti force-pushed the fix/audit-detail-error-state branch from 563e89a to c93025a Compare August 8, 2026 15:19

@gkhngyk gkhngyk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All feedback addressed — the timed-out card styling is restored, the error card renders from audit.loadFailed / audit.retry, and the duplicate retry key is gone. Solid close on #666. Thanks for the quick turnaround!

@gkhngyk
gkhngyk merged commit 622c8ea into ansvisor:main Aug 9, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Site Audit detail: fetch errors render a blank page with no retry

2 participants