feat: add dev server log panel with real-time streaming

Add the ability to view dev server logs in a dedicated panel with:
- Real-time log streaming via WebSocket events
- ANSI color support using xterm.js
- Scrollback buffer (50KB) for log history on reconnect
- Output throttling to prevent UI flooding
- "View Logs" option in worktree dropdown menu

Server changes:
- Add scrollback buffer and event emission to DevServerService
- Add GET /api/worktree/dev-server-logs endpoint
- Add dev-server:started, dev-server:output, dev-server:stopped events

UI changes:
- Add reusable XtermLogViewer component
- Add DevServerLogsPanel dialog component
- Add useDevServerLogs hook for WebSocket subscription

Closes #462

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Shirone
2026-01-13 20:42:57 +01:00
parent 7ef525effa
commit 073f6d5793
17 changed files with 1277 additions and 30 deletions

View File

@@ -1760,6 +1760,22 @@ function createMockWorktreeAPI(): WorktreeAPI {
};
},
getDevServerLogs: async (worktreePath: string) => {
console.log('[Mock] Getting dev server logs:', { worktreePath });
return {
success: false,
error: 'No dev server running for this worktree',
};
},
onDevServerLogEvent: (callback) => {
console.log('[Mock] Subscribing to dev server log events');
// Return unsubscribe function
return () => {
console.log('[Mock] Unsubscribing from dev server log events');
};
},
getPRInfo: async (worktreePath: string, branchName: string) => {
console.log('[Mock] Getting PR info:', { worktreePath, branchName });
return {