Collapse what does not help when focusing the state machine on an error, and show the ways to fix it

オープン
#170 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
typescript, vscode

調査の方向性

Start by reading the State Machine view implementation and its existing focus mode, then trace how the Verification tab receives verifier hints. Use the UDP chat client’s DatagramSocket example to check the focused layout. Done means the focused view collapses dimmed methods, merges constructors, fits the diagram while keeping every state visible, and lists the verifier’s hints; Show all remains unchanged.

索引モデルが issue の本文から書いたものです。

説明

enhancement

Problem

When the State Machine view opens on a state error, focus mode dims what does not help with the error (#158) but keeps every label's text, so the layout does not move. On a large machine the dimmed label stacks still take up the space. In the UDP chat client (DatagramSocket), 11 and 13 dimmed methods sit next to unbound and bound. The state the error is about, closed, ends up below the fold, so the user has to scroll the panel to find it.

#117 first asked for a reduced initial view. #158 chose dimming so that toggling would not re-lay out the diagram.

The view also shows where a call is rejected but not how to get to a state that accepts it. The verifier's hints only appear in the Verification tab.

Proposal

Keep the full diagram and never remove a state. In focus mode, collapse what is dimmed instead of only fading it:

  • Collapse the dimmed methods of each label into a count, with their names in a tooltip: receive · +9 more, 2 methods. Overloads count once. Hovering the count lists those methods next to it, and a click keeps the list open.
  • Merge the constructors of each state into one arrow.
  • Lay the diagram out again, and shrink a tall diagram to fit the panel, but not below a readable scale (60%).
  • Show all stays exactly as it is today.

Include the possible ways to fix the error, from the verifier: the state hints of the error (liquid-java/liquidjava#411 and the PRs after it), listed in the State Machine view as in the Verification tab. They may say "(and possibly others)".

Ways read from the diagram alone were tried and dropped. A shortest path along the transitions ignores their conditions and the code. For a state that no call leaves, such as closed, it could only suggest creating a new object. In the UDP case the real fix is in the control flow, which the verifier's hint already says.

Not in scope

  • Using the error categories to choose what to show (liquid-java/liquidjava#418). This was discussed. The categories are right for 34 of 52 exercises, and most wrong labels are "argument picks the state" bugs reported as Out of order. A diagram reduced by category would hide the evidence in exactly those cases. Categories can add emphasis later, but never remove parts.
  • Drawing a selected hint on the diagram (#156). The hints are text, and their states are combinations of state sets, while the diagrams have one machine per state set.

Acceptance

  • On DatagramSocket in the UDP chat client, the focused view shows closed and bound without scrolling.
  • Focus mode keeps the failed method bright. Every state is still drawn, and every collapsed label can be expanded.
  • Show all is unchanged.
  • The view lists the verifier's hints.
主要言語
TypeScript
スター
6
フォーク
1
平均マージ
14時間 6分
マージ済み PR(30日)
32

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

liquid-java/vscode-liquidjava のほかの issue

liquid-java/vscode-liquidjava の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。