Skip to content

Web UI for organisations: create one from Settings, manage members on its page - #17

Merged
ynishi merged 5 commits into
mainfrom
feat/org-ui
Sep 22, 2026
Merged

ynishi merged 5 commits into
mainfrom
feat/org-ui

Conversation

@ynishi

@ynishi ynishi commented Sep 22, 2026

Copy link
Copy Markdown
Owner

Closes #16.

The organisation API existed without a screen. This adds one, in the two places it belongs, and a browser test that drives it through the real binary.

What changed

  • web/src/lib/api/client.ts: createOrg, addMember, removeMember, each an api.* call through unwrap like the helpers around them.
  • Settings: an Organisations section between "Your tokens" and "Record settings". Enter a slug, press Create; the notice says you are its admin and links to its page.
  • /ns/{org}: when the roster loaded and the session token names this organisation with write or admin, an Add or update form (user, role) and a remove button on every row but the caller's own. The hub still decides who is an admin; the UI only hides controls and shows the hub's refusal as it said it.
  • e2e/smoke.sh: creates alice (admin) and bob after migrate, captures alice's token into a variable and passes it to Playwright on the command line only. It is never printed. An exported EVALHUB_* variable would reach the server, whose configuration rejects unknown keys; that was found by running just e2e and is fixed in the last commit.
  • web/tests/browser/orgs.spec.ts: sign in → create an org → issue a token naming it → sign out and in with that token → add bob as write → remove bob. Skipped when the harness did not provide a token.

What did not change

  • No API or Rust change. GET /whoami still does not report organisation roles, so the UI cannot know in advance whether the caller is an admin; it relies on session.mayWrite(ns) (the token names the org) and on the hub's 403.
  • A token's namespaces are fixed at issue, so the session that creates an organisation cannot manage it until a token naming the org is issued and used. The test follows that flow. Whether the hub should shorten it (for example by letting POST /orgs extend the issuing token, or by a UI shortcut that issues the token) is a separate decision, not taken here.

Verification

  • just web-check: svelte-check 0 errors / 0 warnings; prettier clean.
  • just e2e: 18 shell checks, 4 browser tests, all green on this branch.
  • cargo fmt --check / clippy / per-crate tests: unaffected (no Rust change); the full list was green on main earlier today.
  • Not run: just package (no Rust change; CI runs it).

Notes for review

  • orgs.spec.ts declares a minimal process type instead of adding @types/node; playwright.config.ts already reads process.env under the same tsconfig. If a global type is preferred, that is a one-line devDependency change.
  • The first two commits were produced by a DeepSeek-routed implementation worker from a written spec; the template half of the namespace page and both prettier passes came in follow-up commits. Every commit carries Signed-off-by.

… on the org's namespace page

impl-ds-lite run orgui (20260922-203522)

Signed-off-by: Yutaka Nishimura <ytk.nishimura@gmail.com>
The first commit brought the script side of member management to
/ns/{org} (add, remove, reload) but never rendered it. This adds the
template: a notice line, an "Add or update" form with user and role,
and a remove button on every row except the caller's own, all shown
only when the roster loaded and the token names this organisation.
The hub still decides who is an admin; the UI only hides controls.

The settings page is re-wrapped by prettier.

Signed-off-by: Yutaka Nishimura <ytk.nishimura@gmail.com>
…ng an admin token to Playwright

impl-ds-lite run orgtest (20260922-220315)

Signed-off-by: Yutaka Nishimura <ytk.nishimura@gmail.com>
The spec file is re-wrapped by prettier; no behavioural change.

Signed-off-by: Yutaka Nishimura <ytk.nishimura@gmail.com>
… exported EVALHUB_* variable

The server's configuration loader rejects unknown EVALHUB_* keys, so an
exported EVALHUB_E2E_TOKEN stopped  from starting. The
value now travels the way EVALHUB_E2E_BASE_URL already does.

Signed-off-by: Yutaka Nishimura <ytk.nishimura@gmail.com>
@ynishi
ynishi merged commit 1f1730c into main Sep 22, 2026
4 checks passed
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.

Web UI for organisations: create one from Settings, manage members on its page

1 participant