fix: keep large-folder Git refresh off UI thread#169
Conversation
Move workspace git status scans to a background worker, keep file tree rendering on cached status snapshots, and cap per-frame workspace polling so large folders do not monopolize repaint. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ 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 |
|
@starSumi very nice :) I will look into this and include it in the next release, currently on vacation, scheduled to mid or late August |
Summary
repo.statuses()on the UI thread.Details
The previous auto-refresh path could synchronously scan Git status from the app update path. On large repositories, especially with untracked files, that can make the window appear hung while the UI thread waits for status collection.
This change keeps status collection asynchronous and coalesced. Broad refreshes avoid recursive untracked-directory and ignored-file scans, while preserving untracked-directory semantics through parent status fallback and the existing single-file fallback path.
Symptom and environment
On Windows 11, opening a large Git-backed workspace from Ferrite could leave the window unresponsive during the initial workspace load. The local trace showed normal startup and first paints, then the hang appeared after the workspace was opened and automatic Git status refresh became eligible.
Requested review focus
Please review the async Git status boundary and the responsiveness tradeoff around broad ignored-file scanning. Ignored-file badges are no longer collected during the broad background scan; the goal is to keep the initial workspace UI responsive and avoid recursive ignored/untracked traversal on large folders.
Validation
cargo test --bin ferrite test_git_servicecargo test --bin ferrite status_for_pathcargo test --bin ferrite collect_all_filescargo test --bin ferrite test_filter_eventscargo build --releaseHuman testing
Tested on Windows 11 with the previously hanging large-folder workflow. The window stayed responsive while opening the folder, and Git status badges appeared after the UI was already usable.