Skip to content

Consider renaming MenuItem.when to MenuItem.visible #225

@jni

Description

@jni
  • app-model version: 0.3.0
  • Python version: 3.11
  • Operating System: macOS

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions