♻️ 新 UI 重写:shadcn/ui + Tailwind v4 + React 19 全面重构表现层#1514
Conversation
移除基于 Arco Design + UnoCSS 的旧 UI 层与相关依赖,为下一版
基于 Tailwind CSS + shadcn/ui 的 UI 重构做准备。
- 删除 6 个页面(options/popup/install/confirm/import/batchupdate)、所有 UI 组件、HTML 模板和 CSS
- 卸载 16 个 UI 相关依赖(@arco-design/web-react、unocss、@dnd-kit/*、react-dropzone、react-joyride、react-router-dom、react-icons、react-i18next、@playwright/test 等)
- 删除 e2e 测试目录与 Playwright 配置
- 更新 rspack.config.ts 移除 UI entry 和 HtmlRspackPlugin
- 更新技术栈文档(CLAUDE.md、copilot-instructions、CONTRIBUTING)
保留:非 UI 入口(service_worker/content/inject/offscreen/sandbox)、
monaco-editor、i18next、pages/store/{global,favicons,features/script}.ts
- 使用 Tailwind CSS + shadcn/ui 重构 popup 页面 - 实现完整业务逻辑:脚本列表、启用/禁用、删除、排除、GM 菜单等 - 添加 usePopupData hook 对接 service worker 后端 API 和实时订阅 - 新增 Popconfirm 组件用于删除确认 - 配置设计系统色彩令牌(品牌蓝、状态色、暗色模式) - 搭建 options 页面入口(骨架)
- 新增 Sidebar 组件:导航、帮助中心菜单(hover触发)、主题切换、折叠 - 使用 HashRouter 配置路由(脚本列表/订阅/日志/工具/设置/编辑器) - 提取 GithubIcon 组件替代 popup 和 sidebar 中的 inline SVG - i18n 使用已有翻译 key,与 release/v1.4 保持一致
- 将 translation.json 拆分为 11 个命名空间(common/agent/script/editor/settings/install/popup/logs/guide/tools/permission) - 升级 React 18→19、i18next 23→26,引入 react-i18next - 还原 SW 层 popup 逻辑至 v1.5(不在 SW 中处理 i18n) - 删除 Crowdin 配置、伪语言 ach-UG 及相关文档引用 - 修复 React 19 类型兼容(useRef、cloneElement)
# Conflicts: # package.json # pnpm-lock.yaml # src/app/service/service_worker/gm_api/gm_api.ts # src/app/service/service_worker/index.ts # src/locales/ach-UG/translation.json # src/locales/de-DE/translation.json # src/locales/en-US/translation.json # src/locales/ja-JP/translation.json # src/locales/ru-RU/translation.json # src/locales/vi-VN/translation.json # src/locales/zh-CN/translation.json # src/locales/zh-TW/translation.json # src/pages/components/CodeEditor/index.tsx # src/pages/components/UserConfigPanel/index.tsx # src/pages/components/layout/MainLayout.tsx # src/pages/install/App.tsx # src/pages/options/index.css # src/pages/options/routes/Logger.tsx # src/pages/options/routes/Setting.tsx # src/pages/options/routes/script/ScriptEditor.tsx # src/pages/popup/App.tsx
# Conflicts: # CONTRIBUTING.md # README.md # docs/CONTRIBUTING_EN.md # docs/CONTRIBUTING_RU.md # docs/README_RU.md # docs/README_ja.md # docs/README_zh-CN.md # docs/README_zh-TW.md # e2e/install.spec.ts # e2e/popup.spec.ts # e2e/script-editor.spec.ts # e2e/script-management.spec.ts # e2e/settings.spec.ts # e2e/vscode-connect.spec.ts # package.json # playwright.config.ts # pnpm-lock.yaml # src/app/service/content/scripting.ts # src/app/service/service_worker/gm_api/gm_api.ts # src/app/service/service_worker/index.ts # src/index.css # src/locales/README.md # src/locales/de-DE/translation.json # src/locales/en-US/translation.json # src/locales/ja-JP/translation.json # src/locales/locales.ts # src/locales/ru-RU/translation.json # src/locales/vi-VN/translation.json # src/locales/zh-CN/translation.json # src/locales/zh-TW/translation.json # src/manifest.json # src/pages/components/CodeEditor/index.tsx # src/pages/components/ScriptMenuList/index.tsx # src/pages/components/layout/MainLayout.tsx # src/pages/components/layout/Sider.tsx # src/pages/components/layout/SiderGuide.tsx # src/pages/confirm/App.tsx # src/pages/install/App.tsx # src/pages/install/hooks.tsx # src/pages/install/utils.ts # src/pages/options.html # src/pages/options/routes/AgentChat/ChatArea.tsx # src/pages/options/routes/AgentMcp.tsx # src/pages/options/routes/AgentOPFS.tsx # src/pages/options/routes/AgentProvider.tsx # src/pages/options/routes/AgentSettings.tsx # src/pages/options/routes/AgentSkills.tsx # src/pages/options/routes/AgentTasks.tsx # src/pages/options/routes/ScriptList/components.tsx # src/pages/options/routes/ScriptList/index.tsx # src/pages/options/routes/Setting.tsx # src/pages/options/routes/SubscribeList.tsx # src/pages/options/routes/Tools.tsx # src/pages/options/routes/script/ScriptEditor.tsx # src/pages/options/routes/script/index.css # src/pages/popup.html # src/pages/popup/App.tsx # src/pages/template.html # tests/pages/options/MainLayout.test.tsx
|
9e80ae2 Editor侧栏隐藏后,能以hover方式展开 screen-capture.3.-00.00.15.265-00.00.43.778.mp4 |
|
1addb76 ui adjust - BatchActionsBar / FilterBar screen-capture.4.-00.00.01.876-00.00.26.497.mp4 |
|
4aadf3b 统一 Icon (Update / Sync)
|
|
@CodFrm 用AI做了这个 ResourcePane 未使用 createPreloadableQueryscreen-capture.6.-00.00.05.193-00.00.15.282.mp4ResourcePane 使用了 createPreloadableQueryscreen-capture.5.-00.00.08.695-00.00.20.990.mp4在 按进脚本页时先做 preload key传 function, 回传 string 即可。简单例是 uuid. |
可以考虑状态管理库,比如 zustand
我感觉还好,看你有什么更好的想法 |
之前研究过但不适合ScriptCat所以一直都没提这方面的PR 用这个 createPreloadableQuery 就好。符合 ScriptCat 设计 |
For new (unsaved) scripts, scriptClient.info(uuid) via doThrow throws when the UUID is not in storage yet. This propagated to toast.error in usePreloadResourcePane/SettingsPane/StoragePane, whose error toast was misread by saveCurrentEditor's any-toast heuristic as a save success, causing installScriptByCode to exit before the script was actually saved. GM API e2e tests then found failed=-1 because the test script never ran. Fix: add .catch(() => null/[]) at the fetchScript and permissionClient.getScriptPermissions callsites so unsaved scripts return empty results instead of throwing. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
之前 ArcoDesign 内部一直使用 dayjs,去除不了 |
- Replace Arco Design + UnoCSS with the current shadcn/ui + Tailwind CSS v4 stack - Replace all `translation.json` references with the actual per-namespace file structure (common.json, popup.json, etc.) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
e2e speed up 7ca40ddBefore
After
|




Checklist / 检查清单
设计稿.pen.zip
Description / 描述
使用 shadcn/ui + Tailwind CSS v4 + React 19 对
src/pages/表现层进行从零重写,替换原有的 Arco Design + UnoCSS 技术栈。设计系统(颜色令牌、组件、布局/动效/状态规范)统一沉淀在docs/DESIGN.md,所有页面同时适配亮色/暗色主题(Tailwinddark:变体 +src/index.css设计令牌)。已完成页面
核心管理页
独立页面
Agent 套件(7 页)
其它
docs/DESIGN.md,更新docs/DEVELOP.md/docs/README.md等贡献者文档待办(转正式 PR 前)
Screenshots / 截图