-
Notifications
You must be signed in to change notification settings - Fork 59
fix: close tooltip when window appears in AppItem #1432
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
1. Added logic to close tooltip when windows become available for an application item 2. The tooltip now automatically closes when a window appears while the tooltip is visible 3. This prevents tooltips from staying open when they're no longer relevant 4. Improves user experience by reducing visual clutter Log: Fixed tooltip behavior to automatically close when application windows appear Influence: 1. Test hovering over app items in dock to show tooltips 2. Verify tooltips close automatically when application windows open 3. Test with multiple applications opening while tooltips are visible 4. Check that tooltip behavior remains normal when no windows are opening fix: 修复AppItem中窗口出现时关闭工具提示的问题 1. 添加了当应用程序项有窗口可用时关闭工具提示的逻辑 2. 当窗口出现且工具提示可见时,工具提示现在会自动关闭 3. 防止工具提示在不再相关时保持打开状态 4. 通过减少视觉杂乱改善用户体验 Log: 修复工具提示行为,当应用程序窗口出现时自动关闭 Influence: 1. 测试悬停在Dock中的应用项上显示工具提示 2. 验证当应用程序窗口打开时工具提示自动关闭 3. 测试多个应用程序在工具提示可见时打开的情况 4. 检查在没有窗口打开时工具提示行为保持正常 PMS: BUG-342085
Reviewer's guide (collapsed on small PRs)Reviewer's GuideUpdates AppItem tooltip behavior so that any visible tooltip automatically closes when application windows become available for that item. Sequence diagram for tooltip closing when a window appearssequenceDiagram
actor User
participant Dock
participant AppItem
participant ToolTip
participant WindowManager
User->>Dock: hover over app item
Dock->>AppItem: hover event
AppItem->>ToolTip: open()
ToolTip-->>User: tooltipVisible = true
User->>Dock: open app
Dock->>WindowManager: request app window
WindowManager-->>AppItem: windowsChanged(windows)
AppItem->>AppItem: onWindowsChanged
AppItem->>AppItem: updateWindowIconGeometryTimer.start()
AppItem->>ToolTip: close() (when windows.length > 0 and toolTipVisible)
ToolTip-->>User: tooltipVisible = false
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
deepin pr auto review这段,针对这段代码的审查意见如下: 1. 语法逻辑
2. 代码质量
3. 代码性能
4. 代码安全
改进建议
改进后的代码示例onWindowsChanged: {
updateWindowIconGeometryTimer.start()
// Close tooltip when window list changes and tooltip is visible
if (toolTip && toolTip.toolTipVisible) {
toolTip.close()
}
}总结这段代码整体质量良好,逻辑清晰,但可以通过增加空值检查和更明确的注释来提高健壮性和可维护性。性能和安全方面没有明显问题。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey - I've left some high level feedback:
- Consider guarding the new logic with a check that
toolTipis defined to avoid potential runtime errors iftoolTipis ever missing or refactored away. - You might want to trigger the close only when transitioning from no windows to at least one (e.g., tracking previous
windows.length) so that tooltip behavior isn’t affected by subsequent window list changes while windows are already present.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider guarding the new logic with a check that `toolTip` is defined to avoid potential runtime errors if `toolTip` is ever missing or refactored away.
- You might want to trigger the close only when transitioning from no windows to at least one (e.g., tracking previous `windows.length`) so that tooltip behavior isn’t affected by subsequent window list changes while windows are already present.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 18202781743, wjyrich The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Log: Fixed tooltip behavior to automatically close when application windows appear
Influence:
fix: 修复AppItem中窗口出现时关闭工具提示的问题
Log: 修复工具提示行为,当应用程序窗口出现时自动关闭
Influence:
PMS: BUG-342085
Summary by Sourcery
Bug Fixes: