Improve Claude UI#1299
Conversation
|
Caution Review failedThe pull request is closed. 📝 WalkthroughWalkthroughThis PR adds Claude session integration to the desktop application, introducing backend utilities to scan and read Claude session files, exposing these through tRPC router procedures, and integrating session history management into the chat UI with infinite scrolling session selection. Changes
Sequence Diagram(s)sequenceDiagram
participant UI as ChatInterface/SessionSelector
participant Hook as useClaudeCodeHistory Hook
participant tRPC as tRPC Router (ai-chat)
participant Scanner as Claude Session Scanner
participant Reader as Claude Session Reader
participant FS as Filesystem (~/.claude/projects)
UI->>Hook: Mount with sessionId
Hook->>tRPC: Query getClaudeSessionMessages(sessionId)
tRPC->>Scanner: findSessionFilePath(sessionId)
Scanner->>FS: Scan index in ~/.claude/projects
FS-->>Scanner: Session file paths
Scanner-->>tRPC: File path for sessionId
tRPC->>Reader: readClaudeSessionMessages(sessionId)
Reader->>FS: Read JSONL session file
FS-->>Reader: File content (JSON lines)
Reader-->>tRPC: Parsed messages array
tRPC-->>Hook: Messages data
Hook->>Hook: Combine with live messages
Hook->>Hook: Extract title & auto-rename
Hook-->>UI: allMessages + isClaudeCodeSession
UI->>tRPC: scanClaudeSessions(cursor, limit)
tRPC->>Scanner: Scan sessions with pagination
Scanner->>FS: Index and metadata read
FS-->>Scanner: Session files
Scanner-->>tRPC: ClaudeSessionPage (sessions + nextCursor)
tRPC-->>UI: Session list
UI->>UI: Render with time-based grouping
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🧹 Preview Cleanup CompleteThe following preview resources have been cleaned up:
Thank you for your contribution! 🎉 |
Description
Related Issues
Type of Change
Testing
Screenshots (if applicable)
Additional Notes
Summary by CodeRabbit