Task: Give the embedded table a selection contract
Table of Contents
This page documents a task in the Trade Blotter — the remaining work story. It captures the goal, current status, acceptance, and any notes or results.
1. Goal
Let RecordTable carry an optional selection, so a screen that chooses rows uses the house table instead of copying it.
2. Status
| Field | Value |
|---|---|
| State | DONE |
| Parent story | Trade Blotter — the remaining work |
| Now | Nothing. |
| Waiting on | Nothing. |
| Next | Nothing. |
| Last touched | 2026-11-01 |
3. Acceptance
- RecordTable takes an opt-in selection: which rows are chosen, how a row is toggled, and whether the whole set may be chosen at once.
- A screen that does not ask for selection draws exactly as it does today.
- The grouping screen draws its picker with RecordTable and loses its hand-rolled table.
- The chosen count and the mixed-counterparty guard stay the screen's, since they are its rule and not the table's.
4. Plan
The contract is one optional prop. Three fields and no more: what is chosen, how a row is toggled, and, only where the screen offers it, whether the whole set may be chosen at once. A table that states no selection draws exactly what it drew before, which is what makes this safe to add to a component every list uses.
What stays outside the table is the part that is not drawing: the count the screen shows, the rule that refuses a mixed counterparty, and the act the choice is for. The table reports keys and draws boxes; it decides nothing.
5. Measurements
Every number this task claims about a tree, with the command that produced it
and the commit it was measured at. A number without both is not a measurement,
because a clean-up record describes a tree and trunk moves under a branch: a
consumer count, a gate's component count and a suite's size all change with no
code changing, and the reader of a bare number cannot tell which tree it came
from. Where the raw output matters, put it in an evidence/ file beside the
task and name that file in the Command column.
| What | Value | Command | Commit |
|---|---|---|---|
| The suite still draws | 2384 of 2385 web cases, the one failure being the tenant form case that fails on the tree without this branch | npm test --workspace @ores/web |
this branch |
| The grouping screen | the hand-rolled table is gone; the picker is RecordTable with a selection |
grep -c "<table" projects/ores.web/packages/web/src/trading/GroupStructuresPage.tsx (0) |
this branch |
6. Notes
7. Test Scenarios
Manual QA scenarios (scaffolded via compass add test_scenario)
that verify this task. Link
new ones here as they're created; the scenario doc itself links back
via its "Verifies task" field.
| Scenario | State | Notes |
|---|---|---|
8. PRs
9. Review
| Comment summary | File | Decision | Notes |
|---|---|---|---|
10. Result
RecordTable takes an opt-in selection, and the grouping screen draws its picker
through it.
| Piece | Where |
|---|---|
| The contract | selection={{ chosen, onToggle, all? }}, three fields and nothing else |
| The drawing | a leading box on each row, and a leading box in the header only where the screen offers the whole set |
| The label | refdata.records.chooseAll, in three languages |
| The caller | the grouping screen, which no longer hand-rolls a table |
11. What stayed the screen's
The count it shows, the rule that refuses a mixed counterparty, and the fact that a grouping needs two trades at least. The table reports a key when a row is toggled and draws the box that is in the state the screen states; it holds no opinion about what may be chosen.
12. What a screen that does not choose sees
Nothing different. The prop is optional, and every other table in the product passes none.