Cursor Agent
ff3c66531c
fix(测试数据生成器): 修复规则覆盖保存误创建重复规则
...
覆盖同名规则时 handleSave(true) 未传入已有规则 id,save() 走新建分支
导致旧规则保留且产生同名重复项,getByName 仍返回旧数据。
2026-06-30 20:43:33 +08:00
雨霖铃
ce0af7dff3
Merge branch 'main' into develop
2026-06-27 17:42:43 +08:00
Cursor Agent
0545910b16
fix: 修复路由初始化竞态、存储状态静默覆盖与存储清理误删
2026-06-26 17:17:17 +08:00
cursor[bot]
4b38133cf8
fix(测试数据生成器): 修复 Worker 取消失效与规则存储静默失败 ( #69 )
...
- 为生成任务引入 generationId,忽略过期 Worker 响应,避免取消后展示错误数据
- Worker 每 100 行让出事件循环,使 cancel 消息能被及时处理
- ruleStorage.setAll 返回写入结果,save/update/delete 在 QuotaExceeded 时返回失败
- 补充 useGenerator 与 ruleStorage 单元测试
2026-06-26 17:07:35 +08:00
rsgltzyd
edd4cf266c
fix(StorageCleaner): 修复 IndexedDB 清理竞态、部分成功计数与刷新后状态同步
2026-06-25 23:31:44 +08:00
雨霖铃
ebf9f7a153
refactor(StorageCleaner): 移动 isRestrictedUrl 函数到独立模块并更新相关引用
...
- 将 isRestrictedUrl 函数从 storageCleaner 移动到 restrictedUrls 模块,优化代码结构。
- 更新相关文件以引用新的位置,移除冗余的测试用例。
2026-06-19 21:09:22 +08:00
雨霖铃
0f3060dcf3
refactor(代码重复): 抽取共享工具函数与 UI 组件,消除多处重复实现
...
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-06-19 20:55:39 +08:00
雨霖铃
47d74f999e
refactor(RouterProvider, chromeStorage, useContextMenuData): 更新存储获取逻辑以移除默认值参数
...
- 在 RouterProvider 和 useContextMenuData 中更新对 storageUtil.get 的调用,移除默认值参数,简化逻辑。
- 修改 chromeStorage 中的 get 方法签名,确保在没有默认值时返回可选类型,并添加相应的单元测试以验证类型推断。
2026-06-19 20:47:43 +08:00
雨霖铃
9097c48b1f
feat(Dashboard): 重构仪表板功能组件和逻辑
...
- 新增 dashboardFeatures.ts 和 useDashboard.ts 文件,封装仪表板功能的解析和状态管理逻辑。
- 更新 Dashboard 组件,使用 useDashboard 钩子简化可见工具和最近使用工具的处理。
- 添加仪表板功能的单元测试,确保功能正确性。
- 更新 README.md,移除不再使用的 ToolCard 组件说明。
2026-06-19 09:26:30 +08:00
雨霖铃
f0292acbb7
fix(ThemeModeProvider): 修复主题快照同步与首屏闪烁问题
...
抽取 themeSnapshot 工具模块,异步恢复与跨窗同步时写回 snapshot;HTML 内联脚本与 useLayoutEffect 消除 dark 类首帧闪烁;避免 storage 恢复覆盖用户操作及 setState 嵌套更新。
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-06-19 00:45:52 +08:00
雨霖铃
618f3c36f2
refactor: 更新测试用例和组件结构
...
- 在背景测试中更新菜单项标题,移除图标
- 在 StorageCleaner 页面中更新初始化加载状态的中文文案
- 在 QrCode 组件中修正导入路径
- 在 DecodeResultPaper 中使用 Label 组件替换原生 label 元素
- 移除不再使用的 formatFileSize 函数
2026-06-14 09:40:05 +08:00
雨霖铃
016173a9c5
refactor(JsonTools): 规范化页面组件目录结构
...
- 将子组件移至 components/ 子目录(JsonDiffInput、DiffResult、JsonFormatSection、JsonConvertSection、DiffNavigator、JsonTree)
- 将 diffEngine.ts 工具函数移至 src/utils/
- 提取 ConvertFunction/ConvertResult 类型到 types.ts,解决循环依赖
- 创建 __tests__/ 目录结构
- 更新所有相关导入路径
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-06-10 20:39:40 +08:00
雨霖铃
355a94d116
refactor: 将 formatFileSize 重命名为 formatBytes 并移至通用工具模块
2026-06-10 00:32:29 +08:00
LingandRX
a5d86a92c2
develop ( #67 )
...
feat: 升级项目 Logo、完善 toast 提示及优化工程化配置
### Features
- **logo**: 替换全套项目图标,更新 wxt.config.ts 浏览器扩展图标配置。
### Bug Fixes
- **ui/toast**: 引入 <Toaster> 组件修复 toast 无法显示问题,并调整位置为正下方。
- **i18n**: 统一将 t() 函数中的 `.` 和 `:` 转换为 `_`,修复国际化文案读取失败问题。
- **context-menu**: 限制 srcUrl 检查仅在二维码图片菜单项生效,避免误判。
- **hooks**: 修复 pre-push 钩子,仅对变更文件进行 eslint 检查,并支持无 upstream 时的回退对比。
- **components**: 修复 CopyButton 动画与组件导入方式,并补齐无障碍属性与测试。
- **async**: 延迟生成二维码以正确渲染 loading 状态,并适配相关异步测试。
### Refactor & Cleans
- **clean**: 清理未使用的组件(ToolCard)、Hook(useDebounce)及多个未使用的工具函数导出。
- **structure**: 统一移动测试文件至 __tests__ 目录,移除不必要的类型导出。
### Documentation
- **docs**: 在 AGENTS.md 中明确规范 Git Commit 必须使用中文描述。
2026-06-06 01:07:27 +08:00
雨霖铃
7afce94d93
refactor: 删除高优先级死代码
...
删除未使用的代码以提高代码质量和可维护性:
删除的文件:
- src/pages/Dashboard/ToolCard.tsx:未被使用的组件
- src/utils/useDebounce.ts:未被使用的 hook
- src/components/__tests__/ToolCard.test.tsx:对应组件的测试文件
删除的导出函数:
- chromeTabs: getActiveTab, getActiveTabDomain, ensureContentScriptInjected
- clipboard: copyImageToClipboard
- storageCleaner: isEmptyResult
- chromeI18n: preloadNamespaces
- useContextMenuData: clearContextMenuData
更新了对应的测试文件以保持一致性
总计删除 525 行代码,所有 473 个测试通过
2026-06-06 00:49:57 +08:00
雨霖铃
e919af6857
fix(qrcode): 修复图片右键菜单功能描述和检测逻辑
...
- 修改菜单标题为「解析图片二维码」更准确
- 改进 isImageUrl 函数,支持更多图片URL格式
- 支持 data:image/ 格式
- 支持URL路径中包含图片相关关键词
- 更新国际化文案和测试用例
2026-05-30 21:01:33 +08:00
雨霖铃
5be15301b5
feat(qrcode): 实现图片转二维码右键菜单功能
...
- 添加图片类型的右键菜单配置
- 修改 parseContextMenuClick 支持 srcUrl 参数
- 实现图片URL自动解析功能
- 检测图片URL自动切换到解析模式
- 更新测试用例覆盖新功能
- 新增国际化文案
2026-05-30 20:58:28 +08:00
雨霖铃
f9fbc79612
refactor(storageCleaner): simplify architecture and improve type semantics
...
- Remove RELOAD_TAB message chain, use chrome.tabs.reload() directly
- Rename IndexedDB label to '站点存储' for accuracy
- Introduce StorageSizeInfo type to distinguish bytes vs count
- Rename totalSize to totalBytes for clarity
- Merge runCleanScript into runScript to reduce duplication
- Rename CleaningResult.success to overallSuccess to avoid confusion
- Remove unused domain state and setDomain call
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com >
2026-05-29 21:59:54 +08:00
雨霖铃
1b9f6d044d
refactor: unify formatBytes usage and simplify useContextMenuData
...
1. Remove formatSize/formatByteSize delegation functions:
- storageCleaner.ts:formatSize (was just formatBytes wrapper)
- textStatistics.ts:formatByteSize (was just formatBytes wrapper)
- Update all callers to import formatBytes directly from @/utils/format
2. Simplify useContextMenuData hook:
- Remove unnecessary useCallback wrapping
- Inline checkAndConsumeData logic directly in useEffect
- Eliminate callback->effect dependency cycle
-69 lines, +67 lines (net -2 lines, but removes 2 indirection layers)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com >
2026-05-29 21:08:27 +08:00
雨霖铃
0054e97a0a
refactor: 移除设置页面
...
- 删除 options 入口点目录及相关文件
- 移除 wxt.config.ts 中 options_ui 配置
- 移除 TopBar 组件中的设置按钮和 onOpenOptions prop
- 移除 popup/sidepanel App.tsx 中的 handleOpenOptions
- 移除相关测试中的设置页面引用
- 移除 messages.json 中设置相关翻译键
- 通过 lint、typecheck、test 验证
2026-05-28 22:15:56 +08:00
雨霖铃
067a20fb0a
feat: remove HTML-Markdown conversion features (htmlToMarkdown & markdownToHtml)
...
Removed both conversion tools and all related code:
- Deleted page components: HtmlToMarkdown, MarkdownToHtml
- Deleted utility functions: htmlToMarkdown.ts, markdownToHtml.ts
- Deleted unit tests for both utilities
- Removed feature configs and PageType entries from storage.d.ts
- Removed preview mode types and StorageSchema keys
- Removed all i18n translation keys from messages.json
- Removed vendor-markdown chunk from wxt.config.ts
- Removed marked dependency from package.json
- Updated feature count in tests (11 -> 9, page order 10 -> 8)
- Updated README, AGENTS.md, and copilot-instructions.md
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com >
2026-05-28 21:08:15 +08:00
雨霖铃
ca4bfc33fd
refactor: clean up unused code and simplify imports
...
- Remove unused imports and variables across 35 files
- Simplify component logic and remove dead code
- Clean up test files by removing unnecessary setup
- Streamline CI workflow configuration
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com >
2026-05-28 20:57:08 +08:00
雨霖铃
b79fe7dd49
refactor: reorganize directory structure into src/
...
Move all source code directories into src/ for cleaner project structure:
- pages/, components/, utils/, config/, providers/, types/, lib/, assets/, entrypoints/ → src/
- Use WXT srcDir config to resolve @/ alias to src/
- Update tsconfig, vitest, eslint, tailwind configs
- Remove scattered README.md files from subdirectories
- Update documentation (AGENTS.md, CODING_STANDARDS.md, README.md)
- Fix pre-existing lint error in RouterProvider.tsx
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com >
2026-05-28 20:20:45 +08:00