Repository navigation
fix(plugins): preserve projectPath and prevent duplicate React row keys - #9963
Merged
farion1231 merged 1 commit intoNov 26, 2026
Merged
Conversation
2 tasks done
Owner
|
已合并,感谢您的贡献!同名的 local / project 插件跨项目不再撞 React key、出现幽灵行,补上 projectPath 的展示和搜索也让多项目场景清楚了很多,修复了 #9962。 |
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.
Human Note / 本人说明
我在 Claude Code 插件页删除多个项目的
local范围插件后,发现界面还残留了一条context7的local记录消不掉,同时也看不出每条local/project插件具体属于哪个项目。这个 PR 修复了重复 React key 导致的幽灵行残留问题,并把projectPath传到前端展示和搜索,顺便隔离了只读行的转圈状态。Summary / 概述
projectPath(Rust)PluginEntry(src-tauri/src/services/plugin_manager/mod.rs)新增pub project_path: Option<String>(序列化为projectPath),parse_claude_listing保留非user范围条目的projectPath。catalog_from_listing与parse_codex_entry显式置project_path: None;补齐agy.rs、grok.rs、mcode.rs、openclaw.rs中显式构造的project_path: None。key与条目身份匹配(前端)src/components/plugins/PluginsPage.tsx新增并导出pluginRowKeys,按(id, scope, projectPath)生成稳定唯一的 key(不把会随安装/更新变化的installPath纳入 key),并对升级前缺少projectPath的旧localStorage缓存重复项按出现次序追加#N去重,防止列表缩减、搜索、切页签或切应用时残留幽灵 DOM 行。src/hooks/usePlugins.ts新增并导出projectPathOf与samePluginEntry(按id、scope、projectPath识别),统一供pluginPatches与PluginsPage.tsx卸载回滚逻辑复用,并在installedFromCatalog显式置projectPath: null。user范围且带有projectPath的插件行展示所属项目目录(截断等宽次级行,title提供完整路径,无需新增 i18n 文案),并纳入filterPlugins搜索范围。busyAction对只读已安装行(entry.installed && !entry.manageable)传undefined,避免操作同名user行时把转圈泄漏到local/project行,同时保持 Claude「发现」页条目(installed: false, manageable: false)的安装转圈正常。src-tauri/src/services/plugin_manager/mod.rs):新增多项目projectPath解析/序列化测试并扩展目录字段重置测试。tests/components/PluginsPage.test.tsx):新增filterPlugins/samePluginEntry/pluginRowKeys单元测试,以及旧缓存重复local行刷新清除、多项目展示/搜索/切页/切应用、只读行转圈隔离回归测试。Related Issue / 关联 Issue
Fixes #9962
Checklist / 检查清单
pnpm typecheckpasses / 通过 TypeScript 类型检查pnpm format:checkpasses / 通过代码格式检查cargo clippypasses (if Rust code changed) / 通过 Clippy 检查(如修改了 Rust 代码)