GraphLayer: refresh the hover target when components change under a stationary pointer

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

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
55/100
Issue 类型
功能
描述清晰度
描述清楚
活跃度
活跃
技术栈
typescript
领域
frontend, web-dev

调研方向

Start with src/components/canvas/layers/graphLayer/GraphLayer.ts around lines 215–261 and compare the v2 implementation around lines 201–231. Trace how pointer input, the 3 px movement threshold, camera changes, and pointer capture update the hover target; then identify how a layer could request a re-hit-test after its components change. Done means the stationary pointer gets the normal enter/leave transition, while active pointer capture is respected.

由索引模型根据 Issue 内容生成。

描述

Reproduction

  1. Hover an interactive canvas component with a custom cursor.
  2. Keep the pointer still and use a keyboard modifier to replace that component with another interactive component at the same position. For example, swap a resize handle for an insertion handle while Shift is held.
  3. Let the graph render and its hit-test index settle. The hover target and cursor can still describe the previous component. Moving the mouse far enough refreshes them.

Expected behavior

Provide a supported way to recompute the hover target at the last pointer position once the hit-test scene has changed. It should dispatch the normal enter/leave transition when the target changes and respect an active pointer capture. An explicit invalidation API would let a custom layer request this only when its interactive components change.

GraphLayer currently updates the target on pointer input, skips mouse moves below the 3 px threshold, and can optionally re-hit-test on camera changes. A layer can change its components without any of those events. See main and v2.

主要语言
TypeScript
星标
145
派生
12
平均合并
1 天 14 小时
30 天内合并 PR
43

环境准备

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

从这里开始

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

gravity-ui/graph 的其他 Issue

查看 gravity-ui/graph 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

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