Skip to content

Stop flickering explorer markers and review panel on navigation - #114

Merged
github-actions[bot] merged 1 commit into
mainfrom
fix-git-status-flicker
Aug 1, 2026
Merged

Stop flickering explorer markers and review panel on navigation#114
github-actions[bot] merged 1 commit into
mainfrom
fix-git-status-flicker

Conversation

@mohitranka

Copy link
Copy Markdown
Contributor

Summary

  • Expanding a directory in the file explorer (FileExplorer::expand_selected) re-triggers a git-status refresh on every navigation step, not just the first load. GitStatusCache::start_refresh synchronously cleared the status map before the async git status result came back, so for at least one render frame the cache was empty.
  • Both the file explorer's M/A/D/?/! markers and the chat's "review files" panel (render_diff_workspace) read the same shared GitStatusCache, so both would blank out / flip to "Loading changes…" on every directory expand while browsing.
  • Fix: keep the previous status map 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 failed
  • cargo fmt --check — clean
  • Manually browse the file explorer in a repo with uncommitted changes and confirm markers / review panel no longer flash while expanding directories

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.
@github-actions
github-actions Bot enabled auto-merge (squash) August 1, 2026 11:08
@github-actions
github-actions Bot merged commit 7f2aedb into main Aug 1, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant