Fish Trophy

chipx86 got a fish trophy!

Fish Trophy

Move action activation and state management into the action models.

Review Request #14641 — Created Oct. 18, 2025 and updated

Information

Review Board
release-7.1.x

Reviewers

Actions didn't have a standard way to perform an activation of the
action. The menu item action views had an activate() method tied to a
click handler, and subclasses implemented that, but this wasn't a
capability of ActionView. Quick Access actions happened to get the
same activation support by inheriting the same view for menu items, even
though buttons were used for display (creating a potential future
issue by themselves).

As part of the work to centralize actions, Action now has an
activate() method, which performs the operation backed by the action.
Although these are models, this method is allowed to contain or call
UI/view code.

ActionView has been updated to have an official activate() method
for compatibility, which defaults to calling model.activate().
Subclasses can always override this to put in logic between the parent
class's call and the model's activation logic.

ActionView has also been updated to rely more on Action for
visibility management (newly added for Quick Access actions in 7.1),
so all views for an action will behave the same way.

The existing action views have largely been replaced with models, which
in upcoming changes will be better utilized for both standard and Quick
Access actions. The old views have been removed, and probably aren't
worth retaining for any kind of API compatibility.

Unit tests pass.

Tested every single action, making sure states were updated,
visibility was reflected, and actions were activated correctly.

Summary ID
Move action activation and state management into the action models.
Actions didn't have a standard way to perform an activation of the action. The menu item action views had an `activate()` method tied to a click handler, and subclasses implemented that, but this wasn't a capability of `ActionView`. Quick Access actions happened to get the same activation support by inheriting the same view for menu items, even though buttons were used for display (creating a potential future issue by themselves). As part of the work to centralize actions, `Action` now has an `activate()` method, which performs the operation backed by the action. Although these are models, this method is allowed to contain or call UI/view code. `ActionView` has been updated to have an official `activate()` method for compatibility, which defaults to calling `model.activate()`. Subclasses can always override this to put in logic between the parent class's call and the model's activation logic. `ActionView` has also been updated to rely more on `Action` for visibility management (newly added for Quick Access actions in 7.1), so all views for an action will behave the same way. The existing action views have largely been replaced with models, which in upcoming changes will be better utilized for both standard and Quick Access actions. The old views have been removed, and probably aren't worth retaining for any kind of API compatibility.
5efce448c830245f3ebd41bb3e97fdeb20b7deae
Description From Last Updated

This is missing a docstring, and maybe its better to have the assert be something like "<classname> must implement getLabelForVisibility".

maubinmaubin

This can be removed.

maubinmaubin

This can be removed.

maubinmaubin

Seems like leftover debug code.

maubinmaubin

Shouldn't we be triggering closeError on the reviewRequestEditor instance instead of on the action? I know in the previous code …

maubinmaubin
chipx86
maubin
  1. 
      
  2. Show all issues

    This is missing a docstring, and maybe its better to have the assert be something like "<classname> must implement getLabelForVisibility".

  3. Show all issues

    This can be removed.

  4. Show all issues

    This can be removed.

  5. Show all issues

    Seems like leftover debug code.

  6. Show all issues

    Shouldn't we be triggering closeError on the reviewRequestEditor instance instead of on the action? I know in the previous code we were triggering this event on the action model, but I don't see how this gets bubbled up to ReviewRequestEditor which is the thing that actually listens to closeError events.

    1. That is a very good point. Let me address that in its own change, since that's going to take some testing. I don't want to bury that in here.

    2. Sounds good.

  7. 
      
chipx86
Review request changed
Change Summary:
  • Fixed the default label for the Archive/Mute actions.
  • Improved an assertion message.
  • Added a missing docstring.
  • Removed some old options doc strings.
  • Removed leftover debug code.
Commits:
Summary ID
Move action activation and state management into the action models.
Actions didn't have a standard way to perform an activation of the action. The menu item action views had an `activate()` method tied to a click handler, and subclasses implemented that, but this wasn't a capability of `ActionView`. Quick Access actions happened to get the same activation support by inheriting the same view for menu items, even though buttons were used for display (creating a potential future issue by themselves). As part of the work to centralize actions, `Action` now has an `activate()` method, which performs the operation backed by the action. Although these are models, this method is allowed to contain or call UI/view code. `ActionView` has been updated to have an official `activate()` method for compatibility, which defaults to calling `model.activate()`. Subclasses can always override this to put in logic between the parent class's call and the model's activation logic. `ActionView` has also been updated to rely more on `Action` for visibility management (newly added for Quick Access actions in 7.1), so all views for an action will behave the same way. The existing action views have largely been replaced with models, which in upcoming changes will be better utilized for both standard and Quick Access actions. The old views have been removed, and probably aren't worth retaining for any kind of API compatibility.
aaaacc3ebd53cf6c93e658d1fac7d43fa898c04d
Move action activation and state management into the action models.
Actions didn't have a standard way to perform an activation of the action. The menu item action views had an `activate()` method tied to a click handler, and subclasses implemented that, but this wasn't a capability of `ActionView`. Quick Access actions happened to get the same activation support by inheriting the same view for menu items, even though buttons were used for display (creating a potential future issue by themselves). As part of the work to centralize actions, `Action` now has an `activate()` method, which performs the operation backed by the action. Although these are models, this method is allowed to contain or call UI/view code. `ActionView` has been updated to have an official `activate()` method for compatibility, which defaults to calling `model.activate()`. Subclasses can always override this to put in logic between the parent class's call and the model's activation logic. `ActionView` has also been updated to rely more on `Action` for visibility management (newly added for Quick Access actions in 7.1), so all views for an action will behave the same way. The existing action views have largely been replaced with models, which in upcoming changes will be better utilized for both standard and Quick Access actions. The old views have been removed, and probably aren't worth retaining for any kind of API compatibility.
5efce448c830245f3ebd41bb3e97fdeb20b7deae

Checks run (2 succeeded)

flake8 passed.
JSHint passed.
maubin
  1. 
      
  2.