fix(desktop): show content for new files in changes sidebar#794
Conversation
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe changes enhance file content handling by introducing a safer disk reading utility with size limits and improving git status tracking. The file-contents router now passes worktree context to staged version retrieval and uses fallback-to-disk logic when git index content is unavailable. Git status invocation gains the Changes
Sequence Diagram(s)sequenceDiagram
participant Router as TRPC Router
participant Git as Git Operations
participant Disk as File System
Router->>Git: getIndexContent(filePath)
Git-->>Router: index content (may be empty)
alt Index content exists
Router->>Router: Use git index content
else Index content empty
Router->>Disk: safeReadFromDisk(worktreePath, filePath)
Note over Disk: Check size limit, read with error handling
Disk-->>Router: File content or empty string
Router->>Router: Use disk fallback
end
Router-->>Router: Return versioned file content
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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 |
git status without -uall shows untracked directories as single entries (e.g., ".source/") instead of individual files. When the UI tries to read content for a directory path, it fails silently. Adding -uall shows all individual untracked files, allowing the changes sidebar to display and read each file correctly.
8396037 to
d76c19b
Compare
🧹 Preview Cleanup CompleteThe following preview resources have been cleaned up:
Thank you for your contribution! 🎉 |
git status without -uall shows untracked directories as single entries (e.g., ".source/") instead of individual files. When the UI tries to read content for a directory path, it fails silently. Adding -uall shows all individual untracked files, allowing the changes sidebar to display and read each file correctly.
Summary
git statuswithout-uallshows untracked directories as single entries (e.g.,.source/) instead of individual files inside. When the UI tries to read content for a directory path, it fails because directories can't be read as files.Adding
-uallflag shows all individual untracked files, allowing the changes sidebar to display and read each file correctly.Test plan
.source/file1.txt,.source/file2.txt)