Skip to content

The Assistant page opens on the namespace's overview, and a user or agent is picked from it, not typed - #306

Merged
zlareb1 merged 15 commits into
mainfrom
feat/assistant-ux
Nov 7, 2026
Merged

zlareb1 merged 15 commits into
mainfrom
feat/assistant-ux

Conversation

@zlareb1

@zlareb1 zlareb1 commented Nov 6, 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 Assistant page opens on what the namespace holds and who appears in it; each user and agent there is a button that shows what it remembers, so no id has to be typed. Documents, the graph and drafting improvements are one action each.

Why

The page opened on a Scope form with User selected, an empty User id box and a disabled Inspect saying "Enter an id to inspect", so it read as a page that needs an id before it can do anything, although the overview, the documents read and every starter need none. The ids it asked for were ones it already had: the inventory lists the users and agents found on rows, but as plain badges to copy and retype. Nothing showed until a starter was clicked, Documents sat as a fourth choice in the User/Agent/Session toggle although it takes no id and reads something else, and the graph needed an entity typed into a free-text box with no suggestions. The visible copy named ops and release details.

The page now reads top to bottom as a first-time viewer uses it:

  • Overview, read on load (namespace.inventory, a VIEWER read gated as before): live counts and the newest write per plane (the dashboard's Stat tiles), then users, agents, authors and members. Users and agents are buttons; a click fills the form, inspects, and moves the focus to the answer. Authors and members are listed only, since no inspection is filed under an actor or a grant. Refresh reads it again.
  • Inspect: the User/Agent/Session toggle and an id field that suggests the users or agents the overview found (a text input with a datalist, the native combobox, so any other id or a session id can still be typed). A disabled button says what to do next ("Pick a user above or type an id."). Inspect documents is its own button.
  • Relationships: Open the graph works with the field empty. The graph opens on its own starting points and suggests its top entities, so this page needs no extra read to suggest them.
  • Improve this namespace: one Draft improvements button (secondary: Inspect memories stays the page's one primary action); Review changes appears only once drafts exist. Each draft card replaces the always-disabled Apply button with a "How to apply" line in plain words, above the write and arguments a writer needs.

Design notes:

  • Reading the inventory on load stays inside the op's budget: it is the namespace's counts and three top-20 group-bys over the table's key prefix, read each time the page opens (a visit, or Back from the graph), when the namespace or token scope changes, and on Refresh. Measured on a local ClickHouse with one namespace of 207,360 live memory rows (5,184 users, 30 agents), five calls: 9 queries per call, 836,497 rows read, 71.5 MiB peak memory per query, the slowest query 30–84 ms, and 38–120 ms end to end, against the op's p99 budget of 800 ms (OP_BUDGETS_P99_MS). The reads scale with the namespace's live rows (each FINAL scan reads them once), so it was measured again at ten times the size: 2,073,601 live rows (51,841 users, 31 agents, merged), five calls, 9 queries and 8,294,405 rows read per call, 72 MiB peak memory per query, the slowest query 59–89 ms, and 78–100 ms end to end. (One of the five calls also ran the server's usage-hint checks, which any call can trigger and which share the request's tag: 15 more queries, the slowest 210 ms.) The page is meant for any namespace that size or smaller; one far larger pays the op's own cost, as it did on a click before.

    SELECT log_comment, count() AS queries, sum(read_rows) AS read_rows,
           formatReadableSize(max(memory_usage)) AS peak_mem, max(query_duration_ms) AS slowest_ms
    FROM system.query_log
    WHERE type = 'QueryFinish' AND log_comment LIKE 'namespace.inventory%'
    GROUP BY log_comment
  • Click UI's AutoComplete selects a value from its list and does not keep free text, so the suggest list is the Click UI TextField with a native datalist.

  • The scope and permission gates are unchanged: an unknown role, a token pinned to one user, and a token whose scope needs an id this page does not send each disable the reads they disabled before. The pinned-token reason now names what it blocks ("inspecting memories and drafting").

  • While the role is still being read (namespace.list_mine on a direct visit), the overview shows a loader and each read's button says the role is still loading, not "Your role on this namespace is not known.": lib/namespaceRole.ts gains useNamespaceRoleRead, which returns the role and whether that read is still running; useNamespaceRole returns its role as before.

Tasks a first-time viewer does, measured with Playwright against a local server with four users, three agents, seven sessions and two documents:

Task Before After
See what the namespace holds 1 click 0 (on load)
Inspect a user 3 clicks, the id typed 1 click
Inspect documents 2 clicks 1 click
Open the graph 3 clicks, an entity typed 1 click
Draft improvements 1 click 1 click

Scope and risk

Frontend only: frontend/src/views/Assistant.tsx, views/assistant/Inventory.tsx, ReviewChanges.tsx and the new subjects.ts (what the page calls each subject, and which population is inspected as which), views/assistant/Inspection.tsx (the subject label from subjects.ts, an agent shown by the dashboard's name for it), a comment in lib/graphLink.ts, lib/namespaceRole.ts (the new loading flag; the rows a list_mine read answered are now kept only for the org they were read for), four shared primitives (ui/Unavailable keeps its child mounted when its reason comes or goes, so a focused button keeps its focus, and takes a tip, shown alone without a reason and under the reason with one, while the description stays the reason; ui/BusyButton forwards its ref and keeps an aria-disabled given to it; ui/SectionHeading takes focusable so a script can focus a heading; ui/Stat's hint takes a node), their tests, the Assistant e2e spec, the e2e fixture (which now answers namespace.inventory, as the page reads it on every load), the page's line in docs/features/dashboard.md and docs/features/knowledge.md, and the datalist field in docs/development/dashboard-design.md. No server change. The inspection and document panels show the server's own text, unchanged.

Compatibility, rollout and rollback

  • Wire: none. The page calls the same four ops; namespace.inventory is now called on load instead of on a click.
  • Operator steps: none.
  • Rollback: reverting restores the starters; nothing is stored.

Tests

  • npm --prefix frontend run test: 218 files, 1932 tests pass (one Library tag test fails now and then under heavy load, and passes alone and on a re-run, before and after this change). The primitives' tests pin Unavailable keeping a focused child focused as its reason clears, and BusyButton forwarding its ref and an aria-disabled given to it. The Assistant tests cover the overview on load and its gates, the overview read once the role resolves (a loader meanwhile), the id hint when the overview lists nobody, a section or population the server could not count shown with its own reason, a pick with one memory named in the singular, a second pick while the first is still read moving the focus to the answer, the id field cleared on a namespace switch and a change of subject, Refresh keeping the overview on screen marked busy, a failed draft read showing no Review changes, picking a user and an agent (each moves the focus to the answer; the buttons are named "ada 12 memories"), the suggestions per subject, authors not offered, the top-N note, the pinned-token cases, Refresh, a namespace switch reading the new namespace's overview, the graph with and without an entity, and the "How to apply" line for each kind of draft; axe runs on the overview and on the drafts.
  • npm --prefix frontend run build and run budget: pass.
  • E2E_PORT=<port> npm --prefix frontend run e2e: the Assistant spec draws every panel at 1400 and 375 px with no horizontal scroll, no clipped element and no axe violation, draws blocked picks with a 200-character id at 375 px (described by the reason, the whole id in the tip), checks a pick's accessible name ("ada 3 memories"), the cut id's tip and the focus on the Memories heading after a pick, and that Back from the graph lands on Open the graph. The Assistant, a11y and focus-ring specs pass; in the route-budget spec /assistant passes (three runs of three), and the paint-time failures on other pages track the machine's load (load average 485 at the time).
  • Unavailable now keeps its child inside a closed tooltip on every page, so the route-budget and perf-budget specs ran for main and this head side by side, on the same machine at the same time: main failed four CPU-timed checks (an LCP, and interactions of 312, 448 and 1280 ms), this head three (an LCP, and interactions of 224 and 352 ms). Every Unavailable child is a Click UI Button or BusyButton, and no style keys on the tooltip trigger's data-state.
  • The full Playwright run: 492 pass, 6 skip. The six that fail are CPU-timed budgets on other pages (LCP on /memories, typing INP on Memories, Conversations, Spaces, Repositories, Tasks), each a few ms to a few hundred ms over on a heavily loaded machine; a re-run fails a different set, and main's frontend under the same load fails seven of the same spec. /assistant's route budget, axe and focus-ring runs pass.
  • make format lint: pass.
  • A local server with seeded users, agents, sessions and documents, driven with Playwright at desktop and phone width: each task in the table above, and the screenshots of each state, before and after.

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. I checked the page in a browser against a local server, and read every changed line.

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

Checklist

  • make format, make lint and make typecheck pass; make test-unit runs on the rebased head before the merge; no server behaviour changed, so no integration run.
  • Generated files are regenerated in this PR, not by hand: none are touched.
  • A new migration is additive and numbered after the latest on main; no merged migration is edited. (None.)
  • A behaviour change to any file a plugin ships bumps both plugin manifests' version. (None.)
  • 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 15 commits November 7, 2026 10:37
…gent is picked from it, not typed

The overview (namespace.inventory) is read on load. Each user and agent in it
is a button that inspects it, and the id field suggests them while taking any
other id or a session id. Inspect documents, Open the graph (with or without an
entity) and Draft improvements are one action each; a draft card says how to
apply it in plain words instead of showing a disabled Apply button.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…on, labelled counts and picks

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…ng, the whole id in a tip

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…ead, tips only for cut names

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…icks, Agent name field

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…at the badges' width, focus on the Memories heading

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
… through Unavailable

A pick's accessible name is set on the button, since its flex label drops the space
between the name and the count; the cut name's tip goes through Unavailable's `tip`, so
the button keeps one tree whether blocked or not. Tests pin Unavailable keeping focus as
its reason clears and BusyButton forwarding its ref.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…nt in the singular

An uncounted plane or an incomplete population shows the server's reason as a sentence,
which already says what was not counted. A pick with one row reads "1 memory", and a
blocked, cut pick's description ends with its id as a sentence. The subject mapping
moves to its own module; the e2e behaviour checks for a pick leave the layout setup for a
test of their own, and Unavailable's tip has a unit test.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
… that say why

The drafts block is a section labelled by its Review changes heading, like the
overview's. The pick's flushSync comment says the Memories heading mounts once the read
is busy; the fallback reasons drop their period to match the server's; imports sit in
name order; the BusyButton test clicks the button its mock is for.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
… its tip only

The subject's toggle label, field label and empty reasons are one record in
assistant/subjects.ts, beside the population each is listed under. A blocked, cut pick
is described by its reason alone; Unavailable shows its tip under the reason. Tests pin
Refresh keeping the overview marked busy and a second pick moving the focus, and share
one token helper.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…ble's tip computed once

shownName in assistant/subjects.ts labels both the datalist options and the picks;
Unavailable builds its tooltip content before the JSX; the gate comment keeps only why;
a test name says what it checks.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
… a change of subject

An id picked in one namespace, or typed as a user id, is not sent as another
namespace's id or as a session id. Agents are described by what the server counts
(the agent memories were written under, apart from their authors); the tooltip test
checks the reason and the tip apart.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…, names by domain

The subject toggle clears the id only when the subject changes; a namespace switch
clears the graph's start entity too. The subject copy is SUBJECT_COPY (the inspection
heading reads its label) and the population mapping INSPECTED_AS; `pick` is required, and
the gate comment says why the inventory's answer counts as well as the token's claims.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…hint only with picks

The inspection heading shows an agent by the dashboard's name for it, as the pick and
the suggestion do. "Who appears here" asks for a pick only when the overview lists
someone; the toggle's early return says why it is there.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…t says what it keys on

A session is never suggested, so its copy has no `pick`. The form's namespace key is named
for what it is and says why a new token keeps the typed id; the top-N test is built as the
server answers (20 of 340).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
@zlareb1
zlareb1 merged commit dd8f94e into main Nov 7, 2026
23 checks passed
@zlareb1
zlareb1 deleted the feat/assistant-ux branch November 7, 2026 11:01
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