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

Create utility function wrapping createQuickPick and migrate off showQuickPick #1127

Open
shouples opened this issue Mar 5, 2025 · 5 comments
Assignees
Labels
extension development Topics specifically relating to the development process for the extension (or sidecar), not usage.

Comments

@shouples
Copy link
Contributor

shouples commented Mar 5, 2025

We mostly use showQuickPick, but there are instances where we may want extra behavior (secondary buttons, callbacks on selection/focus, etc) that aren't easily done with showQuickPick and are only supported with createQuickPick.

However, using createQuickPick requires using a lot of boilerplate for event listening and showing/hiding the quickpick element, which is a pain to copy/paste for different quickpick uses.

We should have a centralized utility/helper function around createQuickPick that effectively behaves the same as showQuickPick (for most of our use-cases) to create a quickpick, but with additional options for adding nav/item buttons (and their callbacks).

@shouples shouples added the extension development Topics specifically relating to the development process for the extension (or sidecar), not usage. label Mar 5, 2025
@shouples shouples self-assigned this Mar 5, 2025
@gnana997
Copy link
Contributor

Hi @shouples , I have created a draft pr with generic util createquickpick. I have created normal test cases. However I haven't tested it in the extension.
Can you please suggest me a scenario where I can switch the showquickpick to createquickpick to test it in the extension?

Thanks!

@shouples
Copy link
Contributor Author

Thanks for reaching out @gnana997! This is going to be a non-trivial refactor of our quickpicks across the board, which was why I self-assigned it. We'll effectively have to replace all existing showQuickPick uses with this new helper function that can handle some of the custom behavior like listening for events and providing quickpick buttons.

I'm happy to provide feedback on your branch, but I also understand if you want to pick another issue. 😄

@gnana997
Copy link
Contributor

Hi @shouples , Yeah I will work on this issue. However I would need some help on figuring what custom behaviour is expected so I can add the custom behaviour for the respective one.
Thanks!

@shouples
Copy link
Contributor Author

@gnana997 our "start/stop local resources" quickpick is probably the best example of how customizable this new helper function needs to be: https://github.com/confluentinc/vscode/blob/main/src/quickpicks/localResources.ts

@gnana997
Copy link
Contributor

Hi @shouples , Sure. I will work on this and will let you know for feedback.
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
extension development Topics specifically relating to the development process for the extension (or sidecar), not usage.
Projects
None yet
Development

No branches or pull requests

2 participants