feat: close other popups when opening context menus#1524
Merged
18202781743 merged 1 commit intolinuxdeepin:masterfrom Mar 24, 2026
Merged
feat: close other popups when opening context menus#152418202781743 merged 1 commit intolinuxdeepin:masterfrom
18202781743 merged 1 commit intolinuxdeepin:masterfrom
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideAdds calls to close any existing popups right before opening task manager app-item and tray-item context menus, ensuring only one popup is visible at a time and reducing UI clutter. Sequence diagram for updated popup handling when opening context menussequenceDiagram
actor User
participant AppItem
participant TrayItem
participant Panel
participant ContextMenu
rect rgb(230,230,255)
User->>AppItem: right_click_app_icon()
AppItem->>Panel: requestClosePopup()
Panel-->>AppItem: popupsClosed()
AppItem->>ContextMenu: contextMenuLoader.active = true
AppItem->>ContextMenu: MenuHelper.openMenu(item)
ContextMenu-->>User: app_item_context_menu_visible
end
rect rgb(230,255,230)
User->>TrayItem: right_click_tray_icon()
TrayItem->>ContextMenu: popupMenu.open()
ContextMenu-->>TrayItem: popup_opened
TrayItem->>Panel: requestClosePopup()
Panel-->>TrayItem: other_popups_closed()
TrayItem->>ContextMenu: popupMenuContent.takeFocus()
ContextMenu-->>User: tray_item_context_menu_focused
end
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- The two call sites are inconsistent in ordering
Panel.requestClosePopup()relative to opening the menu; consider calling it beforepopupMenu.open()inTrayItemSurfacePopup.qml(as inAppItem.qml) to avoid the new menu being immediately closed and to keep behavior consistent. - If this pattern of closing other popups before showing a context menu is needed in more than these two places, consider extracting a small helper (e.g.,
openContextMenuWithPopupClose(...)) to centralize the behavior and reduce the chance of future call sites forgettingPanel.requestClosePopup().
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The two call sites are inconsistent in ordering `Panel.requestClosePopup()` relative to opening the menu; consider calling it before `popupMenu.open()` in `TrayItemSurfacePopup.qml` (as in `AppItem.qml`) to avoid the new menu being immediately closed and to keep behavior consistent.
- If this pattern of closing other popups before showing a context menu is needed in more than these two places, consider extracting a small helper (e.g., `openContextMenuWithPopupClose(...)`) to centralize the behavior and reduce the chance of future call sites forgetting `Panel.requestClosePopup()`.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Added Panel.requestClosePopup() calls before opening context menus in both AppItem and tray components. This ensures that when a user opens a context menu (right-click menu), any other open popups are automatically closed to prevent multiple overlapping popups and maintain clean UI state. The change was necessary to improve user experience by avoiding visual clutter and potential interaction conflicts when multiple popups are open simultaneously. This follows standard UI patterns where opening a new context menu should dismiss other open popups. Log: Improved popup management - context menus now automatically close other open popups Influence: 1. Test right-clicking on app icons in task manager with other popups open 2. Verify tray icon context menus close existing popups 3. Check that normal popup functionality remains unaffected 4. Test with multiple popup scenarios to ensure proper dismissal 5. Verify no regression in menu opening/closing behavior PMS: BUG-284867
18202781743
approved these changes
Mar 24, 2026
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 18202781743, qxp930712 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added Panel.requestClosePopup() calls before opening context menus in both AppItem and tray components. This ensures that when a user opens a context menu (right-click menu), any other open popups are automatically closed to prevent multiple overlapping popups and maintain clean UI state.
The change was necessary to improve user experience by avoiding visual clutter and potential interaction conflicts when multiple popups are open simultaneously. This follows standard UI patterns where opening a new context menu should dismiss other open popups.
Log: Improved popup management - context menus now automatically close other open popups
Influence:
PMS: BUG-284867
Summary by Sourcery
Bug Fixes: