Repository navigation
Conversation
… reads Two bugs the declutter review turned up. The create-node and entity-port handlers accepted only a `.py` source, so a palette drop in a Verilog, VHDL or NDF diagram did nothing. The gate now asks the profile's source extensions: the runtime config carries `sourceExtensions`, `SidecarRuntimeService` and `SidecarInvoker` answer `handlesSource(uri)`, and the profile fills the list from its input. A config that names no extension accepts every source. Copy wrote the entity's name as `entityName` with its source text, while paste looked for `name` and `typeName`, so a copied node pasted as nothing; cut and duplicate already wrote the paste shape. One payload now lives in `@dialogram/shared` and is written by copy, cut and duplicate and read by paste and the webview's post-paste selection. The server's `clipboard/py-clipboard` module and the client's `clipboard-payload` are gone; the builder is `buildClipboardPayload` in `clipboard/clipboard`. Claude-Session: https://claude.ai/code/session_01EToj6RJRMSSHQiqGNMU9wv
The `.py` gate goes instead of growing: the other handlers that write to the source ask only that the model has one, so create-node and entity-port do the same. The `sourceExtensions` runtime field and `handlesSource` are gone again. A pasted or duplicated connection now joins the pasted copies, not the entities it was copied from. The pasted name follows one rule, `nextFreeName` in shared, on the sidecar side and in the webview, which predicted `add1` where the toolkit wrote `add2` and so never selected the pasted node. A paste with nothing to paste says so. The shared types are `DiagramClipboardItem` and `DiagramClipboardPayload`, clear of the DOM's `ClipboardItem`. Copy drops a blank name as it did before; cut and duplicate no longer await a synchronous builder. Claude-Session: https://claude.ai/code/session_01EToj6RJRMSSHQiqGNMU9wv
This was referenced Nov 8, 2026
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 2 of the declutter plan: the two likely bugs the review found, each pinned by a test, plus what the review of this PR turned up.
The palette never created a node outside Python
create-node-handler.tsandentity-port-crud-handler.tsreturned no command unless the model's source ended in.py. In a SystemVerilog, VHDL or NDF diagram a palette drop, and the property panel's "add port", did nothing, silently.The other thirteen handlers that write to the source ask only that the model has one (the profile's openability already decided which files open), so these two now do the same. The first version of this PR added a
sourceExtensionsgate instead; the review pointed out that this grew infrastructure around the odd one out, and it is gone again.create-in-every-product.test.tsresolves the real handlers through the toolkit DI module and checks a.sv,.vhd,.mdand.pysource all get a command, and a model with no source does not.Copy then paste pasted nothing
RequestClipboardDatabuilt one payload shape (entityName,sourceRange,text) while the toolkit's paste parsed another (name,typeName,portType, edge endpoints). Cut and duplicate already produced the second shape, so cut+paste worked and copy+paste created a node withtype: undefined.parseClipboardPayloadandclipboardDataFromPayloadmove to@dialogram/shared(clipboard-payload.ts): one shape for the server, the toolkit and the webview. Types areDiagramClipboardItemandDiagramClipboardPayload, clear of the DOM global.clipboard/clipboard.tskeeps onlybuildClipboardPayload(the formerbuildPyClipboardPayload, with the blank-name check the old builder had) and re-exports the shared pieces;py-clipboard.tsand the client'sclipboard-payload.tsare deleted.clipboard/clipboard;post-edit-selection-service.tsreadsitem.name.Found by the review of this PR
addwith its wire re-wired the original and leftadd2unwired. Paste and duplicate now carry a renamed map and connect the copies.nextFreeNamein shared, on both sides.awaiton the now-synchronous builder in cut and duplicate removed.Tests:
paste-handler.test.ts(names, remapped wire, empty payload), the server copy handler round-trips throughparseClipboardPayload, the webview'sprepareForPasteplans exactlyadd2/a2,nextFreeNamepinned.No product repo changes. Typecheck 5/5, neutrality 5/5, server 446, client 363, toolkit touched suites green (the full toolkit run has the known local timeout in
variant-node-create-wizard.test.ts, which passes in CI).https://claude.ai/code/session_01EToj6RJRMSSHQiqGNMU9wv