Port to the new Page Banner support, and add can-close settings.

Review Request #14560 — Created Aug. 7, 2025 and updated

Information

rb-extension-pack
master

Reviewers

When run on Review Board 7.1+, the Message of the Day banner will now
make use of the new standard Page Banner UI component, which takes care
of all the presentation of banners. This creates a more consistent look
and helps make this extension more future-proof.

When run on older versions, the banner will continue to handle all
presentation and placement as before.

This is implemented as two entirely separate TemplateHooks. They
calculate similar state, but behave a bit differently under the hood,
particularly with the visibility state.

There's also a new feature allowing administrators to control whether
users can close this banner. This can be turned off if the banner is
something that needs to always be seen (such as important user
instructions, legal notices, outages, etc.).

This will all be for the upcoming 4.0 release.

Tested on Review Board 7.0 and 7.1, with and without the option
for letting users close banners.

Tested the closing and should-render functionality on both.

Inspected the generated HTML and scripts for all verson/setting
combinations.

Summary ID
Port to the new Page Banner support, and add can-close settings.
When run on Review Board 7.1+, the Message of the Day banner will now make use of the new standard Page Banner UI component, which takes care of all the presentation of banners. This creates a more consistent look and helps make this extension more future-proof. When run on older versions, the banner will continue to handle all presentation and placement as before. This is implemented as two entirely separate `TemplateHooks`. They calculate similar state, but behave a bit differently under the hood, particularly with the visibility state. There's also a new feature allowing administrators to control whether users can close this banner. This can be turned off if the banner is something that needs to always be seen (such as important user instructions, legal notices, outages, etc.). This will all be for the upcoming 4.0 release.
f3745e0d3b0458a81cc3089d9103272bb661bb3c
Description From Last Updated

Did you forget to add the scripts.html file?

daviddavid

This needs a Version Changed for the rename, and shouldn't we keep the old name around and use housekeeping's "class …

maubinmaubin

Nit: we only use this variable in one place (after getting rid of the debug print), we could instead inline …

maubinmaubin

Leftover debug code.

maubinmaubin

Nit: we only use this variable in one place, we could instead inline this in the dict definition.

maubinmaubin
david
  1. 
      
  2. Show all issues

    Did you forget to add the scripts.html file?

  3. 
      
chipx86
Review request changed
Change Summary:

Added the missing scripts.html.

Commits:
Summary ID
Port to the new Page Banner support, and add can-close settings.
When run on Review Board 7.1+, the Message of the Day banner will now make use of the new standard Page Banner UI component, which takes care of all the presentation of banners. This creates a more consistent look and helps make this extension more future-proof. When run on older versions, the banner will continue to handle all presentation and placement as before. This is implemented as two entirely separate `TemplateHooks`. They calculate similar state, but behave a bit differently under the hood, particularly with the visibility state. There's also a new feature allowing administrators to control whether users can close this banner. This can be turned off if the banner is something that needs to always be seen (such as important user instructions, legal notices, outages, etc.). This will all be for the upcoming 4.0 release.
effb44dedb9692e433eec6c3d6edb3e09b936890
Port to the new Page Banner support, and add can-close settings.
When run on Review Board 7.1+, the Message of the Day banner will now make use of the new standard Page Banner UI component, which takes care of all the presentation of banners. This creates a more consistent look and helps make this extension more future-proof. When run on older versions, the banner will continue to handle all presentation and placement as before. This is implemented as two entirely separate `TemplateHooks`. They calculate similar state, but behave a bit differently under the hood, particularly with the visibility state. There's also a new feature allowing administrators to control whether users can close this banner. This can be turned off if the banner is something that needs to always be seen (such as important user instructions, legal notices, outages, etc.). This will all be for the upcoming 4.0 release.
f3745e0d3b0458a81cc3089d9103272bb661bb3c

Checks run (2 succeeded)

flake8 passed.
JSHint passed.
maubin
  1. 
      
  2. rbmotd/rbmotd/extension.py (Diff revision 2)
     
     
    Show all issues

    This needs a Version Changed for the rename, and shouldn't we keep the old name around and use housekeeping's "class moved" decorator? I know these are internal to the MOTD extension but aren't they technically still public.

    1. Nobody is using this code as an API. For extensions like this we want to maintain compatibility and potentially do deprecation cycles for functionality, but we don't need to maintain API stability the way we do in our other code.

  3. rbmotd/rbmotd/extension.py (Diff revision 2)
     
     
    Show all issues

    Nit: we only use this variable in one place (after getting rid of the debug print), we could instead inline this in the dict definition.

  4. rbmotd/rbmotd/extension.py (Diff revision 2)
     
     
    Show all issues

    Leftover debug code.

  5. rbmotd/rbmotd/extension.py (Diff revision 2)
     
     
    Show all issues

    Nit: we only use this variable in one place, we could instead inline this in the dict definition.

  6.