Skip to content

The Proposals tab decides the selected proposals in one confirmed batch - #2285

Merged
zlareb1 merged 3 commits into
mainfrom
feat/proposals-batch-decide
Dec 5, 2026
Merged

zlareb1 merged 3 commits into
mainfrom
feat/proposals-batch-decide

Conversation

@zlareb1

@zlareb1 zlareb1 commented Dec 5, 2026 •

Copy link
Copy Markdown
Member

Part of: #1144
Part of: #1763
Related: #2064

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):

On the dashboard's Proposals tab a namespace administrator ticks rows and rejects or accepts them in one confirmed batch. The plan shows every text before anything is sent, and the result names each proposal left pending and why.

Why

memory.proposal_decide decides many keys in one call and answers one result per key, and the dashboard decided one proposal per dialog. A reviewer with forty proposals to reject opened forty dialogs. The tab now sends one call for the rows the reviewer ticked, after a plan that shows what the call is bound to, and it says for each key the call left pending why it was left.

Scope and risk

Dashboard only: frontend/src/views/admin/Proposals.tsx and its test, frontend/src/api/review.ts, one rule in frontend/src/styles.css, two cases in frontend/e2e/list-tables.spec.ts, the test helper frontend/src/test/opNames.ts and two documentation pages. No server file changes.

What changes on the tab:

  • A toolbar above the table (ListToolbar, no search) counts the list: "the newest 100 of 140 proposals" when the list is cut, "37 proposals" when it holds every one. It replaces the note under the table. While rows are selected the toolbar is the shared selection bar, with its own words ("3 selected", "Select all 40 on this page").
  • Each row has a leading checkbox named "Select " where the caller can decide and the row can be decided with others. The checkbox is not a tab stop: the table stays one tab stop, and Space on the current row toggles it. A role that cannot decide gets no checkbox column. Under a touch pointer the checkbox keeps its 16 px box and is a 44 px target.
  • Two kinds of row take no checkbox and say why under the fact: a row whose key another listed proposal holds (the tab's existing sentence for a shared key) and a high row ("Sensitive proposals are decided one at a time."). Both are decided from their own review, as before.
  • The selection bar holds Reject… for any number of the selected rows and Accept…, which is unavailable above 20 selected with "Accept at most 20 proposals at a time: each is shown in full." and unavailable with the tab's existing reason for a caller who can reject and cannot accept.
  • When the selection empties from the bar (Clear, Escape, or unticking "Select all"), the bar's controls leave and the count that takes their place holds no control, so the panel takes the focus they held. The panel holds the whole table, so it takes the focus without being scrolled into view: the page stays where it was.
  • The reject plan lists each row's key, proposer and preview as the list served them, takes one optional reason ("Optional. Kept on each rejected fact."), says "A rejection cannot be undone: a rejected fact has to be proposed again.", and sends each row's listed hash. Its button counts: "Reject 37 proposals".
  • The accept plan reads each text whole through the read the review dialog uses, and shows it with format and bidirectional control characters (Unicode category Cf) drawn as code points, such as U+202E. A proposal with a non-empty conflict_with is marked "Lands in Conflicts when accepted". A text that could not be read is left out, named in the list with the read's reason, and counted out of the button. The button is disabled until every read has answered, and the call sends the hash of each read.
  • Both plans open with the focus on Cancel, so Enter on a plan that has just opened sends nothing.
  • On the answer the dialog stays open: a role="status" line says "Rejected 37 of 40", a list holds one line per proposal left pending, and the only button is Close. Decided rows leave the selection at once and the list is read again; the rows left pending stay selected. Closing returns the focus to the toolbar action that opened the plan, or to the panel when nothing is selected any more.
  • The words for a proposal left pending come from the result's code: not_found, not_proposed, hash_required, changed, ambiguous, not_independent, proposer_unknown and value_refused. A not_proposed result names the newest row of the key in memory_id. When that is the proposal's own row, someone decided it first, and the line says "Already accepted." or "Already rejected." by its status. When it is another row (the proposal was deleted and another identity's fact holds the key), the line says "Not a pending proposal.". A result with no code, from a server a release behind, and a code the dashboard does not know show the server's reason sentence.
  • A call that gets no answer shows the error toast and keeps the plan open with its reason, since nothing is known to be decided.

Design choices:

  • A plan lists the key, the proposer and the text and nothing else of the row. Advice, graded runs and the agent stay in the single review, where one proposal is weighed. The batch is for rows the reviewer has already judged from the list.
  • The read of a proposal's full text moved into one function, readProposal, that the single review and the accept plan both call, so the two cannot differ in what they treat as a gone or unreadable proposal.
  • The panel mounts one dialog per plan (by key), so a plan never starts with the reads, the reason or the result of the one before. The dialog keeps the plan it was mounted with, so its content stays drawn while it closes.
  • A row decided from its own review also leaves the selection, so a later batch cannot send a key that is no longer pending.
  • The single review shows its text as before. Code points are drawn in the accept plan only, where texts are read in bulk.
  • The action labels end in an ellipsis because each opens a dialog; the shared toolbar folds them into a menu on a narrow window.
  • The touch target is the list rows' rule (styles.css), extended to the table cell that holds a checkbox. Click UI's cell clips what leaves it, and under 769 px its card clips the cell, so under a coarse pointer that cell is 44 px tall and does not clip. A phone's card is 12 px taller for it; a fine pointer sees no change.

Left out: a shared key in a batch, and an order for the list.

Risk:

  • Authorization is the op's. The checkbox column only follows the reason the tab already computes for the two decisions, and a refused call is shown as a failed decision.
  • A rejection is bound to the listed hash and an acceptance to the hash of the plan's own read, so a text that changed after the plan opened is answered changed and stays pending.
  • The accept plan makes up to 20 point reads at once as it opens.
  • The checkbox column is 40 px of a table whose other fixed columns take 620 px. At 1024 px wide with the sidebar open the table is 720 px, which leaves the Fact column 60 px (100 px for a role with no checkbox column). Measured in the 1024 px run below and not changed here.
  • Preserve stored JSON in memory reads and MCP replies #2064 edits the same read in Proposals.tsx. Whichever merges second resolves a small conflict in readProposal.

Compatibility, rollout and rollback

  • Wire: none added, changed or removed. The dashboard now sends memory.proposal_decide with several memory_keys, one approved_sha256 entry per key and one reason, all of which the op already takes (up to 500 keys; the tab lists 100). It now reads results[].decided, status, reason, code and memory_id of that op and conflict_with of memory.proposals, which the server already answers. frontend/src/api/review.ts gains the ProposalDecision type and the conflict_with field for them.
  • Rolling upgrade: a server a release behind sends neither code nor memory_id, and the result then shows its reason sentence. A server that sends no conflict_with gets no Conflicts mark.
  • Tables, settings, migrations: none.
  • Operator steps: none.
  • Rollback: reverting leaves nothing behind.

Tests

New cases in frontend/src/views/admin/Proposals.test.tsx, under a batch of proposals. Each fails when the behaviour it names does not hold:

  • offers no selection to a role that cannot decide.
  • gives an administrator a checkbox per row that is never a tab stop: also that Space on the current row toggles it.
  • a shared-key row and a sensitive row take no checkbox, and each says why.
  • the reject plan lists each preview, starts on Cancel and sends the listed hashes: also the reason, and that no full text is read.
  • the accept plan reads each text whole and sends each read's hash: the reads answer hashes that differ from the listed ones.
  • holds the acceptance until every text is read.
  • draws format and bidirectional control characters as code points: the source writes each character as an escape.
  • Accept is unavailable above 20 selected, and Reject takes them all.
  • a service administrator selects and rejects, with Accept unavailable.
  • marks a contradicted proposal in the accept plan.
  • leaves an unreadable text out of the acceptance, names it and counts it out.
  • the result lists each undecided row with its words, and decided rows leave the selection: also the status line and the focus after Close.
  • a decided row leaves the selection before the list is read again.
  • closing a result that decided every row puts the focus on the panel.
  • ... empties the selection and puts the focus on the panel, three cases: Enter on Clear, Escape from Reject…, and Space on the ticked "Select all". Each failed with the focus on the page before the panel took it.
  • says a proposal was decided only when the result names its own row: a not_proposed result that names another row, or none, reads "Not a pending proposal."; it failed with "Already accepted." before the check on memory_id.
  • shows the reason sentence of a server a release behind, and of a code it does not know.
  • words every code the server can answer: reads the code set from server/memory/domain/proposal_triage.py, so a code added there with no words here fails. The read goes through repositoryText in frontend/src/test/opNames.ts, which the generated op table's read also uses: it throws when server/ is present and the module is not, and answers the test's own list only in a checkout without server/.
  • a batch that gets no answer keeps the plan open for another try.
  • Cancel sends nothing and keeps the selection: also that the next plan starts empty.
  • a row decided from its own review leaves the selection.
  • the open plan has no accessibility violation: axe on the plan and on the result.

Changed cases: the test of a cut list now reads the count from the toolbar and checks that the old note is gone, a new case covers a list that holds every proposal, and the cell helpers skip the added checkbox column.

New cases in frontend/e2e/list-tables.spec.ts:

  • a proposal's checkbox is a 44 px target, with a touch pointer at 375 px (Click UI's cards) and at 1024 px (the table). It taps 20 px from the centre of the 16 px box on each of its four sides and expects each tap to tick or untick the row and none to open the review. Both widths failed before the style rule.
  • clearing a proposal selection leaves the page where it was scrolled: on a list of 40 proposals, taller than the window, it ticks a row, presses Clear, and expects the panel focused and the scroll position unchanged. It failed with the page scrolled 125 px before the focus passed preventScroll.
Command Result
npx vitest run on Proposals.test.tsx and the 13 test files that import the changed modules or read styles.css (api/review.test.ts, ReviewQueue.test.tsx, copy.rules.test.ts, emptyStates.rules.test.ts, canCall.test.ts, RunReliance.test.tsx, ListToolbar.test.tsx, Toast.layer.test.tsx, ThreadReplayDialog.test.tsx, Modal.test.tsx, ui.test.tsx, Unavailable.test.tsx, preview.test.tsx) 14 files, 261 passed; Proposals.test.tsx: 61 passed. With the preventScroll argument, the last change, the two files that reach it ran again (Proposals.test.tsx, ReviewQueue.test.tsx): 160 passed
npx playwright test e2e/list-tables.spec.ts 40 passed
npm --prefix frontend run build, npm --prefix frontend run budget built (tsc -b with no errors); bundle-budget: OK
biome format on the six changed dashboard files and biome lint frontend/src (the pinned Biome) no fixes
ruff check server extractor sdk/python tests scripts .claude, ruff format --check . passed
make typecheck 0 errors; mypy --strict sdk/python/loom: no issues in 75 files
pytest -n 2 on tests/unit/test_package_contracts.py, test_op_transport_contract.py, test_tunable_constants.py, test_store_names_refused.py, test_degraded_unnoted.py, test_public_copy.py, test_doc_links.py, test_agent_instructions.py and tests/analyzer 607 passed, 12 skipped, 1 failed (below)

tests/unit/test_degraded_unnoted.py::test_every_broad_handler_notes_its_fallback_or_says_why_it_need_not fails on server/knowledge/app/sources_queue.py. This change touches no Python file, and the branch point fails the same way: main has since fixed it, in a commit this branch does not hold. It is reported here and not fixed.

Not run locally:

  • The Playwright specs other than e2e/list-tables.spec.ts. That spec ran in headless Chromium with the system libraries it misses on this machine unpacked into a private folder and named in LD_LIBRARY_PATH; nothing was installed.
  • make lint and make format as whole targets: this machine has no rustfmt and no shfmt. Ruff and Biome ran on their own, as the table says, no shell file changed, and the two documentation pages are unchanged since Prettier checked them.
  • The full unit suite, the full dashboard suite and the integration suite, which CI runs. No ClickHouse and no server were started: the change adds no statement and no server path.

The branch merges with main without a conflict (git merge-tree --write-tree origin/main HEAD), so it holds no merge of main.

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 running: each new test against the change, the type check, the build and the bundle budget, the format and lint checks on the changed files, the touch target in a browser at two widths, the scroll position after Clear in a browser, and the diff read once against the dashboard design rules.

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

Checklist

  • Local format, lint, type checks and focused tests pass. The full make test-unit and applicable integration results are reported by CI; a full local run is not required before pushing.
  • 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), the Codex plugin copies (python3 scripts/codegen/agent_plugin_sync.py) and the standalone skill bundles (python3 scripts/codegen/standalone_skills.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.
  • I signed the Contributor License Agreement (CLA) if CLA assistant requested a signature.

🤖 Generated with Claude Code

A namespace administrator ticks rows of the Proposals tab and rejects or
accepts them in one call. A toolbar above the table counts the list
("the newest 100 of 140 proposals") and holds the selection bar; it
replaces the note under the table.

A row takes a checkbox only where the caller can decide and the row can
be decided with others: a row that shares its key with another proposal
and a sensitive row take none and say why.

Reject opens a plan that lists each key, proposer and preview as the
list shows them, takes one optional reason and sends the listed hashes.
Accept reads each complete text with the review dialog's read, draws
format and bidirectional control characters as code points, marks a
proposal that lands in Conflicts, leaves an unreadable text out by name
and sends each read's hash. Accept is unavailable above 20 selected,
because each text is shown in full.

The dialog stays open on the answer: a status line counts what was
decided and one line per proposal left pending says why, in words for
each code the server answers and in the server's sentence where it
sends no code. Decided rows leave the selection.

Signed-off-by: Mohammad Lareb Zafar <lareb.zafar@clickhouse.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@vercel

vercel Bot commented Dec 5, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
loom-docs Ready Ready Preview Dec 5, 2026 5:04pm UTC
loom-telemetry Ready Ready Preview Dec 5, 2026 5:04pm UTC

Request Review

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

const loading = accept && proposals.some((p) => !reads[p.memory_id]);
// What the button counts and the call sends: every row of a rejection, and of an
// acceptance every text but those that could not be read.
const sending = proposals.filter((p) => !(accept && reads[p.memory_id]?.error));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale reads survive scope change

Medium Severity

The accept plan keeps earlier full-text reads when org or namespace changes. loading stays false because those reads are already stored, so Accept can send the previous texts' hashes under the new scope before the fresh reads finish.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 632c89e. Configure here.

…s a result by the row it names

The count that takes the selection bar's place holds no control, so Clear, Escape and
unticking Select all left the focus on the page. The panel takes it, as it does when a
result that decided every row is closed.

A `not_proposed` result names the newest row of the key, which is another row once the
proposal is deleted and another identity's fact holds the key. The result says "Already
accepted." or "Already rejected." only when `memory_id` is the proposal's own row, and
"Not a pending proposal." otherwise.

Under a coarse pointer the row checkbox is a 44 px target. Click UI's cell clips what
leaves it, so the cell that holds a checkbox is as tall as the target and does not clip.
`e2e/list-tables.spec.ts` taps 20 px from the box's centre on each side at 375 px and at
1024 px.

Tests: the code-point case writes its format characters as escapes, and the read of the
server's code table goes through `repositoryText` in `test/opNames.ts`, which throws when
`server/` is present and the module is not.

Signed-off-by: Mohammad Lareb Zafar <lareb.zafar@clickhouse.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.

There are 3 total unresolved issues (including 1 from previous review).

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 44277fb. Configure here.

Comment thread frontend/src/styles.css
.row-check-cell {
overflow: visible;
padding-block: calc((var(--spacing-hit) - var(--click-checkbox-size-all)) / 2);
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Touch target sits under adjacent cells

Medium Severity

The coarse-pointer hit area on a proposal checkbox is a 44px ::after centered on a ~16px control inside a 40px row-check-cell. That box extends into the next cell, which is painted on top and has no z-index on the checkbox. A tap beside the box hits the fact cell instead of toggling the row, and can open the review.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 44277fb. Configure here.

const lost = !document.activeElement || document.activeElement === document.body;
if (wasSelecting.current && !selecting && lost) panel.current?.focus();
wasSelecting.current = selecting;
}, [selecting]);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Selection clear steals dialog focus

Medium Severity

When a batch decides every selected row, the selection bar unmounts while the result dialog is still open. The new layout effect treats the unmounted dialog button as lost focus (activeElement is body) and focuses the panel behind the modal, before BatchDialog moves focus to Close.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 44277fb. Configure here.

The panel that takes the focus when the selection bar leaves holds the
toolbar and the whole table. On a list taller than the window a plain
focus() scrolled it into view: the page moved 125 px and the header and
the tab list left the window. The focus now passes preventScroll.

A Playwright case in list-tables.spec.ts ticks a row of a 40-row list,
presses Clear, and expects the panel focused and the scroll position
unchanged. It failed with the page scrolled before the change.

Signed-off-by: Mohammad Lareb Zafar <lareb.zafar@clickhouse.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@zlareb1
zlareb1 merged commit 95c0a3c into main Dec 5, 2026
79 of 81 checks passed
@zlareb1
zlareb1 deleted the feat/proposals-batch-decide branch December 5, 2026 17:08
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