Repository navigation
Conversation
Phase 4d of the declutter plan. The actor, external-actor and network views drew the same body three times over, differing only in the root classes; renderEntityNode draws it once and each view names its classes. The three classes keep their names: chisel-ide extends ExternalActorNodeView. The headless renders of the fixture graph are byte-identical to main's under all three layouts. findNodeIdByGraphId, the lookup of a diagram element by a producer's id, was written in the outline, the property panel and the headless renderer; it is one function in producer-ids.ts. The renderer's layout table is the Layout menu's own (tunedLayoutOptions). Claude-Session: https://claude.ai/code/session_01EToj6RJRMSSHQiqGNMU9wv
The three producer-id lookups disagreed, and the merged one had locked in the wrong order: a diagram id is a label, which another node's producer id may equal, so the producer id wins; a direct hit must be a node, never a port or compartment that carries the id; the first in document order answers; and a very wide root is walked without a spread. producer-ids.test.ts pins each rule. The renderer's Untangled pins the declared port order as the editor's does, now said so. Claude-Session: https://claude.ai/code/session_01EToj6RJRMSSHQiqGNMU9wv
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Phase 4d of the declutter plan, the webview side of the de-duplication. Cut from main; independent of the other open PRs (only
CHANGELOG.mdcan conflict).The three node views
ActorNodeView,ExternalActorNodeViewandNetworkNodeView(views.ts) each computedisExecuting/isFinished/isErrored/isWarned, resolved the family, drew the sized rect, the run ring, the centre icon or image, the children and the type footer, in the same order with the same attributes. A diff of the three bodies showed they differ only in the root classes:actor-node;external-actor-nodeplusexternal-actor-defaultorexternal-actor-<family>;network-node.renderEntityNode(node, context, rootClasses)draws the body once; each view keeps its class (chisel-ide extendsExternalActorNodeView), itsisVisiblecheck and a one-linerootClassesfunction. The tests that scanviews.tsas text (run-ring.test.ts,header-badges-view.test.ts) look forrenderRunRingandHeaderCompartmentView, both untouched.Verification:
scripts/render-svg/render.mjson the toolkit's fixture graph, all three layouts, before and after: the SVG files are byte-identical.The producer-id lookup
"Which diagram element does this producer id name" was written three times:
findNodeIdByGraphIdinhierarchy-outline.ts,elementIdForinproperty-panel.ts,diagramIdOfinscripts/render-svg/headless-entry.ts, and they disagreed on precedence. OnefindNodeIdByGraphIdindiagram-client/src/producer-ids.ts, with the rule the review settled: the producer id (wf:graphNodeId) wins, because a diagram id is the node's label and another node's producer id may equal it; a direct id hit must be a node, so a port, label or compartment carrying the id is never selected in its place; the first match in document order answers; the walk is a queue, no spread of a root's children.producer-ids.test.tspins each rule. The property panel's link follow pays one tree walk instead of an index hit; a click, not a hot path.The render script
build-schema.tsspelled the Layout menu's option table itself; it now callstunedLayoutOptions('untangled' | 'free-ports')fromlayout-tuned-handler.ts. One deliberate difference: the editor's Untangled pins the declared port order and the script's copy did not, so a document that sets its own port order renders under Untangled as the editor shows it (stated in the changelog). ItscreateSchemastays: GLSP'sDefaultGModelSerializerneeds a DI-provided diagram configuration, which the script has no container for.Not merged: the two test-only
index()helpers in server tests (tests, not product code).Typecheck 5/5, neutrality 5/5, client 361, server untouched.
https://claude.ai/code/session_01EToj6RJRMSSHQiqGNMU9wv