Skip to content

Commit 2e69036

Browse files
author
Marvin Zhang
committed
feat: add Zustand stores for layout, project, and realtime management
- Created layout-store for managing sidebar state. - Implemented project-store for handling project-related actions and state. - Added realtime-store for managing WebSocket connections and subscriptions. - Introduced base CSS styles and font definitions for consistent styling. - Developed layout and responsive styles for improved UI structure. - Updated API integration tests to reflect changes in devlog terminology. - Removed obsolete project-api-client tests to streamline test suite. - Adjusted TypeScript paths for better module resolution.
1 parent 4aaa805 commit 2e69036

File tree

137 files changed

+175
-599
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

137 files changed

+175
-599
lines changed

docs/design/visual-design-system.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ This document outlines the revised color scheme and icon system for devlog statu
4343
5. **Distinctiveness**: Each category is easily distinguishable
4444

4545
## Implementation Files
46-
- `packages/web/app/lib/devlog-ui-utils.tsx` - Core color and icon functions
47-
- `packages/web/app/components/ui/DevlogTags.tsx` - Tag components using the utilities
46+
- `packages/web/lib/devlog-ui-utils.tsx` - Core color and icon functions
47+
- `packages/web/components/ui/DevlogTags.tsx` - Tag components using the utilities
4848

4949
## Benefits
5050
- **Faster Scanning**: Users can quickly identify work types and status

packages/core/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ const entry = await devlog.createDevlog({
5959
type: 'feature',
6060
description: 'Add JWT-based authentication system',
6161
priority: 'high',
62-
businessContext: 'Users need secure login to access protected features',
62+
businessContext: 'Users need secure login to access protected feature',
6363
technicalContext: 'Using JWT tokens with refresh mechanism',
6464
acceptanceCriteria: [
6565
'Users can register with email/password',
@@ -81,16 +81,16 @@ await devlog.addNote(entry.id, {
8181
content: 'Fixed validation issues with email format',
8282
});
8383

84-
// List all devlogs
84+
// List all devlog
8585
const allDevlogs = await devlog.listDevlogs();
8686

87-
// Filter devlogs
87+
// Filter devlog
8888
const inProgressTasks = await devlog.listDevlogs({
8989
status: ['in-progress'],
9090
type: ['feature', 'bugfix'],
9191
});
9292

93-
// Search devlogs
93+
// Search devlog
9494
const authDevlogs = await devlog.searchDevlogs('authentication');
9595

9696
// Get active context for AI assistants

packages/core/src/types/chat.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ export interface ChatStats {
180180
linkageStats: {
181181
linked: number;
182182
unlinked: number;
183-
multiLinked: number; // Sessions linked to multiple devlogs
183+
multiLinked: number; // Sessions linked to multiple devlog
184184
};
185185
}
186186

packages/core/src/types/core.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export type DevlogStatus =
3737
* **In Progress** - Work is actively being developed
3838
* - Developer/AI is actively working on the implementation
3939
* - Main development phase where code is being written
40-
* - Use when: Starting work, making changes, implementing features
40+
* - Use when: Starting work, making changes, implementing feature
4141
*/
4242
| 'in-progress'
4343
/**
@@ -292,8 +292,8 @@ export interface TimeSeriesDataPoint {
292292
date: string; // ISO date string (YYYY-MM-DD)
293293

294294
// Cumulative data (primary Y-axis) - shows total project progress over time
295-
totalCreated: number; // Running total of all created devlogs
296-
totalClosed: number; // Running total of closed devlogs (based on closedAt timestamp)
295+
totalCreated: number; // Running total of all created devlog
296+
totalClosed: number; // Running total of closed devlog (based on closedAt timestamp)
297297

298298
// Snapshot data (secondary Y-axis) - shows workload at this point in time
299299
open: number; // Entries that were open as of this date (totalCreated - totalClosed)

packages/mcp/src/api/devlog-api-client.ts

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,11 @@ export class DevlogApiClient {
5151

5252
constructor(config: DevlogApiClientConfig) {
5353
this.retries = config.retries || 3;
54-
54+
5555
// Create HTTPS agent for proxy tunneling to fix redirect loops
5656
let httpsAgent;
5757
const proxyUrl = process.env.https_proxy || process.env.HTTPS_PROXY;
58-
58+
5959
if (proxyUrl && config.baseUrl.includes('devlog.codervisor.dev')) {
6060
// Use tunnel agent for devlog.codervisor.dev to avoid redirect loops
6161
const proxyMatch = proxyUrl.match(/https?:\/\/([^:]+):(\d+)/);
@@ -68,15 +68,15 @@ export class DevlogApiClient {
6868
});
6969
}
7070
}
71-
71+
7272
this.axiosInstance = axios.create({
7373
baseURL: config.baseUrl.replace(/\/$/, ''), // Remove trailing slash
7474
timeout: config.timeout || 30000,
7575
headers: {
7676
'Content-Type': 'application/json',
7777
},
7878
// Use custom agent if we created one, otherwise let axios handle proxy normally
79-
...(httpsAgent && {
79+
...(httpsAgent && {
8080
httpsAgent,
8181
proxy: false, // Disable built-in proxy when using custom agent
8282
}),
@@ -87,7 +87,7 @@ export class DevlogApiClient {
8787
(response) => response,
8888
(error: AxiosError) => {
8989
throw this.handleAxiosError(error);
90-
}
90+
},
9191
);
9292
}
9393

@@ -118,7 +118,7 @@ export class DevlogApiClient {
118118
// Server responded with error status
119119
statusCode = error.response.status;
120120
responseData = error.response.data;
121-
121+
122122
// Try to extract error message from response
123123
if (responseData) {
124124
if (typeof responseData === 'string') {
@@ -127,12 +127,12 @@ export class DevlogApiClient {
127127
errorMessage = responseData.error?.message || responseData.message || error.message;
128128
}
129129
}
130-
130+
131131
errorMessage = `HTTP ${statusCode}: ${errorMessage}`;
132132
} else if (error.request) {
133133
// Request was made but no response received
134134
errorMessage = `Network error: ${error.message}`;
135-
135+
136136
// Handle specific proxy/network related errors with helpful context
137137
if (error.code === 'ERR_FR_TOO_MANY_REDIRECTS') {
138138
errorMessage += '. Fixed: Using tunnel agent to avoid proxy redirect loops.';
@@ -162,19 +162,17 @@ export class DevlogApiClient {
162162
return response.data;
163163
} catch (error) {
164164
const axiosError = error as AxiosError;
165-
165+
166166
// Only retry on network errors or 5xx server errors, not on client errors
167-
const shouldRetry = attempt < this.retries && (
168-
!axiosError.response ||
169-
(axiosError.response.status >= 500)
170-
);
171-
167+
const shouldRetry =
168+
attempt < this.retries && (!axiosError.response || axiosError.response.status >= 500);
169+
172170
if (shouldRetry) {
173171
logger.warn(`Request failed (attempt ${attempt}/${this.retries}), retrying...`);
174172
await new Promise((resolve) => setTimeout(resolve, 1000 * attempt));
175173
return this.makeRequest(endpoint, options, attempt + 1);
176174
}
177-
175+
178176
// Re-throw the error (will be handled by the response interceptor)
179177
throw error;
180178
}
@@ -194,7 +192,7 @@ export class DevlogApiClient {
194192
return response.data;
195193
}
196194

197-
// Handle paginated response format (devlogs list API)
195+
// Handle paginated response format (devlog list API)
198196
if (
199197
response &&
200198
typeof response === 'object' &&

packages/web/app/api/projects/[name]/devlogs/[devlogId]/notes/[noteId]/route.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const UpdateNoteBodySchema = z.object({
1414
category: z.string().optional(),
1515
});
1616

17-
// GET /api/projects/[name]/devlogs/[id]/notes/[noteId] - Get specific note
17+
// GET /api/projects/[name]/devlog/[id]/notes/[noteId] - Get specific note
1818
export async function GET(
1919
request: NextRequest,
2020
{ params }: { params: { name: string; devlogId: string; noteId: string } },
@@ -53,7 +53,7 @@ export async function GET(
5353
}
5454
}
5555

56-
// PUT /api/projects/[name]/devlogs/[id]/notes/[noteId] - Update specific note
56+
// PUT /api/projects/[name]/devlog/[id]/notes/[noteId] - Update specific note
5757
export async function PUT(
5858
request: NextRequest,
5959
{ params }: { params: { name: string; devlogId: string; noteId: string } },
@@ -106,7 +106,7 @@ export async function PUT(
106106
}
107107
}
108108

109-
// DELETE /api/projects/[name]/devlogs/[id]/notes/[noteId] - Delete specific note
109+
// DELETE /api/projects/[name]/devlog/[id]/notes/[noteId] - Delete specific note
110110
export async function DELETE(
111111
request: NextRequest,
112112
{ params }: { params: { name: string; devlogId: string; noteId: string } },

packages/web/app/api/projects/[name]/devlogs/[devlogId]/notes/route.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { DevlogAddNoteBodySchema, DevlogUpdateWithNoteBodySchema } from '@/schem
88
// Mark this route as dynamic to prevent static generation
99
export const dynamic = 'force-dynamic';
1010

11-
// GET /api/projects/[name]/devlogs/[id]/notes - List notes for a devlog entry
11+
// GET /api/projects/[name]/devlog/[id]/notes - List notes for a devlog entry
1212
export async function GET(
1313
request: NextRequest,
1414
{ params }: { params: { name: string; devlogId: string } },
@@ -68,7 +68,7 @@ export async function GET(
6868
}
6969
}
7070

71-
// POST /api/projects/[name]/devlogs/[id]/notes - Add note to devlog entry
71+
// POST /api/projects/[name]/devlog/[id]/notes - Add note to devlog entry
7272
export async function POST(
7373
request: NextRequest,
7474
{ params }: { params: { name: string; devlogId: string } },
@@ -118,7 +118,7 @@ export async function POST(
118118
}
119119
}
120120

121-
// PUT /api/projects/[name]/devlogs/[id]/notes - Update devlog and add note in one operation
121+
// PUT /api/projects/[name]/devlog/[id]/notes - Update devlog and add note in one operation
122122
export async function PUT(
123123
request: NextRequest,
124124
{ params }: { params: { name: string; devlogId: string } },

packages/web/app/api/projects/[name]/devlogs/[devlogId]/route.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { RealtimeEventType } from '@/lib/realtime';
66
// Mark this route as dynamic to prevent static generation
77
export const dynamic = 'force-dynamic';
88

9-
// GET /api/projects/[name]/devlogs/[id] - Get specific devlog entry
9+
// GET /api/projects/[name]/devlog/[id] - Get specific devlog entry
1010
export async function GET(
1111
request: NextRequest,
1212
{ params }: { params: { name: string; devlogId: string } },
@@ -55,7 +55,7 @@ export async function GET(
5555
}
5656
}
5757

58-
// PUT /api/projects/[name]/devlogs/[id] - Update devlog entry
58+
// PUT /api/projects/[name]/devlog/[id] - Update devlog entry
5959
export async function PUT(
6060
request: NextRequest,
6161
{ params }: { params: { name: string; devlogId: string } },
@@ -106,7 +106,7 @@ export async function PUT(
106106
}
107107
}
108108

109-
// DELETE /api/projects/[name]/devlogs/[id] - Delete devlog entry
109+
// DELETE /api/projects/[name]/devlog/[id] - Delete devlog entry
110110
export async function DELETE(
111111
request: NextRequest,
112112
{ params }: { params: { name: string; devlogId: string } },

packages/web/app/api/projects/[name]/devlogs/route.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { RealtimeEventType } from '@/lib/realtime';
1515
// Mark this route as dynamic to prevent static generation
1616
export const dynamic = 'force-dynamic';
1717

18-
// GET /api/projects/[name]/devlogs - List devlogs for a project
18+
// GET /api/projects/[name]/devlog - List devlog for a project
1919
export async function GET(request: NextRequest, { params }: { params: { name: string } }) {
2020
try {
2121
// Parse and validate project identifier
@@ -84,16 +84,16 @@ export async function GET(request: NextRequest, { params }: { params: { name: st
8484
if (result.pagination) {
8585
return createCollectionResponse(result.items, result.pagination);
8686
} else {
87-
// Transform devlogs and return as simple collection
87+
// Transform devlog and return as simple collection
8888
return createSimpleCollectionResponse(result.items);
8989
}
9090
} catch (error) {
91-
console.error('Error fetching devlogs:', error);
92-
return ApiErrors.internalError('Failed to fetch devlogs');
91+
console.error('Error fetching devlog:', error);
92+
return ApiErrors.internalError('Failed to fetch devlog');
9393
}
9494
}
9595

96-
// POST /api/projects/[name]/devlogs - Create new devlog entry
96+
// POST /api/projects/[name]/devlog - Create new devlog entry
9797
export async function POST(request: NextRequest, { params }: { params: { name: string } }) {
9898
try {
9999
// Parse and validate project identifier

packages/web/app/api/projects/[name]/devlogs/search/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ interface SearchResponse {
2828
};
2929
}
3030

31-
// GET /api/projects/[name]/devlogs/search - Enhanced search for devlogs
31+
// GET /api/projects/[name]/devlog/search - Enhanced search for devlog
3232
export async function GET(request: NextRequest, { params }: { params: { name: string } }) {
3333
try {
3434
// Parse and validate project name parameter

0 commit comments

Comments
 (0)