• 
      

    Add consistent layout and state for actions and a button action template.

    Review Request #14423 — Created May 4, 2025 and submitted — Latest diff uploaded

    Information

    Review Board
    release-7.1.x

    Reviewers

    This introduces a few changes to help write actions and ensure they work
    in a consistent way in multiple places.

    There's now an action_base.html template that handles the general
    structure of an action. This provides the parent rb-c-actions__action
    container with some consistent attributes, plus template variables for
    use in derived templates. Derived templates can use this to build their
    elements and to influence the parent container state.

    This gives us more consistent templates and helps us set some new
    attributes for visibility management. We use both hidden and
    display: none (the latter being necessary since display can override
    the former). From that, we can better manage the accessibility tree and
    check for state more directly.

    RB.ActionView provides the other end of the visibility management.
    Visibility is now managed on the parent action container element, if
    used, so that we don't end up with empty <li> elements affecting
    layout when actions are hidden. If nested in another container (such as
    a menu), the action's own element is used.

    ActionView.show() and hide() update both display and hidden,
    using the visibility element. An isVisible() method returns the state
    based on that as well.

    Along with this, there are a few small typing and function signature
    fixes I hit during development, plus error handling when action
    templates fail to render.

    These will make it easier to implement some new action functionality
    coming in a follow-up change.

    Tested all the current actions in the UI, looking for visual breakages
    or issues invoking the actions.

    Unit tests pass.

    Tested the new functionality with in-progress changes.

    Commits

    Files