Repository navigation
/untangle in every product, its port orders kept with the layout where the source takes none - #237
Merged
Merged
Conversation
…t where the source takes none The untangle tools, session and Apply move from sidecar-toolkit into diagram-server (src/untangle), bound in read-only and editable sessions alike. Apply saves the try's layout with the port orders it draws; a product writes an order into its source by binding a SourcePortOrderWriter, which the sidecar toolkit does where its profile has a sidecar (reorderEntityPorts, wfpy). The card lists the orders kept with the layout, then the files written; its button reads Apply when no file changes. /untangle becomes the platform's chat command, offered to every chat profile whose diagram tools are on, edit backend or not; the reorderEntityPorts gate is gone. Claude-Session: https://claude.ai/code/session_011UYzzUKxNqKPdmLsRmJ6Xu
… is bound From the review of #237: - The orders the card says the layout keeps are those Apply saves (the try's, less those written), and a definition the layout kept that the try draws as declared again is said to be let go, in the card and the message. - Two kept definitions of one name are told apart by their instances. - A read-only diagram's host binds no undo key: its card promises none. - The edit capability and /untangle share one client of the diagram's tools. Claude-Session: https://claude.ai/code/session_011UYzzUKxNqKPdmLsRmJ6Xu
…he diagram
mlir-viewer serves its diagrams with a diagram module of its own, which
registers no untangle Apply: its /untangle ran the tries and then failed
on Apply ("No handler registered for action kind:
dialogram.applyPortOrders"). Its module also lays out without Free Ports
and keeps no layout file, so a try has nowhere to be kept.
The server binds the untangle tools only beside the stock diagram module
(DiagramMcpModuleOptions.untangle), and the chat offers /untangle only to
a profile without serverDiagramModule (platformChatCommands).
Claude-Session: https://claude.ai/code/session_011UYzzUKxNqKPdmLsRmJ6Xu
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.
What changes
/untangleno longer needs a producer that can write a port order. Wherever a product's diagram tools are on and Dialogram's own diagram module serves the diagram, the agent untangles and the person applies or discards the result. Before this PR, every product but wfpy refused with "This diagram's source cannot be given a port order, so it cannot be untangled here." That includes picorv32 in streamblocks-ide.When a try is applied, each definition's port order goes to one of two places:
reorderEntityPorts);portOrders, from A port order the diagram draws is kept with its layout #236). No file changes.The card says which. It lists the orders kept with the layout by definition, then the files written, each with its definitions. Its button reads Apply when no file changes, and Apply to N files otherwise. Undo puts the layout back, and the files too when some were written.
How
src/untangle/): the four tools, the session and the Apply handler move here from sidecar-toolkit.SourcePortOrderWriter(SOURCE_PORT_ORDER_WRITER, optional) is the neutral hook:canWrite,fileOf,writeandusedElsewhere.SidecarPortOrderWriterholds what the tools used to do with the sidecar:supportsOp(reorderEntityPorts),entityFileOf, the op itself, andusesAcrossProjectfor "Also drawn in the new order". It is bound increateSidecarServerModule, but not for areadOnlyprofile, which has no sidecar to ask./untanglemoves from the edit capability tountangle-command.ts.profile-runtimeadds it for every chat profile withmcp.enabledand a server URL, through the newplatformCommandsargument ofassembleChatRuntimeConfig(after the capability's commands, before the profile's).reorderEntityPortsgate is gone; only "the diagram's tools are turned off" still refuses.diagram-tool-session.ts).Products with a diagram module of their own
mlir-viewer serves its diagrams with its own GLSP
DiagramModule. That module registers no untangle Apply, always lays out withFIXED_SIDE(ELK already orders the ports within a side), and keeps no layout file, so a try has nowhere to be kept. Such a product gets neither the tools nor the command:DiagramMcpModuleOptions.untangleis false whendiagramModuleFactoryis set;platformChatCommandsleaves/untangleout for a profile withserverDiagramModule.Before this, the live check on mlir-viewer ran the tries and then failed on Apply with "No handler registered for action kind: dialogram.applyPortOrders".
yliko leaves the diagram MCP server off, so it had no
/untanglebefore either.Tests
mcp-diagram-module.test.ts: the untangle tools in a read-only session as in an editable one;mcp-di.test.tscounts them.untangle-kept-in-layout.test.ts:writes: [];portOrdersand writes nothing, even when sent writes; undo puts the layout back.SidecarPortOrderWriter;operation-modules.test.ts: the Apply handler is in core, the read-only set includes it, the toolkit's MCP tools are its own two, and the writer is bound only with a sidecar.custom-diagram-module.test.ts: the MCP module beside a custom diagram module binds no untangle tools.untangle-command.test.ts: no capability gate,untangle-endafter the turn, refused with the tools off, not offered to a profile with its own diagram module;Live checks
/untanglefrom 12 crossings to 1. The card kept the orders of Cpu and MemIf with the layout, with no file changes. Apply changed only.layout/picorv32.py.layout.json; Undo restored it byte for byte; a reopen drew the same rows.untangle_demo.py: 25 crossings to 21. Apply wrote the Stage and Merge orders intountangle_parts.py, comments kept, and drewimagein the declared order again. Undo put the file back exactly./untanglein its chat and no untangle tools on its MCP server.https://claude.ai/code/session_011UYzzUKxNqKPdmLsRmJ6Xu