Skip to content

feat(history): add project workflow history - #105

Open
xyh202131 wants to merge 2 commits into
1024XEngineer:mainfrom
xyh202131:feat/history-page
Open

feat(history): add project workflow history#105
xyh202131 wants to merge 2 commits into
1024XEngineer:mainfrom
xyh202131:feat/history-page

Conversation

@xyh202131

Copy link
Copy Markdown

What changed

  • Add a project-level History page that groups WorkflowRun records by status.
  • Show the current Revision, step progress, revision lineage, and invalid-record state.
  • Route AI-driven runs back to Quick Start and manual runs back to Workflow Editor.
  • Define a minimal read-only controller contract with only listWorkflows and subscribeAll.
  • Document the boundary between History, assets, Playtest, and workflow execution.

Why

Users need one place to inspect creation tasks and their retry history without treating History as an asset library or Playtest record. The page must remain read-only and return an active task to the interface where it was created.

Scope

This PR targets main directly and contains only:

  • frontend/src/pages/history/index.tsx
  • frontend/src/pages/history/index.test.tsx
  • frontend/src/pages/history/README.md

AppShell routing, backend code, WorkflowRun persistence, local preview files, screenshots, dependencies, and build output are intentionally excluded.

Verification

  • npm test: 3 files, 9 tests passed
  • npm test -- src/pages/history: 7 History tests passed
  • npm run typecheck: passed
  • npm run lint: passed
  • npm run build: passed
  • Modified TypeScript files pass oxfmt --check

Closes #100

@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 Ready Ready Preview Aug 4, 2026 6:06am

@xyh202131
xyh202131 marked this pull request as ready for review August 4, 2026 06:45

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

Review findings:

  • frontend/src/app/app.tsx: The new history page is not imported or registered in the app router. The README documents /projects/:projectId/history, but the current route table still only has /projects/:projectId and /projects/:projectId/assets, so that URL falls through to NotFoundPage and the page cannot be reached in the actual app.

Verification: attempted npm test -- src/pages/history -- --run, npm run typecheck, and npm run lint; all failed before running because the frontend command binaries (vitest, tsc, oxlint) were not executable/available in this checkout.

<p className="mt-2 text-sm text-slate-600">查看任务进度、重做版本与每一步结果。</p>
</div>
<Link
to={`/workflow-editor?projectId=${encodeURIComponent(projectId)}`}

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 link builds /workflow-editor?projectId=..., but the app router only defines /workflow-editor/:runId and /workflow-editor/:runId/:stage. Clicking 新建创作任务 from the history page will therefore fall through to NotFoundPage instead of opening the editor. Please either add the matching creation route or point this button at an existing creation flow.

3. 页面通过 `controller.subscribeAll()` 接收全局变化,并再次按 `projectId` 过滤。
4. 页面卸载时调用 Controller 返回的取消订阅函数。

页面不接触 `WorkflowRunStore`、localStorage 或后端传输。History 在页面入口声明只包含 `listWorkflows` 与 `subscribeAll` 的只读接口;正式 WorkflowController 只要满足这两个方法就能注入。将来持久化方式改变时,History 无需跟着改写。

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 says the formal WorkflowController can be injected if it provides listWorkflows/subscribeAll, but the current exported WorkflowController interface has neither method. As written, the documented integration path cannot compile against the actual controller; please add an adapter/interface that exists in the codebase or correct the README.


每张 Run 卡片展示任务目的、最近 Revision 时间、当前版本、步骤进度和版本数量。展开后显示每个 Revision 的来源、重开步骤和步骤状态。当前 WorkflowRun 没有独立的 `updatedAt` 字段,因此页面以最新 Revision 的 `createdAt` 作为最近活动时间,不伪造 Entity 数据。

History 只选择恢复目标并传递 `runId`。真正的状态恢复由 Quick Start 或 Workflow Editor 调用 `WorkflowController.resume(runId)` 完成,History 不复制恢复逻辑。

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 README assigns resume behavior to WorkflowController.resume(runId), but the current controller interface does not define a resume method. That makes the documented handoff from History to Quick Start/Workflow Editor unimplementable as written; please document the real resume API or add it before relying on this contract.

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: 实现项目级 WorkflowRun 历史页面(Refs #37 §3.7)

1 participant