-
Notifications
You must be signed in to change notification settings - Fork 60
fix: disable tray item interactions during collapse #1446
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
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideMoves the tray item enabled/disabled logic from the AppletItemButton to its HoverHandler and TapHandler so that tray items remain visually enabled while input interactions are blocked during collapse animations. Sequence diagram for tray item interaction during collapsesequenceDiagram
actor User
participant AppletItemButton
participant HoverHandler
participant TapHandler
participant TraySortOrderModel
User->>AppletItemButton: movePointer()
AppletItemButton->>HoverHandler: pointerEvent()
HoverHandler->>TraySortOrderModel: check isCollapsing
TraySortOrderModel-->>HoverHandler: isCollapsing = false
HoverHandler-->>AppletItemButton: hoverAccepted
AppletItemButton-->>User: showHoverEffect
User->>TapHandler: click()
TapHandler->>TraySortOrderModel: check isCollapsing
TraySortOrderModel-->>TapHandler: isCollapsing = false
TapHandler-->>AppletItemButton: triggerAction
AppletItemButton-->>User: performAction
TraySortOrderModel-->>TraySortOrderModel: startCollapse()
User->>HoverHandler: pointerEvent()
HoverHandler->>TraySortOrderModel: check isCollapsing
TraySortOrderModel-->>HoverHandler: isCollapsing = true
HoverHandler-->>User: ignoreEvent (no hover effect)
User->>TapHandler: click()
TapHandler->>TraySortOrderModel: check isCollapsing
TraySortOrderModel-->>TapHandler: isCollapsing = true
TapHandler-->>User: ignoreEvent (no click action)
TraySortOrderModel-->>TraySortOrderModel: endCollapse()
User->>HoverHandler: pointerEvent()
HoverHandler->>TraySortOrderModel: check isCollapsing
TraySortOrderModel-->>HoverHandler: isCollapsing = false
HoverHandler-->>AppletItemButton: hoverAccepted
AppletItemButton-->>User: showHoverEffect
Class diagram for updated tray item input handlingclassDiagram
class AppletItemButton {
bool visible
bool hoverEnabled
bool inputEventsEnabled
void updatePluginMargins()
}
class HoverHandler {
bool enabled
object parent
}
class TapHandler {
bool enabled
object parent
}
class TraySortOrderModel {
bool isCollapsing
}
AppletItemButton o-- HoverHandler : owns
AppletItemButton o-- TapHandler : owns
HoverHandler --> TraySortOrderModel : reads isCollapsing
TapHandler --> TraySortOrderModel : reads isCollapsing
AppletItemButton : hoverEnabled = inputEventsEnabled
HoverHandler : enabled = !TraySortOrderModel.isCollapsing
TapHandler : enabled = !TraySortOrderModel.isCollapsing
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
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:
- You now duplicate the
!DDT.TraySortOrderModel.isCollapsingcondition in bothHoverHandlerandTapHandler; consider binding a single local property (e.g.interactionsEnabled) and using that in all handlers to keep the logic consistent and easier to change. - With
hoverEnabledstill bound toinputEventsEnabledbut theHoverHandlerdisabled during collapse, it may be worth double-checking whether the desired behavior is to suppress hover visual feedback entirely during collapse; if so, aligninghoverEnabledwith the same collapse condition would make the intent clearer in the QML.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- You now duplicate the `!DDT.TraySortOrderModel.isCollapsing` condition in both `HoverHandler` and `TapHandler`; consider binding a single local property (e.g. `interactionsEnabled`) and using that in all handlers to keep the logic consistent and easier to change.
- With `hoverEnabled` still bound to `inputEventsEnabled` but the `HoverHandler` disabled during collapse, it may be worth double-checking whether the desired behavior is to suppress hover visual feedback entirely during collapse; if so, aligning `hoverEnabled` with the same collapse condition would make the intent clearer in the QML.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
37df169 to
8f45edf
Compare
The enabled property was moved from the AppletItemButton to the individual input handlers (HoverHandler and TapHandler). Previously, the entire button was disabled when the tray was collapsing, which could affect visual state. Now only the input interactions are disabled while maintaining the button's visual appearance. This ensures that tray items remain visible but non-interactive during collapse animations. Log: Fixed tray items becoming visually disabled during collapse animation Influence: 1. Test tray collapse animation - items should remain visible but not respond to hover or clicks 2. Verify that tray items return to normal interactive state after collapse completes 3. Check that hover effects and click actions work normally when not collapsing 4. Ensure no visual glitches during the transition between states fix: 修复托盘项在折叠期间交互问题 将 enabled 属性从 AppletItemButton 移动到单独的输入处理器(HoverHandler 和 TapHandler)。之前当托盘折叠时整个按钮被禁用,这可能会影响视觉状态。 现在仅禁用输入交互,同时保持按钮的视觉外观。这确保托盘项在折叠动画期间保 持可见但不可交互。 Log: 修复托盘项在折叠动画期间变为视觉禁用状态的问题 Influence: 1. 测试托盘折叠动画 - 托盘项应保持可见但不响应悬停或点击 2. 验证托盘项在折叠完成后恢复正常交互状态 3. 检查悬停效果和点击动作在非折叠状态下正常工作 4. 确保状态转换期间没有视觉故障 PMS: BUG-350883
deepin pr auto review这段代码变更主要涉及许可证合规性文件的修改和QML文件中逻辑的变更。以下是从语法逻辑、代码质量、代码性能和代码安全四个方面的详细审查与改进建议: 1. 语法逻辑REUSE.toml 变更:
ActionLegacyTrayPluginDelegate.qml 变更:
2. 代码质量
3. 代码性能
4. 代码安全
改进建议
总结: |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: BLumia, robertkill 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 |
The enabled property was moved from the AppletItemButton to the individual input handlers (HoverHandler and TapHandler). Previously, the entire button was disabled when the tray was collapsing, which could affect visual state. Now only the input interactions are disabled while maintaining the button's visual appearance. This ensures that tray items remain visible but non-interactive during collapse animations.
Log: Fixed tray items becoming visually disabled during collapse animation
Influence:
fix: 修复托盘项在折叠期间交互问题
将 enabled 属性从 AppletItemButton 移动到单独的输入处理器(HoverHandler 和 TapHandler)。之前当托盘折叠时整个按钮被禁用,这可能会影响视觉状态。
现在仅禁用输入交互,同时保持按钮的视觉外观。这确保托盘项在折叠动画期间保
持可见但不可交互。
Log: 修复托盘项在折叠动画期间变为视觉禁用状态的问题
Influence:
PMS: BUG-350883
Summary by Sourcery
Bug Fixes: