Repository navigation
Conversation
1. Add FolderMenuRegistry class to manage folder context menu extensions 2. Support plugin-provided custom menu items via registerProvider interface 3. Provide standard items (open-folder, undock-folder) plus plugin custom items 4. Validate provider methods via Qt meta-object system before registration 5. Prevent reserved IDs from being overridden by plugins 6. Filter invalid, duplicate, hidden, and malformed menu items 7. Revalidate actions at click time to handle plugin unload or state changes 8. Guard against stale action IDs and disabled actions during dispatch 9. Add unit tests covering registration, dispatch, validation, and lifecycle Log: Added support for folder context menu extensions from plugins Influence: 1. Test default menu shows only folder name and Undock when no provider registered 2. Verify custom actions from registered plugin are appended after standard items 3. Test that reserved IDs (open-folder, undock-folder) cannot be overridden by plugins 4. Verify duplicate, empty, or malformed menu item IDs are filtered out 5. Test hidden items (visible=false) are not displayed 6. Verify enabled/checkable/checked states are properly passed through 7. Test trigger dispatch only reaches the correct provider plugin 8. Verify actions are revalidated at click time and stale actions are rejected 9. Test provider destruction or unregistration restores the default menu 10. Verify registration is rejected for null, invalid, or thread- mismatched providers 11. Test that a second plugin cannot silently replace an existing provider for the same folder type feat: 添加文件夹菜单注册表以支持插件菜单扩展 1. 新增 FolderMenuRegistry 类用于管理文件夹上下文菜单扩展 2. 通过 registerProvider 接口支持插件提供的自定义菜单项 3. 提供标准菜单项(open-folder、undock-folder)以及插件自定义项 4. 注册前通过 Qt 元对象系统校验插件方法签名 5. 防止插件覆盖保留的菜单项 ID 6. 过滤无效、重复、隐藏及格式错误的菜单项 7. 点击时重新校验动作以处理插件卸载或状态变化 8. 派发时防止过期动作 ID 及已禁用动作 9. 添加单元测试覆盖注册、派发、校验及生命周期 Log: 新增插件文件夹上下文菜单扩展支持 Influence: 1. 测试未注册插件时默认菜单仅显示文件夹名称和取消停靠 2. 验证已注册插件的自定义动作追加在标准菜单项之后 3. 测试保留 ID(open-folder、undock-folder)无法被插件覆盖 4. 验证重复、空或格式错误的菜单项 ID 被过滤 5. 测试隐藏项(visible=false)不显示 6. 验证 enabled/checkable/checked 状态正确传递 7. 测试触发派发仅到达正确的插件提供者 8. 验证点击时动作重新校验,过期动作被拒绝 9. 测试插件销毁或注销后恢复默认菜单 10. 验证空指针、无效或线程不匹配的插件注册被拒绝 11. 测试第二个插件无法静默替换同一文件夹类型的现有提供者 PMS: TASK-397255
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 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 |
Reviewer's GuideAdds a Qt-based FolderMenuRegistry that validates and owns one plugin provider per folder type, combines standard and filtered custom actions, safely revalidates actions at dispatch time, and includes unit coverage for registration, lifecycle, filtering, and triggering. Sequence diagram for folder menu extension and safe action dispatchsequenceDiagram
participant Consumer as FolderMenuConsumer
participant Registry as FolderMenuRegistry
participant Provider as PluginProvider
Consumer->>Registry: registerProvider(folderType, provider)
Registry->>Provider: folderMenuActions(QString)
Registry-->>Consumer: registration result
Consumer->>Registry: menuItems(folderType, folderId, folderName)
Registry->>Provider: folderMenuActions(folderId)
Registry-->>Consumer: standardItems plus filtered custom items
Consumer->>Registry: trigger(folderType, folderId, actionId)
Registry->>Provider: folderMenuActions(folderId)
alt action is valid and enabled
Registry->>Provider: triggerFolderMenuAction(folderId, actionId)
Provider-->>Registry: dispatch result
else action is stale, hidden, disabled, or unknown
Registry-->>Consumer: false
end
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
TAG Bot New tag: 2.0.61 |
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.
Log: Added support for folder context menu extensions from plugins
Influence:
feat: 添加文件夹菜单注册表以支持插件菜单扩展
Log: 新增插件文件夹上下文菜单扩展支持
Influence:
PMS: TASK-397255
Summary by Sourcery
Enable safe plugin-provided folder context-menu actions through a validated registry.
New Features:
Bug Fixes:
Enhancements:
Build:
Tests: