Skip to content

fix(platform): name a failed project read instead of a blank Overview - #4354

Merged
yannickmonney merged 1 commit into
mainfrom
fix/project-overview-read-error
Oct 5, 2026
Merged

yannickmonney merged 1 commit into
mainfrom
fix/project-overview-read-error

Conversation

@yannickmonney

Copy link
Copy Markdown
Contributor

What changed

A project read that failed was indistinguishable from a project that is gone (#3885, duplicate #3886):

  • useProject returned data ?? null and dropped the error, so the Overview rendered nothing.
  • The project shell computed 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:

  • useProject also returns how its read stands (readStateOf: unavailable, stale, retrying, failureCount) plus a stable retry. project and isLoading are unchanged for its other callers.
  • Project shell (routes/dashboard/$id/projects/$projectId.tsx): only a read that answered without a project (the adapter maps 404/403 to null) counts as missing.
    • A failed read keeps the header and tab strip and shows Couldn't load this project. (projects.loadFailed) with Try again, using the shared CatalogLoadError, in place of the tab. Files and Agents render nothing without their project, so no tab is mounted.
    • The alert stays busy (not skeletonized) through a retry.
    • When a retry works, focus goes to a named, focusable content region.
    • A restored arrival neither redirects nor forgets the memory.
  • Overview: on its own it renders the same alert, or the not-found message for an answered missing project, and never null once its read has settled.
  • New ProjectReadError (features/projects/components/project-read-error.tsx), shared by both.
  • EN/DE/FR projects.loadFailed, manual box PROJ-B17, and an automation row beside PROJ-A7.

How it was verified (single worker, local)

  • New project-overview.read-failure.test.tsx: the real useProject, adapter row, backendFetch and four-attempt retry policy against the closed synthetic transport.
    • A 503 shows the alert and Try again, never the not-found text or an empty form.
    • Try again heals into the form.
    • The controls: a 404 shows the not-found message with no retry; a 200 shows the project.
  • Layout $projectId.test.tsx (+5 tests): the alert in the shell with the tab strip kept and no outlet; Try again calls retry; 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.
  • Fail before, pass after:
    • With main's three sources, 8 of 9 new tests fail; the success control passes.
    • Single-file mutants: main's queries.ts makes 2 of 4 Overview tests fail; main's project-overview.tsx makes 3 of 4 fail.
    • Head restored: 44/44 across the 3 files.
  • Every useProject caller's tests: 98/98 across 10 files (tasks workspace ×3, Files ×2, Agents ×2, Secrets, Overview ×2).
  • Gates:
    • oxlint --type-aware --type-check on the changed TS/TSX: clean;
    • oxfmt --check: clean;
    • lib/i18n/messages.test.ts (parity and usage, enforced): 24/24;
    • lint:manual and check-guide suites/projects.md: OK;
    • lint:conflicts: OK;
    • commitlint: OK.
  • Not run locally: the whole platform suite, a whole-workspace tsc, and a real browser (PROJ-B17). CI and the manual box own those.

Review focus

  • The content region (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.
  • A retry that answers 404 lands on the not-found page with no focus target, so focus goes to the body.

Closes #3885
Closes #3886

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
@yannickmonney

Copy link
Copy Markdown
Contributor Author

Independent exact-head review of #4354: ACCEPT at 3002fde2c7f2061744410410d0a5e59ea31f5fd2

Verdict: ACCEPT. There are no blocking findings.

What was checked (#3885, #3886, the brief)

The checks ran the real useProject (adapter row, backendFetch, four-attempt retry) inside the real project shell, against the closed synthetic transport. The probe file is evidence/project-shell.review-probe.test.tsx.

  1. A 503 is not "not found" and does not redirect a restored arrival.
    • S1: after 4 attempts, the projects.loadFailed alert shows inside the content region. The tab strip stays, with no outlet and no not-found text.
    • S2: navRestore plus a 503 does not navigate, and the Home memory still names proj-1.
  2. Only an answered null counts as missing.
    • The adapter maps only 404 and 403 to null. A malformed id is also a 404, from loadProjectOrThrow.
    • S7: a 404 shows not-found after 1 attempt, with no alert.
    • S5: a failed background refresh over a loaded project keeps the tab, as stale data with no alert.
    • S6: a remount over a cached failed read shows the alert, busy, during the re-read. It never shows not-found.
  3. Retry, busy state and focus.
    • S3 holds a retry open. The alert stays, Try again is aria-busy and keeps focus. When the answer arrives, the outlet mounts and focus lands on the region named "Apollo".
    • S3b: a retry that fails again keeps the same Try again node, and its focus.
  4. The other callers.
    • The other call sites destructure only project, and the Agents tab also takes isLoading. Both are unchanged.
    • A render-count probe used a caller that reads only project, across 3 background re-reads with 30 ms latency. It rendered 2 → 2 at the head and 2 → 2 at the base (evidence/use-project.review-probe.test.tsx).
  5. EN/DE/FR, docs and the manual box.
    • projects.loadFailed matches its sibling keys in all three languages: Couldn't load this run/file/skill., Dieser Lauf … konnte nicht geladen werden., and Impossible de charger cette exécution/ce fichier.
    • PROJ-B17 is the next free id; neither main nor any open PR uses it.
    • The automation row sits beside PROJ-A7, and every key the box cites exists.
  6. Security. The change is read-only UI. The alert shows no error detail and no id, the change adds no new request beyond the existing read, and Try again does nothing while it is busy.
  7. Overlap with other PRs. merge-tree is clean against each of these:

Probe red check: swapping in the base ad3cc8304 sources for queries.ts, project-overview.tsx and $projectId.tsx makes 6 of the 8 probes fail (S1–S4, S3b, S6). S5 and S7 are controls and pass. At the head, all 8 pass.

Non-blocking notes

  • N1, the author's focus item 1.

    • What changed: clicking non-interactive content now focuses the shell region wherever no focusable wrapper of its own sits closer, for example General (the Overview route), Threads and Agents. The Tasks board and list, the Files tree and the Secrets body already sit in such a wrapper, so clicks inside them are unchanged.
    • Effect in a browser: pressing Tab after such a click starts at the top of the tab, not after the point clicked.
    • Why it is acceptable: this is the existing pattern (the board region, the Files group and the automation editor region).
    • A narrower option: make the region focusable only for the handoff. focusContent would add tabIndex=-1, and the region would drop it on blur.
  • N2, the author's focus item 2. S4 confirms that a retry which answers 404 lands on the not-found view with focus on <body>. On a restored arrival, the page then redirects and clears the memory, which is correct for a project that is gone. A follow-up could move focus to the not-found message, the way route-not-found.tsx does.

  • N3, tests.

    • The PR's shell tests mock useProject, so only this probe covers the shell with the real hook. S1, S3 and S4 would be worth adopting.
    • The restored-arrival test asserts only that navigate was not called. S2 also checks the memory.
  • N4, the manual box wording. projects.navigation.overview reads General in EN, and the rest of suites/projects.md calls this tab General. PROJ-B17 says "reload its Overview tab" and "the Overview's form returns". The key is right; only the bold label needs to change.

Ran

All runs used one worker and the existing dependencies, in a worktree at the head.

  • PR's targeted tests: project-overview.read-failure, project-overview and $projectId: 3 files, 44/44.
  • Every useProject caller's tests: 17 files, 186/186:
    • task-modal access, draft, limits and repeat;
    • tasks-workspace (3 files);
    • the task reviewer section;
    • Files (2), Agents, Secrets (3);
    • Overview (2) and the shell.
  • Route children: $projectId/overview and $projectId/agents: 2 files, 10/10.
  • Probes:
    • the shell probe passes 8/8 at the head; on base sources, 6 fail and 2 pass;
    • the render-count probe gives 2 → 2 at both the head and the base.
  • Static checks:
    • oxlint --type-aware --type-check on the 6 changed TS/TSX files exits 0;
    • oxfmt --check is clean;
    • a scoped tsc over the changed files plus app/router.tsx exits 0;
    • lib/i18n/messages.test.ts passes 24/24;
    • lint:manual reports ok;
    • commitlint over ad3cc8304..3002fde2c reports ok.
  • CI on this head at 12:19Z: 51 success, 26 skipped, 1 neutral, 0 failing.

Not run

  • A real browser for PROJ-B17: neither the author nor I ran it, and that includes N1's Tab behaviour.
  • E2E, the backend stack, the full suite, and a whole-workspace tsc.

I did not push, merge, rerun CI, change any card's status, or decide the native review, which a human captured. Root's rule (08:15Z) applies: a blocking finding overrides ACCEPT until it is independently closed on the exact head, with proof.

The probes and logs are in the TALE-824 delivery box (3abcb571-6b4c-492d-99af-6edd0d338ed9/evidence/).

@yannickmonney
yannickmonney merged commit ba868b0 into main Oct 5, 2026
@yannickmonney
yannickmonney deleted the fix/project-overview-read-error branch October 5, 2026 12:42
@yannickmonney

Copy link
Copy Markdown
Contributor Author

TALE-830 merge receipt: #4354 normally squash-merged at 2026-10-05T12:42:17Z as ba868b05c1c105899b21508ec822866463fdc42a.

Immediately before merge: accepted head 3002fde2c7f2061744410410d0a5e59ea31f5fd2 unchanged, OPEN/not draft, CLEAN/MERGEABLE; all checks terminal: 51 SUCCESS, 26 conditional SKIPPED, 1 advisory Trivy NEUTRAL; none failing/pending. gh pr checks --required reported no configured required checks; all seven CI-ready contexts independently verified SUCCESS. Skipped/neutral are not successes. Consumed manager answer 32e5e960-5303-4e92-bed8-9f7152fabfaf to question 215c341f-c15f-49c4-a132-476644c11709.

Independent ACCEPT: #6 run 4c4abac6; implementation #3 differs from merger C12 31b27429, run 6e7f8501-7840-4256-afde-f92ed8fee6b1, resumed from 868b8134. Used explicit subject/single-bullet body and --match-head-commit. GitHub squash-message comparison confirms exact requested message and no trailer/attribution. No --admin, push/update-branch, CI rerun, task status change or native-review decision; human-captured reviews preserved. Merged-source evidence only, not release/deployment validation.

#4354

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.

bug(platform): Project Overview becomes blank after a failed project read bug(platform): Project Overview becomes blank after a failed project read

1 participant