Skip to content

ui: show not-found and error states on org and user detail - #1247

Merged
ac-pplx merged 2 commits into
mainfrom
ac/admin-ui-not-found-states
Nov 3, 2026
Merged

ac-pplx merged 2 commits into
mainfrom
ac/admin-ui-not-found-states

Conversation

@ac-pplx

@ac-pplx ac-pplx commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Org and user detail pages now say when the object does not exist, instead of rendering a blank page.

Changes:

  • /dashboard/orgs/{id} and /dashboard/users/{id} never handled a failed load. An unknown or deleted ID left an empty content area and an uncaught promise rejection (resource not found) in the console. Both pages now show "Organization not found" or "User not found" for a 404, with the API's message, the ID and a link back to the list. Any other failure (a 500, a 403, a network error) shows "Could not load the organization" or "Could not load the user" with the error and a Retry.
  • Saving branding on the org page had no error handling. A failed PATCH /admin/api/v1/orgs/{id} produced an unhandled rejection and no message. It now reports the API's error, and the button shows progress while the save runs.

Stack

Not stacked on anything. #1253 (user page) is stacked on this PR, and #1262 on #1253.

Validation

  • At this head, in ui/: npm ci, npm test (144 pass, including src/lib/load-failure.test.mjs), npx tsc --noEmit -p . and npm run build.

  • A Playwright loop against a local Kind stack with synthetic data, run on main (production build) and on this branch (the Kind space-ui image):

    • unknown org and user IDs show their not-found states, and the page errors seen on main are gone;
    • a branding save forced to fail (Playwright returns a synthetic 500 for the PATCH) shows an error message;
  • No new console errors, page errors or failed requests compared with main.

  • A loop step answers the first org or user GET with a synthetic 500 (route interception): the page reads "Could not load the organization" (or "the user") with Retry instead of "not found", and Retry loads the page.

Visual confirmation

Before (main) After
before: unknown org after: unknown org
before: unknown user after: unknown user

Severity and risk

Severity: low. These are error paths, but on them an operator saw nothing and could not tell an unknown ID from a broken page.

Risk: low. The successful paths are unchanged. Roll back by reverting the commit.

AI assistance: Claude Code wrote the code and this description, and ran the validation; a maintainer reviews it.

@github-actions github-actions Bot added the triage:pending Waiting for a maintainer to triage label Oct 31, 2026
@github-actions

Copy link
Copy Markdown

Thanks for opening this pull request! A SPACE maintainer will take a look.

CONTRIBUTING.md explains how we review outside contributions.

zibi-pplx
zibi-pplx previously approved these changes Nov 1, 2026
@zibi-pplx
zibi-pplx dismissed their stale review November 1, 2026 22:30

Withdrawing this approval for now. Any feedback above still stands.

@ac-pplx
ac-pplx added this pull request to stack #1282 November 2, 2026 04:30
Opening an organization or user that does not exist left a blank page
and an uncaught promise rejection, and a failed branding save on the
organization page produced no message at all. Both detail pages now
show a not-found state with the API's error, the ID and a link back to
the list; saving branding reports failures and shows progress.
The organization and user detail pages titled every load failure "not
found", including a 500, a 403 or a network error, which tells an
operator the object does not exist when it merely failed to load.

A 404 still reads "Organization not found" or "User not found". Any
other failure reads "Could not load the organization" or "Could not
load the user" with the error and a Retry that loads the page again.
@ac-pplx
ac-pplx force-pushed the ac/admin-ui-not-found-states branch from 36bf5fd to 8f0f82f Compare November 2, 2026 19:31
@ac-pplx

ac-pplx commented Nov 2, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto main (new head 8f0f82f); it had conflicted in sandbox-detail.tsx.

The conflict was this PR's "stop polling a sandbox after its first 404" change. main now keeps polling after a 404 on purpose: while the sandbox's create operation is still queued or running, the page shows "Sandbox is being created" and loads the sandbox as soon as it exists. Stopping the poll would break that, so the rebase keeps main's handling and drops the change, from the first commit's message and from the description too. The PR now changes only the organization and user pages.

#1253 and #1262, stacked on this PR, were restacked with their commits unchanged. At each of the three heads, in ui/: npm ci, npm test (144, 151 and 151 pass), npx tsc --noEmit -p . and npm run build all exit 0.

@johnlouie-pplx johnlouie-pplx left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving.

I compared 8f0f82f with the head I reviewed before. The only change is dropping the sandbox page's stop-polling-on-404, which is the right call now that main keeps polling while a create is pending. The sandbox page on main also uses the same rule now (404 is "not found" with no retry, anything else is "Could not load" with Retry), so all three detail pages agree. I ran npm test (144 pass) and tsc on this head. I didn't run it in a browser.

@ac-pplx
ac-pplx added this pull request to the merge queue Nov 3, 2026
Merged via the queue into main with commit 3efecc5 Nov 3, 2026
23 checks passed
@ac-pplx
ac-pplx deleted the ac/admin-ui-not-found-states branch November 3, 2026 04:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

triage:pending Waiting for a maintainer to triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants