Context
#20223 (PR #20225) let a Workstation subclass choose the Workspace its viewport creates. Its Out of Scope notes that panes and stores were already swappable (createPane, stateProvider.stores). The status readout is not. A subclass that swaps the scale store changes what scale.count means, but it can't change the readout that prints it.
The Problem
Workstation.view.StatusComponent prints scale.count as "N scale rows" (apps/workstation/view/StatusComponent.mjs l.22).
- For the shipped flat
Scale store, count is the row count.
- For a
TreeStore, count counts the visible projection. TreeStore keeps the full population in its private structural layer and exposes only the expanded nodes as items (src/data/TreeStore.mjs l.18–25).
So a Workstation subclass whose scale store is a TreeStore with collapsed parents reports the parents it shows, not the rows it holds. Today it has no clean way to say otherwise:
Workspace#construct composes the controls row inline: items: [{module: StatusComponent, flex: 1}, {module: TopologyToolbar, workspace: me}] (apps/workstation/view/Workspace.mjs l.264–269).
- Overriding
construct copies its document and topology setup, which then drift. That's the trap #20223 avoided for createRoot.
- Patching
StatusComponent.prototype from the extending app changes the readout for every consumer.
A subclass that wants a different readout altogether (other stores, other numbers) hits the same wall.
The Architectural Reality
- The Workstation's subclass seams are plain class configs that name a module.
ViewportController#workspaceModule (apps/workstation/view/ViewportController.mjs l.35–40) is read where the instance gets created (createWorkspace, l.265–267).
- The readout binds through the Workspace's root state provider:
bind.html() reads getStore('feed') and getStore('scale'). A replacement readout therefore gets the same stores and the same reactivity with no extra wiring.
StatusComponent is created in exactly one place (Workspace.mjs l.268).
The Fix
apps/workstation/view/Workspace.mjs:
- add a class config
statusModule: StatusComponent, with JSDoc in the workspaceModule style: what it is, and how a subclass or a config names its own;
- l.268 creates
{module: me.statusModule, flex: 1}.
test/playwright/unit/apps/workstation/Workspace.spec.mjs: a subclass that names its own status module gets that class in the controls row, and the default stays StatusComponent.
Contract Ledger
| Target surface |
Source of authority |
Proposed behavior |
Fallback |
Docs |
Evidence |
Workstation.view.Workspace#statusModule (new) |
the workspaceModule precedent, ViewportController.mjs l.35–40 |
the controls row creates its readout from this class |
StatusComponent, output unchanged |
JSDoc on the config |
unit spec |
Decision Record impact
none.
Acceptance Criteria
Out of Scope
- A public count of a
TreeStore's full population. That is a data-layer API with its own design, and the readout seam doesn't need it.
- The controls row's other item (
TopologyToolbar) and the tour toolbar.
- Changing what the shipped readout prints.
Avoided Traps
- Overriding
construct in a subclass: it copies setup that drifts.
- Patching
StatusComponent.prototype from an app: it mutates a shared class.
- A
createControls() method that returns the row's items. A subclass would replace the readout by array index, and that breaks as soon as the row changes.
Related
Live latest-open + closed sweep: checked the latest 20 open issues and closed searches (Workstation status readout count, Workstation subclass) at 2026-11-03 19:2xZ; read Out of Scope / Avoided Traps on the same-surface hits #20223, #19540, #18460. No equivalent and no prior exclusion; #20223 scoped Workspace changes out, it didn't rule against them.
A2A in-flight sweep: no claim on this scope in the last 60 minutes.
MC sweep: Workstation status bar scale rows count tree store visible projection, 6 results, no prior decision.
Own-assignment sweep: 6 open, none on this surface.
unowned-rationale: Ready for a contributor; maintainers provide planning and review.
Origin Session ID: 901214bc-bd2e-4eb6-ac5d-3d3b3ca5c3d2
Retrieval Hint: "Workstation subclass status readout statusModule scale count TreeStore projection"
Context
#20223 (PR #20225) let a Workstation subclass choose the Workspace its viewport creates. Its Out of Scope notes that panes and stores were already swappable (
createPane,stateProvider.stores). The status readout is not. A subclass that swaps thescalestore changes whatscale.countmeans, but it can't change the readout that prints it.The Problem
Workstation.view.StatusComponentprintsscale.countas "N scale rows" (apps/workstation/view/StatusComponent.mjsl.22).Scalestore,countis the row count.TreeStore,countcounts the visible projection.TreeStorekeeps the full population in its private structural layer and exposes only the expanded nodes as items (src/data/TreeStore.mjsl.18–25).So a Workstation subclass whose scale store is a
TreeStorewith collapsed parents reports the parents it shows, not the rows it holds. Today it has no clean way to say otherwise:Workspace#constructcomposes the controls row inline:items: [{module: StatusComponent, flex: 1}, {module: TopologyToolbar, workspace: me}](apps/workstation/view/Workspace.mjsl.264–269).constructcopies its document and topology setup, which then drift. That's the trap #20223 avoided forcreateRoot.StatusComponent.prototypefrom the extending app changes the readout for every consumer.A subclass that wants a different readout altogether (other stores, other numbers) hits the same wall.
The Architectural Reality
ViewportController#workspaceModule(apps/workstation/view/ViewportController.mjsl.35–40) is read where the instance gets created (createWorkspace, l.265–267).bind.html()readsgetStore('feed')andgetStore('scale'). A replacement readout therefore gets the same stores and the same reactivity with no extra wiring.StatusComponentis created in exactly one place (Workspace.mjsl.268).The Fix
apps/workstation/view/Workspace.mjs:statusModule: StatusComponent, with JSDoc in theworkspaceModulestyle: what it is, and how a subclass or a config names its own;{module: me.statusModule, flex: 1}.test/playwright/unit/apps/workstation/Workspace.spec.mjs: a subclass that names its own status module gets that class in the controls row, and the default staysStatusComponent.Contract Ledger
Workstation.view.Workspace#statusModule(new)workspaceModuleprecedent,ViewportController.mjsl.35–40StatusComponent, output unchangedDecision Record impact
none.
Acceptance Criteria
Workstation.view.Workspacehas astatusModuleclass config that defaults toStatusComponentand is documented likeworkspaceModule.statusModule. With the default, the shipped Workstation's readout is unchanged.Out of Scope
TreeStore's full population. That is a data-layer API with its own design, and the readout seam doesn't need it.TopologyToolbar) and the tour toolbar.Avoided Traps
constructin a subclass: it copies setup that drifts.StatusComponent.prototypefrom an app: it mutates a shared class.createControls()method that returns the row's items. A subclass would replace the readout by array index, and that breaks as soon as the row changes.Related
workspaceModuleseam this mirrors.Live latest-open + closed sweep: checked the latest 20 open issues and closed searches (
Workstation status readout count,Workstation subclass) at 2026-11-03 19:2xZ; read Out of Scope / Avoided Traps on the same-surface hits #20223, #19540, #18460. No equivalent and no prior exclusion; #20223 scoped Workspace changes out, it didn't rule against them. A2A in-flight sweep: no claim on this scope in the last 60 minutes. MC sweep:Workstation status bar scale rows count tree store visible projection, 6 results, no prior decision. Own-assignment sweep: 6 open, none on this surface.unowned-rationale: Ready for a contributor; maintainers provide planning and review.
Origin Session ID: 901214bc-bd2e-4eb6-ac5d-3d3b3ca5c3d2
Retrieval Hint: "Workstation subclass status readout statusModule scale count TreeStore projection"