Skip to content

Stabilize git diff sidebar status while switching workspaces#83

Merged
Dimillian merged 1 commit intomainfrom
codex/fix-flashing-title-in-git-diff-sidebar
Jan 18, 2026
Merged

Stabilize git diff sidebar status while switching workspaces#83
Dimillian merged 1 commit intomainfrom
codex/fix-flashing-title-in-git-diff-sidebar

Conversation

@Dimillian
Copy link
Owner

Motivation

  • The diff sidebar title/subtitle and file summary sometimes flicker when the periodic git status/diff refreshes or when switching workspaces because the hooks cleared state while loading new data.
  • The change aims to keep the last-known status/diffs visible per workspace during refreshes to avoid UI flashing.

Description

  • Add a per-workspace cache in useGitStatus to store the last successful or error GitStatusState and reuse it when switching to that workspace instead of clearing to an empty state, and persist cached entries on both success and failure.
  • Add a per-workspace cache in useGitDiffs to store the last fetched GitFileDiff[] and reuse it on workspace switches to keep the diff list stable while new diffs load.
  • Updated files: src/features/git/hooks/useGitStatus.ts and src/features/git/hooks/useGitDiffs.ts with minimal logic to set and read the caches and to avoid clearing state immediately on workspace change.

Testing

  • Ran npm run lint, which produced a TypeScript tooling warning from @typescript-eslint about an unsupported TypeScript version but completed the lint step.
  • Ran npm run typecheck (tsc --noEmit) and it succeeded with no type errors.

Codex Task

@Dimillian
Copy link
Owner Author

@codex review

@chatgpt-codex-connector
Copy link

Codex Review: Didn't find any major issues. Swish!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@Dimillian Dimillian merged commit c74749b into main Jan 18, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant