Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
- PowerShellBridge Level 2 移除硬编码中文动词词表($actionPattern)
- 改用基于字符串结构特征的通用过滤逻辑(强排除法):
排除路径符 / 格式占位符 %1~%9 / .NET格式符 {0} /
换行符 / 数字开头 / 中文句末标点(。!?)/ 英文句末标点
- 新增非 ASCII 优先池:优先本地化字符串,无非 ASCII 时回退全部候选
- 取第一条(按资源 ID 升序)替代多级长度排序,逻辑更简洁确定
- 同步更新 RegistryService、MenuManagerService 及渲染层相关代码
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
修复启用/禁用开关无响应的问题: - 将 setItemEnabled 和 setItemEnabledInternal 中的 execute() 改为 executeElevated() - 确保修改注册表时会触发 UAC 提权弹窗 - 避免因权限不足导致操作静默失败
- PowerShellBridge: buildShellExtToggleScript 源键不存在时 throw 而非静默跳过 - PowerShellBridge: ShellExt 枚举时 regKey 统一使用 cleanName(去除 '-' 前缀) - RegistryService: setItemEnabled 不再返回 newRegistryKey,registryKey 身份不变 - RegistryService: 删除 computeShellExtNewKey 方法 - BackupService: 使用 normalizeKey 归一化比对 registryKey,支持跨启用/禁用状态匹配 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- mainPage.ts: regItemPath 对禁用的 ShellExt 条目在键名前插入 '-' 前缀,使"在 Regedit 中定位"指向实际存在的注册表键 - PowerShellBridge.ts: Resolve-ExtName Level1 循环支持字面量字符串(不以 '@' 开头),不再降级到 DLL 启发式名称 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- 配置 Vitest 测试框架和路径别名 - 创建 59 个单元测试,覆盖核心模块 * 工具函数: ipcWrapper, AdminHelper (100% 覆盖) * 服务类: RegistryService, BackupService, MenuManagerService * 数据层: BackupSnapshotRepo, OperationRecordRepo (100% 覆盖) * IPC处理器: registry.ts (100% 覆盖) - 生成测试覆盖率报告 - 配置 GitHub Actions CI/CD 工作流 * 代码质量检查 (Lint & Type Check) * 单元测试与覆盖率报告 * 构建测试 * 发布检查 * 测试结果汇总 - 更新 package.json 添加测试脚本 - 更新 tsconfig.json 支持测试文件 测试统计: - 测试文件: 9 个 - 测试总数: 59 个 - 通过率: 100% (59/59) - 总体覆盖率: 54.48% (statements), 34.21% (branches), 70.14% (functions), 55.59% (lines)
- 添加 packageManager 字段 (pnpm@10.25.0) - 更新 CI/CD 工作流使用 pnpm/action-setup 和 pnpm 缓存 - 更新 test 脚本引用为 pnpm run - 删除 package-lock.json,保留 pnpm-lock.yaml Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
f5fb5d4 to
ba2e5c4
Compare
- 新增 eslint.config.js(ESLint v10 flat config,TypeScript 规则) - 添加 eslint/@typescript-eslint 依赖 - lint 脚本移除已废弃的 --ext .ts 参数 - fix BackupService: require('path') 改为 import * as path - fix system.ts: 三元表达式改为 if/else 语句 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Move test-related TypeScript configuration to a dedicated tsconfig.json in tests directory to better isolate test compilation settings and improve project structure
- system.ts: execFile 改为 spawn 启动 regedit(支持 detached 选项) - logger.ts: 移除 electron-log v5 已删除的 maxDays 属性 - bridge.ts: WindowApi 补充缺失的 openLogDir 方法声明 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- vitest ^4 要求 vite ^6,与 electron-forge 不兼容,降回 ^3 - @vitest/coverage-v8 和 @vitest/ui 同步降级到 ^3 - BackupService.test.ts: 5层相对路径改为 @main/@shared 别名 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Update tests/tsconfig.json to use vitest/globals and add path aliases - Replace unknown type assertions with MockedObject from vitest - Improve type checking in test files with proper type guards - Add new development documentation with common solutions
electron-forge 无 build 子命令,package 已包含编译+打包全流程。 移除 package.json 的 build 脚本,CI 中直接使用 package/make。 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
📋 PR 说明
本次 PR 完成了完整的测试框架搭建和 CI/CD 配置。
✅ 主要变更
1. 测试框架配置
2. 单元测试 (59 个测试)
3. 测试覆盖率
4. CI/CD 配置
创建 包含:
📊 测试统计
📁 新增文件
🔧 修改文件
✅ 测试验证
所有测试已通过本地验证:
�[1m�[46m RUN �[49m�[22m �[36mv4.1.0 �[39m�[90mE:/workspaces/windows-apps/ContextMaster/.claude/worktrees/elastic-swirles�[39m
�[2m Test Files �[22m �[1m�[32m9 passed�[39m�[22m�[90m (9)�[39m
�[2m Tests �[22m �[1m�[32m59 passed�[39m�[22m�[90m (59)�[39m
�[2m Start at �[22m 03:01:42
�[2m Duration �[22m 3.17s�[2m (transform 1.91s, setup 1.22s, import 3.04s, tests 213ms, environment 3ms)�[22m
🚀 后续计划
📝 提交信息
Reviewer Checklist:
Ready for Review! 🚀