Self Checks / 自检
CC Switch Version / 版本号
v3.13.0
Operating System / 操作系统
Windows
Related App / 涉及应用
Claude Code
Steps to Reproduce / 重现步骤
Description
When opening the Skills management panel and clicking the "Import Existing" button, if the user quickly clicks the "Confirm" button twice (or multiple times when the interface lags due to importing many
skills), the displayed count of "Installed Claude:" becomes incorrect - it shows a multiple of the actual count based on the number of clicks.
Root Cause
- The import confirmation button in ImportSkillsDialog (line 841) is not disabled during mutation execution, allowing users to click multiple times
- The cache update in useImportSkillsFromApps hook (lines 207-215) directly appends to the array without deduplication logic, causing the same skills to be added multiple times to the cache
Steps to Reproduce
- Open the Skills management panel
- Click "Import Existing" button
- In the import dialog, quickly click the "Import" button multiple times (or click repeatedly when importing many skills causes UI lag)
- After import completes, observe the "Installed Claude:" count
Expected Behavior / 期望行为
Expected Behavior
- Import button should be disabled during the import process
- Skills count should display the correct number, not multiplied by click count
Actual Behavior / 实际行为
Actual Behavior
- Button remains clickable during import
- Count shows a multiplied number (e.g., if clicked 3 times and imported 5 skills, count shows 15)
Affected Files
- src/components/skills/UnifiedSkillsPanel.tsx - ImportSkillsDialog component
- src/hooks/useSkills.ts - useImportSkillsFromApps hook
Additional Context / 补充信息
Suggested Fix
- Pass importMutation.isPending state to ImportSkillsDialog and disable the button when importing
- Add deduplication logic to the cache update in useImportSkillsFromApps.onSuccess
Environment
- CC Switch version: 3.13.0
- Platform: All (Windows/macOS/Linux)
Self Checks / 自检
I have read the FAQ section in README.
我已阅读 README 中的常见问题。
I have searched for existing issues, including closed ones.
我已搜索过已有的 Issue,包括已关闭的。
CC Switch Version / 版本号
v3.13.0
Operating System / 操作系统
Windows
Related App / 涉及应用
Claude Code
Steps to Reproduce / 重现步骤
Description
When opening the Skills management panel and clicking the "Import Existing" button, if the user quickly clicks the "Confirm" button twice (or multiple times when the interface lags due to importing many
skills), the displayed count of "Installed Claude:" becomes incorrect - it shows a multiple of the actual count based on the number of clicks.
Root Cause
Steps to Reproduce
Expected Behavior / 期望行为
Expected Behavior
Actual Behavior / 实际行为
Actual Behavior
Affected Files
Additional Context / 补充信息
Suggested Fix
Environment