Skip to content

feat(web): build each table from one column list, with search, sticky columns and aligned numbers - #199

Merged
harenome merged 17 commits into
ThinkFlowLab:mainfrom
harenome:refactor/table-toolkit
Nov 18, 2026
Merged

harenome merged 17 commits into
ThinkFlowLab:mainfrom
harenome:refactor/table-toolkit

Conversation

@harenome

@harenome harenome commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #198

What

A table is now one list of column definitions. The table macro in _tables.html reads it and builds the headers, the cells, the controls row, the Columns menu, Sort by and the pager. tables.js (NulliusTable) wires them on load. Launches and Workspaces use the macro. All runs builds its headers and its controls row from its column list (COLUMNS in web/shared.py), and keeps its outcome chips, its live refresh and no pager.

A column definition has these keys:

Key Effect
key, label the data-col of the header and the cells, and the name in the menus
type text or num: how the column sorts
align left, center or right (the default for num), for the header and the cells
sticky pinned at the left while the table scrolls. The last pinned column draws the edge.
blank, check, sr no visible name (a status, the actions), a checkbox that ticks the visible rows, a name for screen readers only
menu, fixed, off not in the Columns menu, always on, or off until the viewer turns it on
width fit (default): the widest cell on one line. expand: the rest of the width, wrapping. Past that, the table scrolls.

The macro writes each row's cells in the order of the columns and asks the page for each cell's content. A cell therefore cannot land under another column's header, and it gets its column's alignment and pinning. A table opts into each feature with the macro's parameters: search, columns, choices (Filter), only (a filter preset), views and actions (a page's own buttons). Sort by is on unless a column says it does not sort.

Controls row. The search box is at the left and takes the remaining width. At the right, in this order: the views slot, Columns, Filter, Sort by and the actions slot. A slot is a macro of the page that writes any number of buttons. The toolkit places them in a group spaced as its own buttons, and writes no group when the slot writes nothing. At 390 px the search takes its own line and the buttons wrap together, flush right. The menus open leftwards. Search matches each word of the query against the row's data-search text, in any order and any case. It narrows the rows before the pager, and a new query shows the first page. Escape clears it. No match shows the empty note. One live region per table tells a screen reader what shows, 300 ms after the last search, filter, sort or page change, in the table's own word: "1–25 of 32 launches". It says nothing on load.

Headers. A header shows an arrow only when its column is the sorted one, on all three tables. The ↕ on unsorted headers and the header filter carets are gone. Filters are in the Filter menu.

Sticky columns. tables.js places each sticky column at the summed widths of the sticky columns before it. It measures them on load and again when a column resizes or hides, or when rows arrive. A page marks a sticky column once, in its definition. The hand-written offsets are gone. On All runs, the Run column now starts where the checkbox column ends.

Alignment. align replaces the num flag, which .grid td overrode. Numbers in Launches, Workspaces and All runs are now on the right, header and cells.

Menus. In Filter, Sort by and Columns, a click on an option's text moved the focus to <main>. The menu then closed before the click reached the label. A focus move to an ancestor of the menu no longer closes it.

Pages.

  • Launches: search by launch, agent, benchmark or workspace. A launch's agents include those of the jobs its record plans but has not written yet (web/runs.py). Machines and Workspaces now sort by name.
  • Workspaces: search by name. Launches is a count button with the sidebar's icon, like Roots. Both sit last, before the trash. A workspace without launches shows a greyed 0: it takes the focus, does nothing, and its tooltip and description say "No launches in ". On the open workspace's row, the count buttons keep a visible border.
  • All runs: one controls row. Search by run, agent, model, benchmark or dataset. Compact is a view, before Columns. Filter lists Agent, Model and Dataset, and Sort by lists every sortable column. A header click still sorts. Compare is an action, at the far right. While fewer than two runs are ticked it is greyed: it takes the focus, does nothing, and its tooltip and description say "Tick two or more runs to compare". The header checkbox is the toolkit's check column. It stays ticked, unticked or mixed over the visible rows, and a hidden row keeps its tick. Compare collects the ticked runs in the same order as before. A live refresh keeps the query, the filters and the sort. Each Filter list takes the values the runs have now, and a new row passes the same query and filters. The visible "Tick two or more runs to compare" hint and the "N of M runs" note beside the buttons are gone. The page header still counts the runs shown.
  • Settings, Hosts: the status and actions headers use the shared blank header.

The caret filter (filter_button) has no user left and is removed from the toolkit. The shared table styles move into one block in style.css. The search box style moves there from Settings, unchanged. AGENTS.md names the two toolkit files.

Touches

routes (web/shared, web/runs) · templates and static (_tables.html, tables.js, runs/launches.html, runs/index.html, workspaces/workspaces.html, settings/settings.html, style.css, runs/launches.css, workspaces/workspaces.css, settings/settings.css) · docs (AGENTS.md)

Before and after

Seeded data: 32 run records and four workspaces ("Main study", two named "Ablation", and "Empty one" with no runs). Before is main, after is this branch, same width.

Before After
Launches, 1280 px, light 01-before-launches-1280-light 01-after-launches-1280-light
Launches, "gsm8k" typed in the search 02-before-launches-search-1280-light 02-after-launches-search-1280-light
Launches, every column on, scrolled to the right 03-before-launches-all-columns-scrolled-1280-light 03-after-launches-all-columns-scrolled-1280-light
Launches, 390 px, dark 04-before-launches-390-dark 04-after-launches-390-dark
Workspaces, 1280 px, light 05-before-workspaces-1280-light 05-after-workspaces-1280-light
Workspaces, "ablation" typed in the search 06-before-workspaces-search-1280-light 06-after-workspaces-search-1280-light
Workspaces rows: Launches and Roots buttons, the greyed 0, the open row 07-before-workspaces-rows-1280-light 07-after-workspaces-rows-1280-light
The same rows, dark 08-before-workspaces-rows-1280-dark 08-after-workspaces-rows-1280-dark
All runs: one controls row, Compare greyed, numbers on the right 09-before-all-runs-1280-light 09-after-all-runs-1280-light
All runs, 390 px, scrolled: the controls wrapped, the sticky checkbox and Run columns 10-before-all-runs-scrolled-390-light 10-after-all-runs-scrolled-390-light
All runs, filtered to two agents and sorted by Trials (after: "launch-0" typed in the search too) 11-before-all-runs-narrowed-1280-light 11-after-all-runs-narrowed-1280-light

Verified

In throwaway rootless containers (python:3.12 with Node.js, which the script tests need, and a clone of the branch):

  • python3 app/tests/parallel.py: 2240 tests in 126 modules, OK.

  • pip install -r app/requirements.txt, then python3 app/tests/parallel.py app/ui_tests: 575 tests in 47 modules, OK.

  • New: app/ui_tests/test_tables.py. Under Node.js, it runs tables.js on a small DOM. It checks:

    • Search with filters and pages. The announcement waits for changes to stop, says nothing on load and names its rows.
    • The header checkbox over the visible rows.
    • Sticky offsets from the widths before them.
    • A label click that keeps its menu open.
    • Two toolbars on one page, each sorting its own table.

    It also renders the macros. Every named column has a header, sorts and is in the Columns menu. The cells follow the columns. Two tables on one page name their own radios. Names and values are escaped. The views and actions slots, from controls and from table: two items each, in place and order, one group each, and no group when a slot is absent or writes nothing.

  • test_run_routes.py checks the Launches and Workspaces markup, the greyed 0, and the planned agents in the Launches search text. test_runs_by_launch.py checks the All runs controls row: the search, the order Compact, Columns, Filter, Sort by, Compare, the Filter and Sort by contents, the greyed Compare, headers without buttons, and each row's search text.

Browser check, Chromium (Playwright 1.49), on the seeded data: the views in the table above, before and after. No page JavaScript error and no console error on either side. Also, on this branch:

  • All runs, at 1280 and 390 px, light and dark: search with an outcome chip, Compact, the Filter menu, Sort by and a header click.
  • Compare is greyed with one run ticked, ready with two, and greyed again when one is unticked. A row that the search hides keeps its tick.
  • A run copied into a job root during the check: the live refresh adds it, and the query, the filter and the sort stay.
  • A compare of two runs, end to end.
  • Launches: the live region is empty after load and reads "1–25 of 27 launches" after a search.

Not checked: other browsers and a screen reader. The All runs page script runs in the browser check only, not in the test suites. A tooltip does not show in a headless screenshot. The greyed Compare's tooltip and description are checked in markup.

Risk

The change rewrites the markup of three tables. A page that reads a removed class or id breaks without an error: the old Launches-only inv-* classes are now .snug, .acts-col and #launches rules, and All runs no longer has #col-btn, #col-menu, #filter-note or the header .filter-btn carets. All runs' "Clear filter" chip now also clears the search and the Filter menu. To undo, revert the branch's commits. Nothing is migrated, and no stored data changes. The viewer's choices stay under the same keys (runs.cols, runs.compact, <table>.cols, <table>.per).

The rules the Launches and Workspaces tables share move from their page
stylesheets into the table block of style.css. The Runs table pins its
checkbox and Run columns with .sticky-col, as Launches does, so one rule
holds every sticky column. An unsortable header is any header without
data-type. The unused .grid.tools row-failed rule goes.
…cros

columns_button and columns_menu give the Runs and Launches tables one
Columns menu; blank gives the Launches, Workspaces and Hosts tables one
header with a screen-reader name only.
NulliusTable.paged joins toolbar and pager, as the Launches and
Workspaces tables both did by hand.
A press on a label's text moves the focus to the page's <main> (tabindex
-1), an ancestor of the menu. The menu's focusout handler took that for
leaving and closed the menu before the click reached the label, so only
the box or radio itself worked, in Filter, Sort by and Columns alike.
Focus moving to an ancestor of the menu no longer closes it.
Each .sticky-col sits at the summed widths of the sticky columns before
it, measured on load and again when one resizes or hides or rows come
in, instead of an offset written by hand per page. The All runs page's
Run column now starts where its checkbox column really ends.
… widths

A table's columns are one list of definitions; the table macro builds
from it the headers, the controls row, the Columns menu, Sort by and the
pages, and tables.js wires them on load, so a page gives its columns,
its opt-ins and its rows' cells.

- Search: a box at the left of the controls row, over each row's
  data-search text, any case; it narrows before the pages, a new query
  shows the first page, Escape clears it, no match shows the empty note.
  The page count is announced politely.
- The buttons go right: Columns, Filter, Sort by. Their menus open
  leftwards, and Sort by's radios are named after their table.
- Every named column sorts unless its definition says not: Launches'
  Machines and Workspaces now sort by their names.
- Widths: a column fits its widest cell on one line, but one that
  expands, with a floor, takes the rest; past that the table scrolls.
- A checkbox column (check_head, check_cell) whose header follows the
  visible rows, and a general actions cell (.acts-col).
- Launches and Workspaces use the table macro, All runs its headers and
  Columns menu. The Launches-only inventory and inv-* classes become
  .snug, .acts-col and #launches rules.
- Workspaces: Launches is a button like Roots, with the sidebar's icon;
  Launches and Roots sit last, before the trash.
- The search box style moves from Settings into the toolkit, unchanged.
A page marks a sticky column once, in its header (the column list's
sticky and edge); tables.js gives each cell under it .sticky-col and
.sticky-edge as it places them, so rows are written plain.
…ing pauses

A query's words now each have to match, in any order. The pages announce
what shows through one live region per table, 300 ms after the last change,
instead of the note and the empty text both on every keystroke. A sticky
row with fewer cells than headers is left as it is. The pages find their
empty note by the table's id, and the Workspaces search says what it reads.
…ned by its column

The table macro now loops over the rows and the columns and asks the page
for each cell, which it writes with the cell macro: its data-col, its
alignment and its pinning come from the column, so a cell cannot land
under another column's header. A column's `align` (left, center, right;
right for a 'num' column) replaces the `num` flag, which `.grid td`
outranked: the numbers flagged with it now right-align, header and cells.
The status and actions columns are `blank` columns, a checkbox column a
`check` one; the last pinned column draws the edge; the unused `sort`
options are gone. Launches and Workspaces build their rows this way.
… check column

The header box is the toolkit's `check` column and the rows' boxes its
check_cell; checks() keeps the header ticked, unticked or mixed over the
visible rows, as the page's own copy of that logic did. Compare still
collects the ticked runs in the same order. The header box's tooltip is
now its name, "Select all runs for comparison".
A workspace without launches shows the same count button as the others,
its icon and 0, greyed: still focusable, it does nothing, and its reason,
"No launches in <name>", is its tooltip and its description. The greyed
macro takes the button's class and text for it.
The open row's background is close to the buttons' plain border, in light
and dark; on that row they take the hover border's token instead.
… written yet

The Launches search says it reads agents; a launch's row now carries the
agents of its unwritten jobs too, from the plan its record already holds.
A page passes macros as `views` (how the table looks), written before Columns, and `actions` (on the rows or the selection), written after Sort by. Each slot is a group spaced as the toolkit's buttons, left out when it writes nothing, and wraps with them on a narrow screen.
All runs gets the toolkit's search box, Filter and Sort by, beside Columns, with Compact as a view and Compare as an action. Search reads each run's id, agent, model, runner and dataset. The header carets and the arrows on unsorted columns go: a header shows an arrow only when its column is the sorted one, on every table. Compare stays focusable and greyed, its reason its tooltip, until two runs are ticked. A live refresh keeps the query, the filters and the sort, and gives each Filter list the values the runs have now. The caret filter has no user left and is removed from the toolkit.
@harenome
harenome merged commit c310580 into ThinkFlowLab:main Nov 18, 2026
2 checks passed
@harenome
harenome deleted the refactor/table-toolkit branch November 18, 2026 09:30
harenome added a commit that referenced this pull request Nov 18, 2026
… and filter pills or dropdowns (#201)

Closes #200

## What

The four catalogue pages (Benchmarks, Agents, Capabilities, Kits) now
build their cards with a card toolkit, `_cards.html`, from the same
field list as the table toolkit. A field's `card` key names the slot it
fills. A field without `card` is not on the card, and `table` false
keeps a card-only field off a table. Each page builds its items in
Python (`web/catalogue.py`, `web/agents.py`) as dicts of display values,
so the template only says where each value goes.

The slots, in order:

| Slot | Holds | How many |
| --- | --- | --- |
| `status`, `tag`, `meta`, `check` | the top row: pills, a version, a
checkbox | tags any, the others one |
| `icon`, `title` | the icon and the name, a link stretched over the
card | one title, required |
| `text` | the description | one |
| `badge`, `note` | runner pills, notes with an optional icon | any |
| `stat` | label first, then value (`<dt>`, `<dd>`), below a line | up
to three |
| `alert`, `action` | a blocker line, buttons or links | one alert, any
actions |

A page that breaks a limit fails to render. A click anywhere on a card
opens it, except on a control of its own. The pills and notes with a
tooltip sit above the card's link to keep their tooltips, so a script
follows the link for them. A middle click or a Ctrl, Cmd or Shift click
opens a new tab or window, and a click that ends a text selection opens
nothing. A stat label wraps between words only: a stat column is at
least as wide as its longest word.

**Icon rule.** When one item of the page has an icon, the items without
one show their initials. When no item has an icon, no card shows one.

**Controls.** The cards use the table toolkit's controls row: the search
box at the left, the buttons at the right, no Sort by. Agents and
Capabilities now have a search. Search and filters hide the cards that
do not match. A Benchmarks shelf with no visible card hides, and its
count follows the visible cards. After a search or a filter, one live
region tells a screen reader how many cards show, 300 ms after the last
change, in the page's word: "9 of 12 benchmarks". It says nothing on
load. Cards and tables share this code (`NulliusTable.cards`, `narrow`,
`voice`).

**Filter forms.** A column's `filter` puts its choices in one or more
forms:

- `button` (default): the global Filter menu.
- `dropdown`: a menu of its own in the controls row. Its button ends in
a chevron that turns while the menu is open. Under reduced motion, it
changes without animation.
- `pills`: a row of toggles under the controls row.

Every form shows the same state. A pill toggles its value. All clears
its column, and Clear filters clears every column. An `only` preset
shows in each form. A column narrows when it does not show every value.
The Filter button or a dropdown that holds such a column is marked as
narrowed and shows a count: the Filter button its narrowed columns, a
dropdown its chosen values. After None, a dropdown shows a 0 beside that
mark. A card filter compares a value's `value` when it has one, else its
text, so a label can differ from its value. A field's `filter_icon`
leads its dropdown button and its pill row. Tables get the same forms.

**Pages.**

- Benchmarks: category pills, an Origin dropdown and a Runs with
dropdown, each with a new sprite icon (`i-origin`, `i-runner`). No
Filter button. The Find box and the chips are gone.
- Kits: family pills, and the search.
- Agents and Capabilities: the search.

**Visible changes outside the lists.**

- Capabilities lose their letter mark, by the icon rule: no capability
has a logo.
- Agents without a logo show two-letter initials instead of one letter.
- The Benchmarks filters take several choices: categories, origins and
runners are toggles, not one choice each.
- The outlined tags (`std-tag`, `run-tag`) have the same 5 px corners as
the filled ones, everywhere they appear: the lists, the detail pages and
the Add dialog.

The Getting started step for Benchmarks now points at the controls row
(`app/nullius/onboarding.py`). The agent mark URL has one source,
`agent_mark_url` (`web/filters.py`), for the `agent_mark` macro and the
Agents cards. The UI sweep's clipped-text check reads the card stats and
text. `catalogue.js` drops its chip filter. It keeps the hash links that
open an entry's page and the dataset tabs. `AGENTS.md` names
`_cards.html`.

Out of scope: a toggle between a table and cards.

## Touches

backend (`onboarding`, one string) · routes (`web/catalogue`,
`web/agents`, `web/filters`) · templates and static (`_cards.html`,
`_tables.html`, `tables.js`, `catalogue/benchmarks.html`,
`agents/standard.html`, `agents/kits.html`, `base.html`, `style.css`,
`catalogue/catalogue.css`, `catalogue/catalogue.js`) · skills
(`ui-sweep/scripts/sweep.py`) · docs (`AGENTS.md`)

## Before and after

Seeded data as in #199, with the bundled catalogue. Before is `main`,
after is this branch, same width.

| | Before | After |
| --- | --- | --- |
| Benchmarks, 1280 px, light | <img width="420"
alt="01-before-benchmarks-1280-light"
src="https://github.com/user-attachments/assets/9147af2b-ef6a-4841-aa44-f21d66cb2750"/>
| <img width="420" alt="01-after-benchmarks-1280-light"
src="https://github.com/user-attachments/assets/de063f5d-ed89-405b-8550-52960801deb1"/>
|
| Benchmarks, the Origin dropdown open | <img width="420"
alt="02-before-benchmarks-dropdown-open-1280-light"
src="https://github.com/user-attachments/assets/2debaa0a-29c4-4dc6-b3cc-894003f25a1f"/>
| <img width="420" alt="02-after-benchmarks-dropdown-open-1280-light"
src="https://github.com/user-attachments/assets/53b7afb0-e233-4c52-a88b-6015a2a7dc76"/>
|
| Benchmarks, filtered to Coding | <img width="420"
alt="03-before-benchmarks-filtered-1280-light"
src="https://github.com/user-attachments/assets/f94abe67-30ca-4b0a-9fee-813897579bfa"/>
| <img width="420" alt="03-after-benchmarks-filtered-1280-light"
src="https://github.com/user-attachments/assets/495654ea-157b-4e34-a62a-133a9aa0cace"/>
|
| Benchmarks, 390 px, dark | <img width="420"
alt="04-before-benchmarks-390-dark"
src="https://github.com/user-attachments/assets/0c87dea0-86a5-4dba-9458-ad394d6bc10a"/>
| <img width="420" alt="04-after-benchmarks-390-dark"
src="https://github.com/user-attachments/assets/609057e1-010d-4da3-b717-3f8445aafbc1"/>
|
| A card's stats, label first | <img width="420"
alt="05-before-card-stats-1280-light"
src="https://github.com/user-attachments/assets/fbf1132f-89a2-42c1-bc12-9f7bc3150f99"/>
| <img width="420" alt="05-after-card-stats-1280-light"
src="https://github.com/user-attachments/assets/6ee545cd-1f41-4ed7-9359-c97a03ce543f"/>
|
| Agents: logos, and initials for the agent without one | <img
width="420" alt="06-before-agents-1280-light"
src="https://github.com/user-attachments/assets/aedf1ad7-e059-497e-991d-a4c2c3139c76"/>
| <img width="420" alt="06-after-agents-1280-light"
src="https://github.com/user-attachments/assets/2692644a-ed48-44fd-80e6-e642607e3472"/>
|
| Agents, "code" typed in the search | <img width="420"
alt="07-before-agents-search-1280-light"
src="https://github.com/user-attachments/assets/1b91d9dd-1369-4747-8f7b-1111d131aac5"/>
| <img width="420" alt="07-after-agents-search-1280-light"
src="https://github.com/user-attachments/assets/a4add8a1-4bf4-45f8-a704-a7e3355ebb3d"/>
|
| Capabilities, "mem" typed in the search, 390 px, dark | <img
width="420" alt="08-before-capabilities-search-390-dark"
src="https://github.com/user-attachments/assets/ec6e1821-108b-4d95-b8d6-be06d9f2f238"/>
| <img width="420" alt="08-after-capabilities-search-390-dark"
src="https://github.com/user-attachments/assets/02edacd6-72e4-4c7e-a526-219db2df4e2b"/>
|
| Kits, the Capabilities family pill | <img width="420"
alt="09-before-kits-family-1280-light"
src="https://github.com/user-attachments/assets/3ce03515-8201-4cb3-8ec8-f36733d0912d"/>
| <img width="420" alt="09-after-kits-family-1280-light"
src="https://github.com/user-attachments/assets/c690a02c-4c23-43fa-882d-cbca340d8132"/>
|
| Kits, 1280 px, dark | <img width="420" alt="10-before-kits-1280-dark"
src="https://github.com/user-attachments/assets/ff05e4e2-59d5-4a81-afda-8c2d2d3dff1e"/>
| <img width="420" alt="10-after-kits-1280-dark"
src="https://github.com/user-attachments/assets/16b94f40-60fd-40d3-b18c-89c0c23b9e76"/>
|

## Verified

In throwaway rootless containers (`python:3.12` with Node.js, which the
script tests need, and a clone of the branch):

- `python3 app/tests/parallel.py`: 2240 tests in 126 modules, OK.
- `pip install -r app/requirements.txt`, then `python3
app/tests/parallel.py app/ui_tests`: 595 tests in 48 modules, OK.
- New: `app/ui_tests/test_cards.py`. It renders the macros and checks
the slot order, the slot limits, empty slots, the icon rule and escaped
values. It also checks controls without Sort by, two collections with
every filter form on one page, and a filter value that differs from its
label. Under Node.js, it runs `tables.js` on cards and checks:
  - Search and filters hide cards and their empty groups.
- The announcement waits for changes to stop, says nothing on load and
names its cards.
- A click on a card opens it, and a modified or middle click opens a new
tab. A click on a control, or at the end of a selection, does not.
- `test_tables.py` checks the filter forms: each column in its forms,
the forms in step, and a preset in every form. It also checks the filter
icon, no Filter button without `button` columns, and the narrowed mark
and counts after None and All.
- The catalogue route tests read the new markup.

Browser check, Chromium (Playwright 1.49), on the seeded data: the views
in the table above, before and after. No page JavaScript error and no
console error on Launches, Workspaces, All runs, Benchmarks, Agents,
Capabilities and Kits. Also, on this branch:

- A click on a run-with pill or a needs note opens the benchmark, and
the pills keep their tooltips. A click on the example tag opens the
agent. A Ctrl click opens a new tab.
- After None, the Origin dropdown is marked narrowed and shows 0.
- The live regions are empty after load. A search on Benchmarks reads "3
of 9 benchmarks".
- At 1280 and 390 px, no stat label or value is cut, and no stats row
passes its card.

Not checked: other browsers, and a screen reader. A click that ends a
text selection is checked in the script test only: the card's link
covers its text, so a drag in the browser selects nothing.

## Risk

The change rewrites the markup of the four catalogue pages. A script or
test that reads the old ids and classes (`#bench-find`, `.bench-cat`,
`[data-filter]` on the chip rows) no longer finds them. The Getting
started target moves with them. The card filters now compare values, not
labels: on Benchmarks, the origin and runner values are `official`,
`community`, `standard` and `harbor`. To undo, revert this pull
request's commit. Nothing is migrated, and no stored data changes.
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.

One table toolkit: a column list, a controls row with search, sticky columns and aligned numbers

1 participant