fix(deployments): hide empty-state during load error (F1)#200
Merged
Conversation
On a 429/5xx the DeploymentsPage catch handler sets items=[] (honest — nothing loaded), so the "No deployments yet" create-CTA (deployments-empty) rendered at the same time as the deployments-error banner: contradictory UX that tells the user both "nothing here, create one" and "something went wrong". Gate the empty-state on `!err` so the error banner is the sole dominant signal during a load error. The genuine zero-deployments empty state (no error) is unchanged and still shows the create CTA. Found by the per-tier error-state matrix sweep (PR #199). Tests (DeploymentsPage.test.tsx): - error → error banner shown AND empty-state NOT shown (fails before fix) - 429 → retry-hint banner, no empty row (fails before fix) - genuine empty (no error, zero items) → create CTA still shown - happy-path empty has no error banner Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
size-limit report 📦
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug F1 (found by the per-tier error-state matrix, PR #199)
src/pages/DeploymentsPage.tsx: on a 429/5xx load error, the page rendered the "No deployments yet" empty-state row (deployments-empty) at the same time as thedeployments-errorbanner.Root cause: the catch handler sets
setItems([])(honest — nothing loaded), which makesitems.length === 0true during an error. The empty-state rendered on!loading && items.length === 0, so the create-CTA showed alongside the error banner — contradictory UX: it tells the user both "nothing here, create one" and "something went wrong."Fix
Gate the empty-state on
!err:The error banner stays the dominant signal. The genuine zero-deployments empty state (no error, zero items) is unchanged and still shows the create CTA. The
deployments-no-matchrow is already guarded byitems.length > 0, so it can't fire during an error. Mirrors the page's stated TeamPage error-banner convention (theLoadErrorshape comment at the top of the file).Tests (
src/pages/DeploymentsPage.test.tsx)Added F1 guards (fail before the fix, pass after):
Fail-before / pass-after verified locally by temporarily reverting the
!errgate: 2 new tests failed, then all 18 passed once restored.Gate
npm run gateGREEN — tsc + build + prerender + vitest (81 files, 1147 passed / 3 skipped). Patch is 100% covered (both branches of the new!errgate exercised).Cross-ref: bug-hunt backlog F1; bug introduced/surfaced by the error-state matrix in #199.
🤖 Generated with Claude Code