Repository navigation
feat(catalogue): sort and filter the catalogue pages, and show them as cards or a table - #240
Merged
Merged
Conversation
Benchmarks, Agents, Capabilities and Kits get the Sort by menu of the card toolkit: by name and by their counts (tasks and datasets, ports proven and benchmarks it runs, checks). A card collection's sort can name the fields it offers; Benchmarks sorts within each shelf.
Two dropdowns, as Benchmarks' Origin and Runs with: the agent's protocol (ACP or its own command) and the ports it has proven, the latter listing only ports some agent proves.
Benchmarks, Agents, Capabilities and Kits get the Table/Cards toggle that Workspaces has, with cards as their default and ?view=table for the table. The toolkits take a page's default view, so the default has no view in its link and the other view carries it; Workspaces stays table by default. The cards macro draws the same items as a table when asked: one column per field a table takes that some item fills, the name pinned with its icon and a link to the entry, the same search, filters and Sort by. Benchmarks are one table in shelf order, their Origin being the shelf, since a controls row drives one table. Secondary fields start hidden in the Columns menu.
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 #239
What
Five commits.
controls(sort=...)also takes a list of field keys, so a page offers only those in Sort by.grid()writesdata-s-<field>for those fields.type='num'. The tasks stat gets a numeric value: a range such as10–89sorts by its top number. A count such as4/7sorts by its first number.NulliusTable.cardsalready puts each card back in its own grid, so Benchmarks keeps its shelves._choices()inweb/agents.pybuilds Protocol (ACP or a command) and Proves, listing only the ports at least one agent has proven. Proves is a filter-only field with no card slot.controls(),table()andcards()takedefault='table'. The toggle's link to the page's default view dropsview, and the other link carries?view=<it>. Workspaces passes nothing new.default='cards'and draw the table with?view=table. In that casecards()draws its items through a newrowsmacro. It keeps a column for each table field that some item fills, and always one for a filtered or a number field. The name column is pinned and holds the entry's mark and link, drawn by amarkmacro the cards share.Touches
routes (
web/agents.py,web/catalogue.py) · templates (_cards.html,_tables.html,catalogue/benchmarks.html,agents/standard.html,agents/kits.html) · static (catalogue/catalogue.css) · testsBefore and after
The same profile on main and on this branch.
Verified
In a throwaway rootless
python:3.12container with Node.js and uv, on a copy of the branch:python3 app/tests/parallel.py: 3074 tests in 156 modules, OK.pip install -r app/requirements.txt, thenpython3 app/tests/parallel.py app/ui_tests: 674 tests in 55 modules, OK.data-f-proves.?view=tablewith only the table and Table current, and the toggle's links.Browser checks, Chromium (Playwright 1.49.1), light at 1280 px and dark at 390 px, on the four pages:
Not checked: two real shelves, since the bundled catalogue has only official benchmarks, and a screen reader.
Risk
#keylink such as/benchmarks#keyfinds its entry only in the cards view. That is the default.