3 Commits

Author SHA1 Message Date
Serendipity 3a21891f84 feat: 原生对话框、ErrorBoundary、配置生效、交互打磨
- handleBrowse 改用 @tauri-apps/plugin-dialog 原生目录选择
- handleImport 清理临时 DOM 元素(add input.remove())
- config/default.json 实际导入生效(maxHistory、path 长度限制)
- app-store.ts 长度检查改用配置值
- 删除 AppShell 中与 store 重复的长度检查
- 新增 ErrorBoundary 组件避免单异常白屏
- StatusBar 加载失败时显示重试按钮
- 取消按钮检查 isModified 未保存提示
- lib.rs 注册 tauri-plugin-dialog
- tsconfig 添加 resolveJsonModule
- CLAUDE.md 添加 cargo test 运行时说明

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-26 00:33:57 +08:00
Serendipity bfd114d80f refactor: 全面代码质量提升 — StringList→string[], strict 模式, 死代码清理
架构重构:
- StringList 类替换为不可变 string[](消除 dataVersion hack,Zustand 自然检测变化)
- UndoRedoManager.undo/redo 返回新数组而非原地修改
- 删除 dataVersion 字段和 _bumpVersion()
- 启用 TypeScript strict 模式

死代码清理:
- 删除 string-list.ts, string-list.test.ts, use-path-validation.ts
- Rust AppError 保留供未来使用

功能修复:
- importFromJson 添加 try/catch
- handleClean 使用真实格式验证替代 () => true
- savePaths 保存前调用 backup_registry,处理部分保存失败
- importFromJson 校验非 object 类型输入

i18n 完善:
- MergePreview/StatusBar 硬编码中文 → t() 调用
- 新增 merge.* 和 status.* 翻译键

Rust 改进:
- registry.rs 抽取 load_paths/save_paths 通用函数,消除重复
- registry 新增 6 个单元测试(split/join/roundtrip)
- backup.rs 时间戳加毫秒防覆盖,回退路径改为 home_dir

元数据:
- package.json 名称→patheditor, 版本→4.0.0
- 新增 CHANGELOG.md
- 移除 UndoRedoButtons 废弃注释
- tsconfig 添加 strict:true

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-26 00:26:27 +08:00
Serendipity 48129a8908 feat: 重写为 Tauri + React + TypeScript (v4.0)
完全移除旧 C+IUP 代码,改用 Tauri 2.x + React 19 + TypeScript + Rust 技术栈重写。
功能与 v3.1 完全等价:

- React 前端:Tailwind CSS 4、Zustand 状态管理、i18next 国际化
- Rust 后端:winreg 注册表读写、Win32 API FFI 调用
- 核心逻辑:StringList、UndoRedoManager、PathManager、Import/Export
- 深色模式、中英文切换、键盘快捷键、合并预览
- 66 个 Vitest 单元测试

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-25 18:33:04 +08:00