Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
100 commits
Select commit Hold shift + click to select a range
e71715f
🔥 清理旧 UI 代码以准备重构
CodFrm Apr 5, 2026
66df077
✨ 实现新版 Popup 页面 UI(Tailwind + shadcn/ui)
CodFrm Apr 7, 2026
dbdbe4e
✨ 实现 Options 页面 Layout(Sidebar + 路由框架)
CodFrm Apr 7, 2026
b340b8c
✨ 实现 Options 页面脚本列表 UI(筛选、排序、批量操作)
CodFrm Apr 7, 2026
0bb6454
💥 合并 release/v1.5 分支,清理旧 UI 模块和未使用依赖
CodFrm Apr 7, 2026
8cd00a8
👷 调整构建ci
CodFrm Apr 7, 2026
ce4af69
♻️ i18n 命名空间重构、升级 React 19 和清理 Crowdin
CodFrm Apr 7, 2026
6c5518c
v1.5.0-beta
CodFrm Apr 7, 2026
9e1c63c
Merge branch 'release/v1.4' into develop/new-ui
CodFrm Apr 29, 2026
3d19efc
💄 优化弹窗搜索与按钮交互样式
CodFrm May 19, 2026
d8e2bd3
Merge branch 'release/v1.4-agent' into develop/new-ui
CodFrm Jun 13, 2026
6631f9b
✨ 新增 useScrollSpy:scroll-spy 监听与平滑滚动 hook
CodFrm Jun 17, 2026
d02b73d
✨ 新增 SettingsLayout:scroll-spy 设置外壳(左导航+右滚动区)
CodFrm Jun 17, 2026
e7dc411
✨ 新增 SettingCard/SettingRow 设置卡片与行原语
CodFrm Jun 17, 2026
828441c
✨ 新增 useSystemConfig:配置读写与变更订阅 hook
CodFrm Jun 17, 2026
4467d9d
🌐 迁移设置页缺失 i18n key 到 settings.json(全语言)
CodFrm Jun 17, 2026
65f4b08
✨ 设置页骨架 + 路由接入 + 通用/界面分区
CodFrm Jun 17, 2026
9bb6d8d
✨ 设置页 更新/运行时/同步(占位)分区
CodFrm Jun 17, 2026
f3111ff
✨ 设置页 安全/开发者分区(失焦自动保存)
CodFrm Jun 17, 2026
6882bbd
🐛 修复 useSystemConfig 兼容同步 getter,避免 .then 抛错
CodFrm Jun 17, 2026
5054745
✨ 新增新 UI 设置与确认页体验
CodFrm Jun 17, 2026
6dd856d
🌐 补充英文权限确认文案
CodFrm Jun 17, 2026
0e7f3ae
♻️ 设置分区去除 as never 并修复 Select 受控警告
CodFrm Jun 17, 2026
cd77225
✨ 补齐批量更新与代理聊天工具
CodFrm Jun 17, 2026
c693d13
🌐 文件系统参数标签键迁移 settings→common(共享 factory 裸 key 解析)
CodFrm Jun 17, 2026
a9c7d66
✨ 移植 FileSystemParams 组件到 new-ui(shadcn 动态参数表单 + 网盘解绑)
CodFrm Jun 17, 2026
a3151f5
✨ 设置页同步分区完整化:FileSystemParams 接入 + 启用时账号校验
CodFrm Jun 17, 2026
f5c43a3
✨ 设置页运行时存储完整化:CAT_fileStorage 配置(保存/重置/打开目录)
CodFrm Jun 17, 2026
b6cf1df
♻️ 同步/运行时分区审查修复:状态色改用 success-fg 令牌、去重描述、补打开目录与同步状态测试
CodFrm Jun 17, 2026
35888cd
✨ 工具页 new-ui:5 分类 scroll-spy(本地/云端备份+自动备份+数据迁移+VSCode)
CodFrm Jun 17, 2026
1eef68f
🔀 接入工具页路由:/tools → <Tools />
CodFrm Jun 17, 2026
6a348a9
♻️ 工具页审查修复:删除确认文案命名空间(Critical)、补 VSCode 帮助链接、补恢复/删除测试
CodFrm Jun 17, 2026
2cd804d
🎨 prettier 格式化 FileSystemParams/RuntimeSection.test
CodFrm Jun 17, 2026
5256f04
🎨 prettier 格式化工具页文件
CodFrm Jun 17, 2026
ee9c4c3
✨ 设置/工具页移动端窄屏:左侧竖栏改为顶部横向滚动分类栏(scroll-spy 保留)
CodFrm Jun 17, 2026
f3a79a2
✨ 拖拽安装/导入菜单/Skill 文案:script.json 新增 key(7 语言)
CodFrm Jun 17, 2026
c9663b4
✨ importHandler:拖拽/导入文件与链接按类型分流安装(6 测试)
CodFrm Jun 17, 2026
1d01535
✨ filePicker:showOpenFilePicker 选本地脚本/Skill(含 input 回退,2 测试)
CodFrm Jun 17, 2026
7f52eed
✨ useScriptDropzone:原生拖拽 hook(仅文件触发,兼容文件监听 handle,3 测试)
CodFrm Jun 17, 2026
85f2bb7
✨ DropOverlay:拖拽安装毛玻璃遮罩组件(投放卡,2 测试)
CodFrm Jun 17, 2026
0704945
✨ Agent 管理页:共享基础组件(页头/空状态/kebab 菜单/标签)+ jsdom 指针垫片
CodFrm Jun 17, 2026
0a956dd
✨ Agent 模型服务:provider_api 直连 HTTP(测试连接/拉取模型)
CodFrm Jun 17, 2026
92427c0
✨ 导入菜单扩展(本地/链接/Skill)+ 链接导入对话框(4 测试)
CodFrm Jun 17, 2026
38bbe25
✨ Agent 模型服务:ModelCard 模型卡片(掩码密钥/能力标签/kebab)
CodFrm Jun 17, 2026
1ccea1e
✨ Agent 模型服务:ModelFormDialog 新增/编辑弹窗 + provider_subtitle/no_models_de…
CodFrm Jun 17, 2026
932f870
♻️ 拖拽只收 UserScript+ZIP:importHandler 移除独立 SkillScript .js 接收(对齐安装页)
CodFrm Jun 17, 2026
007459a
✨ Agent 模型服务页:容器装配 agentClient + 接入 /agent/provider 路由
CodFrm Jun 17, 2026
62ec60e
🐛 终审修复:链接框关闭清空/Textarea、filePicker 取消兜底、await 导入、去 as string、菜单分组 lab…
CodFrm Jun 17, 2026
a243aa4
✨ Agent MCP:McpCard 服务器卡片(状态点/计数标签/开关)+ mcp 文案
CodFrm Jun 17, 2026
3885c39
✨ Agent MCP:McpFormDialog 表单弹窗 + parseHeaders/stringifyHeaders
CodFrm Jun 17, 2026
45110ba
✨ Agent MCP:McpDetailSheet 详情抽屉(工具/资源/提示词 Tabs)
CodFrm Jun 17, 2026
fcbc03d
✨ Agent MCP 服务页:容器装配 mcpApi(测试/详情/启用)+ 接入 /agent/mcp 路由
CodFrm Jun 17, 2026
f975543
✨ Agent 定时任务:cron.ts 下次运行预览(复用 nextTimeInfo)+ tasks 文案
CodFrm Jun 17, 2026
ea9946b
✨ Agent 定时任务:TaskRow 任务行(模式/cron/状态/运行/开关)
CodFrm Jun 17, 2026
9a474e8
✨ Agent 定时任务:TaskFormDialog(模式切换/cron 校验/内部字段)
CodFrm Jun 17, 2026
2ecfc0e
✨ Agent 定时任务:TaskHistorySheet 运行历史(表格 + 清空确认)
CodFrm Jun 17, 2026
0826e10
✨ Agent 定时任务页:容器装配 Repo/run-now + 接入 /agent/tasks 路由
CodFrm Jun 17, 2026
6506ec9
✨ Agent OPFS:opfs_fs 文件系统封装(listDir/remove/read + formatSize/fileKind)
CodFrm Jun 17, 2026
f2f7c92
✨ Agent OPFS:PreviewDialog 预览弹窗(JSON 格式化/图片)
CodFrm Jun 17, 2026
5760e68
✨ Agent OPFS 文件页:容器(面包屑/表格/预览/下载/删除 + 移动列表)+ 接入路由
CodFrm Jun 17, 2026
1ac09e7
✨ Agent 设置页:摘要模型+搜索引擎(复用 SettingsLayout)+ 接入路由 + 清理占位组件
CodFrm Jun 17, 2026
6846422
🎨 Agent Skills:对齐设计系统(AgentPageHeader/AgentEmptyState/CapabilityTag)
CodFrm Jun 17, 2026
496dcfa
🎨 prettier 格式化 Agent 管理页文件
CodFrm Jun 17, 2026
7af5d48
✨ new-ui:AgentChat 会话页 + 安装/导入/批量更新页重设计 + 移动导航抽屉
CodFrm Jun 17, 2026
930b4f1
🐛 fix cloud sync conflict handling
CodFrm Jun 18, 2026
a6ed0e3
🎨 polish new UI pages
CodFrm Jun 18, 2026
de86cb8
Revert "🐛 fix cloud sync conflict handling"
CodFrm Jun 18, 2026
17623ad
✨ improve agent settings and skill install flow
CodFrm Jun 18, 2026
08e1fc4
✅ 恢复并修复 new-ui e2e 测试套件
CodFrm Jun 18, 2026
1a0abc7
🧪 optimize UI vitest: node env for pure-logic files, fix real setTime…
cyfung1031 Jun 18, 2026
b9e98c3
改为混合 jsdom/happy-dom 提升测试速度
cyfung1031 Jun 18, 2026
600bb92
测试工具版本提升
cyfung1031 Jun 18, 2026
3e16c70
github 测试 timeout
cyfung1031 Jun 18, 2026
c36dcd1
github 测试 timeout
cyfung1031 Jun 18, 2026
51a3e90
`@testing-library/dom`
cyfung1031 Jun 18, 2026
307b2c6
vitest页面测试加速
cyfung1031 Jun 18, 2026
c486230
vitest页面测试加速
cyfung1031 Jun 18, 2026
1e80e27
vitest页面测试加速
cyfung1031 Jun 18, 2026
d8b0e1c
🔧 scope pre-commit lint to staged files
cyfung1031 Jun 18, 2026
3478ce9
vitest页面测试调整
cyfung1031 Jun 18, 2026
294a69c
vitest页面测试调整
cyfung1031 Jun 18, 2026
9132c08
修復 E2E
cyfung1031 Jun 18, 2026
3a4c545
`t("change_theme")`
cyfung1031 Jun 18, 2026
b4344c8
fix import page enabled position
cyfung1031 Jun 18, 2026
b0faea2
fix version display
cyfung1031 Jun 18, 2026
f384210
Update utils.ts
cyfung1031 Jun 18, 2026
f1b70d6
tsx fix
cyfung1031 Jun 18, 2026
79131c2
🎨 清理 lint 问题:删除未使用导入 + 包裹 JSX 字面量
CodFrm Jun 18, 2026
8f676d0
🎨 优化安装页权限风险排序
CodFrm Jun 18, 2026
e6eb2fc
space alignment fix
cyfung1031 Jun 18, 2026
f87172e
fix
cyfung1031 Jun 18, 2026
2d478dc
follow table view
cyfung1031 Jun 18, 2026
f8aeaa9
follow table view
cyfung1031 Jun 18, 2026
562b36f
icon fix
cyfung1031 Jun 18, 2026
1addb76
ui adjust - BatchActionsBar / FilterBar
cyfung1031 Jun 18, 2026
96c4d6b
♻️ restore original script list drag handle
CodFrm Jun 18, 2026
9367917
修正 cursor
cyfung1031 Jun 18, 2026
7b83ac6
space fix
cyfung1031 Jun 18, 2026
2004d47
rollback
cyfung1031 Jun 18, 2026
de780d7
rollback
cyfung1031 Jun 18, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 3 additions & 3 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ User scripts are compiled with sandbox context isolation:
## Technology Stack

- **React 18** - Component framework with automatic runtime
- **Arco Design** - UI component library (`@arco-design/web-react`)
- **UnoCSS** - Atomic CSS framework for styling
- **shadcn/ui** - UI component library built on Radix UI
- **Tailwind CSS** - Utility-first CSS framework for styling
- **Rspack** - Fast bundler (Webpack alternative) with SWC
- **TypeScript** - Type-safe development

Expand All @@ -95,7 +95,7 @@ pnpm run coverage # Generate coverage reports
```

**Testing Patterns:**
- Uses Vitest with jsdom environment
- Uses Vitest with jsdom/happy-dom environment
- Chrome extension APIs mocked via `@Packages/chrome-extension-mock`
- Message system testing with `MockMessage` classes
- Sandbox testing validates script isolation
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
branches:
- main
- release/*
- dev
- develop/*
paths-ignore:
- ".github/**"
- ".gitignore"
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ on:
branches:
- main
- release/*
- dev
- develop/*
pull_request:

Expand Down
18 changes: 17 additions & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,23 @@ if [ "$SKIP_PRE_COMMIT" = "1" ]; then
exit 0
fi

pnpm run lint || exit 1
lint_files=$(mktemp)
git diff --cached --name-only -z --diff-filter=ACMR -- "*.js" "*.jsx" "*.ts" "*.tsx" "*.mjs" "*.cjs" > "$lint_files"

if [ -s "$lint_files" ]; then
pnpm run typecheck || {
rm -f "$lint_files"
exit 1
}
xargs -0 pnpm exec eslint < "$lint_files" || {
rm -f "$lint_files"
exit 1
}
else
echo "No staged JS/TS files, skipping lint checks"
fi

rm -f "$lint_files"

# 在 main 或 release/* 分支上提交时额外跑测试
branch=$(git rev-parse --abbrev-ref HEAD)
Expand Down
11 changes: 8 additions & 3 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ This file provides guidance to AI coding agents (Claude Code, etc.) when working

> **Before any translation/localization work, read [`docs/translation/README.md`](docs/translation/README.md)** —
> the single source of truth for translation. Whenever you add or change localized content
> (`src/locales/<locale>/translation.json`, per-language docs, UI copy, or test snapshots), you must first read
> that guide and follow the matching `docs/translation/terminology-<locale>.md` if it exists.
> (`src/locales/<locale>/*.json` namespace files, per-language docs, UI copy, or test snapshots), you must first
> read that guide and follow the matching `docs/translation/terminology-<locale>.md` if it exists.

> **Before adding, editing, reorganizing, or reviewing any contributor doc (this file or `docs/*`), read
> [`docs/DOC-MAINTENANCE.md`](docs/DOC-MAINTENANCE.md)** — keep the doc set organized (links resolve, index
Expand All @@ -27,7 +27,12 @@ This file provides guidance to AI coding agents (Claude Code, etc.) when working

## Project Overview

ScriptCat — Manifest V3 browser extension that runs Tampermonkey-compatible user scripts. TypeScript + React 18 + Rspack. Package manager is **pnpm** (preinstall enforces).
ScriptCat — Manifest V3 browser extension that runs Tampermonkey-compatible user scripts. TypeScript + React 19 + Rspack. Package manager is **pnpm** (preinstall enforces).

> **UI stack.** The presentation layer (`src/pages/`) is built with **shadcn/ui + Tailwind CSS v4** on
> **React 19** (migrated from Arco Design + UnoCSS). The concrete UI/theme rules live in
> [`docs/DEVELOP.md`](docs/DEVELOP.md); the design system (color tokens, components, layout/motion/state
> patterns, new-page recipe) lives in [`docs/DESIGN.md`](docs/DESIGN.md) — read it before building any page.

## Engineering Principles

Expand Down
21 changes: 21 additions & 0 deletions components.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"$schema": "https://ui.shadcn.com/schema.json",
"style": "new-york",
"rsc": false,
"tsx": true,
"tailwind": {
"config": "",
"css": "src/index.css",
"baseColor": "neutral",
"cssVariables": true,
"prefix": ""
},
"aliases": {
"components": "@App/pages/components",
"utils": "@App/pkg/utils/cn",
"ui": "@App/pages/components/ui",
"lib": "@App/pkg",
"hooks": "@App/pages/hooks"
},
"iconLibrary": "lucide"
}
4 changes: 2 additions & 2 deletions docs/ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ Output goes to `dist/ext/src/[name].js` (cleaned each build). Notable behavior:
test-only — defined in `vitest.config.ts` / `tsconfig.json`, not in the Rspack build).
- **Dev vs prod** via `NODE_ENV`: dev enables watch + inline source maps (skipped when `NO_MAP=true`, needed
for incognito); prod minifies with SWC + Lightning CSS and drops debug.
- **Code splitting** pulls big libs into named `lib_*` chunks (react, monaco, arco, dnd-kit, eslint, message),
- **Code splitting** pulls big libs into named `lib_*` chunks (react, monaco, radix-ui, dnd-kit, eslint, message),
but **never splits** `service_worker`, `content`, `inject`, `scripting`, or the workers — MV3 requires those
to be single self-contained files.
- **`CopyRspackPlugin`** copies [`src/manifest.json`](../src/manifest.json) — its `transform` rewrites the beta
Expand Down Expand Up @@ -565,7 +565,7 @@ premature abstraction.

## 11. Testing the Internals

- **Unit (Vitest + jsdom).** Co-locate `*.test.ts` next to source. `chrome.*` is mocked via
- **Unit (Vitest + jsdom/happy-dom).** Co-locate `*.test.ts` next to source. `chrome.*` is mocked via
[`@Packages/chrome-extension-mock`](../packages/chrome-extension-mock) (`tests/vitest.setup.ts`); message-bus
behavior uses `MockMessage`. Run one file: `pnpm test -- --run path/to/file.test.ts`.
- **TDD first.** Write the failing test before the implementation. When a test fails, fix the code — don't edit
Expand Down
10 changes: 5 additions & 5 deletions docs/CONTRIBUTING_RU.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ pnpm start

Файлы перевода ScriptCat размещены на GitHub. Мы приветствуем вклад через Pull Request.

- Файлы перевода находятся в каталоге [`src/locales`](https://github.com/scriptscat/scriptcat/tree/main/src/locales); для каждого языка есть отдельный файл `<язык>/translation.json`
- **Улучшение существующего перевода**: отредактируйте соответствующий `translation.json` напрямую
- **Добавление нового языка**: создайте каталог в `src/locales/` (например, `fr-FR`), скопируйте `en-US/translation.json` в качестве шаблона и переведите строки, затем зарегистрируйте локаль в `src/locales/locales.ts`
- Файлы перевода находятся в каталоге [`src/locales`](https://github.com/scriptscat/scriptcat/tree/main/src/locales); для каждого языка есть каталог `<язык>/`, разделённый по пространствам имён на несколько файлов `*.json` (например, `common.json`, `popup.json`, `script.json`)
- **Улучшение существующего перевода**: отредактируйте нужный файл `*.json` соответствующего пространства имён напрямую
- **Добавление нового языка**: создайте каталог в `src/locales/` (например, `fr-FR`), скопируйте файлы `*.json` каждого пространства имён и `index.ts` из `en-US/` в качестве шаблона и переведите строки, затем зарегистрируйте локаль в `src/locales/locales.ts`
- По завершении создайте Pull Request в ветку `main`

## Участие в разработке
Expand All @@ -86,8 +86,8 @@ pnpm run lint
Для разработки страниц ScriptCat используются следующие технологии:

- [React](https://reactjs.org/)
- UI-фреймворк [arco](https://arco.design)
- CSS-фреймворк [unocss](https://unocss.dev/interactive/)
- UI-фреймворк [shadcn/ui](https://ui.shadcn.com/) (на основе [Radix UI](https://www.radix-ui.com/))
- CSS-фреймворк [Tailwind CSS](https://tailwindcss.com/)
- Инструмент сборки RsPack [rspack](https://rspack.dev/)

Если вы хотите запустить ScriptCat локально, вы можете использовать следующую команду:
Expand Down
10 changes: 5 additions & 5 deletions docs/CONTRIBUTING_ZH.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ pnpm start

ScriptCat 的翻译文件托管在 GitHub 上,欢迎通过 Pull Request 贡献翻译。

- 翻译文件位于 [`src/locales`](https://github.com/scriptscat/scriptcat/tree/main/src/locales),每种语言对应一个 `<语言代码>/translation.json`
- **改进已有翻译**:直接编辑对应语言的 `translation.json`
- **新增语言**:在 `src/locales/` 下新建对应语言代码目录(如 `fr-FR`),复制 `en-US/translation.json` 作为模板进行翻译,并在 `src/locales/locales.ts` 中注册
- 翻译文件位于 [`src/locales`](https://github.com/scriptscat/scriptcat/tree/main/src/locales),每种语言对应一个 `<语言代码>/` 目录,按命名空间拆分为多个 `*.json` 文件(如 `common.json`、`popup.json`、`script.json`)
- **改进已有翻译**:直接编辑对应语言目录下相应命名空间的 `*.json` 文件
- **新增语言**:在 `src/locales/` 下新建对应语言代码目录(如 `fr-FR`),复制 `en-US/` 下的各命名空间 `*.json` 与 `index.ts` 作为模板进行翻译,并在 `src/locales/locales.ts` 中注册
- 完成后向 `main` 分支提交 Pull Request 即可

## 参与开发
Expand All @@ -88,8 +88,8 @@ pnpm run lint
ScriptCat 的页面开发使用了以下技术:

- [React](https://reactjs.org/)
- UI 框架 [arco](https://arco.design)
- CSS 框架 [unocss](https://unocss.dev/interactive/)
- UI 框架 [shadcn/ui](https://ui.shadcn.com/)(基于 [Radix UI](https://www.radix-ui.com/))
- CSS 框架 [Tailwind CSS](https://tailwindcss.com/)
- RsPack 打包工具 [rspack](https://rspack.dev/)

如果你想在本地运行 ScriptCat,可以使用以下命令:
Expand Down
Loading
Loading