chipx86 got a fish trophy!
Move action activation and state management into the action models.
Review Request #14641 — Created Oct. 18, 2025 and submitted
Actions didn't have a standard way to perform an activation of the
action. The menu item action views had anactivate()method tied to a
click handler, and subclasses implemented that, but this wasn't a
capability ofActionView. 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,
Actionnow 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.
ActionViewhas been updated to have an officialactivate()method
for compatibility, which defaults to callingmodel.activate().
Subclasses can always override this to put in logic between the parent
class's call and the model's activation logic.
ActionViewhas also been updated to rely more onActionfor
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 |
|---|---|
| 1d6249e553fb942258a13d696db502316d9bb172 |
| Description | From | Last Updated |
|---|---|---|
|
This is missing a docstring, and maybe its better to have the assert be something like "<classname> must implement getLabelForVisibility". |
|
|
|
This can be removed. |
|
|
|
This can be removed. |
|
|
|
Seems like leftover debug code. |
|
|
|
Shouldn't we be triggering closeError on the reviewRequestEditor instance instead of on the action? I know in the previous code … |
|
|
|
Do we want to explicitly list out the things exported here, in case we add additional things (i.e. attrs interfaces) … |
|
|
|
Can you add a file-level comment at the top? |
|
|
|
Given that this should never be called, can we make the method abstract? |
|
|
|
Typo here: getLabels -> getLabel |
|
|
|
This should be when there is an existing pending review. |
|
|
|
Copy/pasto: Action view -> Action |
|
|
|
Should be UpdateDiffActionView |
|
|
|
So I think the old implementation might have been wrong to start with, but nothing is listening to "closeError" on … |
|
|
|
Same here. |
|
|
|
We also don't have any error handling here in case the promise fails. We probably should show whatever error and … |
|
|
|
Some of our activate() methods are async, and some are not. I feel like we should standardize on all being … |
|
|
|
Since some model implementations are async, I feel like we should make this async as well and do await this.model.activate() |
|
|
|
Do we want a Version Changed here about this now being exported, and perhaps a note about how this is … |
|
|
|
Let's make this async and do await this.#pendingReview.save(). |
|
- Change Summary:
-
Removed debug output.
- Commits:
-
Summary ID 4aa77ebc8b47d05b6e748e3574c5cad666aaf69b aaaacc3ebd53cf6c93e658d1fac7d43fa898c04d - Diff:
-
Revision 2 (+1298 -1214)
Checks run (2 succeeded)
-
-
This is missing a docstring, and maybe its better to have the assert be something like "<classname> must implement getLabelForVisibility".
-
-
-
-
Shouldn't we be triggering
closeErroron thereviewRequestEditorinstance 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 toReviewRequestEditorwhich is the thing that actually listens tocloseErrorevents.
- Change Summary:
-
- Fixed the default label for the Archive/Mute actions.
- Improved an assertion message.
- Added a missing docstring.
- Removed some old
optionsdoc strings. - Removed leftover debug code.
- Commits:
-
Summary ID aaaacc3ebd53cf6c93e658d1fac7d43fa898c04d 5efce448c830245f3ebd41bb3e97fdeb20b7deae - Diff:
-
Revision 3 (+1342 -1214)
Checks run (2 succeeded)
-
-
Do we want to explicitly list out the things exported here, in case we add additional things (i.e. attrs interfaces) to this file later?
-
-
-
-
-
-
-
So I think the old implementation might have been wrong to start with, but nothing is listening to "closeError" on this. I think we want to be doing
reviewRequesEditor.trigger('closeError', err.message)here?Or perhaps we want to think about more generic error handling across the board for actions?
-
-
We also don't have any error handling here in case the promise fails. We probably should show whatever error and set the button to non-busy.
- Change Summary:
-
- Fixed several doc issues.
- Made
BaseVisibilityActionand itsgetLabelForVisibilityabstract.
- Commits:
-
Summary ID 5efce448c830245f3ebd41bb3e97fdeb20b7deae 9f273d1e5282b7a5696a26bc2d723be0adb8823b - Diff:
-
Revision 4 (+1340 -1214)
Checks run (2 succeeded)
-
-
Some of our
activate()methods are async, and some are not. I feel like we should standardize on all being async, starting with the base class definition here. -
Since some model implementations are async, I feel like we should make this async as well and do
await this.model.activate() -
Do we want a Version Changed here about this now being exported, and perhaps a note about how this is exported from this file but does not get exported all the way to the global namespace?
-
- Change Summary:
-
- Removed updates to
MenuActionViewthat should have been in /r/14663/. - Added a
Version ChangedonStoredItemsstating it's exported but stating the conditions.
- Removed updates to
- Commits:
-
Summary ID 9f273d1e5282b7a5696a26bc2d723be0adb8823b 2ab02d97cca79c3ef2580543212794b062578492 - Diff:
-
Revision 5 (+1346 -1212)
Checks run (2 succeeded)
- Change Summary:
-
Updated
index.tsto explicitly list the actions to export. - Commits:
-
Summary ID 2ab02d97cca79c3ef2580543212794b062578492 1d6249e553fb942258a13d696db502316d9bb172 - Diff:
-
Revision 6 (+1370 -1212)