Frontend: terms & authorities lists silently swallow load failures (no loading/error state) #31

Closed
opened 2026-06-04 07:43:31 +00:00 by logaritmisk · 0 comments
Owner

Context

In Milestone 4 the vocabulary list (web/src/vocab/vocabulary-list.tsx) renders all three list states — loading, error (vocab.loadError), and empty. But the two sibling lists do not:

  • Terms list (web/src/vocab/vocabulary-terms.tsx) — renders empty + data only; on a failed useTerms query it shows the empty state, silently hiding the error.
  • Authorities list (web/src/authorities/authorities-page.tsx) — same: empty + data only. The authorities.loadError i18n key is defined in both en/sv but never rendered (dead key as a result).

So a backend/network failure on these two lists looks identical to "no data yet" — misleading for an admin tool.

Ask

  • Add isLoading / isError branches to the terms list and the authorities list, matching the vocab-list pattern (reuse vocab.loadError / authorities.loadError).
  • Consider a shared list-state helper to avoid a third copy of the loading/empty/error ladder (the create-form + dual-alert idiom is already shared; the list-state ladder could be too).
  • The vocab list's loading state is a bare glyph — consider a <Skeleton> for consistency with web/src/objects/ while here.

Acceptance

  • Terms + authorities lists visibly distinguish loading, error, and empty.
  • authorities.loadError is actually used (no longer a dead key).
  • Tests cover the error branch (MSW returns 500 → error text shown).
## Context In Milestone 4 the **vocabulary list** (`web/src/vocab/vocabulary-list.tsx`) renders all three list states — loading, error (`vocab.loadError`), and empty. But the two sibling lists do not: - **Terms list** (`web/src/vocab/vocabulary-terms.tsx`) — renders empty + data only; on a failed `useTerms` query it shows the empty state, silently hiding the error. - **Authorities list** (`web/src/authorities/authorities-page.tsx`) — same: empty + data only. The `authorities.loadError` i18n key is **defined in both en/sv but never rendered** (dead key as a result). So a backend/network failure on these two lists looks identical to "no data yet" — misleading for an admin tool. ## Ask - Add `isLoading` / `isError` branches to the terms list and the authorities list, matching the vocab-list pattern (reuse `vocab.loadError` / `authorities.loadError`). - Consider a shared list-state helper to avoid a third copy of the loading/empty/error ladder (the create-form + dual-alert idiom is already shared; the list-state ladder could be too). - The vocab list's loading state is a bare `…` glyph — consider a `<Skeleton>` for consistency with `web/src/objects/` while here. ## Acceptance - Terms + authorities lists visibly distinguish loading, error, and empty. - `authorities.loadError` is actually used (no longer a dead key). - Tests cover the error branch (MSW returns 500 → error text shown).
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: logaritmisk/biggus-dickus#31