You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While working on napari/napari#5483, @DragaDoncila, @lucyleeow and I got a bit confused about the usage of MenuItem.when vs CommandRule.enablement. I think that's because "when" really needs a "when what": it could just as easily mean "when is it enabled", or "when is it highlighted". In fact it means when is it visible. So we are thinking it may be nice to rename it to visible, visibility, when_visible, ... or similar.
Any thoughts @tlambert03? Obviously the deprecation would be annoying but even medium term I think it would make app-model usage more intuitive.
The text was updated successfully, but these errors were encountered:
I don't know, pretty much everything about menu rules is about visibility, so to me it feels a bit repetitive. There is nothing in menus that has to do with enablement of the command that the menu item represents... since that is a command related feature. That is, menus determine where to show a command (just like toolbars do), but whether it's ok to invoke the command (enablement) is always a property of the command (and not a property of where you've chosen to place that command).
I see that you were confused, so that's worth something for sure... but once you think of everything about menus as "where and when to put a view of a command" and everything about commands to be "what and whether it's enabled" (but not where they are placed), do you still think it's worth the deprecation process?
You guys look at it more than I do, so if it's a thought you or other devs have had more than once, I'm happy to change it for you
Thanks, good writeup. We can stew on this a bit longer, it is potentially just a case of me getting to know my own codebase. 😅 I still see value in making it more verbose (other people will also be newbies in our codebase, for all time), but let's play with it more before taking the leap.
Also @DragaDoncila and @lucyleeow want me to clarify that I besmirched their good name because only I was confused about what "when" did, they were just confused about when it is appropriate to use which of the two, from a UX standpoint. 😂
Description
While working on napari/napari#5483, @DragaDoncila, @lucyleeow and I got a bit confused about the usage of MenuItem.when vs CommandRule.enablement. I think that's because "when" really needs a "when what": it could just as easily mean "when is it enabled", or "when is it highlighted". In fact it means when is it visible. So we are thinking it may be nice to rename it to visible, visibility, when_visible, ... or similar.
Any thoughts @tlambert03? Obviously the deprecation would be annoying but even medium term I think it would make app-model usage more intuitive.
The text was updated successfully, but these errors were encountered: