-
Notifications
You must be signed in to change notification settings - Fork 32
🤖 refactor: consolidate refresh logic into RefreshController #1296
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ammar-agent
wants to merge
9
commits into
main
Choose a base branch
from
git-debounce-5w4e
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+775
−265
Conversation
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
ebab3e7 to
2ec7a60
Compare
2ec7a60 to
c69368c
Compare
Active workspace now uses 1s debounce for git status refresh after file-modifying tools complete, while background workspaces keep 3s. This makes the visible git indicators feel more responsive without adding load from background workspace refreshes.
f464017 to
167e1ce
Compare
Adds debugging visibility to ReviewPanel's refresh button tooltip: - Shows how long ago the last refresh occurred (e.g., '5s ago', '2m ago') - Shows what triggered the refresh (manual click, tool completion, focus, etc.) - Persisted per-workspace so it survives workspace switches RefreshController now uses rate-limiting instead of debouncing: - First event starts timer; subsequent events don't reset it - Guarantees refresh fires within N seconds of first trigger - Events during in-flight refresh queue a follow-up after completion - Better UX during rapid tool calls (refreshes periodically vs never) Fixes controller recreation bug: onRefresh callback was causing useMemo to recreate the controller on every render, disposing active timers. Now uses refs for callbacks to maintain stable dependencies. Debug logging improvements: - RefreshController accepts debugLabel for human-readable logs - WorkspaceStore.getWorkspaceName() helper for log-friendly workspace names - Logs now show workspace names instead of opaque IDs Adds tests for file-modifying tool subscription mechanism.
167e1ce to
f605635
Compare
This reverts commit 43e6652.
Prevents refresh loops by construction - even if other guards fail, executeRefresh() refuses to run if less than 500ms since last start.
- Enforce a 500ms minimum interval between refresh starts without dropping requests - Manual refresh always bypasses pause/hidden by construction - Remove always-on debug log spam from review refresh hook - Update RefreshController tests for new behavior
- Manual refresh now bumps refreshTrigger immediately (no blocking fetch) - Move origin/* git fetch into diff/tree load with GIT_TERMINAL_PROMPT=0 - Share origin fetch across file tree + diff via a keyed promise ref
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.
Consolidates refresh orchestration logic into
RefreshController:Changes:
useReviewRefreshControllernow delegates debouncing, visibility/focus handling, and in-flight guards toRefreshController(−153 LoC)isPausedcallback andschedulePriority()toRefreshController(+43 LoC)GitStatusStoreusesschedulePriority()instead of a separate timer for active workspace (−11 LoC)requestImmediate()bypassesisPausedcheck (regression from rewrite)Net result: −121 LoC (before ReviewPanel fix) with unified refresh behavior across git status and review panel.
Active workspace priority: Still gets 1s debounce (vs 3s for background workspaces).
Generated with
mux• Model:anthropic:claude-opus-4-5• Thinking:high