Store and organize action views by attachment point.

Review Request #14663 — Created Oct. 31, 2025 and updated

Information

Review Board
release-7.1.x

Reviewers

ActionView now takes the attachment point that the view is placed in,
for easy lookup and for registration.

The views are no longer stored in one long list. Instead, they're
organized by the attachment point. This will ultimately allow for
multiple views for the same action in different attachment points, and
to enable looking up the correct action within the right attachment
point.

Unit tests passed.

Tested that all actions, including menus and Quick Access actions,
all worked and expected.

Tested that Quick Access actions could be customized.

Summary ID
Store and organize action views by attachment point.
`ActionView` now takes the attachment point that the view is placed in, for easy lookup and for registration. The views are no longer stored in one long list. Instead, they're organized by the attachment point. This will ultimately allow for multiple views for the same action in different attachment points, and to enable looking up the correct action within the right attachment point.
179aed05a8866af4a7d9e64eac194c8889c3c184
Description From Last Updated

This needs a "Version Changed" block.

daviddavid

I'm not sure I have all your changes in my head at the same time, so it's possible that this …

daviddavid

This needs to be added to the Args section.

maubinmaubin

It might be nice to fail more gracefully if attachmentPointID is not a valid key.

daviddavid

It might be nice to fail more gracefully if attachmentPointID is not a valid key. Right now the call to …

daviddavid

Should we |escapejs this? I guess there could be a scenario where a malicious action author sets the attachment_point_id to …

maubinmaubin
maubin
  1. 
      
  2. Show all issues

    This needs to be added to the Args section.

  3. reviewboard/templates/actions/action.js (Diff revision 1)
     
     
    Show all issues

    Should we |escapejs this? I guess there could be a scenario where a malicious action author sets the attachment_point_id to something hacky.

    1. Yep, very good point. Ended up fixing this in another change to include as part of the new JS state data. It's a bit easier to do it there, with further cleanup after this change.

  4. 
      
david
  1. 
      
  2. Show all issues

    This needs a "Version Changed" block.

  3. reviewboard/static/rb/js/common/views/pageView.ts (Diff revision 1)
     
     
     
     
     
    Show all issues

    I'm not sure I have all your changes in my head at the same time, so it's possible that this is addressed in a different change, but I see that MenuActionView calls page.getActionView() with just the child ID, and there's nothing about that in this change. Is that changed elsewhere?

    1. This was updated, but in the wrong change. It ended up in /r/14641/. I'll fix that up to be in here.

  4. Show all issues

    It might be nice to fail more gracefully if attachmentPointID is not a valid key.

  5. Show all issues

    It might be nice to fail more gracefully if attachmentPointID is not a valid key. Right now the call to _.filter will probably error out.

  6. 
      
chipx86
Review request changed
Change Summary:
  • Added changes to MenuActionView that ended up in a previous change.
  • Added better handling of invalid action point IDs or action IDs in PageView.
  • Added missing version docs.
Commits:
Summary ID
Store and organize action views by attachment point.
`ActionView` now takes the attachment point that the view is placed in, for easy lookup and for registration. The views are no longer stored in one long list. Instead, they're organized by the attachment point. This will ultimately allow for multiple views for the same action in different attachment points, and to enable looking up the correct action within the right attachment point.
0acd57412d565c59c180330c9250261a7dc23cd2
Store and organize action views by attachment point.
`ActionView` now takes the attachment point that the view is placed in, for easy lookup and for registration. The views are no longer stored in one long list. Instead, they're organized by the attachment point. This will ultimately allow for multiple views for the same action in different attachment points, and to enable looking up the correct action within the right attachment point.
179aed05a8866af4a7d9e64eac194c8889c3c184

Checks run (2 succeeded)

flake8 passed.
JSHint passed.
maubin
  1. Ship It!
  2. 
      
david
  1. Ship It!
  2.