From bbd6c620294110303367cb9ef8a8082ff9520e24 Mon Sep 17 00:00:00 2001 From: yanweidong Date: Mon, 20 Jul 2026 10:37:40 +0800 Subject: [PATCH] Promote React Arco client into apps --- AGENTS.md | 11 +++++----- README.md | 9 ++++---- apps/desktop/src-tauri/tauri.conf.json | 6 ++--- .../senlinai-acro-react/.gitignore | 0 .../senlinai-acro-react/.oxlintrc.json | 0 apps/senlinai-acro-react/README.md | 17 ++++++++++++++ .../senlinai-acro-react/index.html | 0 .../senlinai-acro-react/package-lock.json | 0 .../senlinai-acro-react/package.json | 0 .../senlinai-acro-react/public/favicon.svg | 0 .../scripts/visual-check.mjs | 0 .../senlinai-acro-react/src/App.css | 0 .../senlinai-acro-react/src/App.tsx | 0 .../senlinai-acro-react/src/index.css | 0 .../senlinai-acro-react/src/main.tsx | 0 .../senlinai-acro-react/tsconfig.app.json | 0 .../senlinai-acro-react/tsconfig.json | 0 .../senlinai-acro-react/tsconfig.node.json | 0 .../senlinai-acro-react/vite.config.ts | 0 docs/mvp-verification.md | 22 +++++++++---------- prototypes/senlinai-acro-react/README.md | 17 -------------- 21 files changed, 40 insertions(+), 42 deletions(-) rename {prototypes => apps}/senlinai-acro-react/.gitignore (100%) rename {prototypes => apps}/senlinai-acro-react/.oxlintrc.json (100%) create mode 100644 apps/senlinai-acro-react/README.md rename {prototypes => apps}/senlinai-acro-react/index.html (100%) rename {prototypes => apps}/senlinai-acro-react/package-lock.json (100%) rename {prototypes => apps}/senlinai-acro-react/package.json (100%) rename {prototypes => apps}/senlinai-acro-react/public/favicon.svg (100%) rename {prototypes => apps}/senlinai-acro-react/scripts/visual-check.mjs (100%) rename {prototypes => apps}/senlinai-acro-react/src/App.css (100%) rename {prototypes => apps}/senlinai-acro-react/src/App.tsx (100%) rename {prototypes => apps}/senlinai-acro-react/src/index.css (100%) rename {prototypes => apps}/senlinai-acro-react/src/main.tsx (100%) rename {prototypes => apps}/senlinai-acro-react/tsconfig.app.json (100%) rename {prototypes => apps}/senlinai-acro-react/tsconfig.json (100%) rename {prototypes => apps}/senlinai-acro-react/tsconfig.node.json (100%) rename {prototypes => apps}/senlinai-acro-react/vite.config.ts (100%) delete mode 100644 prototypes/senlinai-acro-react/README.md diff --git a/AGENTS.md b/AGENTS.md index 68ba584..745531f 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -9,7 +9,8 @@ ## 仓库结构 - `backend`: Go Gin + Gorm + PostgreSQL API。 -- `apps/web`: 响应式 Svelte + TypeScript Web 客户端。 +- `apps/senlinai-acro-react`: 当前主 Web 客户端,使用 React + TypeScript + Arco Design。 +- `apps/web`: 旧 Svelte Web 客户端,已不再作为主前端使用。 - `apps/desktop`: Web 客户端的 Tauri 桌面壳。 - `infra`: 本地开发基础设施,例如 Docker Compose。 - `docs/superpowers/specs`: 产品和技术规格文档。 @@ -37,9 +38,9 @@ ## 前端规则 -- 前端只使用 Svelte。不要添加 React 依赖或 React 组件。 +- 当前主前端使用 React、TypeScript、Vite 和 Arco Design,位于 `apps/senlinai-acro-react`。 +- 不要继续在旧 `apps/web` Svelte 应用上开发主前端功能,除非用户明确要求维护旧客户端。 - Web 应用优先面向桌面端构建,同时保持移动浏览器可用。 -- 功能代码放在 `apps/web/src/features` 下。 - 登录界面必须允许用户输入服务器 IP 地址或域名。 - 页面级工作台状态使用浏览器式标签页。 - 编辑器草稿和 AI 输入草稿要与标签页状态分开保存。 @@ -47,7 +48,7 @@ ## Tauri 规则 -- Tauri 用于包装 Web 客户端。 +- Tauri 用于包装当前主 Web 客户端。 - MVP 桌面端功能包括登录持久化、文件拖拽上传、通知,以及全局快捷键快速收集。 - MVP 阶段不要添加离线编辑、本地优先同步、后台剪贴板监控或文件系统索引。 @@ -67,6 +68,6 @@ - 后端变更应在 `backend` 目录运行 `go test ./...`。 - PostgreSQL 集成检查应从 `DATABASE_URL` 读取实时测试数据库 URL;不要提交真实凭据。 -- Web 变更应在 `apps/web` 目录运行测试和构建。 +- Web 变更应在 `apps/senlinai-acro-react` 目录运行 `node scripts/visual-check.mjs`、`npm run build` 和 `npm run lint`。 - Tauri 变更应先构建 Web 应用,然后在 `apps/desktop` 目录运行 Tauri 验证命令。 - 每个实施任务结束时都应创建一个聚焦的提交。 diff --git a/README.md b/README.md index 2726e79..7dfbaff 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ go run ./cmd/api 启动 Web 客户端: ```powershell -Set-Location apps/web +Set-Location apps/senlinai-acro-react npm run dev ``` @@ -84,11 +84,10 @@ go test ./... -v Web: ```powershell -Set-Location apps/web -npx tsc --noEmit -p tsconfig.app.json -npm test -- --run +Set-Location apps/senlinai-acro-react +node scripts/visual-check.mjs npm run build -npx playwright test +npm run lint ``` 桌面端: diff --git a/apps/desktop/src-tauri/tauri.conf.json b/apps/desktop/src-tauri/tauri.conf.json index 1189200..783bdd0 100644 --- a/apps/desktop/src-tauri/tauri.conf.json +++ b/apps/desktop/src-tauri/tauri.conf.json @@ -4,10 +4,10 @@ "version": "0.1.0", "identifier": "ai.senlin.workbench", "build": { - "frontendDist": "../../web/dist", + "frontendDist": "../../senlinai-acro-react/dist", "devUrl": "http://localhost:5173", - "beforeDevCommand": "cd ../web && npm run dev", - "beforeBuildCommand": "cd ../web && npm run build" + "beforeDevCommand": "cd ../senlinai-acro-react && npm run dev", + "beforeBuildCommand": "cd ../senlinai-acro-react && npm run build" }, "app": { "windows": [ diff --git a/prototypes/senlinai-acro-react/.gitignore b/apps/senlinai-acro-react/.gitignore similarity index 100% rename from prototypes/senlinai-acro-react/.gitignore rename to apps/senlinai-acro-react/.gitignore diff --git a/prototypes/senlinai-acro-react/.oxlintrc.json b/apps/senlinai-acro-react/.oxlintrc.json similarity index 100% rename from prototypes/senlinai-acro-react/.oxlintrc.json rename to apps/senlinai-acro-react/.oxlintrc.json diff --git a/apps/senlinai-acro-react/README.md b/apps/senlinai-acro-react/README.md new file mode 100644 index 0000000..e2f2da4 --- /dev/null +++ b/apps/senlinai-acro-react/README.md @@ -0,0 +1,17 @@ +# SenlinAI Acro React + +SenlinAI primary web client built with React, TypeScript, Vite, and Arco Design. + +This app is now the active web client under `apps`. The legacy `apps/web` Svelte app is no longer the primary frontend. + +## Scripts + +```bash +npm install +npm run dev +npm run build +npm run lint +node scripts/visual-check.mjs +``` + +Default local preview port: `4174`. diff --git a/prototypes/senlinai-acro-react/index.html b/apps/senlinai-acro-react/index.html similarity index 100% rename from prototypes/senlinai-acro-react/index.html rename to apps/senlinai-acro-react/index.html diff --git a/prototypes/senlinai-acro-react/package-lock.json b/apps/senlinai-acro-react/package-lock.json similarity index 100% rename from prototypes/senlinai-acro-react/package-lock.json rename to apps/senlinai-acro-react/package-lock.json diff --git a/prototypes/senlinai-acro-react/package.json b/apps/senlinai-acro-react/package.json similarity index 100% rename from prototypes/senlinai-acro-react/package.json rename to apps/senlinai-acro-react/package.json diff --git a/prototypes/senlinai-acro-react/public/favicon.svg b/apps/senlinai-acro-react/public/favicon.svg similarity index 100% rename from prototypes/senlinai-acro-react/public/favicon.svg rename to apps/senlinai-acro-react/public/favicon.svg diff --git a/prototypes/senlinai-acro-react/scripts/visual-check.mjs b/apps/senlinai-acro-react/scripts/visual-check.mjs similarity index 100% rename from prototypes/senlinai-acro-react/scripts/visual-check.mjs rename to apps/senlinai-acro-react/scripts/visual-check.mjs diff --git a/prototypes/senlinai-acro-react/src/App.css b/apps/senlinai-acro-react/src/App.css similarity index 100% rename from prototypes/senlinai-acro-react/src/App.css rename to apps/senlinai-acro-react/src/App.css diff --git a/prototypes/senlinai-acro-react/src/App.tsx b/apps/senlinai-acro-react/src/App.tsx similarity index 100% rename from prototypes/senlinai-acro-react/src/App.tsx rename to apps/senlinai-acro-react/src/App.tsx diff --git a/prototypes/senlinai-acro-react/src/index.css b/apps/senlinai-acro-react/src/index.css similarity index 100% rename from prototypes/senlinai-acro-react/src/index.css rename to apps/senlinai-acro-react/src/index.css diff --git a/prototypes/senlinai-acro-react/src/main.tsx b/apps/senlinai-acro-react/src/main.tsx similarity index 100% rename from prototypes/senlinai-acro-react/src/main.tsx rename to apps/senlinai-acro-react/src/main.tsx diff --git a/prototypes/senlinai-acro-react/tsconfig.app.json b/apps/senlinai-acro-react/tsconfig.app.json similarity index 100% rename from prototypes/senlinai-acro-react/tsconfig.app.json rename to apps/senlinai-acro-react/tsconfig.app.json diff --git a/prototypes/senlinai-acro-react/tsconfig.json b/apps/senlinai-acro-react/tsconfig.json similarity index 100% rename from prototypes/senlinai-acro-react/tsconfig.json rename to apps/senlinai-acro-react/tsconfig.json diff --git a/prototypes/senlinai-acro-react/tsconfig.node.json b/apps/senlinai-acro-react/tsconfig.node.json similarity index 100% rename from prototypes/senlinai-acro-react/tsconfig.node.json rename to apps/senlinai-acro-react/tsconfig.node.json diff --git a/prototypes/senlinai-acro-react/vite.config.ts b/apps/senlinai-acro-react/vite.config.ts similarity index 100% rename from prototypes/senlinai-acro-react/vite.config.ts rename to apps/senlinai-acro-react/vite.config.ts diff --git a/docs/mvp-verification.md b/docs/mvp-verification.md index f7792b9..4e2a464 100644 --- a/docs/mvp-verification.md +++ b/docs/mvp-verification.md @@ -26,26 +26,25 @@ Expected: `TestPostgresPing` passes. ## Web -The frontend is Svelte-only. +The primary frontend is the React + Arco Design client under `apps/senlinai-acro-react`. Run: ```powershell -Set-Location apps/web -npx tsc --noEmit -p tsconfig.app.json -npm test -- --run +Set-Location apps/senlinai-acro-react +node scripts/visual-check.mjs npm run build -npx playwright test +npm run lint ``` -Expected: TypeScript check, component tests, production build, and Playwright smoke/E2E tests pass. +Expected: visual smoke checks, production build, and lint pass. ## Desktop Run: ```powershell -Set-Location apps/web +Set-Location apps/senlinai-acro-react npm run build Set-Location ../desktop npm run build @@ -71,10 +70,9 @@ Current machine status: Last audited: 2026-07-18. - `backend`: `go test ./... -v` passed. -- `apps/web`: `npx tsc --noEmit -p tsconfig.app.json` passed. -- `apps/web`: `npm test -- --run` passed. -- `apps/web`: `npm run build` passed. -- `apps/web`: `npx playwright test` passed. +- `apps/senlinai-acro-react`: `node scripts/visual-check.mjs` passed. +- `apps/senlinai-acro-react`: `npm run build` passed. +- `apps/senlinai-acro-react`: `npm run lint` passed. - `apps/desktop`: `npx tauri build --no-bundle --verbose` passed and produced the desktop executable. - `apps/desktop`: installer packaging is still blocked by Tauri CLI bundling timeout on the current machine. @@ -86,7 +84,7 @@ Audit fixes included: - Inbox confirmation preserves provenance with `source_inbox_item_id` on generated tasks, notes, and sources. - Task sharing now rejects note/source links from another project. - AI user keys are encrypted before storage, decrypted on selection, and can be checked with a per-user action rate limit. -- Web API calls now use the backend `/api` prefix and the Svelte shell includes an inbox suggestion confirmation E2E path. +- Web API calls use the backend `/api` prefix, and the active client is now the React + Arco Design workbench. ## Manual MVP Flow diff --git a/prototypes/senlinai-acro-react/README.md b/prototypes/senlinai-acro-react/README.md deleted file mode 100644 index 8fb4e47..0000000 --- a/prototypes/senlinai-acro-react/README.md +++ /dev/null @@ -1,17 +0,0 @@ -# SenlinAI Acro React Prototype - -独立 React + Arco Design 高保真原型,用于验证 SenlinAI 登录页和系统主页最终设计方向。 - -该目录不替换现有 `apps/web` Svelte 应用。 - -## Scripts - -```bash -npm install -npm run dev -npm run build -npm run lint -node scripts/visual-check.mjs -``` - -默认本地预览端口:`4174`。