Skip to content

feat(ui): release 5.0.2 with a Retry row in NavSwitcher after a failed list - #209

Merged
tmccoy14 merged 1 commit into
mainfrom
feat/nav-switcher-retry
Oct 28, 2026
Merged

tmccoy14 merged 1 commit into
mainfrom
feat/nav-switcher-retry

Conversation

@tmccoy14

Copy link
Copy Markdown
Contributor

Summary

Ports Studio's switcher Retry (eqtylab/guardian#533) into NavSwitcher and releases @eqtylab/equality 5.0.2, so eqtylab/guardian#536 can swap Studio's copy for this one without losing it.

<NavSwitcher
  {...props}
  error={projectsQuery.isError}
  retrying={projectsQuery.isFetching}
  onRetry={() => projectsQuery.refetch()}
/>
  • Error row: with error, the list shows "Couldn't load {collection}." and a Retry row above any options it already has. A search that matches nothing still says "No {collection} found".
  • Retry: picking Retry calls onRetry and keeps the list open. With retrying the row reads "Retrying..." and is aria-disabled. The types require onRetry with error.
  • Screen readers: the search box is described by the error when the list opens. A live region announces "Retrying...", a repeat failure, and "Loaded {collection}." or "No {collection} found.". A background refetch of a list that never failed announces nothing.
  • Retry that finds nothing: the open list stays until it closes, then becomes the plain heading, so focus isn't dropped under the user.
  • Closed-list guard: before the trigger mounts, or inside a <form>, Radix's hidden native select can pick Retry; that's ignored while closed, which stops a refetch loop.
  • One option stays a switcher (Changed): it was a plain heading. This matches Studio since #533; apps showing one item will see a dropdown appear.
  • Spinner renders spans, so it is valid inside an option. It looks the same.
  • Docs: a "When the List Fails to Load" section with a live demo (the first Retry fails, the second loads, and Reset starts it over), and the new props.

Testing

  • pnpm format:check, pnpm lint, pnpm test (162 passed) and pnpm build pass.
  • The form guard, Escape after Retry, the background-refetch announcement and the retry that finds nothing each fail without their fix.
  • In Studio, with this build in place of Studio's own NavSwitcher, the switcher specs give the same result as on 5.0.1: 154 passed. The five that fail on both are styling differences between Studio's switcher and Equality's, and Studio's loading row. #536 deals with them.

🤖 Generated with Claude Code

…d list

Need: people whose switcher list failed to load should see that it failed and be able to retry from the list.
Problem: NavSwitcher had no error state, so a failed list read looked the same as an empty one, and Studio carried its own copy with Retry that #536 deletes.
Solution: NavSwitcher takes error, retrying and onRetry (error needs onRetry). The list shows "Couldn't load {collection}." with a Retry row above any options, keeps the list open through Retry, reads "Retrying..." while a retry runs, and announces the failure, the retry and its result. A switcher with one option stays a switcher, as Studio already has it. Spinner renders spans so it can sit inside an option.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@tmccoy14
tmccoy14 merged commit 2194850 into main Oct 28, 2026
1 check passed
@tmccoy14
tmccoy14 deleted the feat/nav-switcher-retry branch October 28, 2026 23:56
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.

1 participant