Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow "inline" menu contributions to quick pick items #88716

Closed
eamodio opened this issue Jan 15, 2020 · 9 comments · Fixed by #130519
Closed

Allow "inline" menu contributions to quick pick items #88716

eamodio opened this issue Jan 15, 2020 · 9 comments · Fixed by #130519
Assignees
Labels
api-finalization feature-request Request for new features or functionality on-testplan quick-pick Quick-pick widget issues
Milestone

Comments

@eamodio
Copy link
Contributor

eamodio commented Jan 15, 2020

Similar to tree items, it would be great to be able to contribute commands to quick pick items

It is possible internally -- see:
image

Example use-case:
I would like to remove that button on top (since it is dependent on selection) and instead have it available on each stash entry. There are many other quickpick lists in GitLens where I would like to do a similar thing.

image

@chrmarti chrmarti added feature-request Request for new features or functionality quick-pick Quick-pick widget issues labels Jan 16, 2020
@vscodebot vscodebot bot added this to the Backlog Candidates milestone Jan 16, 2020
@vscodebot
Copy link

vscodebot bot commented Jan 16, 2020

This feature request is now a candidate for our backlog. The community has 60 days to upvote the issue. If it receives 20 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

@vscodebot
Copy link

vscodebot bot commented Mar 6, 2020

This feature request has not yet received the 20 community upvotes it takes to make to our backlog. 10 days to go. To learn more about how we handle feature requests, please see our documentation.

Happy Coding

@vscodebot
Copy link

vscodebot bot commented Mar 16, 2020

🙁 In the last 60 days, this feature request has received less than 20 community upvotes and we closed it. Still a big Thank You to you for taking the time to create this issue! To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

@TylerLeonhardt
Copy link
Member

TylerLeonhardt commented Aug 9, 2021

API proposal (is basically just exposing the existing internal API):

	interface QuickPickItem {

		label: string;

		// ...

		/*
		NEW
		
		*/
		buttons?: QuickInputButton[];
	}
	export interface QuickPick<T extends QuickPickItem> extends QuickInput {

		/**
		 * Current value of the filter text.
		 */
		value: string;

		// ...

		/**
		 * Buttons for actions in the UI.
		 */
		buttons: readonly QuickInputButton[];

		/**
		 * An event signaling when a button was triggered.
		 */
		readonly onDidTriggerButton: Event<QuickInputButton>;

		/**
		 * NEW
		 */
		readonly onDidTriggerItemButton: Event<QuickPickItemButtonEvent<T>>;
		// ...
	}

New type:

interface QuickPickItemButtonEvent<T extends QuickPickItem> {
	button: QuickInputButton;
	item: T;
}

@alefragnani
Copy link

That’s great to see this feature request being reopened and moving to API proposal stage. I have opened a similar request last year (#96147), but just like this one, was closed due to not enough upvotes.

Similar to this request, but on a keyboard approach, maybe microsoft/vscode-remote-repositories-github#2 could also take advantage if you expose Alt Modifiers, as requested in #18064. I know the Alt modifier is a not so powerful idea, but at least for those in New Window commands, it would follow VS Code behavior.

Looking forward for testing this API 😬

@TylerLeonhardt
Copy link
Member

Reopening for finalization

@TylerLeonhardt TylerLeonhardt added insiders-released Patch has been released in VS Code Insiders and removed api-proposal on-testplan insiders-released Patch has been released in VS Code Insiders labels Oct 4, 2021
@TylerLeonhardt
Copy link
Member

Finalized in f8ed49c

@nturinski
Copy link
Member

@isidorn Wow! You work really fast!

Just kidding, I didn't realize that this was already in. So I guess don't worry about this request 😄

@isidorn
Copy link
Contributor

isidorn commented Dec 15, 2021

@nturinski hahaha, as I said I am not aware of all the Quick Pick api features :)
Let us know how it goes.

@github-actions github-actions bot locked and limited conversation to collaborators Dec 25, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api-finalization feature-request Request for new features or functionality on-testplan quick-pick Quick-pick widget issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants
@eamodio @isidorn @TylerLeonhardt @alefragnani @nturinski @chrmarti and others