Stop flickering explorer markers and review panel on navigation - #114
Merged
Conversation
Expanding a directory re-triggers a git-status refresh on every navigation step (not just the first load), and the refresh synchronously cleared the cache before the async result landed. The file explorer's status markers and the chat's review-files panel both read that same cache, so both blanked out for a frame on every directory expand. Keep the previous status data visible until the new refresh resolves, and only show the full "Loading changes" screen when there's no cached data yet.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
FileExplorer::expand_selected) re-triggers a git-status refresh on every navigation step, not just the first load.GitStatusCache::start_refreshsynchronously cleared the status map before the asyncgit statusresult came back, so for at least one render frame the cache was empty.render_diff_workspace) read the same sharedGitStatusCache, so both would blank out / flip to "Loading changes…" on every directory expand while browsing.statusmap intact until the new refresh resolves (drop the synchronous.clear()), and only show the full "Loading changes" screen when there's no cached data yet (gs.loading && gs.status.is_empty()), not on every background refresh.Test plan
cargo test -p forge-tui --lib— 670 passed, 0 failedcargo fmt --check— clean