Skip to content

chore: remove dead element types, handlers and helpers from shared, server and client - #118

Merged
endrix merged 6 commits into
mainfrom
chore/declutter-core
Nov 8, 2026
Merged

endrix merged 6 commits into
mainfrom
chore/declutter-core

Conversation

@endrix

@endrix endrix commented Nov 7, 2026

Copy link
Copy Markdown
Owner

Phase 1 of the declutter review (pure deletions, no behaviour change) for packages/shared, packages/diagram-server and packages/diagram-client. 43 files changed, 75 insertions(+), 2610 deletions(-).

Element types the model never emits (shared, client, server)

node:proxy, node:collapsed:conditional, node:collapsed:array, node:structure:if:branch, node:structure:if:join, node:structure:foreach:join, node:structure:if:inline, node:join, edge:virtual, comp:ports, comp:port-row had a client model class, a view, a registration, a server type mapping, a shape hint and layout-configurator/ELK branches, and no producer: the graph builder emits then/else/foreach containers directly. Gone with them: nine metadata keys only they carried, the three type guards that always returned false, their CSS rules, and the per-submit model walk in the submission handler that logged virtual edges. The parity baseline fixture loses the ten registrations.

Shared dead exports

NODE_ENTITY, PORT_IN/PORT_OUT, NODE_JOIN, the WORKFLOW_* metadata twins except WORKFLOW_NAME, HAS_EXTERNAL_MEMBERS, PORT_INDEX, NETWORK_VARIABLES/INPUT_PORTS/OUTPUT_PORTS, the Origin helpers, the entity/port type guards (isReadOnlyElement stays), six sizing constants, the model's two never-populated AST maps and its workflow field, and the WorkflowDiagramCss members no TypeScript references.

Client

  • The "Change referenced type" round-trip (requestWorkspaceEntities / showWorkspaceEntities / updateEntityInstanceType) and dialogram.toggleGrid: no handler anywhere (the host's grid command dispatches GLSP's own action). The propertySections.entityType flag stays, it still hides the row.
  • go-to-source-context-menu-provider.ts, open-source-mouse-listener.ts: imported by nothing.
  • di.config.ts, shared-webview-messenger.ts and the index's back-compat block: no caller in dialogram or any product.
  • The wf:labelRole read (no producer; type labels are drawn by the node view), wf:namespace → namespaceName (no reader), WorkflowEditableLabel, ValidationDecoration, isAnyDragActive, isDragActiveForEdge and the write-only map behind it, workflowDiagramViewMap, the chat.sessionLoaded case (the host never sends it).
  • 39 stylesheet selectors whose class names nothing produces. Checked with a producer scan over the client, scripts, chisel-ide, mlir-viewer and the GLSP/sprotty/vscode-elements dists, treating template-built prefixes as producers, so this list is shorter than the review's.

Server

  • The serpentine layout's seeding router (seedEdgeRoutesForFixedLayout and its helpers): every seeded route was overwritten by the reroute the handler runs right after (resetAll routes every edge; with a selection, unselected routes are restored from the pre-op snapshot). The ELK call and the fixed branch stay.
  • layout-key-migration.ts (no caller) and seven LayoutPersistenceService methods with no caller.
  • clipboard.ts: the parser and escapeRegExp no paste path reads. The copy payload itself is untouched (that is phase 2).
  • Context menu: the "Stable, Experimental" reroute entry and the routingStrategy flag the handler never read; navigationTargetFromElement (a copy of sourceTargetFromElement). "Clear Routes Only" stays: it dispatches a real handler.
  • elkDefaults.defaultLayoutOptions: emptied. Verified with elkjs that defaults apply only to a root without options of its own, and the configurator always hands the root a full set, so the old values were never read.
  • agentPersona: no caller set it.

Kept from the review's list, and why

  • diagram-glsp-module.ts facade: four sidecar-toolkit tests import WorkflowSourceModelStorage through it; that package is in the other phase-1 PR.
  • The legacy layout-file locations and the single-network payload reader: layout-persistence-multi-network.test.ts pins reading from the old location, so both stay.
  • The wf:edgeOpenAnchorX/Y args: the review called them unproduced, but the edge-open mouse listener writes them on hover and the edge view reads them. Live.
  • WorkflowDiagramCss.NODE_STRUCTURE_IF_BRANCH: the server still stamps it on then/else/foreach nodes.
  • The @eclipse-glsp/server type import in shared: swapping it for @eclipse-glsp/graph means a dependency change and lockfile churn; left for a dependency pass.

Verification

npm run typecheck 5/5, npm run check:neutrality 5/5, npm run build ok. Tests: diagram-server 441/441, diagram-client 361/361 (one trace test for virtual edges removed with the type), extension-core 344/344. sidecar-toolkit: 5 timeouts in variant-node-create-wizard.test.ts that reproduce on untouched main (5 s limits), unrelated to this change.

https://claude.ai/code/session_01EToj6RJRMSSHQiqGNMU9wv

Ten GLSP types had a client class, a view, a server mapping, a shape hint and
layout branches, and no producer: node:proxy, the two collapsed nodes, the
if-branch, if-join, foreach-join and inline-if structure nodes, edge:virtual,
comp:ports and comp:port-row. The graph builder emits then/else/foreach
containers directly and never any of these. Their metadata keys, the three
type guards that always answered false, their CSS rules and the per-submit
model walk that looked for virtual edges go with them.

Claude-Session: https://claude.ai/code/session_01EToj6RJRMSSHQiqGNMU9wv
The spec-compatibility aliases (node:entity, port:in/out, the WORKFLOW_*
metadata twins), the Origin helpers, the entity/port type guards, six sizing
constants and the model's two never-populated AST maps had no reference
outside their own file. The CSS namespace keeps only the names some TypeScript
writes.

Claude-Session: https://claude.ai/code/session_01EToj6RJRMSSHQiqGNMU9wv
The property panel's "Change referenced type" button and the toggle-grid
action had no handler on any side; two navigation files were imported by
nothing; the back-compat aliases for the pre-split monolith had no caller
left; the label view read a `wf:labelRole` no producer writes; the chat panel
handled a `chat.sessionLoaded` the host never sends; two drag-state helpers
and two model exports had no reference. Thirty-nine stylesheet selectors
named classes no view, template or GLSP module produces (checked against the
client, chisel-ide, mlir-viewer and the GLSP/sprotty/vscode-elements dists).

Claude-Session: https://claude.ai/code/session_01EToj6RJRMSSHQiqGNMU9wv
The serpentine layout seeded every edge with its own 250-line orthogonal
router, then let the reroute handler overwrite every one of those routes, so
the seeding changed nothing. The layout-key migration module had no caller;
seven layout-persistence methods had none either (the legacy file locations
stay: a test pins them). The clipboard module kept a parser no paste path
reads. The context menu offered a "Stable, Experimental" reroute whose
strategy flag the handler never read, beside a navigation helper that was a
copy of the one in use. The ELK defaults were never read, since the
configurator always hands the root a full option set, and no caller set the
MCP persona.

Claude-Session: https://claude.ai/code/session_01EToj6RJRMSSHQiqGNMU9wv
The namespace read comes back: the Run button spreads the diagram context into
the host command and the toolkit's run driver builds `--workflow ns.name` from
it, so only the producer was missing, not the reader. The layout service keeps
`flush()` and the host drains every diagram's pending debounced save on
deactivation, which nothing did before. The if-branch class the server stamped
had no rule and no reader left, so the stamp and its constant go too. Plus the
README's deleted view name, an unused import and two blank-line leftovers.

Claude-Session: https://claude.ai/code/session_01EToj6RJRMSSHQiqGNMU9wv
@endrix
endrix merged commit c0c2112 into main Nov 8, 2026
1 check passed
@endrix
endrix deleted the chore/declutter-core branch November 8, 2026 07:25
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.

1 participant