Skip to content

The dashboard lists, creates, opens and deletes collections - #126

Merged
zlareb1 merged 6 commits into
mainfrom
feat/dashboard-collections
Oct 21, 2026
Merged

zlareb1 merged 6 commits into
mainfrom
feat/dashboard-collections

Conversation

@zlareb1

@zlareb1 zlareb1 commented Oct 21, 2026 •

Copy link
Copy Markdown
Member

Changelog category (leave one):

  • New Feature

Changelog entry (one or two sentences a user of Loom can read without the diff; the release pull request collects these into the release notes):

The dashboard has a Collections page (admin drawer, Access) that lists the collections your grants reach, creates one, shows its grants and newest documents, opens its members, and deletes it with what it holds after a confirm.

Why

Collections and their grants exist on the server (collection.*, grants.*), but the dashboard had no way to see or manage them: an admin needed the SDK or raw HTTP to create a collection, check who can read it, or delete it.

Scope and risk

  • New view frontend/src/views/admin/Collections.tsx at /admin/collections, filed as the first entry of the drawer's Access group, so every namespace admin sees it; Users still shows only to org and platform admins. The page is org-scoped.
  • The list reads collection.list (500 a page, "Load more" on a cursor) and filters by name in the browser. A row opens a dialog that reads namespace.get (description, created), grants.list (the collection's own grants; the parent's are named in a hint, since they reach it too) and knowledge.list (the newest 25 documents, projected to the three fields shown).
  • Create (flows/CreateCollectionDialog.tsx) checks the col- prefix, the reserved col-me- prefix and the namespace name rule before sending, and offers as parents only the non-personal collections the caller writes; the server still decides.
  • Members reuses flows/MembersDialog.tsx (grants.create / revoke / approve).
  • Delete calls collection.delete only after a danger confirm that says what goes: documents, originals and memories erased from disk, grants stop applying, children become top-level, the name is not reused. It is offered only to an admin of a non-personal collection: absent from the row menu otherwise, and aria-disabled with its reason in the details dialog. A delete whose erasure came back failed says it is being retried and names the erasure id.
  • The focus handoff after the last Load more is one hook, lib/useLastPageFocus, used by Collections and the Library; the Library also gains the fallback to its search when the last page shows no row. Activity keeps its own handoff: it keys on a row's position among the filtered events (audit rows carry no unique name to key on), and moving it is a separate change.
  • The details read grants.list's largest page (500) and say "the newest; more not shown" only when the stored rows read, each row plus its folded spellings (also), reach that limit. A folded row whose subject differs from the kept row's only in case adds nothing to also, so a list cut at exactly the limit with such a pair reads as one stored grant short, and as whole; a server-side page flag would close that, and is left to the open grants.list paging change rather than added here.
  • No server code changes. server/operations/reach_manifest.py is regenerated because the dashboard now calls the three collection.* ops.

Compatibility, rollout and rollback

  • Wire: none. Uses existing ops only.
  • Operator steps: none.
  • Rollback: reverting removes the page; nothing is stored.

Tests

  • npm --prefix frontend run build (tsc and Vite): passes. npm --prefix frontend run budget: OK.
  • make format-check, make lint (Biome with its accessibility rules, codegen checks, the reach census), make typecheck: pass.
  • New frontend/src/views/admin/Collections.test.tsx (vitest): loading, list, count, empty, filtered, error with Retry, Load more, details (members, documents, "the newest 25", grants cut at 500 stored rows and no caption below it, focus on the dialog itself), Delete unavailable to a viewer, delete only after the confirm, create and a refused create, and axe over the list and the details dialog. Sidebar.nav.test.ts follows the Access group.
  • e2e: /admin/collections joins ROUTES (the axe, focus-ring and layout sweeps) and the route budget, with a collection.list fixture; a11y.spec.ts runs axe with the details dialog and the New collection dialog open.
  • Unit and e2e suites were left to CI.

AI assistance in the code (leave one; writing this description with AI is fine):

  • AI-generated (an agent wrote most of the diff): Claude Code. Checked by hand: the op inputs and outputs against server/identity/api/models_collections.py, the role gates in ops_collections.py and ops_grants.py, and the design guide's rules for the primitives used.

  • I can explain every line of this diff and how it interacts with the rest of Loom.

Checklist

  • make format-check, make lint, make typecheck and make test-unit pass; the integration suite passes if server behaviour changed.
  • Generated files are regenerated in this PR, not by hand: the SDK op tables, docs/reference/configuration.md and the docs/reference/ tables (python scripts/codegen/docs_reference.py), the reach manifest, schemas/schema.sql (make schema-dump) and the Codex plugin copies (python3 scripts/codegen/agent_plugin_sync.py).
  • A new migration is additive and numbered after the latest on main; no merged migration is edited.
  • A behaviour change to any file a plugin ships (hooks/, lib/, bin/, skills/, .mcp.json, the Codex plugin-defaults.json) bumps both plugin manifests' version, and no other open PR uses that version.
  • The frontend builds (npm --prefix frontend run build) and its tests pass, if frontend/ changed.
  • Docs under docs/ describe the system as it now is, and this description names any operator steps and wire changes.
  • Repository text has no dates, people, host names, internal namespaces, ticket or decision numbers; the history goes in this description (tests/unit/test_public_copy.py).
  • Commits are signed off (git commit -s), as CONTRIBUTING.md asks.

🤖 Generated with Claude Code

zlareb1 and others added 6 commits October 21, 2026 13:33
An Access page in the admin drawer reads collection.list, creates a
collection under a parent or at the top level, shows a collection's
grants and newest documents, opens its members dialog, and deletes it
through collection.delete after a confirm.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
… and the last page

The Members dialog takes the collection's role from collection.list, so
an admin through a parent or a group can add and revoke. A delete hands
focus to the search once the list reads again; the last Load more hands
it to the first row it added. The details dialog opens on itself, puts
Close before Delete, and says when the grants shown are capped; a search
that matches nothing names the pages it covered.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…n no row shows

useLastPageFocus replaces the copies in Collections and the Library, and
sends focus to the search when the last page adds no row the search
shows. The collection details read grants with the page's own limit, say
when the list may be capped, name every ancestor in the inheritance hint,
and remount per collection instead of stamping their reads.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…us hook has its own spec

The details ask grants.list for its largest page and caption it only when
the stored rows read (each row plus its folded spellings) reach the
limit. useLastPageFocus gets a spec for each target and for leaving focus
alone, and the design guide names it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…d the focus guard

The count is people and the limit counts stored grants, so a cut list
says "the newest; more not shown". Specs check the 500 limit sent, the
caption at the limit, grantsCut's arithmetic, and that a page left keeps
focus where it was.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
… shows no caption

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
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.

1 participant