Repository navigation
feat: an automaton in the stock look for a product's own server - #284
Merged
Merged
Conversation
A product whose server builds its own model can now draw an automaton inside one of its frames, as every producer's automaton is drawn: - `stockAutomaton(states, transitions)`: the graph source's states and transitions, under the product's ids. - `placeAutomatonStates(elk, states, transitions)`: the engine's own placement, moved out of WorkflowElkLayoutEngine so a product's engine can place a nested automaton; the engine calls it as before. - The client works a transition out from what holds it (the root, or a frame) in that holder's coordinates; an automaton at the root is drawn as before. - A transition's label box takes the pointer itself, so it selects in a product whose edges take none. - The client exports StateNode, StateNodeView, TransitionEdge, TransitionEdgeView and WorkflowDiagramMetadata. For mlir-viewer's open `ats.fsm`, which today draws as boxes and loses its loops and parallel transitions. Claude-Session: https://claude.ai/code/session_011UYzzShRuBLgefHUrAbqya
- stockAutomaton folds no run: a folded run is a node the product does not have (its ways in and out ended on it, the states inside were lost), and its toggle an operation the product's server does not answer. The graph source takes `openRuns`, which stockAutomaton sets to every run, and the open run's toggle marks are dropped. The ways into a hub stay stubs, as in every producer's automaton. - A transition's link anchor is in the diagram's coordinates: the label is drawn in those of what holds it, so a frame's place is added. - The bounds comment says they are in the holder's coordinates, which every reader takes up through the parents (`boundsInViewport`). Claude-Session: https://claude.ai/code/session_011UYzzShRuBLgefHUrAbqya
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.
A product whose server builds its own model (mlir-viewer) can now draw an automaton inside one of its frames, as every producer's automaton is drawn: each state its name in a pill, the initial one double-outlined, and each transition a curve or a loop labelled with what takes it.
Changes
stockAutomaton(states, transitions)(model/stock-automaton.ts). It returns the graph source's states and transitions under the product's ids, asstockNodedoes for one node.placeAutomatonStates(elk, states, transitions)(server/automaton-layout.ts). This is the engine's own placement (spread until clear enough), moved out ofWorkflowElkLayoutEngineso that a product's engine can place a nested automaton. The engine calls it as before, and its log line is unchanged.StateNode,StateNodeView,TransitionEdge,TransitionEdgeViewandWorkflowDiagramMetadata.Why
mlir-viewer draws an open
ats.fsmas boxes in layers. Its edges keep one edge between two states and none from a state to itself, so the@Cpu_cpumachine of picorv32 shows 18 of its 33 transitions. The mlir-viewer PR that follows draws it with these pieces.Tests
stock-automaton.test.ts. Ids, sizes, the initial mark, every transition including loops and parallel ones, and the exported placement (states apart, inside the drawing).automaton-in-frame.test.ts. A transition in a frame draws in the frame's coordinates, the same as at the root. Both tests fail on main.typecheck.shandcheck-neutrality.shpass.@Cpu_cpuand@MemIfmachines, dark and light), and checked live: selecting a state or a transition, and the panel.https://claude.ai/code/session_011UYzzShRuBLgefHUrAbqya