-
Notifications
You must be signed in to change notification settings - Fork 1k
[GetToCode] Adds noshellEnabled/noshellVisible in CommandCodon to disable items based in WelcomeScreen #8240
base: main
Are you sure you want to change the base?
Conversation
Why do we need this? |
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. |
I feel we should just declare a different extension point into which we put commands which are visible without the Ide being there. |
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
or we use one prop like 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). |
Fixes VSTS #935559 - [Shell] Some menus should be disabled in only GTC mode
} | ||
|
||
internal void InternalUpdate (CommandArrayInfo info) | ||
{ | ||
Update (info); | ||
|
||
if (Ide.IdeApp.Workbench.Visible) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this query gtk? We update command handlers in bulk, might be a bit too much to query this 40 times for a menu open on the UI thread.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe we could cache this value in WelcomePageService
This PR adds a new feature in CommandCodon to enable/disable menu items
Now we can add in the addon manigest
and we'll disable/hidden menus when there is no shell (this is the WelcomeScreen mode)
This properties could be added to:
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
Disabling Debug category group