Repository navigation
fix(platform): name a failed project read instead of a blank Overview - #4354
Conversation
A project read that failed was indistinguishable from a project that is gone. useProject returned `data ?? null` and dropped the error, so the Overview rendered nothing, and the project shell told the reader "We couldn't find that project. It may have been deleted." On a Home panel restore it even forgot the remembered project and left for the list. useProject now also returns how its read stands (readStateOf) and a retry; its other callers keep `project` and `isLoading` as before. The shell treats only a read that answered without a project (404/403) as missing. A failed read keeps the header and the tab strip and shows "Couldn't load this project." with Try again in place of the tab, since Files and Agents render nothing without their project. The alert stays busy, not gone, through a retry, and a retry that works hands the focus to the content region. The Overview on its own says the same, or the not-found message for an answered missing project, and never renders blank. EN/DE/FR, manual box PROJ-B17 and its automation row. Closes #3885 Closes #3886
Independent exact-head review of #4354: ACCEPT at
|
|
TALE-830 merge receipt: #4354 normally squash-merged at 2026-10-05T12:42:17Z as Immediately before merge: accepted head Independent ACCEPT: #6 run |
What changed
A project read that failed was indistinguishable from a project that is gone (#3885, duplicate #3886):
useProjectreturneddata ?? nulland dropped the error, so the Overview rendered nothing.isMissing = !isLoading && !project. A 503 therefore showed "We couldn't find that project. It may have been deleted.", and on a Home panel restore (navRestore) it also cleared the remembered project and redirected to the list.Now:
useProjectalso returns how its read stands (readStateOf:unavailable,stale,retrying,failureCount) plus a stableretry.projectandisLoadingare unchanged for its other callers.routes/dashboard/$id/projects/$projectId.tsx): only a read that answered without a project (the adapter maps 404/403 tonull) counts as missing.projects.loadFailed) with Try again, using the sharedCatalogLoadError, in place of the tab. Files and Agents render nothing without their project, so no tab is mounted.nullonce its read has settled.ProjectReadError(features/projects/components/project-read-error.tsx), shared by both.projects.loadFailed, manual boxPROJ-B17, and an automation row besidePROJ-A7.How it was verified (single worker, local)
project-overview.read-failure.test.tsx: the realuseProject, adapter row,backendFetchand four-attempt retry policy against the closed synthetic transport.$projectId.test.tsx(+5 tests): the alert in the shell with the tab strip kept and no outlet; Try again callsretry; busy while retrying; no redirect on a restored arrival; focus is handed to the region when Try again works. The existing not-found and memory tests are unchanged and green.main's three sources, 8 of 9 new tests fail; the success control passes.main'squeries.tsmakes 2 of 4 Overview tests fail;main'sproject-overview.tsxmakes 3 of 4 fail.useProjectcaller's tests: 98/98 across 10 files (tasks workspace ×3, Files ×2, Agents ×2, Secrets, Overview ×2).oxlint --type-aware --type-checkon the changed TS/TSX: clean;oxfmt --check: clean;lib/i18n/messages.test.ts(parity and usage, enforced): 24/24;lint:manualandcheck-guide suites/projects.md: OK;lint:conflicts: OK;tsc, and a real browser (PROJ-B17). CI and the manual box own those.Review focus
role=region,tabIndex=-1, named after the project) now wraps every project tab. A click on non-focusable content focuses it. The Files tab group and the automation editor region already do this.Closes #3885
Closes #3886