Skip to content

feat: a frame and its toggle for a product's own server and client - #282

Merged
endrix merged 2 commits into
mainfrom
feat/node-open-toggle-for-products
Dec 4, 2026
Merged

endrix merged 2 commits into
mainfrom
feat/node-open-toggle-for-products

Conversation

@endrix

@endrix endrix commented Dec 4, 2026

Copy link
Copy Markdown
Owner

Stage 8.9 part 2 draws mlir's open operations as the stock frame (stockFrame, #281) and its closed ones as the stock node with +. mlir lays out with an ELK engine of its own and composes its own client without the stock features, so two parts of the frame were out of its reach.

Server (@dialogram/diagram-server): settleFrames, isUnwiredPin and placeUnwiredPins are exported. A product's engine calls settleFrames once the edges are built (room for the pins' names in the padding, room under the members for the pins no edge ends on), keeps the unwired pins out of ELK, and places them with placeUnwiredPins after the layout, as the stock engine does.

Client (@dialogram/diagram-client): nodeOpenToggleModule, a module with the toggle's mouse listener and the toggle anchor (the anchor, its model-root listener, and GLSP's update command rebound to the anchored one). The stock features now bind the same through bindNodeOpenToggle, so the bindings live in one place. The container parity baseline is unchanged.

Tests:

  • stock-node.test.ts: a frame with a wired pin, an unwired one and an output keeps more room on the side of the longer name and room under its members, marks only the unwired pin, and placeUnwiredPins puts it on the left border under the members; the barrel exports the three.
  • node-open-toggle.test.ts: the module's registrations (listener, anchor, root listener, update command), the barrel's exports, and the stock features binding through bindNodeOpenToggle.
  • Client 1,286 and server 1,191 tests pass; build, typecheck and the neutrality check pass.

https://claude.ai/code/session_011UYzzShRuBLgefHUrAbqya

Stage 8.9 draws mlir's open operations as the stock frame and its
closed ones as the stock node with `+`. mlir has a layout engine and a
client of its own, so the two parts of the frame they lacked are
exported:

- `settleFrames`, `isUnwiredPin` and `placeUnwiredPins` from the
  server: the room a frame keeps for its pins' names, and the pins no
  edge ends on, placed by the frame after the layout, as the stock
  engine places them.
- `nodeOpenToggleModule` from the client: the toggle's listener and
  the anchor that keeps the node pressed where it was on screen, with
  nothing else of the stock features. The stock features bind the same
  through `bindNodeOpenToggle`, so the bindings are one.

Claude-Session: https://claude.ai/code/session_011UYzzShRuBLgefHUrAbqya
- A product that loads the toggle module and the stock features gets
  the anchor and the listener once: each is bound only if it is not.
- `settleFrames` run again on a frame takes the unwired mark off a pin
  an edge now ends on, and its room off a frame that needs none.
- `placeUnwiredPins` takes a frame with no children.
- The module says it loads after GLSP's defaults, whose update command
  it replaces, and the CHANGELOG that the bus toggle stays with the
  stock features.

Claude-Session: https://claude.ai/code/session_011UYzzShRuBLgefHUrAbqya
@endrix
endrix merged commit c0bcb43 into main Dec 4, 2026
1 check passed
@endrix
endrix deleted the feat/node-open-toggle-for-products branch December 4, 2026 00:28
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