Repository navigation
feat(web): manage workspaces on one page, their roots in a dialog - #186
Merged
Merged
Conversation
…tart narrowed or only sort
The Workspaces page shows one name per workspace, renamed in place by a pencil, and counts its runs and checks as the Runs page does and its launches as the Launches page does, the count a link to Launches filtered to it. The table sorts by Sort by or a header, as the Launches page does. Its roots open in a dialog: add a root, unlink one from this workspace, or delete its folder when the folder is a run Nullius made and has ended. Delete workspace says how many judgements go with it. The sidebar links to the page instead of folding a tree of workspaces and their runs.
harenome
force-pushed
the
feat/workspaces-page
branch
from
November 17, 2026 13:36
214977b to
aba0eb8
Compare
harenome
marked this pull request as ready for review
November 17, 2026 13:36
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 #185
What
The Workspaces page is now for managing workspaces only. The sidebar links to it.
Name. One column shows the label. The folder name on disk (for example
witty-pelican) is the label's tooltip. It also shows in small text when two workspaces have the same label. A pencil icon button opens a text field with Save and Cancel. Enter saves through the existingPOST /workspaces/rename. Escape or Cancel restores the label, sends nothing and gives the focus back to the pencil. The rename rules do not change: an empty label changes nothing, and a taken name gets a number (witty-pelican-2).Runs, Checks and Launches. "Cached runs" (the files in the workspace's parse cache) is gone. Runs and Checks count the workspace's launches as its Runs page groups them, each launch counted by
_tally, the count that the Runs page's launch blocks and the Launches page use: its agents' runs, and apart from them its checks (nop, oracle), without the runs that a merge stands for._groupednow takes a workspace that is not open, and reads it from its cache: it walks the roots and reads each unchanged job from the cache, so a job that left its root is not counted. Launches counts the launches that the Launches page lists for the workspace. Both pages take them from one function,_held_launchesinweb/runs.py. The number links to/launches?ws=<name>. That page then starts with its Workspaces filter on that workspace alone: the Filter button shows the count and Clear filters removes it. The page then removeswsfrom the address, because the other filters are not in the address either. An unknownwschanges nothing. Zero is plain text. Runs is plain text, because a link to the Runs page would open another workspace.Roots. The list of paths is now a button: a folder icon and the number of roots. It opens one dialog, titled "Roots of ", with Add a root at the right of the title. The dialog is up to 56rem wide and never wider than the window less its margins. When two workspaces have the same label, the title's tooltip is the folder name. Add a root opens the import page with
?into=<name>. The page then adds the roots to that workspace, open or not (adopt_roots(into=...)), and returns to Workspaces. When that workspace no longer exists, the page and the form refuse with a notice and add nothing, not even to the open workspace. The dialog lists one root per line, and the path wraps. Each line has two icon buttons. Each opens a confirm in the same dialog, and its title names the workspace. Keep it goes back to the list, with the focus on the button that asked.POST /workspaces/<name>/roots/unlink) removes the root and its parsed runs from this workspace only (workspace.forget). The files stay. The open workspace is read again.POST /workspaces/<name>/roots/delete) deletes the folder from disk. The page renders only a cheap check per root (execution.run_of,execution.deletableand the state of its launch). What Delete takes is worked out when its confirm opens: the button fetchesGET /workspaces/<name>/roots/ask?root=<path>, as the Launches page fetches its Delete question. The confirm shows the folder, the number of its runs and checks (_tallyover this run's jobs, as the Launches page counts a launch), its size, its judgements, and the other workspaces that lose it. A run on a host has a box for its copy there, as for Delete launch. The route usesexecution.delete, as Delete launch does. That removes the run's folder, its roots in every workspace, its parsed runs and judgements. It refuses while any run of the same launch is preparing, running, paused or stopping, as Delete launch does: a shard that ended keeps its folder while another shard of its launch runs. The launch comes from the Launches page's own grouping (_held_launches). Both routes need the form token. Delete also needs a local client.Where Delete stops. The new
execution.run_of(path)first resolves the root's links (realpath). It returns a run name only when the result is<runs root>/<name>or<runs root>/<name>/jobs, and<name>is a run folder that Nullius made (execution.run_folder: a valid name, not a link, with arun.json). Delete then removes<runs root>/<name>. Every other root keeps a greyed trash button. It is the Launches page's greyed button (greyedin_tables.html):aria-disabled="true", still focusable, with its reason as its description (aria-describedby) and in its tooltip:run.jsoncannot be readUnlink works for every root.
Sort. The table sorts with the shared code of the Launches page (
tables.js, thetoolsmacro). The Sort by button above the table lists Default and the columns Name (by label), Roots (by count), Runs, Checks, Launches and Last opened (by time, newest first), then Ascending and Descending. Checks sorts as a number too. A click on a header, or Enter on it, sorts by that column too. Only the sorted header shows an arrow and hasaria-sort. Default gives the page's order back, with no arrow. The Open column and the actions do not sort. There is no Filter or Columns button: the table has nothing to narrow or hide. The shared pager shows 10, 25 (default), 100 or all workspaces, the choice kept per viewer. A sort shows the first page again.Rows. No Open column and no "runs →": the menu at the top of the sidebar opens a workspace. Delete workspace is a trash icon button with a confirm in the dialog.
workspace.deleteremoves the workspace's whole folder. Its parse cache and converted imports come back from the run folders, but its judgements are lost for good. So the confirm says "Its judgements (N) are deleted. Its run folders stay on disk." when it has some, and "Its run folders stay on disk." when it has none. N comes from the newjudge.store.count: one per trial and judge lane, as the store lays them out, every question version in one file. The page counts them when it renders: about 1 ms for 1000 judgements. New workspace is a button on the line of the page title, at the right. The open workspace keeps its dot and its highlighted row.Sidebar. Workspaces is a plain link with the grid icon, as Launches is. The folding tree of workspaces and the runs of the open one is gone, with its CSS and the
nav_runsdata.Icons. Three are new in the sidebar sprite:
#i-pencil,#i-folderand#i-unlink. Delete uses#i-trash. Icon buttons have anaria-labeland atitle.The first of the two commits is shared with the Launches page:
greyedin_tables.html, which the Launches page now uses too. Its look (.icon-btn[aria-disabled="true"]), the red hover of a trash button (.icon-btn.danger) and the visually hidden.srmove tostyle.css.toolsmacro takesonly(a column and the one value ticked at load), andtables.jsreads the boxes at load.toolsmacro given no filters draws Sort by alone, andNulliusTable.toolbarworks without a Filter menu.Touches
backend (
execution,judge/store) · routes (web/workspaces,web/runs,web/filters) · templates and static (workspaces/workspaces.html,workspaces/_root_ask.html,runs/setup.html,runs/launches.html,runs/_launch_ask.html,_tables.html,base.html,tables.js,style.css,runs/launches.css,workspaces/workspaces.css) · docs and site (cli/pages.md)Before and after
Seeded data: three workspaces. "Main analysis" holds a run that ended, a run that is running, and a folder outside Nullius's storage. "Second look" holds the same run that ended. "Imports 2026" holds the outside folder. The run that ended has a nop check, and Main analysis has 3 judgements.
Verified
In throwaway containers (
python:3.12with Node.js, which the builder, live board and dialog tests need, and a clone of the branch):python3 app/tests/parallel.py: 2115 tests in 123 modules, OK.uv run --no-project --with-requirements app/requirements.txt python app/tests/parallel.py app/ui_tests: 529 tests in 44 modules, OK.WorkspacesPageinapp/ui_tests/test_run_routes.py. It checks the headers (one name column, Runs, Launches, no Open), the folder name as tooltip and, for two equal labels, in text and as the dialog title's tooltip. It checks that Runs and Checks equal the Runs page's header and the sum of the Launches page's rows for the workspace, with a launch of an agent, a nop and an oracle, and that the Delete confirm of that launch's folder counts 1 run and 2 checks. It checks both wordings of the Delete workspace confirm, with judgements in two lanes.test_judgechecksstore.count: two versions of a trial are one judgement, both lanes count, and the parse cache does not. It checks that Launches equals the rows of the Launches page for that workspace, with a link to/launches?ws=<name>, and plain 0. It checks that?ws=ticks only that workspace in the filter, and that an unknown or emptywsticks every box. It checks that the folder of a shard that ended stays, and its trash is disabled, while another shard of its launch runs. It checks each reason of the table above, as the greyed button's description and tooltip, and that the Delete question answers 409 while the launch is going. It checks that a folder name from a hand-editedworkspace.json(x"><b>y) is shown as text. It checks thatintonaming a workspace that is gone adds nothing, from the import page,/use-pathand/upload. It checks the pager and the sort: Sort by alone, its columns, the sortable headers (not Open and not the actions), no arrow at load, and the sort keys of the cells. It checks the New workspace button, the pencil, a Cancel that does not submit, an empty name and a taken name. It checks the Roots button and dialog markup, with the workspace in the titles of the dialog and its confirms, that the Delete question is not in the page but fetched from its address, Add a root into a closed workspace, and Unlink from one workspace only. It checks that Delete refuses a folder outside storage and a link out of the runs root, refuses in each state of a run that is going, names the other workspace, and deletes inside storage. It checks the sidebar link and that no tree is left.test_run_deletechecksexecution.run_of. Tests that read the old markup now read the new one.Browser check, Chromium (Playwright 1.49), on the seeded data, with no page JavaScript errors:
/launches. The address has nows, Filter shows 1, and 1 of 2 launches shows. Clear filters hides the count and shows both.aria-sorton that header only. A header click sorts too. Default gives the first order back with no arrow. After a sort that moved the rows, rename and the Roots dialog work as below.Render time of
GET /workspaces(Flask test client, a container limited to 2 CPUs, 60 runs of about 300 files each in 10 workspaces): about 4.4 s for the first request, which parses every job, then about 0.31 s (the median of five). With the Delete question worked out for every root as the page renders, the same seed takes 5.2 s and 0.61 s.Risk
Root Delete removes a folder from disk. It is limited to a run folder that Nullius made in its runs root, after links are resolved, and to a run that has ended. It uses
execution.delete, the code of Delete launch. Ifrun_ofis wrong, the wrong run folder can go. Its test covers links in and out, the runs root, a deeper folder and a folder elsewhere. Unlink of a root that was converted on import leaves the converted copy in the workspace'simported/folder. The workspace no longer reads it. To undo, revert the last two commits. Nothing is migrated.