Skip to content

Conversation

@tikazyq
Copy link
Collaborator

@tikazyq tikazyq commented Aug 6, 2025

No description provided.

Marvin Zhang and others added 17 commits August 5, 2025 10:58
- Changed CopilotParser to extend BaseParser instead of AIAssistantParser.
- Updated message extraction logic to utilize ChatMessage and ChatMessageData types.
- Introduced a new method parseResponseItem to handle various response types from the assistant.
- Removed deprecated ChatHubService and ChatImportService implementations.
- Cleaned up CLI commands by removing chat import functionalities and related utilities.
- Updated ChatSessionEntity to remove unused fields and methods related to tags and linked devlogs.
- Removed Logger interface and ConsoleLogger implementation from AI parsers.
- Enhanced ChatMessageMetadata with detailed message types and additional fields.
- Introduced ChatTurn model to encapsulate request-response cycles in chat sessions.
- Updated ChatSession to include new metadata and improved structure.
- Renamed NoteCategory to DevlogNoteCategory for clarity and consistency.
- Updated all references to NoteCategory across the codebase to DevlogNoteCategory.
- Refactored MCPAdapter methods to use new naming conventions for devlog operations.
- Adjusted schemas and API endpoints to align with new note handling structure.
- Improved note category handling in the frontend components and utilities.
Copilot AI review requested due to automatic review settings August 6, 2025 06:03
@vercel
Copy link

vercel bot commented Aug 6, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
devlog-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 6, 2025 6:03am

@tikazyq tikazyq merged commit 8c58f03 into main Aug 6, 2025
8 of 9 checks passed
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements major architectural refactoring to improve realtime functionality, centralize project management, and enhance type safety across the devlog system. The changes introduce proper debouncing for project fetching, implement project CRUD operations with settings UI, and refactor the realtime system for better server-client coordination.

Key changes:

  • Project Management Enhancement: Adds project settings page with update/delete operations, debounced project fetching, and proper navigation integration
  • Realtime System Refactoring: Replaces direct store usage with custom hooks, implements server-side provider selection, and adds proper configuration API
  • Type System Updates: Renames NoteCategory to DevlogNoteCategory throughout codebase for consistency

Reviewed Changes

Copilot reviewed 91 out of 93 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
packages/web/app/stores/project-store.ts Adds debounced project fetching and CRUD operations (updateProject, deleteProject)
packages/web/app/projects/[id]/settings/ New project settings page with form handling and delete confirmation
packages/web/app/lib/realtime/ Major refactoring of realtime system with server config API and provider selection
packages/web/app/hooks/use-realtime.ts Replaces direct store usage with proper event subscription hooks
packages/core/src/types/core.ts Renames NoteCategory to DevlogNoteCategory for consistency
packages/mcp/src/ Updates tool schemas and handlers to match core type changes
Comments suppressed due to low confidence (1)

packages/web/app/lib/realtime/realtime-service.ts:109

  • [nitpick] Console.log statement inside a try block could create noise in production logs. Consider using a proper logging system or removing debug logs for production.
      return;

},

fetchCurrentProject: async () => {
debouncedFetch();
Copy link

Copilot AI Aug 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The debounced fetch function is called without await, which could lead to race conditions or unhandled promise rejections. Consider awaiting the call or handling errors explicitly.

Suggested change
debouncedFetch();
await debouncedFetch();

Copilot uses AI. Check for mistakes.

useEffect(() => {
setCurrentProjectId(projectId);
}, [projectId]);
Copy link

Copilot AI Aug 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The setCurrentProjectId call in useEffect doesn't include setCurrentProjectId in the dependency array, which could cause issues if the function reference changes. Add it to the dependency array.

Suggested change
}, [projectId]);
}, [projectId, setCurrentProjectId]);

Copilot uses AI. Check for mistakes.
Comment on lines +57 to +58
error,
);
Copy link

Copilot AI Aug 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fallback to client detection doesn't preserve the original server error information, making debugging difficult. Consider logging the server error before falling back.

Suggested change
error,
);
error,
error && error.stack ? error.stack : '',
);
// Note: The error is logged but not propagated; fallback config is returned.

Copilot uses AI. Check for mistakes.

fetchCurrentDevlog();
fetchCurrentDevlogNotes();
try {
Copy link

Copilot AI Aug 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The try-catch block around fetchCurrentDevlog() and fetchCurrentDevlogNotes() only logs warnings but doesn't handle the error properly. Consider showing user feedback or retrying the operation.

Copilot uses AI. Check for mistakes.
Comment on lines +47 to +48
await fetchProjects();
toast.success('Project created successfully');
Copy link

Copilot AI Aug 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The async callback in subscribe could lead to unhandled promise rejections if fetchProjects() fails. Consider wrapping in try-catch or using a non-async callback.

Suggested change
await fetchProjects();
toast.success('Project created successfully');
try {
await fetchProjects();
toast.success('Project created successfully');
} catch (error) {
console.error('Error fetching projects after creation:', error);
toast.error('Failed to refresh project list');
}

Copilot uses AI. Check for mistakes.
}

// Cache for server configuration to avoid repeated API calls
let serverConfigCache: RealtimeConfig | null = null;
Copy link

Copilot AI Aug 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Module-level caching without proper invalidation could lead to stale configuration being used across the application lifecycle. Consider implementing cache invalidation or using a more robust caching strategy.

Copilot uses AI. Check for mistakes.
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.

2 participants