Context
An app that builds on the Workstation, for example a workspace app that extends Workstation.view.Workspace with its own stores and panes, has no way to get that subclass created. Workstation.view.ViewportController#createRoot names the class at its call site: Neo.create(Workspace, {...}) at apps/workstation/view/ViewportController.mjs:210 (dev bb9f0311).
The rest of the Workstation already supports the extension. Workspace#createPane(itemId, item) is a method a subclass overrides, and the root stateProvider.stores map is a config.
The Problem
Swapping the workspace today means overriding createRoot in full. That is a ~60-line async method: it hydrates the topology library, validates the saved topology and writes the cold-hydrate transaction. A copy drifts from the original on every topology change, and a one-line seam avoids that.
The Architectural Reality
createRoot(binding, layoutId) (ViewportController.mjs:172-232) ends in Neo.create(Workspace, {flex, initialTopology, topologyGroupId, topologyLibrary, windowId}).
Workspace.MAIN_WORKSPACE_ID is read as a static at lines 151 and 199. A subclass inherits it, so those reads stay valid.
- The Viewport takes its controller as a config, so a config object
{module: ViewportController, workspaceModule: X} reaches a new controller config without subclassing the controller.
- Engine owners take the class to instantiate as a config elsewhere too, e.g.
Neo.grid.column.Tree defaults: {module: TreeComponent}. A class named at its call site defeats replacement.
The Fix
Add a workspaceModule config to Workstation.view.ViewportController, defaulting to Workstation.view.Workspace, and create the root workspace from it in createRoot. Its JSDoc names the two ways to set it: a subclass, or the controller config object.
Contract Ledger
| Surface |
Source of authority |
Behavior |
Fallback |
Docs |
Evidence |
Workstation.view.ViewportController#workspaceModule (new config) |
this ticket; createRoot at ViewportController.mjs:210 |
createRoot instantiates this class for the main workspace, with the same config as today |
unset → Workstation.view.Workspace, today's behavior |
JSDoc on the config |
unit spec in test/playwright/unit/apps/workstation/ViewportController.spec.mjs |
Decision Record impact
none
Acceptance Criteria
Out of Scope
- Making panes or stores swappable:
createPane and stateProvider.stores already are.
- Any change to
Workstation.view.Workspace itself.
Avoided Traps
- Overriding
createRoot in a subclass copies 60 lines of topology hydration, which then drift.
- Patching
Workspace.prototype from the extending app mutates a shared class for every consumer.
Related
apps/workstation/view/Workspace.mjs: createPane and stateProvider, the existing seams.
Live latest-open + closed sweep: checked latest 20 open + closed search (Workstation workspace subclass createRoot, Workstation ViewportController Workspace) at 2026-11-03T06:45Z; no equivalent or prior exclusion found. A2A in-flight claim sweep (latest 30 lane-claims): none on this surface. Memory Core rationale sweep: no prior decision on a swappable workspace class. Own-assignment sweep: no overlapping ticket.
Origin Session ID: 5e9128fe-c4ce-41cb-869a-e627945eb9b8
Retrieval Hint: "Workstation ViewportController createRoot workspace class seam"
Context
An app that builds on the Workstation, for example a workspace app that extends
Workstation.view.Workspacewith its own stores and panes, has no way to get that subclass created.Workstation.view.ViewportController#createRootnames the class at its call site:Neo.create(Workspace, {...})atapps/workstation/view/ViewportController.mjs:210(devbb9f0311).The rest of the Workstation already supports the extension.
Workspace#createPane(itemId, item)is a method a subclass overrides, and the rootstateProvider.storesmap is a config.The Problem
Swapping the workspace today means overriding
createRootin full. That is a ~60-line async method: it hydrates the topology library, validates the saved topology and writes the cold-hydrate transaction. A copy drifts from the original on every topology change, and a one-line seam avoids that.The Architectural Reality
createRoot(binding, layoutId)(ViewportController.mjs:172-232) ends inNeo.create(Workspace, {flex, initialTopology, topologyGroupId, topologyLibrary, windowId}).Workspace.MAIN_WORKSPACE_IDis read as a static at lines 151 and 199. A subclass inherits it, so those reads stay valid.{module: ViewportController, workspaceModule: X}reaches a new controller config without subclassing the controller.Neo.grid.column.Treedefaults: {module: TreeComponent}. A class named at its call site defeats replacement.The Fix
Add a
workspaceModuleconfig toWorkstation.view.ViewportController, defaulting toWorkstation.view.Workspace, and create the root workspace from it increateRoot. Its JSDoc names the two ways to set it: a subclass, or the controller config object.Contract Ledger
Workstation.view.ViewportController#workspaceModule(new config)createRootatViewportController.mjs:210createRootinstantiates this class for the main workspace, with the same config as todayWorkstation.view.Workspace, today's behaviortest/playwright/unit/apps/workstation/ViewportController.spec.mjsDecision Record impact
none
Acceptance Criteria
Workstation.view.ViewportControllerhas a documentedworkspaceModuleconfig that defaults toWorkstation.view.Workspace.createRootcreates the root workspace fromworkspaceModule, and no other site in the controller instantiates the class.ViewportController.spec.mjsshows both the default and an override reaching the instantiation.Out of Scope
createPaneandstateProvider.storesalready are.Workstation.view.Workspaceitself.Avoided Traps
createRootin a subclass copies 60 lines of topology hydration, which then drift.Workspace.prototypefrom the extending app mutates a shared class for every consumer.Related
apps/workstation/view/Workspace.mjs:createPaneandstateProvider, the existing seams.Live latest-open + closed sweep: checked latest 20 open + closed search (
Workstation workspace subclass createRoot,Workstation ViewportController Workspace) at 2026-11-03T06:45Z; no equivalent or prior exclusion found. A2A in-flight claim sweep (latest 30 lane-claims): none on this surface. Memory Core rationale sweep: no prior decision on a swappable workspace class. Own-assignment sweep: no overlapping ticket.Origin Session ID: 5e9128fe-c4ce-41cb-869a-e627945eb9b8 Retrieval Hint: "Workstation ViewportController createRoot workspace class seam"