Skip to content

feat(setting): 插件详情指令列表增加打开/固定/快捷键/别名/禁用操作#567

Merged
lzx8589561 merged 2 commits into
ZToolsCenter:mainfrom
Particaly:feature/plugin-detail-command-actions
Jun 30, 2026
Merged

feat(setting): 插件详情指令列表增加打开/固定/快捷键/别名/禁用操作#567
lzx8589561 merged 2 commits into
ZToolsCenter:mainfrom
Particaly:feature/plugin-detail-command-actions

Conversation

@Particaly

Copy link
Copy Markdown
Collaborator
  • 新增 usePluginCommandActions composable,抽取插件指令操作共享逻辑 (禁用/启用、固定到搜索框、固定到超级面板、设置全局快捷键、自定义别名、打开指令)
  • PluginDetailTabs: 所有指令(含 text 与 match)统一下拉菜单,已安装插件 支持上述 6 项操作,未安装回退纯展示;修复匹配指令详情弹窗禁用按钮失效
  • AllCommandsSetting: 机械替换为 composable,消除约 290 行重复代码, 并修正系统应用禁用图标(裸字符串 ban/check 改为 i-z-ban/i-z-check)

- 新增 usePluginCommandActions composable,抽取插件指令操作共享逻辑
  (禁用/启用、固定到搜索框、固定到超级面板、设置全局快捷键、自定义别名、打开指令)
- PluginDetailTabs: 所有指令(含 text 与 match)统一下拉菜单,已安装插件
  支持上述 6 项操作,未安装回退纯展示;修复匹配指令详情弹窗禁用按钮失效
- AllCommandsSetting: 机械替换为 composable,消除约 290 行重复代码,
  并修正系统应用禁用图标(裸字符串 ban/check 改为 i-z-ban/i-z-check)

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors plugin command actions (such as disabling, pinning, and custom aliases) by extracting the shared logic into a reusable usePluginCommandActions composable, successfully reducing duplication in PluginDetailTabs.vue and AllCommandsSetting.vue. The review feedback highlights opportunities to improve state consistency and cleanup when switching between different sources or plugins. Specifically, it is recommended to clear cached plugin commands when switching to a non-plugin source, add defensive checks for falsy plugin paths, and consistently use the cmdKey helper function instead of manual fallback chaining for command names.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread internal-plugins/setting/src/composables/usePluginCommandActions.ts Outdated
Comment thread internal-plugins/setting/src/composables/usePluginCommandActions.ts
Comment thread internal-plugins/setting/src/composables/usePluginCommandActions.ts Outdated
Comment thread internal-plugins/setting/src/composables/usePluginCommandActions.ts Outdated
Comment thread internal-plugins/setting/src/views/AllCommandsSetting/AllCommandsSetting.vue Outdated
采纳代码审查意见:
- loadPluginCommands: 切换到非插件来源时清空 pluginCommands 缓存,避免残留
- AllCommandsSetting: selectSource 无条件调用 loadPluginCommands 以配合上述清空
- handleMatchMenuSelect / MatchDetail 钩子统一使用 cmdKey 提取指令名,消除重复 fallback
- 调整 useMatchCommandDetail 调用顺序至菜单处理之前,使 cmdKey 等先定义后引用

修复取消固定到搜索框失效:
主进程 filterOutCommand 对插件类型按 pluginName 匹配存储项(而非指令名),
此前 toggleSearchPin 调用 unpinApp 传入指令名(cmdName),与存储项 pluginName
永不相等导致过滤不掉。对齐主窗口搜索框行为,改为传入 pluginName。
@lzx8589561 lzx8589561 merged commit b08e7dd into ZToolsCenter:main Jun 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants