雨霖铃
c69a26b469
refactor: 清理代码注释并优化组件结构
...
- 在 useQrCode.ts 中移除多余的注释,简化代码逻辑。
- 在 DataPreview.tsx 和 FieldEditor.tsx 中删除不必要的注释,提升可读性。
- 在 format.ts 和 jsonToToml.ts 中更新注释内容,确保准确性。
2026-06-19 01:04:15 +08:00
雨霖铃
cd21d11fa1
refactor: 将 UI 文案改为中文并优化相关逻辑
...
- 在 background.ts 中将错误信息翻译为中文。
- 在 uiPopover.ts 中移除注释并更新弹出框标题。
- 在 Base64ConverterSection.tsx 中动态显示最大文件大小。
- 在 DecodeResultPaper.tsx 中简化标题文案注释。
- 在 GenerateButton.tsx 中动态显示生成进度和预计剩余时间。
- 在 base64Converter.ts 中将错误信息翻译为中文。
2026-06-19 00:53:56 +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
雨霖铃
ec92afa294
refactor(i18n): 移除 chrome.i18n 国际化,统一使用中文硬编码
...
移除 chromeI18n 工具、_locales 翻译文件和 manifest default_locale 配置,
将所有 UI 文案改为直接硬编码中文,并更新相关测试与文档。
2026-06-19 00:26:56 +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
雨霖铃
30d3561726
refactor: 规范化页面组件目录结构
...
- 将 QrCodePreview、ImageUploader 移动到 QrCode/components/
- 将 DecodeResultPaper、Base64ConverterSection、TextMode 移动到 Base64Converter/components/
- 提取 useTextMode Hook,遵循 UI + Hook 分离模式
- 简化 SwitchButtonGroup 组件,提取常量到外部
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-06-10 20:11:35 +08:00
雨霖铃
355a94d116
refactor: 将 formatFileSize 重命名为 formatBytes 并移至通用工具模块
2026-06-10 00:32:29 +08:00
雨霖铃
9a0c8ba850
fix: 更新 features 测试断言以匹配新增的 testDataGenerator
...
fix: 修复测试数据生成器多项代码问题
- useCallback 闭包问题:改用函数式 setFields 更新,避免依赖过时引用
- Worker 复用:复用已有 Worker 而非每次 generate 都销毁重建
- 导出复制反馈:复制操作完成后添加 toast 成功/失败提示
- 字段名校验:添加空值、非法字符、重复名称校验
- i18n 硬编码:GeneratorConfig 和 ruleStorage 统一使用 t() 函数
2026-06-06 23:40:36 +08:00
雨霖铃
6c7b7294b4
feat: 优化规则管理功能
...
- 移动保存按钮到字段配置区域
- 添加规则编辑功能,支持更新和另存为
- 编辑模式下显示编辑状态标识
- 保存时检查规则名称重复,支持覆盖保存
- 优化弹窗样式,统一风格
- 更换加载图标为 FolderOpen
- 添加搜索防抖和错误处理
- 添加国际化文本
2026-06-06 23:08:05 +08:00
雨霖铃
1a92e88934
feat: 实现测试数据生成器完整功能
...
- 添加类型定义 (FieldConfig, DataRule, GeneratorDefinition 等)
- 实现 21 个数据生成器 (个人信息/业务数据/技术数据/基础类型)
- 实现 Web Worker 后台数据生成引擎
- 实现规则存储与管理功能
- 实现 JSON/CSV 数据导出功能
- 开发完整 UI 组件 (字段管理/生成器选择/数据预览/导出面板等)
- 集成到应用功能配置,添加国际化支持
功能特性:
- 实时预览生成的数据
- 字段配置 (名称/描述/必填/空值率/唯一性约束)
- 规则管理 (保存/加载/搜索/导入导出)
- Web Worker 后台生成,支持进度显示和取消
- 响应式布局,支持多种设备
docs: 更新 TASKS.md 所有子任务复选框为已完成状态
2026-06-06 09:29:12 +08:00
雨霖铃
7f22b95aa2
refactor: 移除不必要的 export 关键字
...
中优先级任务:将仅内部使用的函数和类型移除 export 关键字
移除 export 的函数:
- uiPopover: showPopover
- storageCleaner: injectClearLocalStorage, injectClearSessionStorage,
injectClearIndexedDB, injectClearCacheStorage, injectUnregisterServiceWorkers
移除 export 的类型和常量:
- base64Converter: SUPPORTED_IMAGE_TYPES, SUPPORTED_IMAGE_EXTENSIONS,
TextToBase64Result, Base64ToBlobResult
- contextMenu: ContextMenuItemConfig, ContextMenuClickedInfo, ParseResult
- jsonFormatter: JsonMinifyResult
- jsonToToml: JsonToTomlResult
- jsonToYaml: JsonToYamlResult
- jwt: JwtHeader, JwtPayload
- qrCodeParser: QrCodeParseResult
所有 473 个测试通过,类型检查通过
2026-06-06 01:00:10 +08:00
雨霖铃
9990d86270
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 01:00:10 +08:00
LingandRX
2c45ddada9
fix: add missing Toaster component to enable toast display ( #65 )
...
The project was calling toast.success/error/warning from sonner in 7 files,
but the <Toaster> component was never rendered in the React tree. This meant
sonner stored toast data internally but no UI was ever displayed to users.
Changes:
- Create src/components/ui/sonner.tsx with shadcn/ui-style Toaster wrapper
that integrates with ThemeModeProvider for light/dark theme support
- Add <Toaster /> to AppRoot.tsx so it works across all entry points
(popup, sidepanel, browser-tab)
fix: always convert dots to underscores in i18n t() key lookup
The t() function only converted dots to underscores when the key contained
a colon (namespace:key format). Keys using dot notation like
'messages.copySuccess' were passed directly to chrome.i18n.getMessage()
without dot-to-underscore conversion, causing lookups to fail silently and
return empty strings - resulting in toast notifications with no text.
Now all separators (both ':' and '.') are consistently converted to '_'
regardless of format, matching the messages.json key convention.
fix: position toast at bottom-center instead of bottom-right
2026-06-05 19:34:09 +08:00
雨霖铃
77f722b575
fix: 修复右键菜单 srcUrl 误判、pre-push 全量扫描、generating 状态不可见问题
...
- contextMenu: srcUrl 检查限定为 qrCode-image 菜单项,避免其他菜单误返回图片 URL
- pre-push: eslint 改为只检查变更文件(git diff 过滤),tsc 保留全项目检查
- useQrCode: confirmGenerate 用 setTimeout 延迟生成,让 loading 状态先被 React 渲染
- tests: 生成相关测试改为 async + waitFor 适配异步 confirmGenerate
2026-06-05 12:49:43 +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
雨霖铃
c2e54b34cb
refactor(base64Converter): simplify utility functions
...
- Mark formatFileSize() as @deprecated, delegate to formatBytes
- Replace manual for-loop in base64ToBytes() with Uint8Array.from()
- Replace nested loops in sniffMimeFromBytes() with Array.every()
5 insertions(+), 23 deletions(-)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com >
2026-05-29 20:38:06 +08:00
雨霖铃
dbdec710ef
refactor(storageCleaner): extract executeScript helpers
...
Extract two generic helpers to eliminate repetitive executeScript boilerplate:
- runScript<T>(): for size/query operations (5 functions)
- runCleanScript(): for cleanup operations (5 functions)
Also add CLEAN_OPTION_KEYS constant shared by formatCleaningResult
and isEmptyResult.
- 428 lines → 379 lines (-49 lines)
- Eliminates ~100 lines of duplicated try/catch/result parsing
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com >
2026-05-29 20:32:58 +08:00
雨霖铃
c9fe27a26b
refactor(background): extract main world injection script
...
Move the 62-line inline main world injection function from background.ts
to a dedicated utils/rightClickInjection.ts file.
This separates the RightClickRestorer's DOM patching logic from the
service worker's message routing concerns.
- background.ts: -62 lines, now delegates to imported function
- utils/rightClickInjection.ts: new file with mainWorldInjectionScript()
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com >
2026-05-29 20:20:11 +08:00
雨霖铃
6bddc4fcfc
Merge remote-tracking branch 'origin/main' into develop
2026-05-28 22:35:39 +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
雨霖铃
97159cb799
fix: useI18n fallback for empty string translations from chrome.i18n
2026-05-28 21:53:35 +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
雨霖铃
e140af7698
refactor: remove meaningless comments
...
Remove 50+ noise comments across the codebase:
- AI-generated verbose prose (💡 emoji, '超进化', '大闸', etc.)
- Comments that restate what the code obviously does
- Comments about deleted code
- Import-level noise comments
- Overly verbose Chinese section markers
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com >
2026-05-28 20:37:52 +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