Promote React Arco client into apps

This commit is contained in:
2026-07-20 10:37:40 +08:00
parent aa2bf9b88f
commit bbd6c62029
21 changed files with 40 additions and 42 deletions

View File

@@ -9,7 +9,8 @@
## 仓库结构 ## 仓库结构
- `backend`: Go Gin + Gorm + PostgreSQL API。 - `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 桌面壳。 - `apps/desktop`: Web 客户端的 Tauri 桌面壳。
- `infra`: 本地开发基础设施,例如 Docker Compose。 - `infra`: 本地开发基础设施,例如 Docker Compose。
- `docs/superpowers/specs`: 产品和技术规格文档。 - `docs/superpowers/specs`: 产品和技术规格文档。
@@ -37,9 +38,9 @@
## 前端规则 ## 前端规则
- 前端使用 Svelte。不要添加 React 依赖或 React 组件 - 当前主前端使用 React、TypeScript、Vite 和 Arco Design位于 `apps/senlinai-acro-react`
- 不要继续在旧 `apps/web` Svelte 应用上开发主前端功能,除非用户明确要求维护旧客户端。
- Web 应用优先面向桌面端构建,同时保持移动浏览器可用。 - Web 应用优先面向桌面端构建,同时保持移动浏览器可用。
- 功能代码放在 `apps/web/src/features` 下。
- 登录界面必须允许用户输入服务器 IP 地址或域名。 - 登录界面必须允许用户输入服务器 IP 地址或域名。
- 页面级工作台状态使用浏览器式标签页。 - 页面级工作台状态使用浏览器式标签页。
- 编辑器草稿和 AI 输入草稿要与标签页状态分开保存。 - 编辑器草稿和 AI 输入草稿要与标签页状态分开保存。
@@ -47,7 +48,7 @@
## Tauri 规则 ## Tauri 规则
- Tauri 用于包装 Web 客户端。 - Tauri 用于包装当前主 Web 客户端。
- MVP 桌面端功能包括登录持久化、文件拖拽上传、通知,以及全局快捷键快速收集。 - MVP 桌面端功能包括登录持久化、文件拖拽上传、通知,以及全局快捷键快速收集。
- MVP 阶段不要添加离线编辑、本地优先同步、后台剪贴板监控或文件系统索引。 - MVP 阶段不要添加离线编辑、本地优先同步、后台剪贴板监控或文件系统索引。
@@ -67,6 +68,6 @@
- 后端变更应在 `backend` 目录运行 `go test ./...` - 后端变更应在 `backend` 目录运行 `go test ./...`
- PostgreSQL 集成检查应从 `DATABASE_URL` 读取实时测试数据库 URL不要提交真实凭据。 - 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 验证命令。 - Tauri 变更应先构建 Web 应用,然后在 `apps/desktop` 目录运行 Tauri 验证命令。
- 每个实施任务结束时都应创建一个聚焦的提交。 - 每个实施任务结束时都应创建一个聚焦的提交。

View File

@@ -20,7 +20,7 @@ go run ./cmd/api
启动 Web 客户端: 启动 Web 客户端:
```powershell ```powershell
Set-Location apps/web Set-Location apps/senlinai-acro-react
npm run dev npm run dev
``` ```
@@ -84,11 +84,10 @@ go test ./... -v
Web Web
```powershell ```powershell
Set-Location apps/web Set-Location apps/senlinai-acro-react
npx tsc --noEmit -p tsconfig.app.json node scripts/visual-check.mjs
npm test -- --run
npm run build npm run build
npx playwright test npm run lint
``` ```
桌面端: 桌面端:

View File

@@ -4,10 +4,10 @@
"version": "0.1.0", "version": "0.1.0",
"identifier": "ai.senlin.workbench", "identifier": "ai.senlin.workbench",
"build": { "build": {
"frontendDist": "../../web/dist", "frontendDist": "../../senlinai-acro-react/dist",
"devUrl": "http://localhost:5173", "devUrl": "http://localhost:5173",
"beforeDevCommand": "cd ../web && npm run dev", "beforeDevCommand": "cd ../senlinai-acro-react && npm run dev",
"beforeBuildCommand": "cd ../web && npm run build" "beforeBuildCommand": "cd ../senlinai-acro-react && npm run build"
}, },
"app": { "app": {
"windows": [ "windows": [

View File

@@ -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`.

View File

Before

Width:  |  Height:  |  Size: 9.3 KiB

After

Width:  |  Height:  |  Size: 9.3 KiB

View File

@@ -26,26 +26,25 @@ Expected: `TestPostgresPing` passes.
## Web ## Web
The frontend is Svelte-only. The primary frontend is the React + Arco Design client under `apps/senlinai-acro-react`.
Run: Run:
```powershell ```powershell
Set-Location apps/web Set-Location apps/senlinai-acro-react
npx tsc --noEmit -p tsconfig.app.json node scripts/visual-check.mjs
npm test -- --run
npm run build 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 ## Desktop
Run: Run:
```powershell ```powershell
Set-Location apps/web Set-Location apps/senlinai-acro-react
npm run build npm run build
Set-Location ../desktop Set-Location ../desktop
npm run build npm run build
@@ -71,10 +70,9 @@ Current machine status:
Last audited: 2026-07-18. Last audited: 2026-07-18.
- `backend`: `go test ./... -v` passed. - `backend`: `go test ./... -v` passed.
- `apps/web`: `npx tsc --noEmit -p tsconfig.app.json` passed. - `apps/senlinai-acro-react`: `node scripts/visual-check.mjs` passed.
- `apps/web`: `npm test -- --run` passed. - `apps/senlinai-acro-react`: `npm run build` passed.
- `apps/web`: `npm run build` passed. - `apps/senlinai-acro-react`: `npm run lint` passed.
- `apps/web`: `npx playwright test` passed.
- `apps/desktop`: `npx tauri build --no-bundle --verbose` passed and produced the desktop executable. - `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. - `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. - 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. - 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. - 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 ## Manual MVP Flow

View File

@@ -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`