API + frontend: capability feature-detect for spaces; controls reflect availability; surface real errors #216

Closed
opened 2026-08-13 15:17:37 +00:00 by Cordy · 1 comment
Owner

Parent: #211. Resolves the UI half of #209 and #210.

API: expose what's available so the UI stops showing dead controls — a capabilities signal (extend GET /api/v1/me or a small /api/v1/capabilities) reporting e.g. spaces: { create, manageMembers } (true when app-owned spaces are on and/or the IdP power mode is configured).

Frontend:

  • Feature-detect (like the audit panel #173): hide/disable "New folder" (create-space) on the Spaces root and the "Members" control when the capability is absent, instead of firing requests that 404.
  • Surface real errors — the api() raw-Response must be parsed on the error branch so failures show the server message, not empty Create failed: / silent add-member (#136 class). Sweep the space create + member calls (and any sibling that has the same swallow).

Acceptance: on an instance with app-owned spaces enabled, create-space + members controls appear and work; on one with nothing configured they're hidden; every failing call shows a real message.

Parent: #211. Resolves the UI half of #209 and #210. **API:** expose what's available so the UI stops showing dead controls — a capabilities signal (extend `GET /api/v1/me` or a small `/api/v1/capabilities`) reporting e.g. `spaces: { create, manageMembers }` (true when app-owned spaces are on and/or the IdP power mode is configured). **Frontend:** - Feature-detect (like the audit panel #173): hide/disable "New folder" (create-space) on the Spaces root and the "Members" control when the capability is absent, instead of firing requests that 404. - **Surface real errors** — the `api()` raw-`Response` must be parsed on the error branch so failures show the server message, not empty `Create failed:` / silent add-member (#136 class). Sweep the space create + member calls (and any sibling that has the same swallow). **Acceptance:** on an instance with app-owned spaces enabled, create-space + members controls appear and work; on one with nothing configured they're hidden; every failing call shows a real message.
Cordy referenced this issue from a commit 2026-08-13 16:55:49 +00:00
Author
Owner

API half merged (PR #223). SpacesAPI now dispatches to the app-owned spacestore when the IdP power mode is off, so create-space + member management work with no IdP client — apiH.Spaces is non-nil on every instance now, which removes the silent-404 backend cause of #209/#210. GET /me reports spaces: {create, manageMembers} for feature-detect. httptest coverage green.

Remaining for this issue: the frontend — read the capability from /me and hide/disable the create-space ("New folder" on the Spaces root) + Members controls when it's false, and parse the api() response on the error branch so failures show the real message instead of an empty toast. That's the next PR.

**API half merged** (PR #223). `SpacesAPI` now dispatches to the app-owned `spacestore` when the IdP power mode is off, so create-space + member management work with no IdP client — `apiH.Spaces` is non-nil on every instance now, which removes the silent-404 backend cause of #209/#210. `GET /me` reports `spaces: {create, manageMembers}` for feature-detect. httptest coverage green. Remaining for this issue: the **frontend** — read the capability from `/me` and hide/disable the create-space ("New folder" on the Spaces root) + Members controls when it's false, and parse the `api()` response on the error branch so failures show the real message instead of an empty toast. That's the next PR.
Cordy referenced this issue from a commit 2026-08-13 17:02:07 +00:00
Cordy closed this issue 2026-08-13 17:03:56 +00:00
Sign in to join this conversation.
No labels
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#216
No description provided.