Commit Graph

59 Commits

Author SHA1 Message Date
雨霖铃 cf05df7022 fix(i18n): replace useTranslation with useLazyTranslation in Base64Converter
Fix missing translations by ensuring base64Converter namespace is dynamically loaded.
2026-05-23 13:07:31 +08:00
雨霖铃 e0888c7fb3 refactor: remove remaining config/pageTheme dependencies
- Replace base64ConverterPageStyles.primaryColor with inline text-indigo-800
- Replace qrCodePageStyles.primaryColor with inline text-green-700
- Remove obsolete page-error-boundary design doc
2026-05-23 12:58:35 +08:00
雨霖铃 8b2bca9eef refactor(timestamp): migrate pageTheme constants to Timestamp feature
Remove config/pageTheme.ts and move DATE_FORMAT, ZONES, UnitType, ZoneType
to pages/Timestamp/constants.ts for better feature cohesion.
2026-05-23 12:57:51 +08:00
雨霖铃 6bac88fbc4 feat(right-click-restorer): add unsupported page detection
- Detect and block chrome://, chrome-extension://, about://, edge://, brave:// pages
- Show 'Unsupported' badge with warning icon and disabled button
- Add 'unsupported' and 'unsupportedDesc' i18n keys (zh/en)
- Update useRightClickRestorer hook with isUnsupported state
- Add unit tests for unsupported page behavior
- Update page UI to render conditional unsupported layout
2026-05-23 12:46:20 +08:00
雨霖铃 4c08e17b19 fix(right-click-restorer): prevent domain overflow in domain card
- Add truncate/min-w-0/flex-1 to domain code block for ellipsis
- Add shrink-0 to Badge to prevent compression
- Add gap-2 for consistent spacing
2026-05-23 12:41:42 +08:00
雨霖铃 fa0f1bdcad feat: add right-click restorer for current site
- Add RightClickRestorer page with active unlock trigger
- Content script with dual-world strategy (isolated + main world)
- Monkey patch preventDefault/stopPropagation via background executeScript
- Overlay penetration for pointer-events blocking layers
- Delegated main-world injection to avoid CSP restrictions
- Async message handling for reliable state updates
- i18n translations (zh/en) and unit tests
2026-05-23 12:39:14 +08:00
雨霖铃 a0e6871b16 refactor: rename autoRefresh to reloadAfterClean for clarity and consistency across components 2026-05-23 10:02:02 +08:00
雨霖铃 5e23b29a25 refactor: use regex matchers for i18n text and add uniform mocks in test files 2026-05-22 23:51:16 +08:00
雨霖铃 272bcae904 refactor: 优化 MarkdownToHtml 预览样式,剥离 CSS 变量回退值并增强 iframe 暗色模式自适应 2026-05-22 22:46:13 +08:00
雨霖铃 539f9648b1 refactor: 优化 Dashboard 布局及 ToolCard 描述文本截断处理 2026-05-22 22:37:45 +08:00
雨霖铃 7e58b5688f refactor: 重构 QrCode 页面为声明式响应架构并统一 shadcn 样式 2026-05-22 22:32:11 +08:00
雨霖铃 89e33f6273 refactor: 抽离 useBase64Converter hook 并新增 Base64ConverterSection 组件,统一 Base64 转换页面的 shadcn 样式 2026-05-22 22:26:35 +08:00
雨霖铃 9601afdd49 refactor: 重构 HtmlToMarkdown 和 MarkdownToHtml 页面,统一 shadcn 样式并优化打印与暗色模式 2026-05-22 22:06:34 +08:00
雨霖铃 ae0b923e11 refactor: 重构 Dashboard 页面和 ToolCard 组件,全面迁移至 shadcn 样式并优化布局 2026-05-22 21:56:09 +08:00
雨霖铃 917fca5947 refactor: 全面重构 Jwt 页面,采用防抖输入并统一 shadcn 样式 2026-05-22 21:46:45 +08:00
雨霖铃 d2e5e6b45d refactor: 全面重构 JsonTools 页面,采用声明式响应架构并统一 shadcn 样式 2026-05-22 21:45:13 +08:00
雨霖铃 336b62256d refactor: 全面迁移 StorageCleaner 页面至 shadcn 样式并移除 GlobalSnackbar 依赖 2026-05-22 21:26:02 +08:00
雨霖铃 67553afe9c refactor: 将 TextStatistics 页面和 TextInputArea 组件全面迁移至 shadcn 样式并优化布局 2026-05-22 21:10:52 +08:00
雨霖铃 02aef0c7b1 refactor: 重构 Timestamp 页面使用响应式 Hook 统一状态并全面迁移至 shadcn 样式 2026-05-22 21:03:48 +08:00
雨霖铃 21e44cb889 refactor: 移除 MUI sx 样式和未使用的 GlobalSnackbar 引用 2026-05-22 20:51:57 +08:00
雨霖铃 b3dd7146ad refactor: 重构 CopyButton 与 RouterContainer 组件,移除 GlobalSnackbar 并统一使用 sonner toast 和 cn 工具函数 2026-05-22 20:51:13 +08:00
雨霖铃 cf0d19914c refactor: remove DomainHeader component and its usage 2026-05-22 20:44:59 +08:00
雨霖铃 72883b5d1d fix: 增强 SwitchButtonGroup 和立即转换按钮的视觉层级
- SwitchButtonGroup 选中按钮阴影从 shadow-sm 升级到 shadow-md
- 同步更新单元测试中断言
- Timestamp 立即转换按钮添加 shadow-md 增强边界感
2026-05-22 18:08:44 +08:00
雨霖铃 c7beebf6e0 fix: 修复输入框和按钮在暗色模式下的样式问题
- 为 :root 和 .dark 添加 color-scheme,使浏览器表单控件默认样式适配暗色模式
- 将 bg-primary 搭配 text-white 的按钮改为 text-primary-foreground
- 替换残留的 hover:bg-blue-700、text-blue-500、bg-gray-200 等硬编码颜色
- 同步更新 TextInputArea 单元测试
2026-05-22 17:36:37 +08:00
雨霖铃 de7da9f1db fix: 修复暗黑模式样式兼容性
- 在 tailwind.config.js 中启用 darkMode: 'class' 并扩展语义化颜色变量
- 将全项目硬编码颜色(bg-white、text-gray-*、border-gray-* 等)替换为语义化类名
- 修复 popup/index.html 硬编码浅色背景色
- 同步更新相关单元测试中的类名断言
2026-05-22 16:04:50 +08:00
雨霖铃 e2dd5f5915 重写所有页面和组件:用纯 Tailwind CSS 替换 MUI 组件和图标 2026-05-22 00:51:11 +08:00
雨霖铃 1bc3ee59a0 重写基础骨架组件:用纯 Tailwind CSS 替换 MUI Box 组件 2026-05-22 00:44:32 +08:00
雨霖铃 6711783975 修复 TypeScript 类型错误:将 MUI sx 语法改成标准 CSS 属性 2026-05-22 00:38:48 +08:00
雨霖铃 37618eb71f 用 Tailwind CSS 重写 JsonTools 页面 2026-05-22 00:07:56 +08:00
雨霖铃 d2334c5e95 用 Tailwind CSS 重写 StorageCleaner 页面,创建 shadcn/ui Dialog 组件 2026-05-22 00:00:04 +08:00
雨霖铃 a4533be2c1 用 Tailwind CSS 重写 Jwt 页面 2026-05-21 23:52:20 +08:00
雨霖铃 83bf9dd342 用 Tailwind CSS 重写 QrCode 页面及相关组件 2026-05-21 23:46:44 +08:00
雨霖铃 8902bc0f10 用 Tailwind CSS 重写 Base64Converter 页面 2026-05-21 23:40:52 +08:00
雨霖铃 4753a7b54d 用 Tailwind CSS 重写 TextStatistics 页面 2026-05-21 23:35:25 +08:00
雨霖铃 7f9bf2334c 用 Tailwind CSS 重写 Dashboard/index.tsx 和 ToolCard.tsx 2026-05-21 23:32:19 +08:00
雨霖铃 6bd05aa6f1 用 Tailwind CSS 重构 ResultView 和 LiveClock 组件 2026-05-21 23:23:13 +08:00
雨霖铃 bdb40343b1 用 Tailwind CSS 重写 Timestamp 页面的 MUI 基础排版组件 2026-05-21 23:13:29 +08:00
雨霖铃 9a9336aea8 替换 Timestamp 页面图标为 lucide-react 的 Clock 图标 2026-05-21 23:00:44 +08:00
雨霖铃 f1f0047928 test: 修复测试中的 act() 警告和 clipboard mock 问题
- TextInputArea: 使用 userEvent 替代 fireEvent,用 vi.spyOn 替代 Object.assign mock clipboard
- ImageMode/FileMode: 添加 waitForStorageReady() 等待 useStorageState 异步初始化
2026-05-21 22:06:09 +08:00
Ubuntu 4a382144d1 chore: upgrade medium-risk dependencies
- lint-staged: 16.2.7 → 17.0.5
- jsdom: 25.0.0 → 29.1.1
- @vitejs/plugin-react: 4.3.4 → 6.0.2
- vitest: 2.0.0 → 4.1.7
- @vitest/coverage-v8: upgraded to match vitest
- @webext-core/messaging: 2.3.0 → 3.0.1
- eslint: 9.39.2 → 10.4.0
- @eslint/js: added as new dependency
- @types/marked: removed (marked now provides its own types)

Fixes:
- Fix ref update during render in useQrCode.ts
- Fix ref update during render in useStorageCleaner.ts
- Add error cause in jwt.ts decode function
- Add type assertion for mock functions in htmlToMarkdown.test.ts
2026-05-21 20:44:40 +08:00
雨霖铃 8e2ac5200d fix(i18n): 统一使用 useLazyTranslation 避免翻译 key 闪烁 2026-05-21 00:50:01 +08:00
雨霖铃 e4fac241f1 refactor(qrCode): 优化二维码解析功能
- 将'二维码转 URL'改为'二维码转文本'
- 将解析结果的文本预览框的 placeholder 置为空
- 去除手动解析二维码功能,只保留自动解析
2026-05-21 00:22:47 +08:00
雨霖铃 70580a9a63 fix(qrcode): 修复切换 tab 后二维码图片失效问题
- 移除 ImageUploader 组件卸载时的预览 URL 释放逻辑
- 在 useQrCode hook 中统一管理预览 URL 生命周期
- 创建新预览 URL 前释放旧的,避免内存泄漏
2026-05-21 00:12:06 +08:00
雨霖铃 df0b9440ca refactor(qrcode): 组件化重构,采用 Context + Hook 模式
- 创建 QrCodeContext 和 QrCodeProvider 管理共享状态
- 提取 useQrCode Hook 封装所有状态和业务逻辑
- 创建 GeneratePanel 组件处理二维码生成模式
- 创建 ParsePanel 组件处理二维码解析模式
- 简化 index.tsx 为容器组件 (340行 → 47行)
- 删除未使用的旧组件文件 (QrCodeToUrlSection, UrlToQrCodeSection)
- 清理 types.ts 中未使用的类型定义
- 603 个测试全部通过
2026-05-21 00:07:42 +08:00
雨霖铃 c5b51a9b33 refactor(qrcode): 国际化补充、质量保障与错误处理优化
- 补充 i18n 翻译键(generateMode, parseMode, pasteHint 等)
- 创建 useDebounce Hook 实现输入防抖 (200ms)
- 使用 useRef 解决 useEffect 无限循环问题
- 编写 pages/QrCode 单元测试 (7 个用例)
- 优化右键菜单错误处理,改进用户提示
- 运行 603 个测试全部通过
2026-05-20 22:42:33 +08:00
雨霖铃 bc560cc453 refactor(qrcode): 引入通用组件并重构双栏布局
- 引入 SwitchButtonGroup 用于模式切换
- 引入 TextInputArea 用于文本输入和结果展示
- 使用 MUI Grid 构建响应式双栏布局
- 实现 generate/parse 模式下的左右面板内容切换
- 修复 iconColor 颜色格式错误,使用 qrCodePageStyles.primaryColor
2026-05-20 22:12:48 +08:00
雨霖铃 2870e01610 refactor(qrcode): 提取独立组件并添加单元测试
- 创建 pages/QrCode/types.ts 定义状态类型接口
- 提取 QrCodePreview 组件用于二维码预览和操作
- 提取 ImageUploader 组件封装图片上传、拖拽、粘贴逻辑
- 重构 UrlToQrCodeSection 状态提升到父组件
- 重构 QrCodeToUrlSection 通过回调传递解析结果
- 更新主页面 index.tsx 集中管理所有状态
- 为 QrCodePreview 和 ImageUploader 添加单元测试 (23 个用例)
2026-05-20 21:59:57 +08:00
雨霖铃 0427f16cc9 fix: 修复右键菜单功能的多个逻辑漏洞
1. 修复时区硬编码问题 - 使用用户选择的时区而非固定 Asia/Shanghai
2. 修复 openPopup() 失败后数据残留 - 失败时清除 storage 中的待处理数据
3. 统一数据过期时间常量 - 导出 CONTEXT_MENU_DATA_EXPIRY_MS 并统一使用
4. 修复 featureKey 类型断言不安全 - 使用映射表处理非常规菜单 ID
2026-05-20 21:39:33 +08:00
雨霖铃 e9a6fa3dd8 feat: 支持右键菜单时间戳转换
- 在 useTimestampConverter 中添加 useContextMenuData hook
- 智能识别输入是时间戳还是日期时间字符串
- 自动切换到对应模式并执行转换
- 时间戳自动识别秒/毫秒单位
2026-05-20 21:32:35 +08:00
雨霖铃 00fe3eddd9 refactor: 暂时移除图片二维码识别功能
- 删除 qrCode-image 右键菜单配置
- 删除 parseQrCodeFromUrl 函数
- 删除 QrCodeToUrlSection 中的 useContextMenuData 相关代码
- 更新相关测试用例
2026-05-20 21:27:36 +08:00