MotirBuilding in public
MOTIR · moooon
onMotir
You’re viewing a public project. Anyone can view it — no account needed. Sign in to submit, upvote, or comment on requests.View-only — you can’t edit work items
MOTIR-390

6.10.5 Org admin UI — org settings, cross-workspace member management, the org switcher in the shell

Done
Description

Estimate: 70m · Depends on: 6.10.1, 6.10.4, 6.10.10

Build the org administration UI from the 6.10.1 design, over the 6.10.4 services: the org switcher in the app shell, the org settings page, and cross-workspace member management. This is the customer-facing org admin (the TENANT org owner/admin — NOT the Motir-internal platform console, which is Epic 10). NO billing/credit/usage surface here (that is 7.12.5 / Epic 8).

4-layer (motir-core/CLAUDE.md). Each surface’s route parses + calls ONE organizationsService method (6.10.4); the route is session-gated (401 without a session) + org-gated (404-not-403 for a non-org-member, via the 6.10.4 gate). No db.* / $transaction / business logic in routes.

The surfaces (render the 6.10.1 design verbatim — incl. its PROGRESSIVE-DISCLOSURE rules):

  • The org control in the shell + progressive disclosure (6.10.2 §6; design-notes "Progressive disclosure"). The ORG is ALWAYS the top-left anchor — a menu button (Settings / Members / Billing-soon / New workspace), with a "Switch organization" section shown ONLY when the account is in ≥2 orgs. The WORKSPACE switcher renders ONLY when the active org has ≥2 workspaces (to the right of the org, Acme › Engineering); at one workspace it is NOT rendered at all (no "individual" mode — an OPC is just an org of one). The PROJECT switcher stays in the sidebar; switching the workspace re-scopes it. At one workspace the workspace-settings SURFACE is hidden but its config still operates underneath: the single Settings home folds in the workspace-config sections (settings/workspace/*) and saves them to the single Workspace row; they split into a per-workspace Settings area only at ws #2 (no data move).
  • Org settings — org name / slug / org-level metadata, editable by an org owner/admin (the gate enforces the role). The passive "billing later" placeholder per the design — NO active billing control.
  • Cross-workspace member management — the roster of everyone across the org’s workspaces with org role + workspace membership, and add / remove / change-role actions. The roster is PAGINATED / lazy (the at-scale rule — NOT load-all; a large org has hundreds of members); inline edits follow the no-whole-tree-refresh rule (a success response is the confirmation — no router.refresh / revalidatePath fan-out on a field update).

Design-system compliance. References ONLY --el-* colour + [data-display-style] shape tokens (no Tier-0 --color-*, no hand-rolled spacing); uses the palette for the org-role chips (a Pill tone / per-role tint — not grey-only, finding #54); an aria-live region for the loading→loaded transition; i18n via a new orgAdmin namespace (the app’s locale set).

Acceptance criteria

  • The org is ALWAYS the header anchor with its menu; org settings renders + saves (org-owner/admin gated); cross-workspace member management lists + adds + removes + role-changes members — all rendering the 6.10.1 design.
  • Progressive disclosure holds (6.10.2 §6 / design-notes): with ONE workspace the workspace switcher is NOT rendered; creating a 2nd workspace makes it appear and switching it re-scopes the sidebar project switcher; the org menu’s "Switch organization" section is present only when the account is in ≥2 orgs; with one workspace there is no separate workspace-settings surface — its config sections fold into the Settings home and still save to the Workspace row (and split out into a per-workspace area at ws #2).
  • The member roster is paginated/lazy (at-scale, NOT load-all); inline edits use the success-response-is-confirmation pattern (no whole-tree refresh).
  • Routes are session-gated (401) + org-gated (404-not-403 cross-tenant); 4-layer respected (route → organizationsService; no client component touches the service directly).
  • The UI references ONLY --el-* + shape tokens, uses the palette for role chips, and contains NO billing / credit / usage / checkout surface (7.12.5 / Epic 8).
  • No new primitive is hand-rolled — composes the shipped components/ui/* (a new primitive would be a new design/ subtask).

Context refs

  • 6.10.1 — the design asset (the surfaces this implements verbatim).
  • 6.10.4 — the organizationsService + the access gate this UI calls through.
  • The existing workspace-switcher + workspace-settings components — the patterns the org switcher / org settings sit alongside / above.
  • motir-core/CLAUDE.md § 4-layer + § colour/shape tokens + the inline-edit no-whole-tree-refresh rule.
  • motir-core/app/globals.css — the --el-* + shape tokens.
  • 6.10.10 — the create-workspace flow design this org menu’s "New workspace" entry launches (the dialog + the tier-2 first-reveal).