Skip to content

前端架构(骨架版)评审(Refs #45 · 仅评审不合并)#46

Open
huyanxius wants to merge 10 commits into
1024XEngineer:mainfrom
huyanxius:docs/45-frontend-architecture
Open

前端架构(骨架版)评审(Refs #45 · 仅评审不合并)#46
huyanxius wants to merge 10 commits into
1024XEngineer:mainfrom
huyanxius:docs/45-frontend-architecture

Conversation

@huyanxius

Copy link
Copy Markdown
Collaborator

改动说明

新增 docs/frontend-architecture.md:Windup MS2 前端最小架构(骨架版)——目录结构、依赖方向、Import 权限与骨架验收范围。承接前端业务模块拆分 #41,纯文档,不涉及代码改动。

实现方式

按 app / pages / features / api / shared 分层,给出依赖方向图、精确 Import 权限、各 feature 对外能力与边界,以及骨架最小竖线与验收。已并入 07-22 导师走查结论:header 归 app/layout、工作流编辑界面命名 workflow-editor。

测试

Not run(纯文档、无代码改动;本 PR 仅用于逐行评审、不合并)。


Refs #45 · 仅评审不合并,评审定稿后内容落回该 Issue。

The MS2 frontend needs an executable skeleton that fixes module layers, dependency direction and boundaries before feature work starts.

Add docs/frontend-architecture.md defining the app/pages/features/api/shared layers, their dependency and import rules, each feature's public surface, and the minimal vertical slice for skeleton acceptance.

It serves as the line-by-line review target for issue 1024XEngineer#45; the review PR is not merged, and its content lands back in the issue once settled.
@gemini-code-assist

Copy link
Copy Markdown

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@fennoai fennoai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The architecture proposal has two contract gaps that should be resolved before implementation: the mock API path is not covered by the import rules, and the shared utility boundary conflicts with the documented download responsibility.

View job run

Comment thread docs/frontend-architecture.md Outdated
app 启动
→ 打开一个 page
→ page 使用一个 feature
→ feature 通过 api/mock 获得数据

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This acceptance path says a feature obtains data through api/mock, but the import matrix only permits features to import api/client (line 159), and every dependency diagram routes features through api/client. Please define api/mock as an implementation selected behind the client facade, or explicitly add its allowed import path; otherwise the required skeleton vertical slice contradicts the architecture rules.

Comment thread docs/frontend-architecture.md Outdated
└─ shared/ 无业务依赖的通用零件
├─ ui/ 按钮、弹窗、输入框、进度条等
├─ lib/ 格式化、下载等通用工具

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The import rules define shared/lib as browser-free and network-free pure utilities (line 163), but this directory is also assigned download utilities here. A download helper normally needs browser APIs such as Blob, URL, or an anchor element, so this makes the boundary internally inconsistent. Please move browser-facing download behavior to an appropriate UI/app layer or narrow the shared/lib rule and document the exception.

huyan added 7 commits July 23, 2026 11:04
Per mentor review, the real client and the mock should not stand as two permanent parallel api modules; they are one module whose implementation swaps from mock to real over time.

Move mock under api/client as one of two implementations (real, mock) behind a single interface, selected by environment config, and note it is dropped once the backend is ready.

Reviewers now see one api surface with an explicit real/mock swap instead of two sibling folders.
The previously submitted version used five layers with no entities layer, letting each feature own its own model. That version is now outdated relative to the actual direction being taken.

Replace it with the six-layer FSD scheme (adds widgets and entities), defining WorkflowRun, Project, Character and Asset as shared entities used by both Quick Start and Workflow Editor.

The PR now reflects the same direction already used to scaffold entities/project and entities/character locally.
The generation/quality/review/playtest features were flattened under one workflow-editor widget, and the asset library page had no widget or feature behind it at all.

Split review and playtest into a dedicated qc-station widget matching the product's own QC station framing, add an asset-library widget backed by Character and ActionTemplate entities, and add a character-setup feature for creating/confirming a character's master and attaching action templates. Also add WorkflowRun's missing characterId field and flag its backend endpoints as unconfirmed.

Workflow-editor now only owns character setup and generation; export is used directly by the page since it holds no interactive state.
…es directly

None of the four widgets (quick-start, workflow-editor, qc-station, asset-library) were ever reused across more than one page, so the layer added import rules and directory ceremony without buying the reuse it exists for.

Collapse to app/pages/features/entities/shared: pages now import Feature and Entity public interfaces directly. Local interaction state that lived on widgets moves to the feature it belongs to (canvas state into generation, review frame into review, playback into playtest) or to the page (quick-start draft, asset filters). HomePage also now calls character-setup directly alongside generation, closing a gap where quick-start's character-creation step had no owner.

Every diagram, dependency example, and the skeleton acceptance line are updated to match; the directory tree, layer table, and import permission table all drop widgets accordingly.
The widgets-layer removal in 57661fa turned out incomplete and confusing in execution: quick-start and workflow-editor lost their identity as named units, one sub-item (navigation) was dropped silently, and the replacement structure was not validated against the actual product flow before being applied.

Restore the file to its state at fc02171, the last version with widgets intact and both quick-start and workflow-editor present as named modules.

Whether to remove widgets again, and how, is unresolved and needs to be redone more carefully rather than reapplied from this point.
…ages

The widgets layer was reinstated once (bcc9492) after an incomplete removal, but the underlying problem stood: quick-start, workflow-editor, qc-station and asset-library each only ever mounted on one page, so the widgets layer bought import-rule overhead without the reuse it exists for.

Remove it for good this time, with every site checked against a three-pass review (completeness against the prior doc, cross-check against the team's module breakdown doc, FSD import-rule compliance). quick-start and workflow-editor become their own pages; qc-station's review UI and asset-library fold directly into their host pages. Add ProjectsPage to carry the "从项目开始" entry path that was previously unaccounted for, sharing character-setup with quick-start rather than duplicating it.

Reword the dependency-direction and layer-responsibility sections from negative framing ("shared doesn't understand X") to positive framing (what each layer actually provides), and convert the legal/illegal dependency examples into separate small diagrams instead of one cramped, crossing-heavy graph.
…ionTemplate

Wearable was added as an entity alongside ActionTemplate but never actually referenced by any page or feature, unlike ActionTemplate which AssetLibraryPage already reads. Add it to AssetLibraryPage's diagram, prose, and the directory/responsibility listings so it matches ActionTemplate's treatment instead of sitting unused.

Also drop a leftover "(不再经过 Widget 这层)" annotation that should have been removed along with the other migration-history notes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants