monodevelop icon indicating copy to clipboard operation
monodevelop copied to clipboard

[GetToCode] Adds noshellEnabled/noshellVisible in CommandCodon to disable items based in WelcomeScreen

Open netonjm opened this issue 6 years ago • 4 comments

This PR adds a new feature in CommandCodon to enable/disable menu items

Now we can add in the addon manigest

  • noshellEnabled = "[true|false]"
  • noshellVisible = "[true|false]"

and we'll disable/hidden menus when there is no shell (this is the WelcomeScreen mode)

This properties could be added to:

  • Command (single or an array of items)
  • Category

And in case of group the value will affect it's children.

Fixes VSTS #935559 - [Shell] Some menus should be disabled in only GTC mode

Disabling layout Command group

Screenshot 2019-09-03 at 17 02 33

Disabling Debug category group

Screenshot 2019-09-03 at 17 01 23

netonjm avatar Jul 19 '19 17:07 netonjm

Why do we need this?

Therzok avatar Jul 19 '19 22:07 Therzok

What commands should we actually have in GTC mode? Maybe we should actually conditionally add commands for when we only show GTC. As in, a whitelist, not a blacklist.

Therzok avatar Jul 19 '19 22:07 Therzok

I feel we should just declare a different extension point into which we put commands which are visible without the Ide being there.

Therzok avatar Jul 19 '19 22:07 Therzok

I agree with @Therzok, but I don't think that we need an additional extension point for this (would be cumbersome to maintain). A better approach would be a simple opt-in in CommandCodon. Something like:

  • noshellEnabled = "[true|false]"
  • noshellVisible = "[true|false]"

or we use one prop like noshell = "disabled|disabled-visible"

could look like this to opt in to show in disabled state:

<Command     id = "MonoDevelop.Debugger.DebugCommands.DebugApplication"
 noshellEnabled = "false"
 noshellVisible = "true"
           [...]
/>

Also I wouldn't delegate the logic to the command handlers, but do it all in CommandManager. If a command has no opt-in, it wouldn't run the update handler at all but just set the appropriate values in the CommandInfo (so they get picked up correctly by the menu logic).

sevoku avatar Jul 22 '19 09:07 sevoku