fix: replace ComboBox with Menu for notification actions#1523
Merged
18202781743 merged 1 commit intolinuxdeepin:masterfrom Mar 24, 2026
Merged
fix: replace ComboBox with Menu for notification actions#152318202781743 merged 1 commit intolinuxdeepin:masterfrom
18202781743 merged 1 commit intolinuxdeepin:masterfrom
Conversation
1. Replaced the ComboBox component with a custom NotifyActionMenu for displaying additional notification actions 2. Created new NotifyActionMenu.qml file implementing a Qt Labs Platform Menu with dynamic action items 3. Modified NotifyAction.qml to use NotifyActionButton with actionMenu property instead of ComboBox 4. Changed the "More" button behavior to open a menu instead of a dropdown combo box 5. Removed complex ComboBox width calculation logic and replaced with simpler menu implementation Log: Fixed notification action text truncation by replacing ComboBox with Menu Influence: 1. Test notification with multiple actions to ensure all actions are displayed without truncation 2. Verify that clicking the "More" button opens a menu showing all additional actions 3. Check that action menu items are properly triggered and invoke the correct actions 4. Test keyboard navigation between action buttons and menu items 5. Verify visual appearance and styling of the action menu matches system theme 6. Ensure menu positioning is correct relative to the notification action button fix: 修复通知操作文本被截断的问题 1. 将 ComboBox 组件替换为自定义的 NotifyActionMenu 用于显示额外的通知 操作 2. 创建新的 NotifyActionMenu.qml 文件,实现基于 Qt Labs Platform Menu 的 动态操作项 3. 修改 NotifyAction.qml,使用带有 actionMenu 属性的 NotifyActionButton 替代 ComboBox 4. 更改"更多"按钮行为,现在打开菜单而不是下拉组合框 5. 移除了复杂的 ComboBox 宽度计算逻辑,替换为更简单的菜单实现 Log: 通过将 ComboBox 替换为 Menu 修复通知操作文本被截断的问题 Influence: 1. 测试包含多个操作的通知,确保所有操作都能完整显示而不被截断 2. 验证点击"更多"按钮能正确打开显示所有额外操作的菜单 3. 检查菜单项是否能正确触发并调用相应的操作 4. 测试操作按钮和菜单项之间的键盘导航功能 5. 验证操作菜单的视觉外观和样式是否与系统主题匹配 6. 确保菜单位置相对于通知操作按钮的定位正确 PMS: BUG-312949
Reviewer's GuideReplaces the notification actions ComboBox with a custom Qt Labs Platform Menu-based NotifyActionMenu, updates NotifyAction.qml to use a more/secondary NotifyActionButton with an attached menu instead of a dropdown, and wires up menu actions and CMake to fix truncated notification action text and simplify layout logic. Sequence diagram for notification action menu invocationsequenceDiagram
actor User
participant NotifyActionButton
participant NotifyActionMenu
participant NotifyActionRoot
User->>NotifyActionButton: click()
alt has_actionMenu
NotifyActionButton->>NotifyActionMenu: set actions = root.actions.slice(1)
NotifyActionButton->>NotifyActionMenu: open(actionButton)
NotifyActionMenu-->>User: show menu
User->>NotifyActionMenu: select menu item
NotifyActionMenu->>NotifyActionMenu: onTriggered(modelData.id)
NotifyActionMenu->>NotifyActionRoot: actionInvoked(modelData.id)
else no_actionMenu
NotifyActionButton->>NotifyActionButton: onClicked(actionData.id)
NotifyActionButton->>NotifyActionRoot: actionInvoked(actionData.id)
end
Class diagram for updated notification action componentsclassDiagram
class NotifyActionRoot {
<<QML_Control>>
var actions
void actionInvoked(var actionId)
void gotoNextButton()
}
class NotifyActionButton {
<<QML_Button>>
var actionData
var actionMenu
string text
bool enabled
void onClicked()
}
class NotifyActionMenu {
<<LP_Menu>>
var actions
actionInvoked(var actionId)
void open(var anchorItem)
void insertItem(int index, var item)
void removeItem(var item)
}
NotifyActionRoot o-- NotifyActionButton : contains
NotifyActionButton --> NotifyActionMenu : uses_actionMenu
NotifyActionMenu --> NotifyActionRoot : emits_actionInvoked
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:
- In
NotifyAction.qml, the menu for the "More" button is populated withroot.actions.slice(1), which will include the same action already shown as the secondNotifyActionButton; consider usingslice(2)(or otherwise excluding the primary extra action) to avoid duplicate entries in the menu. - There are several
console.logcalls in the new menu and button click handlers that look like debugging output; consider removing or guarding them to avoid noisy logs in normal usage.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In `NotifyAction.qml`, the menu for the "More" button is populated with `root.actions.slice(1)`, which will include the same action already shown as the second `NotifyActionButton`; consider using `slice(2)` (or otherwise excluding the primary extra action) to avoid duplicate entries in the menu.
- There are several `console.log` calls in the new menu and button click handlers that look like debugging output; consider removing or guarding them to avoid noisy logs in normal usage.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
mhduiy
approved these changes
Mar 24, 2026
BLumia
approved these changes
Mar 24, 2026
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 18202781743, BLumia, mhduiy 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.
displaying additional notification actions
Menu with dynamic action items
property instead of ComboBox
dropdown combo box
simpler menu implementation
Log: Fixed notification action text truncation by replacing ComboBox
with Menu
Influence:
displayed without truncation
additional actions
correct actions
system theme
action button
fix: 修复通知操作文本被截断的问题
操作
动态操作项
替代 ComboBox
Log: 通过将 ComboBox 替换为 Menu 修复通知操作文本被截断的问题
Influence:
PMS: BUG-312949
Summary by Sourcery
Replace the notification actions ComboBox with a dedicated menu-based interaction to prevent text truncation and improve usability.
New Features:
Bug Fixes:
Enhancements:
Build: