kubeshop / vscode-monokle

An extension for Visual Studio Code to validate your Kubernetes configuration
https://marketplace.visualstudio.com/items?itemName=kubeshop.monokle
MIT License
6 stars 0 forks source link

Hide Monokle when workspace is not Kubernetes related #41

Closed WitoDelnat closed 12 months ago

WitoDelnat commented 1 year ago

Currently, when I open a directory that does not relate to Kubernetes and is not a git repo then I get a subtle error "Monokle: Needs attention" in the status bar at the bottom of VSC.

In my opinion we should completely hide Monokle when the plugin is irrelevant to the end-user. Great plugins are transparent and you don't notice they are there. The only reason for me to get rid of this indicator is to uninstall the plugin - you don't want to give people those kind of idea!

WitoDelnat commented 1 year ago

I've been using the extension for a while and believe we should even go a step further as the red cross with "needs attention" and thinking icon when loading are still to present.

All of this will lead to a much more sober experience which I think will be beneficial. Monokle should be there when you need it and otherwise get out of your way; this is how all good extensions behave.


edit: installing Monokle will also cause both Monokle & Sarif to appear in the bar which both do the same when you click it (i.e. open the validation pane). An alternative is to not show Monokle by default and Monokle only appears when something is off?

f1ames commented 12 months ago

Looks like custom icons are not supported in status bar (see https://github.com/microsoft/vscode/issues/72244 and https://stackoverflow.com/a/70544972, well, as not part of custom theme).

So either we go with one from default set or just a text. Some proposals:

  1. Large circle image

  2. Small circle image

  3. Monokle text image

  4. M letter image

Well, apart from dedicated icon, it's just UTF text so we can use any UTF character there (that's how emojis works now), but I haven't found anything suitable TBH. IMHO Monokle seems to do the job for me, it's simple, doesn't take too much space and you don't have to wonder where is the icon from.

And it seems to match to official UX Guidelines:

image


edit: installing Monokle will also cause both Monokle & Sarif to appear in the bar which both do the same when you click it (i.e. open the validation pane). An alternative is to not show Monokle by default and Monokle only appears when something is off?

On this one, the difference is that both icons when clicked have the same action but Monokle one bring additional information when hovered.

f1ames commented 12 months ago

Currently, when I open a directory that does not relate to Kubernetes and is not a git repo then I get a subtle error "Monokle: Needs attention" in the status bar at the bottom of VSC.

In my opinion we should completely hide Monokle when the plugin is irrelevant to the end-user. Great plugins are transparent and you don't notice they are there. The only reason for me to get rid of this indicator is to uninstall the plugin - you don't want to give people those kind of idea!

For this I think more static status bar icon does the job, but we also have separate related issue which can improve this further - #38. So even if active folder will not be a git repo it can still be validated with local/default policy.

And going even further, if we want to completely hide Monokle icon, we could detect if project contains any K8s resources. If not just hide all extension related UI. But then it will require a bit smarter approach to restore it when such resources are added. so it's not a quick fix.

WitoDelnat commented 12 months ago

We still need an build-in icon for when Monokle needs attention right? What about the following, it's clear this is Monokle and the small-circle is simply there to prevent layout shifts while it has some recognition to our logo.

const icon = needsAttention ? "warning-icon" : "small-circle"
const label = `${icon} Monokle`

I also had a look at Prettier which might be a decent approach? I like the double checkmark wrt validation

https://github.com/kubeshop/vscode-monokle/assets/7761005/e3a2185a-aea6-41f6-8106-d0df9a14d192


Wrt hiding, if its not a quick-fix then let's split that for a separate task and tackle it later. This more sober experience will make that less urgent.

f1ames commented 12 months ago

Ok, yes, let's have the icon so we can show invalid status. I went with first proposal = circle + warning icons.

As for hiding, I extracted it to separate issue as it is more broader than just hiding an icon, see #44.