feat(testing): show running badge on Activity Bar while tests are running#292257
feat(testing): show running badge on Activity Bar while tests are running#292257connor4312 merged 3 commits intomicrosoft:mainfrom
Conversation
…ning Shows a spinning loading indicator badge on the Testing icon in the Activity Bar when tests are actively running. This provides visual feedback at a glance to know when test runs have started and completed. The badge priority is: 1. Running tests (spinning icon) - highest priority 2. Count badge (failed/passed/skipped) 3. Continuous testing indicator Fixes microsoft#201982 Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Pull request overview
Adds an Activity Bar badge to indicate when tests are actively running, so users can see test execution status without opening the Testing view.
Changes:
- Extends
ResultSummaryView.renderActivityBadgewith anisRunningparameter. - Shows a
spinningLoadingicon badge on the Testing Activity Bar icon while tests are running. - Preserves existing badge precedence for counts and continuous testing when not running.
| if (this.lastBadge instanceof IconBadge && this.lastBadge.icon === spinningLoading) { | ||
| return; | ||
| } | ||
|
|
||
| this.lastBadge = new IconBadge(spinningLoading, () => localize('testingRunningBadge', 'Tests are running')); |
There was a problem hiding this comment.
The early-return cache (return when lastBadge matches) can prevent re-applying the badge after badgeDisposable.clear() is called in the "no results" branch. For example, if results are cleared and then tests start again, lastBadge may still be spinningLoading (or the same NumberBadge value) and this will return without calling activityService.showViewActivity, leaving the Activity Bar without a badge. Consider including badgeDisposable.value (or a separate boolean) in the cache condition, or resetting lastBadge when clearing the badge, so the badge is always re-shown after a clear/dispose.
There was a problem hiding this comment.
Good catch! Fixed in 2e5b848 — I've added this.badgeDisposable.value to the early-return cache check in all three badge branches. This ensures that if badgeDisposable.clear() is called (e.g. in the no-results branch), the badge will be properly re-applied when tests start again, even if lastBadge still references the same badge type.
|
Ready for review. Shows spinning badge on Testing Activity Bar icon while tests are running. |
Include badgeDisposable.value in the early-return cache check so that badges are properly re-applied after results are cleared (e.g. when badgeDisposable.clear() is called in the no-results branch) and tests start again. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Pushed an empty commit to retrigger CI after a transient 403 rate-limit failure in Compile & Hygiene. Current workflow runs are in action_required state for this fork commit and need maintainer approval to proceed. |
Summary
Shows a spinning loading indicator badge on the Testing icon in the Activity Bar when tests are actively running.
Before
No visual indication on the Activity Bar icon when tests are running - you had to look at the Testing view to see if tests were in progress.
After
A spinning loading badge appears on the Testing Activity Bar icon while tests are running, providing immediate visual feedback.
Changes
isRunningparameter torenderActivityBadgefunctionspinningLoadingicon badge when tests are running (highest priority)Use Case
This is particularly useful when:
Fixes #201982
Made with Cursor