Skip to content

Conversation

@ammar-agent
Copy link
Collaborator

Summary

Cache git diff and file tree results in a module-scope LRU cache so switching back to a previously visited workspace is near-instant.

Changes

  • Add single LRU cache (20MB limit, 20 entries max) for both diff hunks and file tree
  • Cache key derived from git command string (auto-updates when filters change)
  • Ctrl/Cmd+R bypasses cache and re-fetches
  • Simplified implementation: cache check happens in effect only (no sync init)

Testing

  • Switch workspace A → B → A: second visit to A should be instant
  • Ctrl/Cmd+R in review tab: should re-run git and update cache
  • make static-check passes

Generated with mux • Model: anthropic:claude-opus-4-5 • Thinking: high

- Remove redundant cache prefix from key (git command already distinguishes)
- Merge reviewPanelDiffCache and reviewPanelFileTreeCache into one
- Remove cache param from executeWorkspaceBashAndCache helper

---
_Generated with `mux` • Model: `anthropic:claude-opus-4-5` • Thinking: `high`_
Remove getInitialDiffState and readPersistedState usage. Cache hits in
the effect are fast enough (~16ms) that the brief loading state is not
user-visible. This removes duplicated cache-key logic and simplifies
the code.

---
_Generated with `mux` • Model: `anthropic:claude-opus-4-5` • Thinking: `high`_
@chatgpt-codex-connector
Copy link

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@ammario ammario merged commit c3e09d5 into main Dec 14, 2025
20 checks passed
@ammario ammario deleted the review-panel-1wzk branch December 14, 2025 19:58
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.

2 participants