confluentinc / vscode

Confluent for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=confluentinc.vscode-confluent
Apache License 2.0
13 stars 3 forks source link

Make message viewer available via command palette #219

Closed alexeyraspopov closed 1 month ago

alexeyraspopov commented 1 month ago

For a while now the message viewer was only available via tree item action, mainly because it was bound to the context of a topic entity. In the spirit of vscode-like editors, any kind of repetitive work should be possible to be done via keyboard. Enabling message viewer via command palette means the user doesn't need to get out of their current context, look for the extension in the sidebar or wherever they left topics panel at. In this PR I add a condition to the consume command that uses quick picks for cluster/topic in case if topic entity is not present (which happens if command is used via the command palette, instead of a tree item action).

If a cluster doesn't have any topics, an info message appears on the screen. I'm not quite sure yet what to do if the command is used by unauthorized user.

EDIT: this part should cover unauthorized case https://github.com/confluentinc/vscode/blob/8548f963f715071c81c502418c2da1e6c828e33d/src/quickpicks/kafkaClusters.ts#L60

https://github.com/user-attachments/assets/7b706088-11db-4a73-ba45-5c07746fa455

Closes #168

rohitsanj commented 1 month ago

/sem-approve

rohitsanj commented 1 month ago

/sem-approve