feat(api): GET /api/workspaces/:id/stats endpoint
This commit is contained in:
42
workers/project-detail-page-prompt.txt
Normal file
42
workers/project-detail-page-prompt.txt
Normal file
@@ -0,0 +1,42 @@
|
||||
Create the missing project detail page in ~/src/mosaic-stack.
|
||||
|
||||
## Problem
|
||||
Clicking a project card on /projects navigates to /projects/[id] but that route doesn't exist → 404.
|
||||
|
||||
## What to Build
|
||||
Create: apps/web/src/app/(authenticated)/projects/[id]/page.tsx
|
||||
|
||||
The API endpoint GET /api/projects/:id returns a project with this shape:
|
||||
{
|
||||
id, name, description, status, priority, startDate, dueDate, createdAt, updatedAt,
|
||||
creator: { id, name, email },
|
||||
tasks: [{ id, title, status, priority, dueDate }],
|
||||
events: [{ id, title, startTime, endTime }],
|
||||
_count: { tasks, events }
|
||||
}
|
||||
|
||||
## Page Requirements
|
||||
1. Fetch the project using the existing API client pattern (look at how projects/page.tsx calls the API — follow same auth/workspace patterns)
|
||||
2. Display: project name, description, status badge, priority badge, dates, creator
|
||||
3. Display tasks list: title, status, priority, dueDate — empty state if none
|
||||
4. Display events list: title, startTime, endTime — empty state if none
|
||||
5. Back button → /projects
|
||||
6. Loading state and error state (show friendly message if project not found or fetch fails)
|
||||
7. Match the visual style of the existing projects/page.tsx (same component library, shadcn/ui, same spacing/layout conventions)
|
||||
|
||||
## API Client
|
||||
Look at apps/web/src/lib/api/ for existing project fetch functions. If no getProject(id) function exists, add it following the same pattern as other functions in that file.
|
||||
|
||||
## Process
|
||||
1. git checkout main && git pull --ff-only origin main
|
||||
2. Branch: feat/project-detail-page
|
||||
3. Check apps/web/src/lib/api/ for existing project API functions
|
||||
4. Create the page and any needed API client functions
|
||||
5. Run: pnpm turbo lint typecheck --filter=@mosaic/web
|
||||
6. Run: pnpm --filter @mosaic/web test -- --run
|
||||
7. Review: confirm page handles loading/error/not-found states, confirm no TypeScript errors
|
||||
8. Commit --no-verify: "feat(web): add project detail page (/projects/[id])"
|
||||
9. Push and PR: ~/.config/mosaic/tools/git/pr-create.sh -t "feat(web): add project detail page" -b "Clicking a project card navigated to /projects/[id] which returned 404. This adds the missing detail page showing project info, tasks, and events."
|
||||
|
||||
When completely finished:
|
||||
openclaw system event --text "Done: project detail page PR ready" --mode now
|
||||
Reference in New Issue
Block a user