feat(dashboard): graph node click improvements #255

Merged
xiaomo merged 4 commits from feat/graph-interactions into main 2026-05-14 08:29:29 +00:00
Owner

What

改善流程图节点的点击交互体验。

Why

之前回边偏移太大,terminal 节点不可点击,多次执行的角色无法循环查看。

Changes

  • 回边 offset 140→80,更紧凑
  • Start/End 节点点亮后可点击(start→滚到 prompt,end→滚到底部)
  • 未点亮节点无 cursor-pointer,点击无响应
  • 角色节点多次执行时,重复点击循环跳转到不同执行记录
  • 所有 record 加 data-record-index 用于滚动定位

Ref

#247

## What 改善流程图节点的点击交互体验。 ## Why 之前回边偏移太大,terminal 节点不可点击,多次执行的角色无法循环查看。 ## Changes - 回边 offset 140→80,更紧凑 - Start/End 节点点亮后可点击(start→滚到 prompt,end→滚到底部) - 未点亮节点无 cursor-pointer,点击无响应 - 角色节点多次执行时,重复点击循环跳转到不同执行记录 - 所有 record 加 data-record-index 用于滚动定位 ## Ref #247
xingyue added 3 commits 2026-05-14 08:20:16 +00:00
What: Feedback (back) edges now connect from the left/right side of nodes
instead of top/bottom, making the routing visually clearer.

Changes:
- role-node.tsx: add Left/Right handles for feedback edge connections
- use-layout.ts: set sourceHandle/targetHandle for feedback edges
- condition-edge.tsx + use-layout.ts: increase FEEDBACK_OFFSET_X to 140

Ref: #247
Prevent React Flow from auto-routing forward edges to side handles.
All handles now have explicit IDs and all edges specify sourceHandle/targetHandle.
- Reduce feedback edge offset (140→80) for tighter layout
- Terminal nodes (start/end) now clickable when lit
- Unlit nodes have no cursor-pointer and ignore clicks
- Role nodes cycle through occurrences on repeated clicks
- Start node click scrolls to thread prompt
- End node click scrolls to bottom
- All records get data-record-index for scroll targeting

Ref: #247
xingyue added 1 commit 2026-05-14 08:24:34 +00:00
Previously __start__ only lit when role records existed. Now it lights
up as soon as a thread-start record is present (i.e. the trigger prompt).
xiaomo approved these changes 2026-05-14 08:29:24 +00:00
xiaomo left a comment
Owner

LGTM 👍

代码清晰,交互改进合理。Handle ID 命名化让 feedback edge 路由更精确,循环跳转逻辑用 modulo 简洁有效。

小 note: clickCycleRef 在 records 变化时不重置,但 modulo 保证无害。

LGTM 👍 代码清晰,交互改进合理。Handle ID 命名化让 feedback edge 路由更精确,循环跳转逻辑用 modulo 简洁有效。 小 note: clickCycleRef 在 records 变化时不重置,但 modulo 保证无害。
xiaomo merged commit d140801337 into main 2026-05-14 08:29:29 +00:00
Sign in to join this conversation.
No Reviewers
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: uncaged/workflow#255