Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
136 commits
Select commit Hold shift + click to select a range
5455d69
prototype: mirror frontend with local mock data
qingqing-ux May 15, 2026
ffc68aa
add tutorial page
qingqing-ux May 17, 2026
56e33a9
docs: specify full prototype frontend sync
qingqing-ux May 17, 2026
b1bef70
docs: plan full prototype frontend sync
qingqing-ux May 17, 2026
4e70c98
prototype: sync full frontend surfaces offline
qingqing-ux May 17, 2026
1acc092
prototype: align preview walkthrough gaps
qingqing-ux May 17, 2026
5a1c5dd
prototype: fix sign in nav wrapping
qingqing-ux May 17, 2026
2d4daaf
prototype: remove default button border
qingqing-ux May 17, 2026
4e5fb34
prototype: align project runner overlay
qingqing-ux May 17, 2026
1b858d7
prototype: move project actions to sidebar
qingqing-ux May 17, 2026
5a25866
prototype: restructure project page like spx gui
qingqing-ux May 17, 2026
c2d1da2
prototype: fill copilot folded icon
qingqing-ux May 17, 2026
42df595
prototype: align sign in callback page
qingqing-ux May 17, 2026
d0b56c2
prototype: add user sidebar icons
qingqing-ux May 17, 2026
9214c8b
prototype: remove extra user header stats
qingqing-ux May 17, 2026
17ac54f
prototype: align user overview section links
qingqing-ux May 17, 2026
d60ab5b
prototype: restore editor category icons
qingqing-ux May 17, 2026
5141386
prototype: fix editor project menu icon
qingqing-ux May 17, 2026
3b67e49
prototype: remove extra editor new project button
qingqing-ux May 17, 2026
12b53fa
prototype: align editor sprite card size
qingqing-ux May 17, 2026
046a583
prototype: use real editor stage panel icons
qingqing-ux May 17, 2026
0151e04
prototype: use real editor quick config icons
qingqing-ux May 17, 2026
1220067
prototype: apply xgo code colors to snippets
qingqing-ux May 17, 2026
d04cd54
prototype: add editor costumes tab view
qingqing-ux May 17, 2026
5581106
prototype: add editor animations detail view
qingqing-ux May 17, 2026
9447d6c
prototype: add editor map edit mode
qingqing-ux May 17, 2026
06a7122
prototype: add editor project name controls
qingqing-ux May 17, 2026
fcfe578
prototype: use real sprite options icon
qingqing-ux May 17, 2026
e4805e7
prototype: align editor asset detail title
qingqing-ux May 17, 2026
65176e6
prototype: align editor detail panel header
qingqing-ux May 17, 2026
7a35fe8
prototype: add editor project menu dropdown
qingqing-ux May 17, 2026
af87c97
prototype: add editor stage panel navigation
qingqing-ux May 17, 2026
b8db815
prototype: add sprite options menu actions
qingqing-ux May 17, 2026
89fb01d
prototype: add sprite creation menu
qingqing-ux May 17, 2026
80565b3
prototype: make copilot panel draggable
qingqing-ux May 17, 2026
0840a6f
prototype: add code category switching
qingqing-ux May 17, 2026
65c085d
prototype: align map size input styling
qingqing-ux May 17, 2026
71a81a2
prototype: add map sprite rename editing
qingqing-ux May 17, 2026
52949b4
prototype: add map sprite config collapse
qingqing-ux May 17, 2026
c178e84
prototype: complete editor save state indicators
qingqing-ux May 17, 2026
81a25ff
prototype: align tutorials banner with spx gui
qingqing-ux May 17, 2026
c13fbf4
prototype: add community project menu dropdown
qingqing-ux May 17, 2026
6c46f64
prototype: align search empty results layout
qingqing-ux May 17, 2026
c7ec993
prototype: align community navbar menu interactions
qingqing-ux May 17, 2026
c0a9a31
prototype: align community sign in button style
qingqing-ux May 17, 2026
5356f44
prototype: align project card body spacing
qingqing-ux May 17, 2026
5ac60b0
prototype: align project remix card spacing
qingqing-ux May 17, 2026
6c33a26
prototype: align project share button icon
qingqing-ux May 17, 2026
ac0755e
prototype: align project collapse headers
qingqing-ux May 17, 2026
399a6c0
prototype: align project share action button
qingqing-ux May 17, 2026
4d4856a
prototype: align project remix stat icon
qingqing-ux May 17, 2026
0066fd1
prototype: sync editor selection color tokens
qingqing-ux May 17, 2026
5230852
prototype: align editor sound detail
qingqing-ux May 17, 2026
83b3c6b
prototype: align editor sound list player
qingqing-ux May 17, 2026
272994f
prototype: align stage quick entry state
qingqing-ux May 17, 2026
2ef90c0
prototype: sync editor data with current project
qingqing-ux May 17, 2026
a8426c9
prototype: align map editor project data
qingqing-ux May 17, 2026
fc968f0
prototype: align map physics controls
qingqing-ux May 17, 2026
25fb93d
prototype: restore map workspace background
qingqing-ux May 17, 2026
8d47fe4
prototype: add editor profile menu
qingqing-ux May 17, 2026
4a70146
prototype: align map sprite config title
qingqing-ux May 17, 2026
f7f3f92
prototype: align copilot launcher style
qingqing-ux May 18, 2026
9e5715d
prototype: set project card title size
qingqing-ux May 18, 2026
51ead45
prototype: align button sizing
qingqing-ux May 18, 2026
4a889ce
prototype: align project card variants
qingqing-ux May 18, 2026
8d018d9
prototype: center navbar menu icons
qingqing-ux May 18, 2026
92d63d4
prototype: align navbar search input text
qingqing-ux May 18, 2026
b671f7c
prototype: show sign in dialog
qingqing-ux May 18, 2026
0b124e9
prototype: flip copilot fold on left
qingqing-ux May 18, 2026
011d561
prototype: align text view typography
qingqing-ux May 18, 2026
49e013b
prototype: align collapse heading typography
qingqing-ux May 18, 2026
c6bae18
prototype: contain add sprite menu text
qingqing-ux May 18, 2026
716d11a
prototype: add animation grouping action
qingqing-ux May 18, 2026
3cea306
prototype: wire sprite menu actions
qingqing-ux May 18, 2026
7d3bcd8
prototype: remove mode icon stroke
qingqing-ux May 18, 2026
e1aacd4
prototype: align editor mode toggle
qingqing-ux May 18, 2026
5cec5e9
prototype: add preview size quick config
qingqing-ux May 18, 2026
24b3df4
prototype: address pr review feedback
qingqing-ux May 18, 2026
3b72a4d
prototype: add preview rotation quick config
qingqing-ux May 18, 2026
e54904d
prototype: align explore header style
qingqing-ux May 18, 2026
2d0476d
prototype: align project detail controls
qingqing-ux May 18, 2026
5de7849
prototype: use real quick config back icon
qingqing-ux May 18, 2026
83c647f
prototype: align quick config icon colors
qingqing-ux May 18, 2026
a9da79c
prototype: use ui button for editor format
qingqing-ux May 18, 2026
643f26f
prototype: use grey 300 editor navbar
qingqing-ux May 18, 2026
84d6432
prototype: use ui tag for editor labels
qingqing-ux May 18, 2026
5c1755d
prototype: unclip sprite options menu
qingqing-ux May 18, 2026
6c97aec
prototype: use real code zoom icons
qingqing-ux May 18, 2026
f5b96be
prototype: add code document preview tabs
qingqing-ux May 18, 2026
3b0b4df
prototype: wrap sprite panel cards
qingqing-ux May 18, 2026
882ef7f
prototype: fix sprite list columns
qingqing-ux May 18, 2026
32f5933
prototype: complete sprite quick config
qingqing-ux May 18, 2026
5745e86
prototype: use card component for map side
qingqing-ux May 18, 2026
0756308
prototype: share sprite item component
qingqing-ux May 18, 2026
4d4ee9a
prototype: overlay map sprite drawer
qingqing-ux May 18, 2026
2afc5f9
prototype: align map sprite form controls
qingqing-ux May 18, 2026
f0ef215
prototype: use library edit icons
qingqing-ux May 18, 2026
e807833
docs: remove agent workflow artifacts
qingqing-ux May 18, 2026
9f444d8
prototype: align copilot launcher
qingqing-ux May 18, 2026
cfe74dc
chore: ignore playwright mcp artifacts
qingqing-ux May 18, 2026
ae235d6
prototype: tailwind copilot launcher
qingqing-ux May 18, 2026
deccf89
prototype: align editor tabs
qingqing-ux May 18, 2026
5f501b6
prototype: align code category rail
qingqing-ux May 18, 2026
424163c
prototype: fix category state colors
qingqing-ux May 18, 2026
ed8422f
prototype: align code token colors
qingqing-ux May 18, 2026
b67e195
prototype: align editor panel headers
qingqing-ux May 18, 2026
0f45478
prototype: add editor tutorials entry
qingqing-ux May 18, 2026
eba027d
prototype: use ui icons for editor controls
qingqing-ux May 18, 2026
696ae96
prototype: add animation menu action
qingqing-ux May 18, 2026
64c1a90
prototype: add animation item actions
qingqing-ux May 18, 2026
9bae160
prototype: add costume item actions
qingqing-ux May 18, 2026
9cde689
prototype: add sprite rename modal
qingqing-ux May 18, 2026
13d6cd6
prototype: use eye-off icon for hidden sprites
qingqing-ux May 18, 2026
585f721
prototype: add sprite generator flow
qingqing-ux May 18, 2026
06655ba
prototype: align stage panel entries
qingqing-ux May 18, 2026
4a4300d
prototype: align editor dropdown menus
qingqing-ux May 18, 2026
c653e82
prototype: address review scope cleanup
qingqing-ux May 18, 2026
8a27db4
prototype: set category label font size
qingqing-ux May 18, 2026
1a3a11c
prototype: inherit editor navbar background
qingqing-ux May 18, 2026
6dca53d
prototype: remove editor navbar border
qingqing-ux May 18, 2026
97624f9
prototype: contain editor tabs
qingqing-ux May 18, 2026
e47cf59
prototype: add snippet horizontal drag
qingqing-ux May 18, 2026
d7f67fd
prototype: align add sprite icon button
qingqing-ux May 18, 2026
fd00770
prototype: fix stage overview size
qingqing-ux May 18, 2026
6aad0f7
prototype: add stage panel divider
qingqing-ux May 18, 2026
e8bfd7b
prototype: align publish action icon
qingqing-ux May 18, 2026
ea85509
prototype: add runner loading animation
qingqing-ux May 18, 2026
5158703
prototype: add local publish flow
qingqing-ux May 18, 2026
5758226
prototype: fix sound asset item styling
qingqing-ux May 18, 2026
1b3b266
prototype: fix widget asset item styling
qingqing-ux May 18, 2026
ee2b11a
prototype: add local sound editing controls
qingqing-ux May 18, 2026
d7dc908
fix prototype editor review feedback
qingqing-ux May 19, 2026
4de8bf6
docs: track editor component refactor follow-up
qingqing-ux May 19, 2026
497c8dc
refactor prototype editor modals
qingqing-ux May 19, 2026
9803620
refactor sprite generator modal flow
qingqing-ux May 19, 2026
4c1c24a
Merge pull request #1 from qingqing-ux/codex/prototype-editor-components
qingqing-ux May 19, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,10 @@
# Go workspace file
go.work

# Agent workflow artifacts
docs/superpowers/
*/docs/superpowers/
.playwright-mcp/

.idea/
*.wasm
8 changes: 1 addition & 7 deletions ui/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ The same requirement should use one issue to connect the Design PR and Code PR.

`ui/prototype` is a runnable product prototype, not an isolated demo.

It is used during Design PR to express product behavior, page structure, visual design, and basic interactions. See [Prototype Maintenance](skills/prototype-maintenance/SKILL.md) for detailed maintenance rules.
It is used during Design PR to express product behavior, page structure, visual design, and basic interactions. See [`prototype/AGENTS.md`](prototype/AGENTS.md) for detailed maintenance rules.

## Quick Start

Expand Down Expand Up @@ -79,12 +79,6 @@ It is used during Design PR to express product behavior, page structure, visual
| [Design to Code Mapping (Legacy)](docs/design-to-code-mapping-legacy.md) | Legacy `.pen` to `spx-gui` mapping rules |
| [Component Docs Naming](docs/component-docs-naming.md) | Component documentation naming conventions |

## Skills

| Skill | Description |
| ----- | ----------- |
| [Prototype Maintenance](skills/prototype-maintenance/SKILL.md) | Use when maintaining `ui/prototype` and keeping it aligned with the real frontend structure, routes, and interactions |

## Tests and Validation

`ui/tests/pen/` contains design asset validation tests for protecting the component library and page-level Pencil files. See [Design Asset Validation](docs/design-asset-validation.md) for details.
8 changes: 1 addition & 7 deletions ui/README.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ PR(Code 发布)

`ui/prototype` 是可运行的功能原型,不是孤立 demo。

它用于在 Design PR 阶段表达产品功能、页面结构、设计样式和基础交互。具体维护规则见 [Prototype Maintenance](skills/prototype-maintenance/SKILL.md)。
它用于在 Design PR 阶段表达产品功能、页面结构、设计样式和基础交互。具体维护规则见 [`prototype/AGENTS.md`](prototype/AGENTS.md)。

## 快速开始

Expand Down Expand Up @@ -79,12 +79,6 @@ PR(Code 发布)
| [设计到代码映射(旧版)](docs/design-to-code-mapping-legacy.md) | 旧版 `.pen` 到 `spx-gui` 的映射规则,历史参考 |
| [组件文档命名](docs/component-docs-naming.md) | 组件文档命名约定 |

## Skills

| Skill | 说明 |
| ----- | ---- |
| [Prototype Maintenance](skills/prototype-maintenance/SKILL.md) | 维护 `ui/prototype` 时使用,确保 prototype 与真实前端结构、路由和交互保持一致 |

## 测试与校验

`ui/tests/pen/` 存放设计资产校验测试,用于保护组件库和页面级 Pencil 文件。详细说明见 [设计资产校验](docs/design-asset-validation.md)。
2 changes: 1 addition & 1 deletion ui/docs/design-to-code-mapping-legacy.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Design to Code Mapping Guide (Legacy)

> 本文是旧版 `.pen` 到 `spx-gui` 的映射与规范化文档,主要服务旧版设计同步流程。
> 当前 prototype 维护规则请优先查看 [`ui/skills/prototype-maintenance/SKILL.md`](../skills/prototype-maintenance/SKILL.md)。
> 当前 prototype 维护规则请优先查看 [`ui/prototype/AGENTS.md`](../prototype/AGENTS.md)。

本文记录整个仓库里 `.pen` 设计资产与 `spx-gui` 前端实现之间的对应关系,供后续开发者同步设计稿到代码时使用。

Expand Down
8 changes: 4 additions & 4 deletions ui/docs/team-workflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,11 @@ Code PR 不应只从静态设计稿重新推导实现方案,而应把 Design P

## Prototype 维护

Prototype 的维护规则已经单独整理为 skill
Prototype 的维护规则已经合并到原型目录

- [`ui/skills/prototype-maintenance/SKILL.md`](../skills/prototype-maintenance/SKILL.md)
- [`ui/prototype/AGENTS.md`](../prototype/AGENTS.md)

当任务涉及 `ui/prototype`、Pencil 页面改动同步、prototype 预览环境或 prototype 与真实前端代码对齐时,应优先使用该 skill
当任务涉及 `ui/prototype`、Pencil 页面改动同步、prototype 预览环境或 prototype 与真实前端代码对齐时,应优先遵循该文件

## 责任边界

Expand Down Expand Up @@ -142,5 +142,5 @@ Code PR 不应绕开 issue 和 Design PR 单独解释需求。

- Issue 编写规则:[Issue 模板](./issue-template.md)
- Design PR 编写规则:[PR 模板](./pr-template.md)
- Prototype 维护规则:[`ui/skills/prototype-maintenance/SKILL.md`](../skills/prototype-maintenance/SKILL.md)
- Prototype 维护规则:[`ui/prototype/AGENTS.md`](../prototype/AGENTS.md)
- 旧版协作流程:[团队工作流程(旧版)](./team-workflow-legacy.md)
Binary file added ui/images/tutorials-banner.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
119 changes: 70 additions & 49 deletions ui/prototype/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,60 @@ This file guides AI agents working under `ui/prototype/`.

## Purpose

`ui/prototype/` is a standalone, design-driven UI preview workspace, usually generated from `.pen` files in `ui/pages/` and assets in `ui/images/`.
`ui/prototype/` is a standalone, runnable XBuilder frontend prototype. It exists for Design PR work: product behavior, page structure, visual design, and basic interactions should be experienced here before production logic is implemented in `spx-gui/`.

It should stay close to the real frontend in stack and presentation style, but it is not the real frontend.
The prototype must look and behave like the current Builder frontend, but it must be disconnected from the server. Data shown in the prototype is local fake data.

## Core Contract

- `spx-gui/` is the real product frontend.
- `ui/prototype/` is a local preview sandbox.
- The prototype should resemble the real frontend in structure, theme shape, typography, and implementation style.
- The prototype must not depend on the real frontend at runtime, build time, or type-check time.
- `spx-gui/` is the real product frontend and the reference implementation.
- `ui/prototype/` is an independent frontend app with its own install, dev, build, and preview flow.
- Prototype code must follow the real frontend's stack and organization where practical: Vite, Vue 3, Vue Router, Tailwind CSS v4, page/component/API-style boundaries, local theme tokens, and local app styles.
- Runtime, build, and typecheck must not depend on `spx-gui/`.
- The prototype must not call real backend services.

Stable rule:

- You may copy or adapt presentation-layer patterns from the real frontend.
- You must not import code, config, styles, fonts, routes, tokens, utilities, or components directly from `spx-gui/`.
- Inspect the current real frontend implementation before changing the corresponding prototype surface.
- Recreate the needed structure locally under `ui/prototype/`.
- Use local mock APIs and fake data instead of real network calls.
- Do not import code, config, styles, fonts, routes, tokens, utilities, or components directly from `spx-gui/`.

If something is needed from the real frontend, copy the minimum local version into `ui/prototype/` and remove production-only concerns.
If something is needed from the real frontend, copy or adapt the minimum local presentation-layer subset into `ui/prototype/` and remove production-only concerns.

## Source Priority

When changing the prototype, use this order:

1. Design files and design assets decide what should be rendered.
2. Existing prototype files decide local conventions.
3. The real frontend is only a reference for structure, theme, naming, and visual implementation patterns.
1. The changed Pencil design file or design asset decides the intended UI.
2. The current real frontend decides the page structure, route shape, component boundaries, styling approach, and interaction model.
3. Existing prototype files decide local conventions.

Do not invent an unrelated demo architecture when a matching real frontend surface exists.

## Required Workflow

1. Start from the real frontend.
- Inspect the corresponding implementation in the current Builder frontend before editing prototype code.
- Reuse the same route model, page/component split, style approach, and interaction logic where practical.

2. Ensure the target prototype surface exists.
- If `ui/prototype` does not have the changed page or UI, initialize it from the current real frontend structure.
- If it exists but has drifted from the real frontend organization, align the structure first, then apply the design change.

3. Apply only the current design change.
- Sync the latest relevant Pencil page change into `ui/prototype`.
- If only one page changed, only override that page or component surface.
- Other pages, routes, and features must remain accessible and usable through local mock behavior.

4. Keep the prototype offline.
- Replace server APIs with local `src/apis/*` mock modules.
- Replace auth, persistence, permission, and backend state with deterministic local state.
- Keep interactions local and preview-oriented.

5. Keep edits scoped.
- Write prototype-related changes under `ui/` unless the user explicitly authorizes broader scope.
- Do not modify `spx-gui/` by default.

## Boundaries

Expand All @@ -38,83 +67,74 @@ Agents must preserve all of the following:
- Runtime and build dependencies stay inside `ui/prototype/`, except shared static assets under `ui/images/`.
- Do not import from `../../spx-gui` or any other real frontend directory.
- Do not extend, merge, or proxy real frontend config.
- Do not add business logic, network requests, auth flow, persistence, or real app state.
- Keep interactions local, minimal, and preview-oriented.
- Do not add real network requests, real auth flow, real persistence, or real app state.
- Keep mock data local.

Forbidden shortcuts include:

- importing the real frontend's Vite config, router, token files, or components
- reading fonts from the real frontend instead of copying them locally
- using aliases that resolve into the real frontend project
- adding `fetch`, `axios`, or backend client calls for prototype data
- replacing the app with a single isolated static demo page

## Alignment And Simplification

Keep these areas aligned with the real frontend when practical:

- Vite + Vue 3 + Vue Router + Tailwind CSS v4
- page/component/data/style directory split
- route names and URL shape for community, search, tutorials, project, and editor surfaces
- page/component/API-style directory split
- semantic token naming and UI-facing class style
- typography, spacing, radius, shadow, and color conventions
- `src/styles/app.css`, especially the `@theme inline` bridge and base presentation rules

At the same time, keep the prototype simpler than the real frontend:

- replace business state with static data or minimal local state
- replace real flows with a small local router
- replace product actions with no-op handlers or local feedback
- replace real APIs with local functions returning mock data
- replace product actions with local feedback
- replace game/project runtime surfaces with static placeholder previews; do not copy SPX engine assets or parse XBP files
- do not recreate `/docs/*` pages or `src/widgets/*` entry surfaces because they are not end-user prototype UI
- omit infrastructure and edge-case handling unless it changes the visual result

## Editing Rules

When iterating on the prototype:

1. Start from the design artifact that changed.
2. Reuse existing prototype components before adding abstractions.
3. Prefer pure presentational Vue components.
4. Prefer Tailwind utility classes.
5. Keep `src/styles/app.css` structurally aligned with the real frontend's `app.css`.
6. If new token families are needed, add local `--ui-*` variables first, then expose them through local `@theme inline` mapping.
7. If copying from the real frontend, copy the minimum presentational subset and strip production logic.

## Long-Term Stability

These rules are more important than reducing duplication:

- Never reintroduce a direct dependency on the real frontend.
- Prefer local copies over shared imports for theme, style, asset, and config surfaces.
- Keep the prototype's public shape similar to the real frontend so later migration stays easy.
- Keep the prototype's implementation simpler so preview work stays cheap.
- If the prototype deliberately diverges from the real frontend, document that near the affected file or in `README.md`.

Sync direction:

1. Copy semantic token names and theme structure.
2. Copy base presentation rules.
3. Copy static assets locally when needed.
4. Recreate markup and styling locally.
5. Drop production-only logic.

Do not treat prototype code as the source of truth for production code.
2. Inspect the matching real frontend files.
3. Reuse existing prototype components before adding abstractions.
4. Prefer pure presentational Vue components.
5. Prefer Tailwind utility classes.
6. Keep `src/styles/app.css` structurally aligned with the real frontend's `app.css`.
7. If new token families are needed, add local `--ui-*` variables first, then expose them through local `@theme inline` mapping.
8. If copying from the real frontend, copy the minimum presentational subset and strip production logic.

## Validation

After substantive changes:
After substantive changes, run from `ui/prototype/`:

- run `npm run build` inside `ui/prototype/`
```bash
npm run test:prototype
npm run build
```

When UI structure or styling changes, also do the following when possible:
When UI structure or styling changes, also:

- run the dev server from `ui/prototype/`
- open the preview in a browser
- verify the main route renders
- verify any local preview interaction still works
- verify changed pages are accessible
- verify important unchanged pages still load
- verify navigation, search, course-card navigation, project pages, and editor preview flows when relevant

Before finishing, confirm:

- no import points into `spx-gui/`
- no config references the real frontend
- the prototype still behaves as a standalone app
- no real backend calls exist
- the prototype still behaves as a standalone offline app

## Keep This File Updated

Expand All @@ -125,6 +145,7 @@ Update this file when any of the following changes:
- the allowed relationship with the real frontend
- the validation flow
- the local prototype architecture
- the mock API/data strategy
- the sync strategy for theme, asset, or config surfaces

If a change creates pressure to depend on the real frontend directly, document the local alternative here instead.
If a change creates pressure to depend on the real frontend directly, document the local alternative here instead.
24 changes: 17 additions & 7 deletions ui/prototype/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# XBuilder Prototype Preview

这是一个独立的 UI 原型工程,用来预览 `ui/pages/spx/tutorial.pen` 对应的设计实现
这是一个独立的 XBuilder 前端原型工程,用来在 Design PR 阶段预览页面结构、视觉样式和基础交互
它保持与真实前端相近的组织方式和技术栈:基于 Vite、Vue 3、Vue Router、Tailwind CSS v4,按页面、
组件、数据和样式拆分;主题 token、基础排版和字体资源尽量与真实前端保持一致,但不包含业务逻辑,也不直接依赖真实前端项目
组件、mock API、数据和样式拆分;主题 token、基础排版和字体资源尽量与真实前端保持一致,但不直接依赖真实前端项目,也不调用服务端

## Run

Expand All @@ -19,14 +19,24 @@ http://127.0.0.1:5174/

## Scope

- `/` 重定向到 `/tutorials`
- `/tutorials` 使用 prototype 页面,并直接引用 `ui/images` 中的设计资源
- `/`、`/explore`、`/search`、`/user/:nameInput` 以及 `/user/:nameInput/projects|likes|followers|following` 复刻社区和用户主页结构
- `/project/:ownerInput/:nameInput` 复刻项目详情、运行预览、owner、说明、remix、release history 和相关项目区域
- `/tutorials`、`/course-series/:courseSeriesIdInput`、`/course/:courseSeriesIdInput/:courseIdInput/start` 复刻教程主流程
- `/editor/:ownerNameInput/:projectNameInput/:inEditorPath*` 提供离线编辑器预览,并包含 sprite editor 局部 prototype surface
- `/sign-in/callback`、`/sign-in/token` 提供本地模拟登录页面,不触发真实鉴权
- 样式通过 Tailwind v4 utility class 实现,并在 `src/styles/app.css` 中维护与真实前端接近的 `@theme inline` token 映射
- 本地 mock 教程数据与卡片点击反馈
- 导航、banner、列表和页脚都保留为纯展示层实现
- 数据由 `src/apis/*` 和 `src/data/mock.ts` 提供,全部为本地假数据;导航、搜索、课程卡片跳转、项目页、编辑器局部交互均为本地状态

## Constraints

- 这个目录应始终可单独安装、单独启动、单独构建
- 可以复用 `ui/images` 这类设计资源,但不要直接 import 真实前端项目中的代码或配置
- 如需模拟交互,只保留用于预览 UI 的最小本地状态
- 不要加入真实 `fetch`、`axios`、鉴权、持久化、OpenAPI 服务加载或服务端状态
- 不复刻 `/docs/*` 页面、`src/widgets/*` entry surface、SPX engine runtime 或 XBP 解析逻辑;项目运行区域使用静态占位预览

## Validate

```bash
npm run test:prototype
npm run build
```
3 changes: 2 additions & 1 deletion ui/prototype/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"scripts": {
"dev": "vite",
"build": "vue-tsc --noEmit && vite build",
"preview": "vite preview"
"preview": "vite preview",
"test:prototype": "node scripts/check-prototype.mjs"
},
"dependencies": {
"@tailwindcss/vite": "4.2.2",
Expand Down
Loading