Workspace manager - design proposal

Design B selected by the Star Colonel on 2026-10-23 and refined to his notes. Aligned with the design system of the jupyterlab-extension skill on 2026-10-28, section 12. The functional requirements are acceptance criteria in docs/acc-crit.md.

The extension replaces the built-in panel "Running Terminals and Kernels" with a panel built on workspaces. Each JupyterLab workspace is a card: its colour, purpose, age, counts and actions in the header, then its tabs, terminals and kernels when the card is open. The dark models use the token values of the live lab's theme, Galaxa Dark Theme - Steel; the light models use stock JupyterLab Light.

1. The panel it replaces

Built-in Running panel of the live lab, 2026-10-23

Screenshot of the live lab on 2026-10-23 (JupyterLab 4.6.4), taken in a scratch workspace that was deleted afterwards.

  • Seven sections in one column: Open Tabs, Kernels, Language servers, Recently Closed, Workspaces, Terminals, Launcher application
  • The 16 terminals of this server read terminals/1 to terminals/16; none shows the program that runs in it or when it was last used
  • Workspaces are a flat list of names; nothing shows which terminal or kernel belongs to which workspace
  • Sidebar icon today: current icon (a circle with a square); the extension brings its own, section 8

2. Decided by the Star Colonel

3. Where the data comes from

The five open questions of the brief, each answered from the JupyterLab 4.6.4 source and from probes on this server.

QuestionAnswerEvidence
How is a terminal or a kernel assigned to a workspace? Where does one show that belongs to no workspace, or to two?
  • A terminal belongs to a workspace when the workspace's saved layout holds the key terminal:<name>
  • A kernel belongs to a workspace when a notebook or console tab of that workspace has a session on that kernel (GET /api/sessions: session path → kernel id)
  • For the workspace of this window the panel reads the live tabs of the window, not the saved file
  • In two workspaces: the row appears in both cards, each count includes it, and a shutdown asks first and names the other workspace
  • In none: the KERNELS and TERMINALS sections list every running kernel and terminal, in a workspace or not; the LANGUAGE SERVERS section lists every running language server
16 terminals on this server: workspace default holds 5 (7, 11, 13, 14, 15), auto-6 holds 1 (1), 10 are in no workspace. The culler sibling reads the same terminal:<name> keys to protect terminals.
Where does the "last accessed" time of a workspace come from?
  • metadata.last_modified of the workspace, which jupyterlab_server reads from the file's modification time
  • JupyterLab writes the workspace 500 ms after any state change of a window that shows it, and once when a window opens it
  • The age in the header is therefore the time since a window last opened or changed the workspace
  • Limit: a window left open with no change does not move the time
Probe 2026-10-23: a workspace with its time set 2 days back was opened in a headless browser; with no click, its last_modified became the load time. Source: apputils-extension state plugin, a 500 ms debouncer around workspaces.save. The culler deletes a workspace when this same time is older than its idle timeout (7 days by default; never default), so the age is also the culler's clock.
Where do the last activity time and the process name of a terminal come from?
  • Last activity: last_activity of GET /api/terminals; jupyter_server_terminals sets it on each output read and each input message
  • Process name: a new endpoint of the server extension reads the foreground process group of the terminal's pty (os.tcgetpgrp on the pty, then /proc/<pgid>/comm)
  • The tab name is the title the program sets with the OSC 0 or 2 escape; JupyterLab copies it into the tab label and never stores it, so only a window that shows the terminal knows it
  • The row shows the process name for every terminal, and the tab title as the row's tooltip when this window shows that terminal superseded, section 12: DQ-17
The REST model of a terminal is {name, last_activity} only. Probe 2026-10-23: the foreground process of each terminal shell of this server reads claude or fish from /proc. Source: terminal/src/widget.ts, onTitleChange sets title.label.
How are the tabs of a workspace that is not the current one read and closed?
  • Read: GET /lab/api/workspaces/<id>; data["layout-restorer:data"].main.dock lists the tab keys (terminal:7, notebook:<path>, editor:<path>)
  • Close all: the extension removes those keys from the layout and from data, and writes the workspace back with PUT; a terminal or kernel keeps running
  • A browser window that has that workspace open keeps its own copy and writes it back on its next change. Each window reports its workspace to the server extension every 30 s, so the panel knows which workspaces are open elsewhere and refuses Close all tabs, Delete workspace, Open workspace (the header click, the header icon and the menu item), Open in new browser tab and a row click for them, naming the reason
  • Open: this window navigates to /lab/workspaces/<id> and JupyterLab loads that workspace with its tabs; the menu also offers "Open in new browser tab"
Saved layout of default on 2026-10-23: main.dock.widgets = terminal:14, terminal:11, terminal:13, terminal:15, terminal:7, each with a data entry {"name": "<n>"}. The built-in Workspaces section reads the tab count the same way.
Replace the built-in panel or add a panel?
  • Decided: replace
  • package.json disables only @jupyterlab/running-extension:sidebar (jupyterlab.disabledExtensions); @jupyterlab/running-extension:plugin stays, so other extensions still register their sections
  • The new panel provides IRunningSessionSidebar, keeps the id jp-running-sessions and the restorer name running-sessions (saved layouts open it in the same place) and registers running:show-panel again
  • The panel shows four sections below its header: WORKSPACES with one card per workspace, then KERNELS, TERMINALS and LANGUAGE SERVERS. Each is independent and starts open; a click on a header opens or closes that section only, and the open state is saved per panel in localStorage, read and written in try/catch
  • The panel lists no section another extension registers through IRunningSessionManagers (here: Recently Closed and Launcher application are absent); it reads only the Language servers manager, for the rows of LANGUAGE SERVERS and their Shut down all
Source of running-extension 4.6.4: the sidebar is its own plugin, restorer.add(running, 'running-sessions'); jupyterlab_server reads disabledExtensions from an extension's package.json (config.py, lines 170 to 173).

4. Design B, refined

The models of sections 4 to 6 draw the design as aligned with the design system on 2026-10-28. The text of sections 4 to 6 and 11 is the design approved from 2026-10-23 to 2026-10-26; each statement the alignment replaces ends in a pointer to section 12.

At load: no card is open

{{svg:b2-closed}}

After a click on the card of this window's workspace, then on a KERNELS row (the panel's one selected row)

{{svg:b2-open}}

Icons

{{svg:b2-legend}}

Legibility

Measured as WCAG contrast ratio of text to its background; WCAG AA asks 4.5:1 for text under 18px. Galaxa Dark Theme - Steel sets --jp-ui-font-size1 to 11px and its colour 2 (#7d8791) reads 3.3:1 even on the plain panel, so the refined cards keep colour 2 out of every text. Each value is the lowest of the six workspace colours. superseded, section 12: DQ-03, DQ-06, DQ-07, DQ-08, DQ-09, DQ-10 replace the colour, size and hover rules of this table

TextFirst draft of BRefinedGalaxa SteelLight
Workspace name12px, colour 1, 12% tint--jp-ui-font-size2 (13.2px), semibold, colour 0, 8% tint3.7 → 5.614.8 → 19.8
Purpose11px italic, colour 2size 1 (11px), regular, colour 02.5 → 5.64.2 → 19.8
Age and counts11px, colour 2size 1, colour 0; glyphs colour 12.5 → 5.64.2 → 19.8
Header of this window's workspacecolour 2 on 22% tint (open card)colour 0 on the active shade2.0 → 6.74.0 → 9.9
Row detail (terminal name, notebook)11px, colour 2size 1, colour 1 on a neutral body3.3 → 4.84.6 → 16.1
Row detail in this window's open cardcolour 2colour 1 on the body (40% of the active shade)3.3 → 4.84.6 → 12.6
Row detail on a hovered rowcolour 2 on layout 2colour 0 under a 12% veil of the text colour2.4 → 5.24.0 → 7.7
"now"brand colour 1colour 0, semibold, plus a brand colour 2 dot3.8 → 5.64.6 → 19.8

5. Behaviour common to the panel

Panel header

New workspace

{{svg:b2-new}}

Filter

{{svg:b2-filter}}

Workspace menu

{{svg:b2-menu}}

Candidates for the Open workspace icon, each as a hover button beside close-all-tabs and enlarged. Decided by the Star Colonel: 2, the arrow in a circle. An arrow into a box read as exit, and two opposite arrows were rejected.

{{svg:open-icons}}

Hidden workspaces

{{svg:b2-hidden}}

Rules of the cards

6. Workspace colours

{{svg:palette}}

7. Working with the culler sibling

8. Sidebar icon

{{svg:icons}}

9. Choices, all decided on 2026-10-23

ChoiceDecision
1. Visual designB, tinted cards, refined
2. Filterevery card with a match is open while the filter is active (recommendation, accepted with "ok")
3. Countstabs, terminals, notebooks in each card header; the number of cards in the panel header
4. Tab listeach tab once (recommendation, accepted with "ok")
5. Recordsthe extension's own file beside the workspaces (recommendation, accepted with "ok")
6. Coloursgiven automatically from the extension's own palette, which starts from the colourful tab's active tab shades; the user changes them in the workspace menu
7. Sidebar icon4, four panes
8. Hide this window's workspacenot possible (recommendation, accepted with "ok")
9. Clicks on a cardthe triangle opens or closes it; the header of another workspace switches to that workspace

10. Acceptance criteria

The criteria live in docs/acc-crit.md, written through pm-tools as @kj: 169 in 9 categories, none open, 161 closed and 8 rejected. Importance: 14 CRITICAL, 57 HIGH, 76 MEDIUM, 22 LOW. Each names its test: 57 with a Jest or pytest test, 128 with a Galata test (a criterion with both counts twice). pm-tools report docs/acc-crit.md prints the status.

11. Added while filling the criteria

A complete replacement of the Running panel needs these; they are filed as criteria and wait for the Star Colonel's veto.

12. Design-system alignment, decided on 2026-10-28

On 2026-10-28 the Star Colonel answered the design questions of the render checklist and adopted the design system of the jupyterlab-extension skill (SKILL.md design sections, design-language.md, design-system/extension-design-system.dc.html, references/dialog-controls.md) for each point below. Where this section and sections 2 to 6 or 11 differ, this section holds; each statement it replaces carries a pointer here. The models of sections 4 to 6 draw the aligned design.

IdDecisionDesign-system rule it adoptsCriteria
DQ-01Every colour is a --jp-* token, never a literal value; a theme flip changes the same token names, and the extension's CSS has no light or dark branch. The six workspace colours become theme tokens; workspaces stay told apart by colour as far as the tokens allow (table below)Colour tokens: "Read colour only from lab tokens", "A theme flip overrides the same --jp-* names; no light or dark branch in extension CSS"; design-language Colour choiceACC-PANEL-203-TOKENS-ONLY, ACC-ACCORD-86-OWN-PALETTE, ACC-ACCORD-15-STRIP, ACC-ACCORD-150-COLOUR-SWATCH; rejected ACC-ACCORD-188-STRIP-SATURATION
DQ-02A card has 2 px corners, a --jp-layout-color1 body with a 1 px --jp-border-color1 border, and a header one step up on --jp-layout-color2. No header tint, no active shade, no coloured border; the colour stays on the 4 px strip, which is the card's left borderCards & surfaces: "Card: --jp-layout-color1 body plus 1px var(--jp-border-color1); header one step up on --jp-layout-color2"; Spacing & radius: "Every corner is var(--jp-border-radius) (2px)"ACC-ACCORD-69-CARD, ACC-ACCORD-128-STRIP-PLAIN, ACC-ACCORD-129-FLUSH; rejected ACC-ACCORD-125-SELECTED-SHADE
DQ-03A section header is a band on --jp-layout-color2: 6 px above and below the text, the caret on the 4 px inset, the label 18 px from the edge in weight 600, uppercase, 1 px letter spacing, --jp-ui-font-size0; the count in --jp-ui-font-color2 6 px after the label; hover --jp-layout-color3; no drop shadowSections & headers; Spacing & radius ("section headers 6px 10px", "In-flow surfaces take depth from layered --jp-layout-color*, never a drop shadow")ACC-PANEL-192-SECTION-TITLES, ACC-PANEL-74-TEXT-SIZE, ACC-PANEL-80-WS-COUNT, ACC-PANEL-168-COUNT-BRACKETS, ACC-PANEL-152-NARROW-LABELS
DQ-04The four sections are independent, not an accordion: each starts open, a click opens or closes only that section, and the open state is saved per panel in localStorage, read and written in try/catchSections & headers: "Every section starts expanded. The state is saved per panel in localStorage"ACC-PANEL-182-SECTION-HEADS, ACC-PANEL-208-SECTION-STORE, ACC-PANEL-8-POLL, ACC-ACCORD-11-ONE-OPEN; rejected ACC-PANEL-137-OTHERS-CLOSED
DQ-05Each section's list is its own scroll container (overflow-y: auto; min-height: 0), its header sticks at the top (position: sticky; top: 0), scrollbar-gutter: stable, height clamp(5 rows, 33vh, 10 rows); never two scroll containers on one axisPanel construction, Sections and scrollACC-PANEL-90-SCROLL, ACC-PANEL-8-POLL
DQ-06The panel header is a band 24 to 30 px tall on --jp-layout-color2; the title WORKBENCH is weight 600, uppercase, 1 px letter spacing, --jp-ui-font-size0Sections & headers: "Header 24-30px on --jp-layout-color2"; Panel construction, HeaderACC-PANEL-201-HEADER-BAND, ACC-PANEL-152-NARROW-LABELS
DQ-07The root and primary text are --jp-ui-font-color1; meta text, counts, the caret and empty states are --jp-ui-font-color2. The 4.5:1 contrast floor of section 4 goesPanel construction, Theme contract and RootACC-PANEL-202-TEXT-COLOURS; rejected ACC-PANEL-73-TEXT-CONTRAST
DQ-08An empty state is italic, --jp-ui-font-color2, --jp-ui-font-size0Panel construction, Rows (empty state)ACC-PANEL-75-NO-ITALIC, ACC-PANEL-74-TEXT-SIZE
DQ-09Ages read now, Nm ago, Nh ago, Nd ago, Nmo ago, Ny ago, and never without a time. Under 60 s the name and the time are --jp-brand-color1 with jp-mod-recentlyActive; over 7 days the name alone is at opacity 0.65 with jp-mod-stale. The brand colour 2 dot before "now" goesLists & rows, Recency emphasis and Time labelsACC-ACCORD-20-AGE, ACC-ACCORD-130-NOW-DOT
DQ-10A hovered row is --jp-layout-color2, with no veil of the text colour; a selected row is --jp-layout-color2Panel construction, Theme contract ("Header, band, hover"); Lists & rows ("selected on layout-color2")ACC-LISTS-211-ROW-HOVER, ACC-LISTS-210-ROW-SELECT
DQ-11Delete workspace draws label and icon in --jp-error-color1 at rest and while selected, through a danger class in its command's className; armed it reads Confirm delete with jp-mod-confirm in --jp-error-color1. The row entries Shut down terminal and Shut down kernel are destructive entries toodesign-language Destructive menu entry and Two-step destructive action; Dialogs & popups build notesACC-ACCORD-148-MENU-ICONS, ACC-ACCORD-155-ARMED-COLOUR, ACC-LISTS-212-DANGER-ENTRIES
DQ-12The card header counts as a header: every header and toolbar icon keeps its place on every view; an icon that does not apply is disabled, never removed. Open workspace, Close all tabs, the eye and ... show on every card at all timesdesign-language Header icons never hide between views; Panel construction, Icon states (Disabled: "Glyph holds its place")ACC-ACCORD-98-HOVER-ACTIONS, ACC-HIDDEN-213-EYE-TOGGLE, ACC-PANEL-214-HEADER-PLACE, ACC-ACCORD-167-NO-BUTTONS; rejected ACC-ACCORD-153-HOVER-NAME
DQ-13A status dot has its word in the line, in the title and in the aria-label, kernel rows in cards includedBadges & indicators ("Colour never carries meaning alone"); icon inventory, status dotACC-KERNEL-49-STATE, ACC-KERNEL-48-ROW
DQ-14In the New workspace, Set description and shutdown dialogs the affirmative action is the only filled button; Cancel is the surface button; a destructive action is unfilled with error-coloured text and border at the far left; the focus rim shows for keyboard focus onlydesign-language One-primary dialog footer; references/dialog-controls.md, footer classesACC-PANEL-204-DIALOG-FOOTER
DQ-15An inline panel message is a banner: color-mix(in srgb, var(--jp-error-color1) 15%, transparent) background and a border of the same token at 35 percent. A state line in a dialog has padding 6px 12px on --jp-layout-color2 with a 2 px left border in the state colour. The error-colour dot of section 5 goesBanners; design-language Dialog status accent lineACC-PANEL-96-LOAD-ERROR, ACC-PANEL-205-DIALOG-STATE
DQ-16A header button draws a 14 px glyph in a 24 px button; the card header's buttons as well, since the card header counts as a headerPanel construction, Header ("actions 24x24, glyph 14x14"); Icons ("14px in buttons")ACC-PANEL-147-HEADER-ORDER, ACC-PANEL-214-HEADER-PLACE
DQ-17Every row, KERNELS rows included, carries only a status dot, a name and a time; everything else - the terminal's process, the kernel type, the document, memory and CPU, a card's purpose and counts - appears on selection. Replaces the 2026-10-26 requirement that KERNELS rows show memory and CPU in the rowSide panel: "Default rows carry only a status dot, name and time; everything else appears on selection"ACC-LISTS-209-ROW-LINE, ACC-LISTS-210-ROW-SELECT, ACC-TERM-42-PROCESS, ACC-TERM-44-PROCESS-UNREAD, ACC-TERM-46-NAME, ACC-TERM-113-PROCESS-LIVE, ACC-KERNEL-48-ROW, ACC-KERNEL-156-DISPLAY-NAME, ACC-KERNEL-196-KERNEL-DETAILS, ACC-ACCORD-18-PURPOSE, ACC-ACCORD-22-COUNTS, ACC-ACCORD-70-COUNT-TABS, ACC-ACCORD-99-PURPOSE-DIALOG, ACC-PANEL-181-PURPOSE-WRAP, ACC-LISTS-154-TAB-SHRINK, ACC-DOCS-186-SHOT-CURRENT, ACC-PANEL-157-OTHERS-ACTIONS, ACC-LISTS-109-CONSOLE, ACC-ACCORD-97-ELLIPSIS, ACC-KERNEL-151-ROW-CLICK, ACC-LISTS-104-ROW-MENU
DQ-18Identifiers - terminal names, kernel ids, paths - are set in --jp-code-font-familyPanel construction, Rows ("identifiers --jp-code-font-family")ACC-PANEL-206-CODE-FONT
DQ-19The focus outline sits 1 px outside the element, and 1 px inside it only within cards, where the card clips its contentPanel construction, Icon states (Focus: "1px --jp-brand-color1 outline, offset 1px, :focus-visible only")ACC-PANEL-93-FOCUS
KERN-02Where a KERNELS row shows its document, a long file name shows whole at a 300 px panel, and the kernel type and the folder give way first. Replaces the 2026-10-26 shrink order "Type keeps a minimum"Panel construction, Rows ("only the text span ellipsises")ACC-KERNEL-196-KERNEL-DETAILS, ACC-LISTS-154-TAB-SHRINK
OPT-1The terminals route leaves out a terminal whose pty has ended (pty.ptyproc.terminated, or not isalive()). This replaces the panel's map of shut-down terminals, the route's fingerprint cache, fingerprint() and the fingerprint field; the row of a shut-down terminal leaves at the panel's next load in every windowdesign-language Timing independenceACC-TERM-200-ROW-LEAVES
OPT-2iconButton stops the propagation of Enter and Space only, so the arrow keys reach the row from a button inside itPanel construction, Rows ("one tab stop per section, roving tabindex")ACC-PANEL-207-BUTTON-ARROWS, ACC-LISTS-104-ROW-MENU

Workspace colours as theme tokens

The theme defines five hue families as tokens: red (error), orange (warn), green (success), blue (brand) and cyan (info). No token has a yellow or a purple hue, so lemon takes the lighter orange step and lavender takes cyan, and the Colour menu names the hue each token shows. The stored names stay, so records, the server's validation and the command line do not change. The rotation stays sky first. Section 6 draws the six.

Stored nameMenu labelToken
roseRed--jp-error-color1
peachOrange--jp-warn-color1
lemonAmber (was Yellow)--jp-warn-color2
mintGreen--jp-success-color1
skyBlue--jp-brand-color1
lavenderCyan (was Purple)--jp-info-color1

Dialogs and the panel's banner

{{svg:b2-shutdown}}

How this design reads the decisions

Each point below is a reading this stage made where a decision left a detail open. Each is stated in the criteria named and can be changed there.

Consequences

Appendix - the alternatives compared on 2026-10-23

The first drafts, kept as the record of the choice; they are not maintained.

A. Accordion with a colour strip

{{svg:alt-a}}

B. Tinted cards, first draft (selected)

{{svg:alt-b}}

C. Colour rail

{{svg:alt-c}}