Skip to content

feat(web): manage workspaces on one page, their roots in a dialog - #186

Merged
harenome merged 2 commits into
ThinkFlowLab:mainfrom
harenome:feat/workspaces-page
Nov 17, 2026
Merged

harenome merged 2 commits into
ThinkFlowLab:mainfrom
harenome:feat/workspaces-page

Conversation

@harenome

@harenome harenome commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

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 existing POST /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. _grouped now 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_launches in web/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 removes ws from the address, because the other filters are not in the address either. An unknown ws changes 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.

  • Unlink (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.
  • Delete (POST /workspaces/<name>/roots/delete) deletes the folder from disk. The page renders only a cheap check per root (execution.run_of, execution.deletable and the state of its launch). What Delete takes is worked out when its confirm opens: the button fetches GET /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 (_tally over 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 uses execution.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 a run.json). Delete then removes <runs root>/<name>. Every other root keeps a greyed trash button. It is the Launches page's greyed button (greyed in _tables.html): aria-disabled="true", still focusable, with its reason as its description (aria-describedby) and in its tooltip:

Root Reason
a folder elsewhere, or a link that leaves the runs root Outside Nullius's storage
a deeper folder of a run Inside a run, not a run folder
the runs root, or a folder in it that is not a run Not a run folder
a run whose run.json cannot be read Cannot read its run record
a run whose launch has a run still going Not while its launch is going

Unlink works for every root.

Sort. The table sorts with the shared code of the Launches page (tables.js, the tools macro). 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 has aria-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.delete removes 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 new judge.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_runs data.

Icons. Three are new in the sidebar sprite: #i-pencil, #i-folder and #i-unlink. Delete uses #i-trash. Icon buttons have an aria-label and a title.

The first of the two commits is shared with the Launches page:

  • The greyed icon button becomes a macro, greyed in _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 .sr move to style.css.
  • A table filter can start narrowed: the tools macro takes only (a column and the one value ticked at load), and tables.js reads the boxes at load.
  • A table can sort without Filter: the tools macro given no filters draws Sort by alone, and NulliusTable.toolbar works 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.

Before After
Page, 1280 px, light 01-before-workspaces-1280-light 02-after-workspaces-1280-light
Page, 1280 px, dark 03-before-workspaces-1280-dark 04-after-workspaces-1280-dark
Page, 390 px, light 05-before-workspaces-390-light 06-after-workspaces-390-light
Sidebar 13-before-sidebar-1280-light 14-after-sidebar-1280-light
Action After
Page, 390 px, dark 07-after-workspaces-390-dark
Rename 08-after-rename
Roots dialog: one root to delete, one running, one outside storage 09-after-roots-dialog-1280-light
Launches, after a click on the Launches count of Second look 16-after-launches-filtered-to-a-workspace
Sorted by Runs, ascending 17-after-sorted-by-runs
Delete workspace, with judgements 18-after-delete-workspace-confirm-judgements-1280-light
Delete workspace, without judgements, 390 px, dark 19-after-delete-workspace-confirm-none-390-dark
Roots dialog: each reason a folder stays 20-after-roots-dialog-reasons-1280-light
Roots dialog, 390 px, dark 10-after-roots-dialog-390-dark
Unlink confirm 11-after-unlink-confirm
Delete confirm 12-after-delete-confirm
After Delete 15-after-folder-deleted

Verified

In throwaway containers (python:3.12 with 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.
  • New: WorkspacesPage in app/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_judge checks store.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 empty ws ticks 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-edited workspace.json (x"><b>y) is shown as text. It checks that into naming a workspace that is gone adds nothing, from the import page, /use-path and /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_delete checks execution.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:

  • Light and dark, 1280 px and 390 px: the page does not scroll sideways. The Roots dialog is 896 px wide at 1280 px, and at 390 px it stays inside the window (17 px to 373 px).
  • Runs, Checks and Launches: Main analysis 4, 1 and 2, Second look 2, 1 and 1, Imports 2026 1, 0 and 0 (plain text). The Launches link of Second look opens /launches. The address has no ws, Filter shows 1, and 1 of 2 launches shows. Clear filters hides the count and shows both.
  • Delete workspace, light and dark, 1280 px and 390 px: "Its judgements (3) are deleted. Its run folders stay on disk." for the workspace with judgements, "Its run folders stay on disk." for the other, the dialog inside the window.
  • At 390 px the table is wider than its box (654 px in 358 px) and scrolls inside it; the page does not.
  • The five reasons of the table above, light at 1280 px and dark at 390 px, on a workspace that holds one root of each kind; the dialog stays inside the window. Tab reaches each greyed trash, and its description is its reason.
  • Pager: with 15 workspaces and Show 10, the first page shows 10 rows and Next shows the last 5; a sort by Name shows the first page again.
  • Sort: Name, Roots, Runs, Checks, Launches and Last opened each sort correctly in both directions from Sort by, with the arrow and aria-sort on 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.
  • Rename: the pencil puts the focus in the field. Escape hides the field, restores the label and puts the focus on the pencil. Cancel sends no request. Enter saves.
  • Roots: Enter on the button opens the dialog with three roots. The trash button is active for the run that ended, and greyed with "Not while its launch is going" and "Outside Nullius's storage" for the two others. Escape closes the dialog and the focus goes back to the button. Unlink opens its confirm with the focus on Keep it. Keep it goes back to the list with the focus on that Unlink button.
  • The Delete confirm, fetched when it opens, shows the run folder, "2 runs · 3.8 kB · 3 judgements" and "Also removed from Second look." Delete removes the folder: Main analysis has 2 roots and Second look 0. Unlink removes the outside root from Main analysis only. Delete workspace opens its confirm.

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. If run_of is 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's imported/ folder. The workspace no longer reads it. To undo, revert the last two commits. Nothing is migrated.

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
harenome force-pushed the feat/workspaces-page branch from 214977b to aba0eb8 Compare November 17, 2026 13:36
@harenome
harenome marked this pull request as ready for review November 17, 2026 13:36
@harenome
harenome merged commit 97d483b into ThinkFlowLab:main Nov 17, 2026
3 checks passed
@harenome
harenome deleted the feat/workspaces-page branch November 17, 2026 13:44
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.

Workspaces: one name, rename in place, roots in a dialog, and a plain sidebar link

1 participant