Repository navigation
feat(web): show the Workspaces page as cards, with a card layout shared by every card page - #238
Merged
Merged
Conversation
A Table/Cards toggle at the end of the controls row (the controls macro's `layout`, a link to ?view=cards that keeps the rest of the query). The server renders only the view chosen. The cards are the card toolkit's over the table's own fields, each in its slot; their Roots and Delete open the same dialogs. Sort by now works on cards too, for a collection that asks.
…nd date at its foot The card toolkit drops its top row: the check sits at the right of the title row, level with the title's first line however it wraps, and status, tags and meta form the card's last line, after its actions, the meta at the right. Actions sit at the right edge, so the left holds what a card is and the right what can be done with it. The title now comes first in the card's markup.
…cards their Roots as one The card toolkit no longer stops at three stats: a stat field is a column (--stats on the grid), and more than three widen every card of the page so they keep one line, fewer cards a line. On a card too narrow for one line they wrap in two balanced rows. A stat without a value keeps its place as a dash, so the next ones stay aligned across cards. A Workspaces card shows its Roots as a stat after Launches, the same count button and dialog; Delete is its only action.
A card's title may carry a control after its last word (its value's after) and a class on the title row. A Workspaces card puts the table's pencil there, and the same form swaps in for its name: the page's script, the same POST and token. A rename returns to the view it was made from.
The card toolkit's title row ends with a corner for the check and a new delete slot, in that order, level with the title's first line. A delete is a quiet trash button, the table's row delete, with an action's value shape. A Workspaces card's Delete moves there, the same button and dialog, and the card has no action line.
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 #237
What
Workspaces: Table or Cards.
controls()andtable()in_tables.htmltakelayout='table'|'cards'. It adds an icon.seg-toggleat the end of the controls row, Table (#i-table) and Cards (a new#i-cards, staggered tiles). The links keep the other query parameters. Only Workspaces turns it on.?view=cardsthe cards (cards(..., sort=true, layout='cards')). Both come from the same column list, each field with its card slot. Roots, the launches button, the pencil and the rename form are macros both views share. The page's script hides.ws-show, .card-link, .ws-editwhen the form opens, so one handler serves a row and a card.workspace_renamereads a hiddenviewfield and returns to the view the rename came from.The card toolkit, for every card page. That is Benchmarks, Agents, Capabilities, Kits and Workspaces.
check, then a newdeleteslot (at most one). A title value can carryafter, a control placed after its last word, as the Workspaces pencil is.status,tagandmeta, is now the card's last line, only when one of them has a value. It has one height with or without a status glyph, so the stats of a row line up.deleteis anicon-btn dangertrash, which is neutral until hover or focus, like the table's.--stats, its number of stat fields. It has that many columns.—in its cell. No page passes one today.NulliusTable.cardsruns the same Sort by menu as the table whencards()hassort=true. Each card carries its sort keys asdata-s-<field>. The catalogue pages keepsort=false.Touches
templates (
_cards.html,_tables.html,base.html,workspaces/workspaces.html) · static (tables.js,catalogue/catalogue.css) · routes (web/workspaces.py) · testsBefore and after
The same synthetic profile on main and on this branch: 100 workspaces, the bundled catalogue.
Verified
In a throwaway rootless
python:3.12container with Node.js and uv, on a copy of the branch:pip install -r app/requirements.txt, thenpython3 app/tests/parallel.py app/ui_tests: 667 tests in 55 modules, OK.python3 app/tests/parallel.py: 3061 tests in 155 modules. One test failed:test_osworld2_drivertest_a_driver_killed_mid_run_leaves_its_reaper_the_vm_and_its_volume. This branch does not touch the backend, and the module passed 3 of 3 times on its own.test_cards.py: the slot order; the check and delete ending the title row; a card with only a check, only a delete or both; one delete per card; no corner and no foot when empty; four stats with no failure,--stats, and—in place of an empty stat.test_run_routes.py: the default view and?view=cards; the toggle on Workspaces only, keeping other parameters; Roots as the fourth stat; the delete in the corner and no action line; the pencil and the form on each card; a rename withview=cardsreturning to the cards.Browser checks, Chromium (Playwright 1.49.1), light at 1280 px and dark at 390 px:
Not checked: a screen reader, and a page with a
checkfield, since none has one yet.Risk
viewis the toggle's query parameter. Runs and Compare already useviewfor other things, so a toggle there would need another name.