feat(spaces): frontend feature-detect + robust error surfacing (#216 frontend) #224

Merged
Cordy merged 3 commits from feat-fe-spaces216 into main 2026-08-13 17:03:54 +00:00
Owner

Frontend half of #216 — closes the UI side of #209/#210.

  • api() error hardening: the helper already pulled .error from JSON, but a Go plain-text 404 page not found (and empty HTTP/2 statusText) left the message blank — the empty Create failed: you saw. Now it reads the body once and falls back JSON .error → raw body → HTTP <code>, so a real message always surfaces.
  • Feature-detect from /me: reads the new me.spaces capability into feat.spaceCreate / feat.spaceMembers.
    • The Members button only shows in a space and when member management is available.
    • "New folder" at the Spaces root (which creates a space) is hidden when create isn't available — no more clicking a control that can't work.

With the API half already merged, both capabilities are true on every instance now, so create-space and member management work; the feature-detect keeps the UI coherent on any instance where they're not.

JS validated with node --check in the scaffold workflow (CI itself only builds Go). No i18n added — reuses existing keys.

Frontend half of #216 — closes the UI side of #209/#210. - **`api()` error hardening**: the helper already pulled `.error` from JSON, but a Go plain-text `404 page not found` (and empty HTTP/2 `statusText`) left the message blank — the empty `Create failed:` you saw. Now it reads the body once and falls back JSON `.error` → raw body → `HTTP <code>`, so a real message always surfaces. - **Feature-detect from `/me`**: reads the new `me.spaces` capability into `feat.spaceCreate` / `feat.spaceMembers`. - The **Members** button only shows in a space *and* when member management is available. - **"New folder" at the Spaces root** (which creates a space) is hidden when create isn't available — no more clicking a control that can't work. With the API half already merged, both capabilities are true on every instance now, so create-space and member management work; the feature-detect keeps the UI coherent on any instance where they're not. JS validated with `node --check` in the scaffold workflow (CI itself only builds Go). No i18n added — reuses existing keys.
scaffold: run #216 frontend
All checks were successful
ship216fe / edit (push) Successful in 6s
04660bd98e
feat(spaces): frontend feature-detect + robust error surfacing (#216)
All checks were successful
ci / test-and-build (pull_request) Successful in 34s
49b3f1e6d1
Cordy merged commit 76f6df4839 into main 2026-08-13 17:03:54 +00:00
Cordy deleted branch feat-fe-spaces216 2026-08-13 17:03:55 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Cordy/Cairn#224
No description provided.