Allow removing notification sources from the DnD picker#313708
Open
maruthang wants to merge 1 commit intomicrosoft:mainfrom
Open
Allow removing notification sources from the DnD picker#313708maruthang wants to merge 1 commit intomicrosoft:mainfrom
maruthang wants to merge 1 commit intomicrosoft:mainfrom
Conversation
Adds a per-row trash button to the "Notifications: Toggle Do Not Disturb Mode By Source..." quick-pick. Triggering the button calls the existing INotificationService.removeFilter API and rebuilds the picker items minus the removed source while preserving the remaining selection. The same picker is also reached from the status-bar "Configure Do Not Disturb..." entry. Fixes microsoft#248913
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
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.
Summary
Adds a per-row "Remove Source" trash button to the "Notifications: Toggle Do Not Disturb Mode By Source..." quick-pick (and the status-bar "Configure Do Not Disturb..." entry, which opens the same picker), implementing the action @bpasero suggested in #248913.
Fixes #248913
Implementation
removeSourceButton: IQuickInputButtonis added to every quick-pick item, usingCodicon.removeClose, a localized "Remove Source" tooltip, andalwaysVisible: true.picker.onDidTriggerItemButtonhandler:INotificationService.removeFilter(item.id)API (no new service surface —removeFilteris already wired through to storage and is what extension-uninstall flows already use internally).picker.itemsminus the removed entry.onDidAccepthandler is unchanged. Because it iteratespicker.items, the removed source is not re-added on accept — it simply disappears from the list. This matches the user's expectation that "Remove" means "forget this source entirely."Test plan
notificationService.test.tscover theremoveFilter/getFiltersAPI the picker depends on:getFiltersreturns sources registered viasetFilter.removeFilterdrops a tracked source and reverts its per-source filter to the default.removeFilteris a no-op for unknown ids.NotificationServiceinstances backed by the same storage.