Skip to content

feat(projects): implement project center and asset library - #119

Open
huyanxius wants to merge 14 commits into
1024XEngineer:mainfrom
huyanxius:feat/118-project-asset-workspace
Open

feat(projects): implement project center and asset library#119
huyanxius wants to merge 14 commits into
1024XEngineer:mainfrom
huyanxius:feat/118-project-asset-workspace

Conversation

@huyanxius

@huyanxius huyanxius commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

实现 Projects 模块的项目中心与项目资产工作区,覆盖项目浏览、项目导航、角色资产库和角色详情,并按真实后端字段展示造型、动作与帧。

Closes #118

合并顺序:先合并 #117,再合并本 PR。本分支直接从主仓库 main 创建,只包含 Projects 的 14 个提交,不包含 #117 的提交历史。后端运行还需要 #75 合并并部署。

Why

  • main 目前只有 Projects 路由骨架,项目、角色和资产层级还不能读取正式数据。
  • 前期验证页使用过 Mock 与 livedemo 资源,本 PR 将正式实现收敛到后端 Project / Character 契约,不把演示数据带入生产包。
  • Projects 负责资产浏览与管理,不重复实现 Workflow Editor、新建项目流程或生成流程。

Change Description

  • 实现项目中心的分页浏览、进入项目和删除确认,并保留明确禁用的新建项目入口。
  • 实现项目工作区、角色资产库和角色详情路由,按 Project → Character → Outfit → Action → Frame 浏览资产。
  • 实现 Project 4 个端点与 Character 5 个端点的 DTO 映射、分页和完整 character_data 更新。
  • 为动作卡、帧展开、空状态、删除和分页补齐页面与接口测试。
  • 动作模板和导出没有可接入的正式后端能力,当前入口保持禁用并显示原因。

Implementation Approach

  • 页面只从 entities 公共入口调用 projectApischaracterApis,snake_case 到 camelCase 的转换留在对应实体模块。
  • /projects/:projectId/* 使用独立项目工作区路由,资产库与角色详情保留同一项目上下文。
  • 测试数据只存在于 Vitest 的 HTTP 替身;生产代码不包含 Mock API、演示实体或 livedemo 资源。
  • 复用 feat(frontend): add shared API client infrastructure #117 提供的 HTTP、响应外壳、分页和 Token 注入边界,不复制其实现或提交历史。

Screenshots

以下截图来自本地接口契约环境。测试数据与图片仅用于页面核对,不进入生产源码或构建产物。

项目中心

项目中心

角色资产库

角色资产库

角色详情与动作帧

角色详情与动作帧

Testing

在本地将本分支与 feat/shared-api-client 临时合并且不创建提交,完整门禁通过:

  • npm run format:check:通过,55 个文件。
  • npm run lint:通过。
  • npm run typecheck:通过。
  • npm run test:通过,10 个测试文件、38 项测试。
  • npm run build:通过,Vite 构建 96 个模块。
  • git merge-tree --write-tree HEAD feat/shared-api-client:无冲突。
  • 独立性检查:merge base 为 upstream/main,Projects 差异不包含 frontend/src/shared/api/*

Follow-ups

  • 新建项目流程、Workflow Editor 与登录流程分别由后续 PR 实现。
  • Action Template 等待后端提供存储与接口;导出等待正式能力完成资产字段接线。
  • 后端仍需处理 Character 名称落库、资源归属隔离和 Project 删除级联。

Related

Projects need a domain adapter for the backend contract in PR 75.

Map project DTOs, enums, pagination queries, creation, lookup, and deletion.

Project pages can use typed data without handling transport fields.
Project transport mapping must stay aligned with the backend contract.

Cover pagination, DTO mapping, writes, deletion, and bearer token injection.

Contract regressions fail before reaching the project pages.
The asset library needs the persisted character hierarchy from PR 75.

Map character, outfit, action, and frame data with complete tree updates.

Pages can browse formal assets without generated or mock-only fields.
Character tree mapping carries the core project asset contract.

Cover list, detail, create, update, delete, and token-aware requests.

Nested asset serialization remains protected by executable tests.
Pages consume entities through the layer public entry point.

Export the implemented project and character APIs with their domain types.

Project pages keep respecting the existing dependency boundary.
Backend project and character lists can span multiple pages.

Add a business-neutral pagination control and export it from shared UI.

List pages can navigate all records without duplicating controls.
Projects need an entry page and a persistent project-level workspace.

Implement paged project browsing, deletion, navigation, and project constraints.

Users can enter one project before managing its contained assets.
Project assets need formal browsing below the project workspace.

Implement character cards, outfit selection, stacked actions, and frame expansion.

The UI reflects only fields persisted by the character contract.
Project pages require a nested route boundary outside the global shell.

Mount the asset library and character detail beneath the project workspace.

Direct routes preserve project context without duplicating global navigation.
Project navigation currently changes state without visual continuity.

Add restrained entry, route, dialog, and card transitions with reduced motion.

Page changes remain legible without changing the established palette.
Page tests need realistic HTTP responses without production mock data.

Provide a test-only Project and Character backend with configurable pagination.

Production bundles remain independent from demonstration fixtures.
Project entry and workspace behavior need route-level regression coverage.

Cover real HTTP data, deletion, pagination, constraints, and disabled boundaries.

The project navigation flow remains verifiable without browser fixtures.
Asset browsing must preserve project ownership and frame ordering.

Cover pagination, empty states, outfits, stacked actions, and frame expansion.

Unsupported template and export actions stay explicit and inert.
The architecture documents still describe project pages as placeholders.

Record the formal workspace, backend mappings, merge order, and excluded flows.

Reviewers can distinguish current behavior from backend and future work.
@vercel

vercel Bot commented Aug 4, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
windup Error Error Aug 4, 2026 8:04pm

@huyanxius
huyanxius marked this pull request as ready for review August 4, 2026 20:09

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

Found a build blocker and one brittle load path. Details are inline.

@@ -1,32 +1,25 @@
import { ApiError, createApiClient, getApiAccessToken } from '@/shared/api'

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.

High: this new import resolves @/shared/api, but that module is not present anywhere in the repo tree. The PR will fail type-check/bundling before the new Project API can be used. The same missing-module issue also exists in frontend/src/entities/character/index.ts:1.


setProject(null)
setError(null)
void Promise.all([

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.

Medium: Promise.all makes the whole workspace fail if the character-count request rejects, even when projectApis.get(projectId) succeeds. The project shell should still render and treat the count as optional; otherwise a transient /characters outage blocks direct access to /projects/:projectId.

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.

feat: 实现项目中心与项目资产工作区

1 participant