Commit Graph

119 Commits

Author SHA1 Message Date
Serendipity 9c74c61d64 chore: 版本号统一升级至 4.3.0
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-28 21:35:45 +08:00
Serendipity 26f6953919 fix: ProfileDialog 标题栏添加 ✕ 关闭按钮
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
v4.3.0
2026-05-28 21:29:50 +08:00
Serendipity 5ed15535e7 fix: 深色模式下选中行对比度不足 — 新增 CSS 变量分别适配浅色/深色主题
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-28 21:25:54 +08:00
Serendipity 230fb5d741 fix: 配置文件目录从 %APPDATA% 改为 %USERPROFILE%/.patheditor/profiles
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-28 21:20:38 +08:00
Serendipity d7d11480b8 feat: PATH 配置文件/预设切换 — 保存、加载、一键应用不同场景的 PATH 配置
- 新增 profiles.rs: list/save/load/delete/rename 五个 Rust 命令
- 配置文件存储在 %APPDATA%/.patheditor/profiles/<name>.json
- ProfileDialog: 保存当前 PATH、加载预览、一键应用到注册表
- 工具栏新增「配置」按钮

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-28 21:02:29 +08:00
Serendipity 7869886670 feat: 新增 PATH 智能分析功能 — 冲突检测 + 工具清单
CI / 前端检查 (TypeScript + Lint + Test) (push) Has been cancelled
CI / Rust 检查 (Check + Clippy + Test) (push) Has been cancelled
- scan_conflicts: 检测不同目录中的同名可执行文件(遮蔽冲突)
- scan_tools: 扫描各目录提供的可执行文件,支持关键词搜索
- Rust scanner.rs 后端,前端 AnalyzeDialog 弹窗
- 工具栏新增「分析」按钮

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-28 10:02:12 +08:00
Serendipity 49ef9c0cff chore: 添加 Issue 模板、CI 徽章、修复仓库描述
CI / 前端检查 (TypeScript + Lint + Test) (push) Has been cancelled
CI / Rust 检查 (Check + Clippy + Test) (push) Has been cancelled
- 新增 bug_report 和 feature_request Issue 模板
- README 添加 GitHub Actions CI 状态徽章
- 修复仓库描述(去重,更新至 v4.2)
- 默认分支改为 main

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-28 00:46:56 +08:00
Serendipity 344011a02c chore: 整理仓库 — 版本号统一、README 徽章更新、新增 CHANGELOG 和 CONTRIBUTING
- 版本号 4.0.0 → 4.2.0(tauri.conf.json, Cargo.toml, 窗口标题)
- README 徽章更新(tests 55→72, version 4.0.0→4.2.0)
- CHANGELOG.md 补充 v4.1 和 v4.2 变更记录
- 新增 CONTRIBUTING.md 贡献指南
- GitHub Release: v4.2.0 补充说明,旧 C 版本标记为 pre-release

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-28 00:43:36 +08:00
Serendipity 3aed03f599 fix: 修复 5 个 bug + 备份警告丢失
- BUG 1: undo/redo 后持久化 disabled 状态到 disabled.json
- BUG 2: expand_env_vars 增加缓冲区不足检测(result > required)
- BUG 3: E2E mock load_disabled_state 返回格式从对象改为数组
- BUG 4: 双 hive 保存失败时同时显示两个错误原因
- BUG 5: 导入 both 合并为单条 undo 记录(新增 IMPORT_BOTH 操作类型)
- 备份失败后保存成功时显示"保存成功(备份失败)"而非覆盖警告

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-28 00:38:32 +08:00
Serendipity d7bc752b84 fix: release workflow 兼容已存在的 release + 版本号升到 4.2.0
CI / 前端检查 (TypeScript + Lint + Test) (push) Has been cancelled
CI / Rust 检查 (Check + Clippy + Test) (push) Has been cancelled
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-27 14:54:52 +08:00
Serendipity c1975e836c chore: 移除调试文件,更新 .gitignore
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
v4.2.0
2026-05-27 14:34:23 +08:00
Serendipity be04b7d0da fix: 修复 ESLint 错误 — path-manager 测试去 as any、search-clean 未用参数
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-27 14:26:56 +08:00
Serendipity 2b372cbf89 chore: 添加 vitest.config.ts — 排除 e2e 测试目录,配置 @/ 路径别名
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-27 14:18:42 +08:00
Serendipity 45e2a4e584 test: 新增 4 条 E2E 测试 — 启动加载、CRUD撤销、禁用保存、搜索清理 2026-05-27 14:16:24 +08:00
Serendipity ff343185c9 chore: 安装 Playwright + 配置 E2E 基础框架
- 安装 @playwright/test 1.60.0
- 创建 e2e/playwright.config.ts(webServer 自动启动 vite dev)
- 创建 e2e/mocks/ipc.ts(Tauri IPC mock)
- 新增 npm run test:e2e 脚本

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-27 14:01:47 +08:00
Serendipity 6d711d0f8e test: 修复所有测试适配 PathEntry,全部通过
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-27 13:59:40 +08:00
Serendipity d6e535aa98 feat: UI 组件适配 PathEntry — 复选框列、禁用行灰显删除线
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-27 13:56:52 +08:00
Serendipity e646a84291 feat: app-store 适配 PathEntry — 新增 togglePath、loadPaths 合并禁用状态、savePaths 过滤 disabled
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-27 13:49:26 +08:00
Serendipity 611a36fb98 refactor: core 模块适配 PathEntry — path-manager、import-export 类型迁移
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-27 13:45:05 +08:00
Serendipity ab2d0da20c feat: 新增 disabled.rs — 禁用路径 JSON 文件读写
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-27 13:44:24 +08:00
Serendipity 914b25f236 test: 所有测试适配 PathEntry[] 类型,新增 TOGGLE undo/redo 测试
- undo-redo.test.ts: 所有 11 项测试通过(含新增 TOGGLE 撤销/重做)
- app-store.test.ts: 断言改用 .map(e => e.path),待 Task 5 修复
- import-export.test.ts: sampleData 改用 pe(),导出断言适配
- path-manager.test.ts: 测试数据用 pe() 包裹,待 Task 3 修复
- validation.test.ts: 无需变更(纯 string 接口)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-27 13:42:21 +08:00
Serendipity 32287c0e4b feat: 新增 PathEntry 类型 + TOGGLE 操作类型,undo-redo 用 PathEntry[] 替代 string[]
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-27 13:32:35 +08:00
Serendipity 71b98e308a docs: 添加 v4.3 路径启用/禁用 + E2E 测试实现计划(10 个 Task)
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-27 13:21:35 +08:00
Serendipity fcd4796fee docs: 添加 v4.3 路径启用/禁用 + E2E 测试设计文档
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-27 13:19:02 +08:00
Serendipity 8ff02fd88b fix: 修复 ESLint 错误 — PathEditDialog/use-keyboard/test 添加规则豁免注释
这些是正当的 React 模式(对话框状态重置、ref 同步避免重复注册、测试 mock)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-27 01:07:57 +08:00
Serendipity 39a95cc50d fix: CI 切换到 MSVC 工具链、添加 eslint.config.js
- Rust: windows-latest 默认 MSVC,无需额外安装 GNU/MinGW
- ESLint: 添加 eslint flat config(js + tseslint + react-hooks)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-27 00:58:30 +08:00
Serendipity 44fdc2eec6 fix: release 改用 gh release create、ci 添加 permissions: contents: read
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-27 00:54:07 +08:00
Serendipity 6dc32dca93 ci: 添加 CI workflow — push 自动检查 TypeScript + Rust
前端: tsc --noEmit + ESLint + Vitest (ubuntu)
Rust: cargo check + clippy + test (windows + GNU toolchain)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-27 00:52:13 +08:00
Serendipity a2b66d087f ci: 添加 Release workflow — tag 推送自动构建 NSIS 安装包并发布
tag v* 触发 npx tauri build,NSIS 安装包上传到 GitHub Release

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-27 00:52:12 +08:00
Serendipity 8c1655d25c docs: 添加 v4.2 CI/CD 流水线设计文档
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-27 00:50:33 +08:00
Serendipity 63c8ed424b docs: 添加 v4.1 bug 修复与代码清理的设计文档和实现计划
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
v4.1.1
2026-05-26 22:48:07 +08:00
Serendipity 605105da09 test: 移除 _markDirty 测试(函数已私有化,行为由 CRUD 测试间接覆盖)
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-26 22:48:03 +08:00
Serendipity 68f4617bda fix: PathTable — 环境变量展开限流20并发、消除useEffect双重触发、类型断言改为常量
- expand useEffect 增加 .slice(0, 20) 批次限制,避免大量路径时并发过高
- validatedRef / expandedRef 替代 validationCache.has / expandedCache.has 过滤,
  从 useEffect 依赖数组中移除缓存 state,消除双重触发
- ValidationState 类型提升到模块层级,新增 DEFAULT_VALIDATION_STATE 常量
  替代硬编码类型断言

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-26 22:43:03 +08:00
Serendipity c30855fa70 refactor: backup.rs — use 语句移至文件顶部,注册表路径复用常量
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-26 22:42:15 +08:00
Serendipity 652280c2dd fix: AppShell 拖拽路径用 TauriFile 接口替代 as any
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-26 22:41:40 +08:00
Serendipity 2db872c661 docs: undo/redo 添加注释说明为何内联计算 isModified
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-26 22:41:38 +08:00
Serendipity 1ce3ebfd9e refactor: 代码清理 — 删除 AppError、重命名 replacePaths、修正 detectExportFormat、统一 PATH 长度、优化 BOM 检查、添加同步注释
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-26 22:14:13 +08:00
Serendipity 613fb51fd7 fix: 验证 IPC 异常时返回 unknown 状态,不再错误标记为有效路径
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-26 22:09:23 +08:00
Serendipity be375ed3ad fix: backup_registry 调用加 await,避免与 save 竞态导致备份到新值
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-26 22:08:05 +08:00
Serendipity 804e02004d fix: backup_registry 改为内部读取注册表当前值,不再依赖前端传入数据
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-26 22:04:16 +08:00
Serendipity 2775a3a588 fix: 非连续删除 undo 恢复到错误位置 — OpRecord 新增 indices 精确记录原始位置
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-26 21:57:21 +08:00
Serendipity 26ab52483a fix: 修复安装包缺少 WebView2Loader.dll 的问题
在 bundle.resources 中显式包含 WebView2Loader.dll,
GNU 工具链下 NSIS 打包器未自动检测此依赖。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-26 19:10:45 +08:00
Serendipity 775a570d31 feat: 导入改用原生对话框、新增 app-store 单元测试、修复窗口滚动
- handleImport 从 DOM <input> hack 改为 @tauri-apps/plugin-dialog 原生文件选择
- 新增 Rust read_text_file 命令读取文件内容,零外部依赖
- 新增 tests/unit/app-store.test.ts,25 个测试覆盖 CRUD/undo-redo/loadPaths/savePaths
- 修复 AppShell overflow-hidden 导致无法滚动窗口的问题

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-26 19:01:56 +08:00
Serendipity 41008e9282 chore: 从仓库移除 CLAUDE.md 和 .claude/ 内部配置文件
这些是 Claude Code 工具的内部配置文件,对开源项目用户无意义。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
v4.1.0 v4.0.0
2026-05-26 08:27:16 +08:00
Serendipity 732b2aabaa docs: 重写 README.md 为开源项目风格
- 添加 badges(版本/Tauri/React/Rust/测试数)
- 按功能模块分组(路径管理/验证/撤销/导入导出/安全/界面)
- 补充安装章节(Releases + 源码构建)
- 补充贡献指南(开发环境、代码规范)
- 完整项目结构和快捷键表

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-26 08:22:35 +08:00
Serendipity 19bdb3078a docs: 重写 CLAUDE.md 反映最新项目状态
- 更新架构图(移除已删除的 string-list.ts,补充 Modal/buttons/ErrorBoundary)
- 新增数据模型章节(不可变 string[] + snapshot 比较 isModified)
- 新增撤销/重做 API 说明
- 新增错误处理章节(前端 + Rust 完整覆盖表)
- 补充 TypeScript strict 模式、Rust SAFETY 注释等质量约束

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-26 08:20:15 +08:00
Serendipity bdbb399ddc refactor: 清理 LOW 问题 — 样式去重、死代码删除、命名修正
- 抽取 buttons.ts 共享按钮样式,消除 3 个组件的重复定义
- store 删除未调用的 canUndo/canRedo 方法
- importFromContent 变量 ext→lower 修正确性
- CSV 导出修复 BOM 重复(exportToCsv 自带 BOM)
- Rust error.rs 添加 allow(dead_code) 消除编译警告

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-26 08:13:17 +08:00
Serendipity d28861ff9c refactor: 抽取 Modal 组件、支持 JSON/CSV 导出、清理冗余代码
- 新增 Modal 组件,消除 3 个 Dialog 中重复的遮罩层/Escape/stopPropagation 代码
- PathEditDialog/HelpDialog/ImportDialog 改用 Modal 包裹
- handleExport 支持 JSON/CSV 两种格式(CSV 导出代码之前存在但从未接线)
- App.tsx 移除冗余的 initDarkMode 后重复设 store 的逻辑
- ErrorBoundary 添加 componentDidCatch 日志和 console.error

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-26 00:51:32 +08:00
Serendipity b159407773 fix: 最终审查修复 — 数据安全、功能缺失、状态管理
Rust:
- save_paths 添加 Windows PATH 32767 字符上限检查防静默截断
- backup_registry 回退路径统一为 backup_base_dir() 三级链

Store:
- 新增 isSaving 并发守卫防止重复保存
- 保存失败详情通过 Promise.allSettled.reason 展示
- isModified 改为与上次保存快照比较(undo/redo 后准确反映状态)
- 批删除合并为单条撤销记录(N 次删除 → 1 次 Ctrl+Z 恢复)
- 保存失败/备份失败使用 i18n 键(消除硬编码中文)

UI:
- 拖拽添加改用 webkitGetAsEntry().isDirectory 校验文件夹
- Ctrl+F 快捷键聚焦搜索框
- handleClean 使用 is_valid_path_format(替代不完整的 inline 函数)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-26 00:48:43 +08:00
Serendipity e6a2416271 refactor: AppShell 拆分 + savePaths 并行化
- 抽取 useAppActions hook(~160行),AppShell 从 306 行精简至 105 行
- AppShell 现在只负责布局和渲染,操作逻辑全部可单独测试
- savePaths 改为 Promise.allSettled 并行保存 + 并行备份
- useKeyboard 通过 hook 内部集成,不再暴露给 AppShell

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-26 00:36:59 +08:00