• 
      

    Fix up problems with the archive actions.

    Review Request #14782 — Created Jan. 13, 2026 and submitted — Latest diff uploaded

    Information

    Review Board
    release-7.1.x

    Reviewers

    The actions refactor introduced a few bugs related to the archive menu:

    • The menu itself isn't rendered for draft (unpublished) review
      requests, but we were still adding the views for the menu items, which
      would then crash during their initialization because they didn't have
      a valid parent element.
    • Interaction with the menu items worked, but the top-level icon wasn't
      changing state and did not respond to clicks, because we were no
      longer using the correct view class.

    This change adds back the ArchiveMenuActionRenderer class which was
    removed in the middle of the new actions rewrite, but in a much simpler
    form that just specifies the js_view_class (as opposed to using a
    custom template). This fixes the interaction regressions with the menu.

    The RB.ArchiveMenuActionView implementation needed to be updated to
    handle initialization inside onInitialRender rather than overriding
    initialize. The old initialize method wasn't passing through
    options (which was added to the other action views), resulting in
    some errors. onInitialRender is a more correct place to do this
    initialization anyway.

    ActionAttachmentPoint.iter_render_js has been fixed so that it only
    renders the JS views for child actions if the menu action itself should
    render. This prevents the crashes with draft review requests.

    While in here I fixed up some bad type hints, doc comments, and typos.
    There was also one place that was double-checking should_render.

    • Verified that interaction with the archive menu worked correctly,
      with the icon responding to changes in the archive/mute state, and
      that clicking on the icon itself also toggled the archive state.
    • Loaded a draft review request and saw that there were no longer any JS
      crashes in the console.
    • Ran unit tests.

    Commits

    Files