Skip to content

feat: the selection's path, traced across group frames - #109

Merged
endrix merged 2 commits into
mainfrom
feat/selection-trace
Oct 30, 2026
Merged

endrix merged 2 commits into
mainfrom
feat/selection-trace

Conversation

@endrix

@endrix endrix commented Oct 30, 2026

Copy link
Copy Markdown
Owner

Selecting a node draws every path through it: what leads to it in green, what it leads to in blue, and the rest fades. It is mlir-viewer's trace highlighter (packages/client/src/trace-highlighter.ts) ported onto Dialogram's model, opt-in with clientBehavior.selectionTrace.

How it walks

  • Port to port, both ways, as far as the edges go.
  • A boundary port on a group's frame (port:group-boundary, where splitEdgesAtGroups cuts an edge) is passed through, so the group never counts as a node on the path. A path follows a cut edge out of one group and into another at any depth, and every piece and boundary port of it is drawn.
  • On a cycle, where reachability would light the whole diagram, the trace is cut to the node's direct neighbours, as mlir-viewer does.
  • A selected edge draws all its pieces and its two ends.
  • A selected container draws what feeds it and what it feeds across its frame, and leaves its members as they are.
  • A container is never faded, because its opacity would fade every member.

How it draws

  • The classes go on as GLSP feedback, like published node states (execution-states.ts), so the dispatcher re-applies them to every model and a relayout or an edit keeps the trace.
  • The listener and command are bound in the base module, so every container has them, the headless one included.
  • An edge is recoloured through color: its line and arrowhead use currentColor, so a product's dash pattern per edge type stays.

Tooling. scripts/render-svg --select <id> selects an element as a click would, by the diagram's id or the producer's (wf:graphNodeId), so a trace can be rendered and looked at.

Tests. selection-trace.test.ts has 13 tests. The nested cases build their models with the server's own splitEdgesAtGroups, so the pieces and boundary ports are the ones the client receives. The parity baseline gains exactly the three new registrations.

Checked visually with the renderer

  • picorv32 20-behavior/trap.md, grouped by layer, with TRAP-CAUSE-001 selected: its whole upstream cone across the L2 to L1 frames is green and TRAP-001 → PIPE-FSM-001 is blue. VER-TRAP-001, trap_halt and PRM-CATCH-001, which touch the path only at TRAP-001, fade.
  • hdl-sidecar's glue golden with input a selected: the path through a & b, u_buf and the mux to lo and y; the rest fades.

Gates. npm run build and check:neutrality pass. Every test passes except the two known load-flaky ones (session-manager, and the variant wizard's 5 s timeout), which pass when run alone.

https://claude.ai/code/session_01E8WfqKknDNN6xpNVcJL5K8

Selecting a node draws every path through it: what leads to it in green,
what it leads to in blue, the rest faded. After mlir-viewer's trace
highlighter, ported onto Dialogram's model:

- The walk goes port to port, both ways. A boundary port on a group's
  frame is passed through without counting the group as a node, so a path
  follows a cut edge out of one group and into another at any depth, every
  piece and boundary port of it drawn.
- On a cycle, where reachability would light the whole diagram, the trace
  is cut to the node's direct neighbours.
- A selected edge draws all its pieces and its two ends; a selected
  container, what feeds it and what it feeds across its frame, leaving its
  members as they are.
- A container is never faded: its opacity would fade every member.

Opt-in with `clientBehavior.selectionTrace`. The classes go on as GLSP
feedback, as published node states do, so the dispatcher re-applies them
to every model and a relayout keeps the trace. The listener and command
are bound in the base module, so every container has them, the headless
one included.

`scripts/render-svg --select <id>` selects an element as a click would
(the diagram's id or the producer's), to render a trace and look at it.

Claude-Session: https://claude.ai/code/session_01E8WfqKknDNN6xpNVcJL5K8
@endrix
endrix merged commit 574e3fc into main Oct 30, 2026
1 check passed
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