Skip to content

fix(web): animate refresh icons while checking - #9561

Open
StiensWout wants to merge 2 commits into
pingdotgg:mainfrom
StiensWout:t3code/fix-checking-refresh-spinners
Open

fix(web): animate refresh icons while checking#9561
StiensWout wants to merge 2 commits into
pingdotgg:mainfrom
StiensWout:t3code/fix-checking-refresh-spinners

Conversation

@StiensWout

@StiensWout StiensWout commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Refresh controls changed their labels or disabled state while checking, but their refresh icons stayed static. That made active provider, pull-request, and usage checks look stuck.

This ties each icon's spin animation to the control's existing busy state. Usage limits now track the refresh command until it settles, and usage queries derive activity across every connected environment.

Before

Static refresh icon while checking

After

https://pub-b182a4071edc4521829926b34990540b.r2.dev/files/0d81d599-13ce-44d3-8f65-99a8c42b44ac/provider-refresh-after.mp4

Verification

  • pnpm exec vp test run apps/web/src/components/pullRequest/PullRequestListEmptyState.test.tsx apps/web/src/components/settings/ProviderSettingsPanel.environment.test.tsx apps/web/src/components/usage/UsagePage.test.tsx
  • pnpm exec vp fmt apps/web/src/components/pullRequest/PullRequestListEmptyState.tsx apps/web/src/components/settings/ProviderSettingsPanel.tsx apps/web/src/components/usage/UsagePage.tsx --check
  • pnpm exec vp lint apps/web/src/components/pullRequest/PullRequestListEmptyState.tsx apps/web/src/components/settings/ProviderSettingsPanel.tsx apps/web/src/components/usage/UsagePage.tsx --type-aware --type-check
  • Verified in the isolated web app that the provider refresh control becomes busy, receives animate-spin, and rotates while the request runs.

Built with GPT-5.6-Sol in T3 Code via Codex.


Note

Low Risk
Mostly UI feedback and a clearer usage refetch path; behavior change is disabling Usage refresh during in-flight requests and awaiting environment queries instead of fire-and-forget registry refresh.

Overview
Refresh actions already disabled buttons and changed labels, but refresh icons stayed static, so in-flight checks looked stuck. This PR applies animate-spin to RefreshCwIcon wherever an existing busy flag is true (pull request empty states, provider settings, usage top bar).

On Usage, refresh now tracks isRefreshing (with a ref guard against double-clicks), sets aria-busy / disabled on both desktop and mobile refresh buttons, and clears busy state when the underlying command or useUsage().refresh() promise settles. Limits mode wires that busy state to refreshProviders; usage mode always awaits refresh(nextWindow) after optionally rolling the time window forward.

useUsage’s refresh is now async and optionally accepts a window input. It awaits per-environment rate refresh plus executeAtomQuery(..., { refresh: true }) instead of registry-only refresh, so the Usage button’s spinner reflects work across all connected environments.

Reviewed by Cursor Bugbot for commit 86bb529. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Animate refresh icons across UsagePage, ProviderSettingsPanel, and PullRequestListEmptyState

  • Adds spinning icon animation to all three refresh controls so users see activity while a refresh is in progress.
  • Refactors useUsage so refresh returns a promise, accepts an optional usage window, and forces a usage-summary query per environment after its provider-rate refresh completes.
  • UsagePage adds a local busy state and a ref-based guard to prevent overlapping refresh activations; both desktop and mobile refresh buttons disable and spin until the promise settles.
  • Behavioral Change: UsageView.refresh changes from a fire-and-forget () => void to an async (window?) => Promise<void>; callers in UsagePage.tsx are updated but any out-of-tree callers of the old signature will break.

Macroscope summarized 86bb529.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Sep 4, 2026
Comment thread apps/web/src/components/usage/UsagePage.tsx Outdated
@macroscopeapp

macroscopeapp Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Not approved

Macroscope's review found this PR not approvable — The PR is mostly a localized refresh-feedback fix, but the Usage path now waits on per-environment queries that can remain pending during reconnect, backoff, or no-session states. This can leave refresh controls spinning and disabled indefinitely, warranting targeted human review.

You can add or adjust custom eligibility rules. Learn more.

@github-actions github-actions Bot added size:M 30-99 changed lines (additions + deletions). and removed size:S 10-29 changed lines (additions + deletions). labels Sep 4, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 86bb529. Configure here.

);
},
[environments, windowKey],
);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Refresh hangs on reconnecting environments

Medium Severity

refresh now awaits executeAtomQuery on every environment's usageSummary. Those queries yield Effect.never while an environment is connecting, in backoff, or connected without a session, so the promise never settles. isRefreshing then stays true and the refresh control remains disabled and spinning until that environment leaves recovery.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 86bb529. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant