As a consequence, a menu item's enablement state is set only once, when the menu item is added. Given that the command decides whether it can be executed, the enablement state should be updated every time a menu item is displayed. In Spec, that is achieved by passing a block to #enabled:.
Context : Pharo 12 and Pharo 13.
I think CmUICommandDisplayStrategy>>#display:in:do: is implemented incorrectly. Now it is:
As a consequence, a menu item's enablement state is set only once, when the menu item is added. Given that the command decides whether it can be executed, the enablement state should be updated every time a menu item is displayed. In Spec, that is achieved by passing a block to
#enabled:
.So I think the method should be implemented as:
This issue is related to https://github.com/pharo-spec/Spec/issues/1559 and https://github.com/pharo-spec/Spec/issues/1561, which report other enablement issues.