feat(projects): client project status pages at /projects/{projectId} (app#2048)
Implements the app row of #2048, against the approved design frames.
Merges last. Contract recoupable/docs#326 → tables recoupable/database#68 → the three api PRs → this. The pages will 404 until the endpoints exist.
What ships
| Route | Renders |
|---|---|
/projects/{projectId} | The task timeline. Active and Completed tabs, the viewer's own open tasks pinned above Active. |
/projects/{projectId}/tasks/{taskId} | One task: status, due date, description, the completion toggle, and Messages / Documents / Collaborators. |
Structure
Mirrors app/tasks/* rather than inventing a pattern: a two-line route wrapper around a client component, a UUID guard that notFound()s a bad segment (isProjectId, same shape as isTaskId), PageContainer for the column, and RunPageSkeleton while the query is pending.
Data comes from api.recoupable.dev over the Privy access token — the same Bearer credential the rest of the app already sends, so there is no new auth path.
The decisions worth reviewing
Pinning lives in splitProjectTasks, not in the list. A client opens this link to find out what is being asked of them, so that ordering rule is one tested function rather than something re-expressed at each render site. A completed task never needs anyone, even while it still carries an assignee.
isPending, not isLoading. isLoading is false during the window where the query is disabled waiting on Privy, so gating on it flashes the not-found copy before the fetch runs. That is the exact bug #2041 fixed on the task page.
Not-found copy keeps the API's ambiguity. The endpoints answer 404 both for an unknown id and for a caller who is not a collaborator, and the page says the same thing for both. Telling someone a project exists but is not theirs is how a project id gets confirmed.
Dates are split by hand, not parsed. due_date arrives as a bare YYYY-MM-DD, which new Date() reads as UTC midnight and renders as the day before in any negative-offset timezone. There is a test for it.
Two deliberate deviations from the approved frames
- No "Powered by Recoupable" footer. The frames were drawn when this was a public capability-URL page. It is now Privy-gated inside the app shell, so it takes the app's chrome like
/tasksdoes. - No client-org eyebrow above the title. It was backed by
projects.client_name, which was cut in schema review. The project name carries it.
Verification
vitest: 12 tests over 4 files, all passing. Written test-first with RED confirmed forisProjectId,getTaskStateandformatTaskDate;splitProjectTaskswas written alongside its test.tsc --noEmit: clean for every file in this diff.eslint: clean.- Not yet preview-verified — the endpoints do not exist. A full walk (dark desktop → light desktop → mobile, in one login session) with screenshots follows once the
apiPRs are onmain, and this PR should not merge before that comment is posted.
🤖 Generated with Claude Code
https://claude.ai/code/session_01BTaK5sDuryYsQG5W56mR5n
Summary by cubic
Adds client project status pages for issue #2048 at /projects/{projectId} and /projects/{projectId}/tasks/{taskId}. Clients previously had no project timeline or task detail view; they can now track progress, see tasks assigned to them, comment, and mark tasks complete or incomplete. The pages return 404 until the underlying project API endpoints are deployed.
Bug Fixes
- The shared
Progresscomponent now emitsaria-valuenowwith a rounded whole-percent value; every progress bar in the app, including CatalogSongsResult's, now reports its value to screen readers.
New Features
- Pins the viewer's open assigned tasks above the Active list and keeps completed tasks in a separate tab.
- Shows task progress, due dates, comments, collaborators, and a Documents empty state.
- Validates UUID route parameters and keeps unknown and inaccessible projects indistinguishable.
- Adds focused tests for task grouping, task state, date formatting, and route validation.
Summary by CodeRabbit
- New Features
- Added project pages with task progress, active and completed tabs, and “Needs you” indicators.
- Added task detail pages with status controls, due dates, descriptions, breadcrumbs, comments, documents, and collaborators.
- Added the ability to post comments and mark tasks complete or incomplete.
- Added loading, empty, and not-found states for projects and tasks.
- Invalid project or task links now display a not-found page.