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

未关闭
#170 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
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 分钟
30 天内合并 PR
32

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

liquid-java/vscode-liquidjava 的其他 Issue

查看 liquid-java/vscode-liquidjava 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。