Change:
Type: <bBug</bAn extension I maintain creates multiple SourceControl objects and implements a command to refresh them all in parallel. When an object has completed its refresh (adding/removing/updating its SourceControlResourceGroups) it updates its count property. When this happens for the first object the progress (clock) badge on the SCM icon in the activity bar gets replaced by that count, thus giving the user the impression that the refresh has completed if they have switched to a different activity and so don't see the ongoing progress bar animation across the top of the SOURCE CONTROL pane. When ProgressService adds the clock badge using ActivityService it specifies , which sounds like it is supposed to give this badge priority over a count badge: But it doesn't seem to have that effect. I will try to prepare a sample extension that demonstrates the issue. VS Code version: Code - Insiders 1.84.0-insider (, 2023-10-26T21:24:03.029Z) OS version: Windows_NT x64 10.0. Modes: <!-- generated by issue reporter --
Adding as he seems to have recently changed the referenced line.
Would be waiting for the sample extension. Thanks in advance for doing so. Can you also please check the behaviour in older version of VS Code?
For the repro: the source-control-sample folder. and run. EDH window, close any already-open folder/workspace, and optionally create an empty profile to rule out other extensions and odd settings. palette run . Accept the default (demo), then in the local folder dialog create/choose a scratch folder, and trust it if prompted. to SCM view. and watch the SCM side bar and activity bar icon badge: ! Notice how the first SourceControl completes its withProgress refresh after 4 seconds, updates the input box placeholder to report this, and sets its count property. At this point the second SourceControl is half way through its 8-second refresh, and the progress bar animation continues, but the clock badge on the activity bar icon has been displaced by the count badge (4) of the first one. Behaviour on 1.83.1 is correct: !
do you now have the info you need? Seeing how this is apparently a 1.84 regression, will it be treated as a Candidate for the milestone?
Thanks a lot for info and repro. This is indeed a regression and caused by the wrong prioritising of the badges. Tagged this as candidate.
/verified
Adding verified label as verified it

Discussion:
import { GLOBAL_ACTIVITY_ID, ACCOUNTS_ACTIVITY_ID } from 'vs/workbench/common/activity'; import { Emitter, Event } from 'vs/base/common/event'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; <ins> import { isUndefined } from 'vs/base/common/types'; </ins> class ViewContainerActivityByView extends Disposable {

this.viewContainerActivities.set(viewContainerId, activities); } for (let i = 0; i <= activities.length; i++) { <del> if (i === activities.length) { </del> <ins> if (i === activities.length || isUndefined(activity.priority)) { </ins> activities.push(activity); break; <del> } else if (activities[i].priority ?? 0 <= (activity.priority ?? 0)) { </del> <ins> } else if (isUndefined(activities[i].priority) || activities[i].priority! <= activity.priority) { </ins> activities.splice(i, 0, activity); break; }