Skip to content

fix(tooltip): 提示框可被鼠标拖出 [DeepSeek-V4.1-flash-1017] - #3773

Merged
LuLu-ling merged 1 commit into
PCL-Community:devfrom
CerikoSky:fix-tooltip-drag-out
Nov 4, 2026
Merged

LuLu-ling merged 1 commit into
PCL-Community:devfrom
CerikoSky:fix-tooltip-drag-out

Conversation

@CerikoSky

@CerikoSky CerikoSky commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

变更说明 / Summary

长图

image

关联 Issue / Related Issue

验证方式 / Verification

AI 使用情况 / Generative Artificial Intelligence Usage

  • 使用情况 / Usage:辅助性使用(Auxiliary)
  • 使用工具及模型 / Tools and models:DeepSeek-V4.1-flash-1017
  • 使用目的 / Purpose:修复其他 Tooltip 错误
  • 涉及范围 / Scope:部分代码
  • 人工审查与验证 / Human review and verification:已人工审查

提交前检查 / Checklist

  • 我已阅读并遵守 技术规范 和 生成式人工智能使用方针。/ I have read and followed the Technical Guidelines and the Generative Artificial Intelligence Usage Policy.
  • 我能解释本次修改的全部内容,包括关键逻辑、异常处理和已知限制。/ I can explain all changes, including key logic, error handling, and known limitations.
  • 我确认未伪造日志、测试结果、基准数据或其他证据。/ I confirm that no logs, test results, benchmarks, or other evidence have been fabricated.
  • 本次提交不包含与修改无关的文件变更,也未提交临时文件或构建产物。/ The PR contains no unrelated changes, temporary files, or build artifacts.
  • 所有提交均已签名,且提交信息符合提交信息规范。/ All commits are signed and follow the commit message convention.
  • 我确认 PR 描述由本人撰写,未直接提交未经核实的 AI 生成内容。/ I confirm that I wrote this PR description myself and have not submitted unverified AI-generated content.

Sourcery 摘要

按下鼠标左键时,关闭并禁止工具提示活动,避免工具提示干扰鼠标拖动。

错误修复:

  • 按下鼠标按钮时,阻止工具提示打开、捕获鼠标事件或保持活动状态,使指针能够拖出工具提示,而不会意外移动或重新打开工具提示。

改进:

  • 优化工具提示的指针离开和关闭行为,确保鼠标拖动期间活动中的工具提示能够一致地关闭。
Original summary in English

Sourcery 总结

通过在鼠标左键按下期间禁用工具提示的激活,并在指针离开时关闭已打开的工具提示,防止工具提示干扰鼠标拖动。

错误修复:

  • 按住鼠标左键时,防止工具提示打开、继续保持活动状态或干扰鼠标拖动。
  • 确保拖动过程中指针离开时,已打开的工具提示始终会关闭;并且在松开鼠标后,除非符合重新打开的条件,否则不会再次打开。

增强功能:

  • 改进工具提示在拖动、指针离开和松开鼠标等事件中的指针跟踪,以及关闭和重新启动行为。
Original summary in English

Sourcery 摘要

在按住鼠标左键时,持续隐藏并关闭工具提示,避免其妨碍鼠标拖动。

Bug 修复:

  • 按下鼠标左键时,防止工具提示打开、保持激活或干扰鼠标拖动。
  • 拖动过程中指针离开时关闭已激活的工具提示,并避免松开鼠标按键后意外重新打开。

功能增强:

  • 改进工具提示对指针移动、离开、拖动和松开事件的跟踪,以及关闭和重新打开行为。
Original summary in English

Sourcery 摘要

通过在指针移动和离开事件期间抑制工具提示的激活并统一关闭工具提示,避免工具提示干扰鼠标拖动。

Bug 修复:

  • 按住鼠标左键时,阻止工具提示打开、保持激活状态或干扰鼠标拖动。
  • 拖动期间指针离开时关闭已激活的工具提示,并防止它们随后意外重新打开。

功能增强:

  • 改进指针离开或拖动进行中时的工具提示指针追踪和关闭行为。
Original summary in English

Summary by Sourcery

Prevent tooltips from interfering with mouse dragging by suppressing activation and closing them consistently during pointer movement and leave events.

Bug Fixes:

  • Prevent tooltips from opening, remaining active, or interfering with mouse dragging while the left mouse button is pressed.
  • Close active tooltips when the pointer leaves during a drag and prevent them from reopening unexpectedly afterward.

Enhancements:

  • Improve tooltip pointer tracking and shutdown behavior when the pointer leaves or a drag is in progress.

@pcl-ce-automation pcl-ce-automation Bot added 🛠️ 等待审查 Pull Request 已完善,等待维护者或负责人进行代码审查 size: S PR 大小评估:小型 labels Nov 2, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-02T15:00:46.271371Z 6372dd1 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@sourcery-ai

sourcery-ai Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

审阅者指南

更新了工具提示的鼠标事件处理逻辑,确保在鼠标拖动期间工具提示不会显示、保持激活状态或重新定位;当光标被拖出目标区域时,工具提示会关闭。

鼠标拖动期间抑制工具提示的时序图

sequenceDiagram
    actor User
    participant Target as Target element
    participant Tooltip as Tooltip

    User->>Target: Mouse move while left button pressed
    Target->>Tooltip: OnMove
    Tooltip->>Tooltip: _PointInside
    alt Cursor leaves target
        Tooltip->>Tooltip: _WindDown
    else Cursor remains inside target
        Tooltip-->>Target: Do not _PlaceNear
    end

    User->>Target: Tooltip opening attempted while dragging
    Target->>Tooltip: OnOpening
    Tooltip-->>Target: _Hush
Loading

文件级变更

变更 详细信息 文件
防止用户拖动或光标离开目标区域时激活或重新定位工具提示。
  • 检测到光标移出目标区域时关闭工具提示。
  • 在关闭过程中抑制工具提示跟踪。
  • 将鼠标左键松开事件视为立即关闭工具提示的信号。
  • 鼠标左键按下时,阻止工具提示打开、取得所有权以及延迟显示弹出窗口。
PCL.Core.Wpf/UI/Controls/Tooltip.cs

提示和命令

与 Sourcery 交互

  • 触发新的审阅: 在拉取请求中评论 @sourcery-ai review。
  • 继续讨论: 直接回复 Sourcery 的审阅评论。
  • 根据审阅评论创建 GitHub issue: 回复审阅评论,请 Sourcery 根据该评论创建 issue。你也可以回复审阅评论并发送 @sourcery-ai issue,以据此创建 issue。
  • 生成拉取请求标题: 在拉取请求标题的任意位置写入 @sourcery-ai,即可随时生成标题。你也可以在拉取请求中评论 @sourcery-ai title,以随时(重新)生成标题。
  • 生成拉取请求摘要: 在拉取请求正文中你希望摘要出现的位置写入 @sourcery-ai summary,即可随时生成 PR 摘要。你也可以在拉取请求中评论 @sourcery-ai summary,以随时(重新)生成摘要。
  • 生成审阅者指南: 在拉取请求中评论 @sourcery-ai guide,即可随时(重新)生成审阅者指南。
  • 解决所有 Sourcery 评论: 在拉取请求中评论 @sourcery-ai resolve,即可解决所有 Sourcery 评论。如果你已经处理完所有评论,不想再看到它们,这个命令就很有用。
  • 关闭所有 Sourcery 审阅: 在拉取请求中评论 @sourcery-ai dismiss,即可关闭所有现有的 Sourcery 审阅。如果你想从头开始进行新的审阅,这个命令尤其有用——别忘了评论 @sourcery-ai review 来触发新的审阅!

自定义使用体验

访问你的控制面板以便:

  • 启用或停用审阅功能,例如 Sourcery 生成的拉取请求摘要、审阅者指南等。
  • 更改审阅语言。
  • 添加、删除或编辑自定义审阅说明。
  • 调整其他审阅设置。

获取帮助

Original review guide in English

Reviewer's Guide

Updates tooltip mouse-event handling so tooltips cannot appear, remain active, or be repositioned during a mouse drag, and are dismissed when the cursor is dragged outside the target.

Sequence diagram for tooltip suppression during mouse drag

sequenceDiagram
    actor User
    participant Target as Target element
    participant Tooltip as Tooltip

    User->>Target: Mouse move while left button pressed
    Target->>Tooltip: OnMove
    Tooltip->>Tooltip: _PointInside
    alt Cursor leaves target
        Tooltip->>Tooltip: _WindDown
    else Cursor remains inside target
        Tooltip-->>Target: Do not _PlaceNear
    end

    User->>Target: Tooltip opening attempted while dragging
    Target->>Tooltip: OnOpening
    Tooltip-->>Target: _Hush
Loading

File-Level Changes

Change Details Files
Prevent tooltip activation and repositioning while the user is dragging or the cursor has left the target.
  • Close the tooltip when movement is detected outside the target.
  • Suppress tooltip tracking during the closing sequence.
  • Treat left-button leave events as an immediate tooltip shutdown.
  • Block opening, ownership claims, and delayed popup display while the left mouse button is pressed.
PCL.Core.Wpf/UI/Controls/Tooltip.cs

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

你好——我发现了 1 个问题

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="PCL.Core.Wpf/UI/Controls/Tooltip.cs" line_range="292" />
<code_context>
                 _cursor = Mouse.GetPosition(_target);
-                if (_IsCursorPlaced(_target) && _flyout is { IsOpen: true })
+                if (!_PointInside(_target, _cursor))
+                    _WindDown();
+                else if (_IsCursorPlaced(_target) && _flyout is { IsOpen: true })
                     _PlaceNear(_target, _cursor);
</code_context>
<issue_to_address>
**Tooltip stays hidden after drag**

When a drag ends over an eligible tooltip target and the pointer stays still, `_TryClaim` leaves `_target` null while the button is pressed, and `OnLeave` can clear it; `OnRelease` then returns without claiming the element under the pointer, so its tooltip stays hidden until another mouse event.

Have `OnRelease` claim the eligible element under the pointer when `_target` is null.

Also at `PCL.Core.Wpf/UI/Controls/Tooltip.cs:330`, `PCL.Core.Wpf/UI/Controls/Tooltip.cs:370`.
</issue_to_address>

Sourcery 对开源项目免费——如果你喜欢我们的评审,欢迎分享 ✨
Original comment in English

Hey - I've found 1 issue

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="PCL.Core.Wpf/UI/Controls/Tooltip.cs" line_range="292" />
<code_context>
                 _cursor = Mouse.GetPosition(_target);
-                if (_IsCursorPlaced(_target) && _flyout is { IsOpen: true })
+                if (!_PointInside(_target, _cursor))
+                    _WindDown();
+                else if (_IsCursorPlaced(_target) && _flyout is { IsOpen: true })
                     _PlaceNear(_target, _cursor);
</code_context>
<issue_to_address>
**Tooltip stays hidden after drag**

When a drag ends over an eligible tooltip target and the pointer stays still, `_TryClaim` leaves `_target` null while the button is pressed, and `OnLeave` can clear it; `OnRelease` then returns without claiming the element under the pointer, so its tooltip stays hidden until another mouse event.

Have `OnRelease` claim the eligible element under the pointer when `_target` is null.

Also at `PCL.Core.Wpf/UI/Controls/Tooltip.cs:330`, `PCL.Core.Wpf/UI/Controls/Tooltip.cs:370`.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment thread PCL.Core.Wpf/UI/Controls/Tooltip.cs Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 557e9a0253

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread PCL.Core.Wpf/UI/Controls/Tooltip.cs Resolved
@pcl-ce-automation pcl-ce-automation Bot added size: M PR 大小评估:中型 and removed size: S PR 大小评估:小型 labels Nov 2, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a7899eabe9

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread PCL.Core.Wpf/UI/Controls/Tooltip.cs Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3c70850b9f

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread PCL.Core.Wpf/UI/Controls/Tooltip.cs Resolved
@CerikoSky
CerikoSky force-pushed the fix-tooltip-drag-out branch from 3c70850 to 6372dd1 Compare November 2, 2026 14:56
@pcl-ce-automation pcl-ce-automation Bot added size: S PR 大小评估:小型 and removed size: M PR 大小评估:中型 labels Nov 2, 2026
@pcl-ce-automation pcl-ce-automation Bot added 🕑 等待合并 已处理完毕,正在等待代码合并入主分支 and removed 🛠️ 等待审查 Pull Request 已完善,等待维护者或负责人进行代码审查 labels Nov 4, 2026
@LuLu-ling
LuLu-ling merged commit 16207f9 into PCL-Community:dev Nov 4, 2026
3 checks passed
@pcl-ce-automation pcl-ce-automation Bot added 👌 完成 相关问题已修复或功能已实现,计划在下次版本更新时正式上线 and removed 🕑 等待合并 已处理完毕,正在等待代码合并入主分支 labels Nov 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size: S PR 大小评估:小型 👌 完成 相关问题已修复或功能已实现,计划在下次版本更新时正式上线

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants