Skip to content

The Library shows the collections a person can read, and the separate Collections page is gone - #219

Merged
zlareb1 merged 2 commits into
mainfrom
feat/library-collections
Nov 4, 2026
Merged

zlareb1 merged 2 commits into
mainfrom
feat/library-collections

Conversation

@zlareb1

@zlareb1 zlareb1 commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

Changelog category (leave one):

  • Improvement

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's Library now shows the collections you can read, as a tree with each one's description: pick one to see and add its documents, share it (Members) or delete it from its menu, or create a new one. The separate Admin › Collections page is gone, and collection.list returns each collection's description.

Why

A person met two separate concepts for "a place where documents live and who can see it":

  • the namespace picker with the Library;
  • an admin-only Collections page.

The Collections page only listed what the caller's own grants reach, so it was a per-person view behind an admin label. Its details panel already listed the collection's documents, a second, smaller Library. Agents already treat collections as Library places: knowledge.search and loom_search fan out over every collection the caller can read (knowledge_search_fanout_kinds includes collection).

So a collection is now a place inside the Library, and one concept goes away:

  • The Library's select. It holds the namespace picked at the top, then every collection collection.list returns. Collections show as a tree: each parent comes before its children and is indented, the user's own @me first as "My files", and a collection whose parent the caller cannot read at the top. Each one is labelled with its description, and the select finds one by typing its name or description. The picker is one row at every width, with what the place is behind an info button beside it, so the list still starts where the list rules want it; a phone leaves out the library's figures line, whose count the toolbar shows. On a code or tracker namespace, or with none, the Library still opens: it reads nothing until a collection is picked, and the select lists only collections. A header namespace that is itself a collection is listed once, as that collection, with its role; until collection.list names that role the page takes it from the namespace menu, and offers no write while neither says.
  • Picking a collection. The Library lists that collection's documents, and Add, Replace, Edit and Delete act there. A viewer gets no Add document, no Replace, Edit or Delete on a document (in its row or its preview), and no selection. The pick rides the URL (?collection=), and the page reads it from there on every render. A pick is a history entry, so Back steps through the places picked; the page's own corrections (leaving a collection it cannot show) replace the entry. A value that is not a col- name is ignored, so the page never prints text a link made up; boot reads it with the same check. It never changes the header's namespace, which is also where the person's agents write (/v1/me/set-default-namespace).
    • Confirmed first. A collection is read and written only once collection.list, read in full by the Library, names it, so the page never shows or writes one under the namespace's label. Until then the select says it is opening it and Add document waits. A link naming a collection the caller cannot read shows the namespace and drops the key. One whose list fails shows the namespace for now and keeps the link for "Load collections again".
    • Following the URL. The collection follows the URL on every navigation (a document opened from the header search opens in the namespace) and on Back and Forward. Picking one drops an open document's link.
    • Gone while shown. A collection refused while shown (deleted, or the grant revoked) is re-read once (again after any later successful read). If the list no longer names it, or still does (one replica has the revoke, another not yet), the page goes back to the namespace. Only an error from that collection's own read counts.
    • Open things. A preview or an Add, Replace or Edit dialog belongs to the place it was opened in. When Back or a confirmed collection shows another place, it closes, and the address stops naming the document it showed, so nothing opened for one is written to the other.
    • Pending documents. A pending document (a ?doc= link, or one opened from the header search) opens only from rows read for the place shown, and never while the URL names a collection the list has not confirmed, so after a failed list it opens in its collection once the list answers. Picking another place drops it. Leaving a place also drops an open still in flight and its file preview.
    • The header. Picking another namespace at the top drops the key and shows that namespace. Boot's own correction of a provisional namespace keeps it, and so does an entry made in another namespace, with the document it had open in the collection: a collection, and what it holds, is the org's.
    • Shared links. A Library link also names its sender's namespace. A reader who cannot read that namespace lands on their own with the collection kept, instead of on "No access", and the Library opens the collection if collection.list names it.
    • Saying why. Whenever the page leaves a collection, a toast says it is not among the ones the reader can read now (or that it is past the first ones listed).
  • Its menu. Members (the existing MembersDialog) is offered on any collection except the user's own. It and New collection close when the URL moves to another place and stay closed on the way back, so Back never lands a grant on the wrong one; the list confirming the place shown moves nothing, so what was typed stays. Delete collection, for an admin, erases what it holds (collection.delete) after a confirm; deleting the header's own namespace opens the namespace picker and leaves nothing of it on screen.
  • New collection. It creates a collection, inside the one shown when the person writes there, and then shows it. The header's New adds to the header's namespace, so while the Library shows a collection (or is confirming one), or a namespace that holds no documents, it offers no Document, and the Library's own Add document adds there; a document meant for a collection never lands in the header's namespace. If a replica's list has not caught up yet, the list is asked for again, up to twice, and a list that still lacks it says the collection is not listed yet.
  • Tree order. Collections a parent cycle would cut off from the top are listed at the top too.
  • Names. A collection's col-… slug stays its one name, and the description is the display text beside it. collection.list now returns description: the collection's directory description, which collection.create already stored. Since every grantee now sees it, collection.create holds it to 2000 characters (a longer one is refused with a validation error), and the select cuts it to 80 characters (by character, never inside an emoji).
  • Removed. The Admin › Collections page, its rail entry and route (admin:collections), and its tests. Its details panel (grants and newest documents) is replaced by the Library itself and the Members dialog.

Scope and risk

  • Access is unchanged. The select lists exactly what collection.list returns (sharing.readable), and every read and write still goes through the collection's gate.
  • collection.list makes one more statement per page: the directory descriptions of the collections on it (loom.namespaces FINAL, keyed by org and the page's names, read with the replica's own writes so a collection created a moment ago has its description). It is a single IN over at most a page of names, with a LIMIT of their count.
  • The Library reads collection.list once per load, every page up to 20; callBudget.test.tsx pins one call for a one-page answer. Past 20 pages it says only the first 10,000 are listed, and that a link to a later one shows the namespace. If it fails, the namespace's documents still show, with a one-line note and a way to load the collections again.
  • The removed page's search by name and its grants list are gone; the Members dialog lists the grants.
  • /admin/collections is no longer a route. An old link lands where an unknown path does.

Compatibility, rollout and rollback

  • The shell's index chunk stays within its 120 kB budget (115.8 kB): the page a memory view shows on a code or tracker namespace, or none, loads as its own chunk, as the views do.
  • Wire: collection.list entries gain description (string, "" when none). It is additive. The dashboard reads it as optional, so a server a release behind shows names only. collection.create refuses a description over 2000 characters, which it accepted before.
  • Generated: docs/reference/operations/collection.md, sdk/python/loom/ops.py and sdk/typescript/src/generated/ops.ts are regenerated.
  • Operator steps: none.
  • Rollback: revert the commit. Nothing is stored.

Tests

  • tests/integration/test_knowledge_sharing.py::test_collection_list_names_each_collection_with_its_description: a collection created with a description lists it for its creator and for a grantee, and one created with none lists "". A collection the grantee cannot read is not listed. The whole file (31 tests) passes against a local server with auth on.
  • frontend/src/views/LibraryCollections.test.tsx:
    • the Library reads a linked collection only once collection.list names it, and shows the namespace for one it does not hold (dropping the key) or when the list fails (keeping it);
    • a viewer gets no Add document, no write on a document (row or preview) and no selection;
    • a preview closes when Back shows another place;
    • a linked document waits for its collection while the list fails, and opens there once it answers;
  • frontend/src/App.boot.test.tsx: a Library link to a collection opens on the reader's own namespace though the sender's namespace denies them, keeps the collection and reads it, and a junk ?collection= still shows "No access";
  • frontend/src/views/LibraryCollections.test.tsx also: a ?collection= that is no collection's name is ignored, and leaving after a re-read says why;
    • a collection refused while shown leaves for the namespace, and an error from another place does not;
    • a document opened from the header search while a collection is shown opens in the namespace;
    • a collection the list still names after a refusal is left, with one re-read and no loop;
    • a collection just created is asked for again until the list names it;
    • Members closes when another collection is shown;
    • every page of collection.list is read, and a cycle in the tree keeps its collections;
    • a collection is labelled with its description, and the user's own as "My files";
    • the collections come in tree order;
    • the namespace is named when no collection is picked, and axe passes;
    • a picked collection shows its role and menu, with Members but no Delete for a viewer;
    • the user's own collection gets no menu;
    • a failed read says so and offers to load the collections again.
  • frontend/src/layout/Sidebar.nav.test.ts: the Access group holds Users only.
  • tests/integration/test_knowledge_sharing.py: a grantee's list carries only the description of the collection the grant opens.
  • Playwright a11y.spec.ts and route-budget.spec.ts (91 tests) pass. The a11y case for the removed page now opens the Library's select, a collection's menu and the New collection dialog.
  • The full frontend suite (209 files, 1,651 tests), npm run budget, make lint typecheck, and tests/unit/test_sharing.py and test_identity_incomplete.py (121 tests) pass.
  • Manual, against a local server, in the dark theme (the dashboard's only theme), at 1280 and 390 px:
    • Before: the Library had no collections, and Admin › Collections was a table of col-… names.
    • After: the select lists col-handbook · Team handbook and onboarding, with col-handbook-hr · People policies under it and col-research · Papers and notes the agents cite. Picking col-handbook shows its document, the Admin role and the Members / Delete collection menu, and the URL reads ?collection=col-handbook.

🤖 Generated with Claude Code

zlareb1 and others added 2 commits November 4, 2026 01:50
…s its own chunk

With main's Assistant page and the Library's collections the shell's
index chunk passed its 120 kB budget. The page a memory view shows on a
code or tracker namespace, or none, is a page of its own, as the views
are, and loads when it is shown. The index chunk is 115.8 kB.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
@zlareb1
zlareb1 force-pushed the feat/library-collections branch from 1e14ade to 3a50e9d Compare November 4, 2026 01:53
@zlareb1
zlareb1 merged commit 61460f1 into main Nov 4, 2026
21 of 22 checks passed
@zlareb1
zlareb1 deleted the feat/library-collections branch November 4, 2026 01:59
@pufit pufit mentioned this pull request Nov 4, 2026
9 tasks done
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