Add remove button to Command Palette recently used commands#278276
Add remove button to Command Palette recently used commands#278276TylerLeonhardt merged 3 commits intomainfrom
Conversation
|
@copilot no need for keeping track of |
Simplified the code by removing |
Co-authored-by: jruales <[email protected]>
Co-authored-by: jruales <[email protected]>
Co-authored-by: jruales <[email protected]>
fc37940 to
fbd7dbe
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR adds a remove button ("X") to individual commands in the Command Palette's "recently used" section, allowing users to remove specific commands from their recent history. The implementation follows existing patterns from similar features like "Remove from Recently Opened" in the file picker.
Key changes:
- Added
CommandsHistory.remove()method to delete entries from the LRU cache - Modified
toCommandPick()to conditionally add a close button with localized tooltip for recently used items - Implemented trigger handler that removes items from history and returns
TriggerAction.REMOVE_ITEM
|
🤖 Copilot has tried out this change! Members of the team can view the recording here or download the Playwright trace here (run) |



Adds an "X" button to remove individual commands from the Command Palette's "recently used" section. Button appears only for recently used items, positioned rightmost after the existing "Configure Keybinding" button.
Changes
src/vs/platform/quickinput/browser/commandsQuickAccess.ts:CommandsHistory.remove()method to delete entries from LRU cache_getPicks()to useisInHistoryto identify recently used itemstoCommandPick()to:isRecentlyUsedparameter (passed asisInHistory)commandsHistory.remove()and returnsTriggerAction.REMOVE_ITEMButton uses
Codicon.closeicon, positioned as last button element (rightmost). Follows existing pattern from "Remove from Recently Opened" in file picker.Fixes #issue_number
<issue_title>Add "X" button to remove command from "recently used" list in Command Palette</issue_title>
><issue_description>The Command Palette in VS Code keeps track of the top 50 most recently used commands used, and shows them at the top of the filtered commands lists if they apply to the given search. There should be an X button next to each Command Palette item in the "recently used" quickpick section. The X button should show the tooltip "Remove from recently used", properly localized. This button should not appear for items in sections "other commands" nor "similar commands".</issue_description>
>
> ## Comments on the Issue (you are @copilot in this section)
>
>
>
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.