Repository navigation
Focus the state machine on the rejected call - #158
Open
CatarinaGamboa wants to merge 4 commits into
Open
CatarinaGamboa wants to merge 4 commits into
CatarinaGamboa wants to merge 4 commits into
Conversation
When the State Machine view is opened from a state refinement error, start with a reduced diagram of the found state, the required states, and the states on a shortest path between them. The rejected call is a note on the found state instead of a highlighted transition, so it never reads as a successful transition, and it is shown even when the method is absent from the general diagram or merged into another label. A summary lists the rejected call, Found, and Required with icons and text, and a button toggles between the focused and the full diagram. The view uses the receiver, expected states, conditions, and definite found state from the liquidjava-fsm error context. When Found is not one definite state, the found condition is shown without marking a single state. Error contexts without these fields keep the previous highlighting by label. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Mermaid draws a state with a description as an outer rect and a divider line rather than a .label-container, so the found, required, and possible state styles only reached the divider. Target the outer rect as well and cover both node shapes with style tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Give a state that may be found and is also required one combined label and style instead of duplicate descriptions. - Keep self loops of the called method on required states in the focused view, since they show where the call is allowed. - Keep the called method highlight in the full diagram; the focused view shows the allowed edge without it. - Let the pan handler ignore the error summary so its text stays selectable. - Enable condition expansion only for the transitions actually displayed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Description
Closes #117.
When the State Machine view is opened from a state refinement error, it now starts focused on the error.
receiver,expectedStates,expectedCondition,foundCondition,definiteFoundState), not from transition label text. With an older context the view behaves as before.client/src/webview/diagram-focus.ts. It works on one machine at a time, so multiple@StateSetsupport can reuse it.liquidjava-fsmto 0.1.4.Tests
Run against liquidjava-fsm 0.1.4 and verifier 0.0.35 from Maven Central:
npm run lintandnpm run test:typecheck: clean.npm run test:unit: 61 passed in 7 files. The 25 new tests are indiagram-focus.spec.ts,styles.spec.ts,fsm.spec.tsandscript.spec.ts.npm test(VS Code): 8 + 1 passing.mvn test: 24 passing.The new tests cover:
DefaultMutableTreeNodeexample;Also checked in headless VS Code on the
DefaultMutableTreeNodeexample from the issue, using the real verifier output. The view opens onchildrenAllowed(root), the rejectedgetFirstChild()andmaybeHasChildren.Independently reviewed; all five findings were fixed with regression tests.
Known limits
mainwith the orientation and conditions buttons.🤖 Generated with Claude Code