feat(frontend): wire useProjects hook to SDK and enhance MSW handlers

- Regenerate API SDK with 77 endpoints (up from 61)
- Update useProjects hook to use SDK's listProjects function
- Add comprehensive project mock data for demo mode
- Add project CRUD handlers to MSW overrides
- Map API response to frontend ProjectListItem format
- Fix test files with required slug and autonomyLevel properties

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-03 02:22:44 +01:00
parent fe2104822e
commit 731a188a76
8 changed files with 4881 additions and 165 deletions

View File

@@ -10,6 +10,7 @@ describe('ProjectCard', () => {
const mockProject: ProjectListItem = {
id: 'proj-1',
name: 'Test Project',
slug: 'test-project',
description: 'This is a test project description',
status: 'active',
complexity: 'medium',
@@ -21,6 +22,7 @@ describe('ProjectCard', () => {
createdAt: '2025-01-01T00:00:00Z',
owner: { id: 'user-1', name: 'Test User' },
tags: ['frontend', 'react', 'typescript'],
autonomyLevel: 'milestone',
};
it('renders project name', () => {

View File

@@ -18,6 +18,7 @@ describe('ProjectsGrid', () => {
{
id: 'proj-1',
name: 'Project One',
slug: 'project-one',
description: 'First project',
status: 'active',
complexity: 'medium',
@@ -27,10 +28,12 @@ describe('ProjectsGrid', () => {
lastActivity: '5 min ago',
createdAt: '2025-01-01T00:00:00Z',
owner: { id: 'user-1', name: 'User One' },
autonomyLevel: 'milestone',
},
{
id: 'proj-2',
name: 'Project Two',
slug: 'project-two',
description: 'Second project',
status: 'paused',
complexity: 'high',
@@ -40,6 +43,7 @@ describe('ProjectsGrid', () => {
lastActivity: '1 day ago',
createdAt: '2025-01-02T00:00:00Z',
owner: { id: 'user-2', name: 'User Two' },
autonomyLevel: 'full_control',
},
];