Fix a couple mobile bugs on the unified banner's review menu.

Review Request #14130 — Created Aug. 29, 2024 and updated

Information

Review Board
release-7.x

Reviewers

We had a couple bugs when using the review menu on mobile.

The first has to do with the event overlay that we add to the page when the
review menu opens. The overlay wasn't going away when closing the menu by
tapping somewhere else on the unified banner (i.e. tapping the mode selector,
publish buttons or empty space). And, if you opened the review menu again, a
new overlay would be added, and the overlays would keep stacking if you
repeated this.

This is fixed by listening to the closing event on the menu and removing
the overlay that way. Previously, we subclasses the closeMenu()
method that exists on the parent Actions.MenuActionView and put the
overlay removal logic in there. However that method doesn't actually
always get called when the menu closes. The grandparent Ink MenuView
sometimes closes the menu directly through its close() method. We may
want to remove or rework these Actions.MenuActionView.openMenu() and
closeMenu() methods in the future, since it could lead to unexpected
state leftover like it did here.

Secondly, the contents of the menu would get cut off when viewing on
mobile. This change makes things look much better by forcing the menu
contents to take up the entire width of the screen and wrap any text
in it.

  • Tested opening, closing, and selecting items in the review menu in
    mobile and desktop.
  • Tested exiting the review menu by it and a lot of other places.
  • Tested scrolling with the menu open.
  • Ran JS unit tests.
Summary ID
Fix a couple mobile bugs on the unified banner's review menu.
We had a couple bugs when using the review menu on mobile. The first has to do with the event overlay that we add to the page when the review menu opens. The overlay wasn't going away when closing the menu by tapping somewhere else on the unified banner (i.e. tapping the mode selector, publish buttons or empty space). And, if you opened the review menu again, a new overlay would be added, and the overlays would keep stacking if you repeated this. This is fixed by listening to the closing event on the menu and removing the overlay that way. Previously, we subclasses the `closeMenu()` method that exists on the parent `Actions.MenuActionView` and put the overlay removal logic in there. However that method doesn't actually always get called when the menu closes. The grandparent Ink `MenuView` sometimes closes the menu directly through its `close()` method. We may want to remove or rework these `Actions.MenuActionView.openMenu()` and `closeMenu()` methods in the future, since it could lead to unexpected state leftover like it did here. Secondly, the contents of the menu would get cut off when viewing on mobile. This change fixes this by forcing the menu contents to take up the width of the screen and wrap any text in it.
03085618495099e1fb0eaffb670c8fd11b58274a

Checks run (2 succeeded)
flake8 passed.
JSHint passed.
david
  1. Ship It!
  2.