Repository navigation
feat(builder): draw the Agent step with the Agents page's cards, as cards or a table - #249
Merged
Merged
Conversation
…in one place The Agents page built its entries, their ports and their fits in the web layer. recipe.entries now does it for a given list of benchmarks, so the builder's Agent step can draw the same entries. The Agents page output is unchanged.
A card's pick ({value, on, disabled}) makes its title a button with
aria-pressed instead of a link; tables.js flips it on a click, Space or
Enter and sends nullius-pick, and the page keeps the choice. A disabled
card's reason goes in its alert slot, which now takes a tooltip, and a
row of filter pills can name its first pill (all).
The Agent step fetched nothing and drew its own tiles, search and chips from the builder payload. It now loads /new-run/agents for the recipe's benchmark: the Agents page's entries (recipe.entries) as pick cards, with Protocol and Fit pills and a Filter menu for From and Proves, a skeleton while loading and one line on failure. The grid is kept while the benchmark stays the same, so its filters survive each render, and its cards follow the recipe. Other benchmarks' agents are part of From.
… protocol The Original card carried "reference" as its protocol, so the Protocol pills offered it. It now reads "as published" and is left out of them.
…nchmark Runs on: OSWorld 1 showed Codex alone, since From hides a benchmark's own agents by default. Their cards now pass From whenever Runs on narrows to their benchmark (a card's unless in the card toolkit), so the 12 show beside Codex without changing From.
…nd the Agents page Every agent and capability card now reads the same whatever it comes from and whether it can be chosen: the name and its version on the title row, the reason it cannot be chosen under it, the ports it has proven (Computer use) and what it is as badges, and the foot on the card's last line with its protocol on the left and where it comes from on the right (Bundled, Yours, or the benchmark it belongs to). The protocol is in sentence case where it is made (recipe.protocol), so a card's pill reads as its filter does. The foot no longer wraps in the builder, which put the protocol on a line of its own on some cards.
A filter of the builder's Agent step could hide an agent the recipe runs, as the tiles before the card toolkit never did. A pick card that is pressed now shows whatever the search and the filters say; one unpicked under a filter stays until the next change, so the card does not vanish under the pointer.
…r menu The two rows of pills above the cards (protocol; can run it or not) are now two groups of the one Filter menu, beside From and Proves, as the Agents page filters. Every value starts on, so the step still shows any protocol and any fit until a value is left out.
…s did A pick card of the card toolkit showed it was chosen only by its colour. An enabled one now holds a check in its title row's corner, shown while its toggle is pressed (by CSS, so a click, Space or Enter shows or hides it at once); a card that cannot be chosen has none.
The Agent step has the catalogue pages' toggle between cards and a table, cards by default. The table is the card toolkit's rows of the same items: each row's name is the pick toggle with its check, a click on the row picks it, a disabled row is faint with why not beside the name, and a chosen row stays in view under any filter, as a chosen card does. The builder fetches the other view of the step in place, keeping the recipe and its picks, and remembers the viewer's choice.
…n it Fit leaves the Filter menu for a dropdown of its own beside it, ticked to Can run it at first, so the step opens on what can run this benchmark; a benchmark's Original card always can. A toolkit dropdown narrowed to one value now names it on its button (Fit: Can run it) rather than counting it, so what is hidden is never a surprise; this applies to every dropdown of the table toolkit. A choice made outside the grid, such as a loaded recipe, that the filters hide now draws the grid again, so the chosen agent shows.
A card link with a tooltip (every pick card) was raised for that tooltip, which made its focus ring wrap the name instead of the card, and the builder drew its own outline round it too. The link stays unpositioned, so its ring is the card's.
In the table view of the card toolkit, a pick is now a checkbox in a leftmost column of no name, ticked when chosen and disabled on a row that cannot be chosen; the name is plain text and the check beside it goes. The header has no box that ticks every row, since an agent is picked one at a time, so the table toolkit's check column and its tick-all are not used: the box sends the same nullius-pick as a card's toggle, a click elsewhere on the row still ticks it, and the builder sets the box from the recipe as it sets a card, so either view picks for the one recipe.
A table toolkit menu opens leftwards from its button. On a narrow screen a button that is not at the row's right end, such as the Agent step's Fit, opened its menu past the page's left edge, its boxes cut off. Such a menu now opens rightwards instead.
The Agent step's table had no column to take the width the table spares, so the table shared it among every column and the box column grew to about 100px. From now takes it, as an expanding column does elsewhere, and the box column's header carries the table toolkit's pick-col class (a `pick` column: blank, as narrow as a `check` column, with no tick-all box), so it is the check column's width.
Name, not From, now takes the width the table spares, so From stays compact at the right and Why not, Protocol and Proven keep their natural widths. On a phone the pinned name wraps beside its box rather than pushing the reason off its line.
The table toolkit's snug cells have .4rem each side, about 13px between columns, which reads well for text beside text but left Proven's outlined pill nearly touching From. The Agent step's table, whose Protocol and Proven are pills, now has .6rem each side (about 19px) on a screen wider than a phone; on a phone it keeps snug's, so its pinned name does not break mid-word.
Fit leads with the plug icon of the sprite, a connector whose halves fit, as Filter and Columns lead with theirs. It uses the table toolkit's existing filter_icon, so no other dropdown changes.
The sprite gains i-puzzle, a piece with a knob above and to the right and a notch on the left, centred in its 24 grid and drawn by .ic as its neighbours are; Fit uses it in place of the plug, which stays for Settings.
The Agent step's row in docs/builder.md still named Protocol and Fit pills. Fit is now a menu of its own that starts on Can run it, Protocol is in the Filter menu with From and Proves, the step shows as cards or a table, and a chosen agent stays in view under any filter.
4 of 17 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #248
What
The builder's Agent step now shows the same listing as the Agents page, drawn with the shared card and table toolkits. Before, it drew its own tiles, search and pill rows in
command-builder.js.recipe.entries(kind, benches)builds the agents or capabilities with their ports and their fits. The Agents page and the step both read it. The Agents page output does not change.GET /new-run/agents?benchmark=<key>returns the step's grid (builder/agents.html), with?view=tablefor the table. The builder loads it once per benchmark and view, keeps it while the benchmark stays the same, and shows a skeleton while it loads. An unknown benchmark is a 404.pickis a toggle: its title is a button witharia-pressed. A click, Space or Enter flips it, andtables.jssendsnullius-pick. The builder changes the recipe from that event. A chosen card shows a check mark. A card that cannot be chosen is disabled, and its reason is in the alert slot with the full text in a tooltip.recipe.protocolgives sentence case ("Its own script", "A command", "No agent"), so a card and its filter use the same words. A benchmark's Original reads "As published" and is not in the Protocol filter.localStoragekeeps the viewer's choice. The sprite gets ani-puzzleicon.nullius-pickas a card.Touches
backend (
nullius/standard/recipe.py) · routes (web/builder.py,web/agents.py) · templates and static (_cards.html,_tables.html,base.html,agents/standard.html,builder/agents.html,builder/new_run.html,tables.js,catalogue/catalogue.css,builder/command-builder.js,command-builder-core.js,command-builder.css) · docs (builder.md,standard.md) · testsBefore and after
Verified
python:3.12):python3 app/tests/parallel.py: 3100 tests in 157 modules, OK.pip install -r app/requirements.txt, thenpython3 app/tests/parallel.py app/ui_tests: 554 tests in 56 modules, OK.python3 app/tests/catalogue_docs.py --writeandpython3 app/tests/field_contract.py --writeleave the tree unchanged.app/ui_tests/test_recipe_execution_fixtures.pyand its fixtures are unchanged.test_benchmark_agents.py: One listing, whose fits are the builder's.test_builder_agents.py: The step's greying equals the builder's for every benchmark. OSWorld1 offers its own agents and Codex and says why not for the rest. A benchmark without own agents keeps its Original and greys OSWorld's. The table view picks as the cards do. A capability benchmark lists capabilities. An unknown benchmark is a 404, and the builder page loads the toolkit.test_cards.py: A pick card is a toggle and a disabled one says why. A pick flips and sends its event, and a disabled one does not. A row click flips its pick, except on a disabled row. A chosen card shows under any filter. A card passes a filter that its Runs on column narrows to.Not checked: a real run from the step.
Risk