Skip to content

Conversation

@rrahir
Copy link
Collaborator

@rrahir rrahir commented Nov 19, 2025

Currently, if a menu is evaluated as disabled, we disable it and prevent the possibility to see its children by hover. However, there are some issues with this:

  • the user is mislead because we keep showing the arrow that suggest the presence of children items
  • the user can simply not navigate through the submenus to see what kind of feature could be available
  • if a menu has several children some of which are readonlyAllowed, then the readonlyAllowed condition has to be set on the parent as well; the 'enabling' condition therefore becomes a combination set on both the parent and children
  • if a parent menu is computed as 'enabled' it will not be greyed out (suggests that it has useful children) even if the said children are not enabled.

This revision changes the computation of 'enabled' state of item by looking at the full tree of children and applies the following logic; A parent menu is disabled if every leaf of the tree is disabled. A single 'enabled' leaf (that is a child without children of its own) will make all its parent enabled as well, up to the root. We also allow all submenus to be opened regardless of the state of the parent.

The user will therefore have a visual hint that there are active submenus or not (if all children are disabled, so will be the parent) and they will also have the possibility to have a look at all children to explore the possibilities.

Task: 5331717

Description:

description of this task, what is implemented and why it is implemented that way.

Task: TASK_ID

review checklist

  • feature is organized in plugin, or UI components
  • support of duplicate sheet (deep copy)
  • in model/core: ranges are Range object, and can be adapted (adaptRanges)
  • in model/UI: ranges are strings (to show the user)
  • undo-able commands (uses this.history.update)
  • multiuser-able commands (has inverse commands and transformations where needed)
  • new/updated/removed commands are documented
  • exportable in excel
  • translations (_t("qmsdf %s", abc))
  • unit tested
  • clean commented code
  • track breaking changes
  • doc is rebuild (npm run doc)
  • status is correct in Odoo

@robodoo
Copy link
Collaborator

robodoo commented Nov 19, 2025

Pull request status dashboard

Copy link
Contributor

@hokolomopo hokolomopo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👋

Comment on lines +254 to +256
this.openingTimeOut.schedule(() => {
this.openSubMenu(menu, currentTarget);
}, TIMEOUT_DELAY);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find it a bit strange UX-wise that the menu opens while there is a cursor: not-allowed and no hover/effect background. I'd remove the cursor and add back the hover effect for disabled parent menus

Comment on lines 122 to 123
if (children.length) {
const areChildrenEnabled = children.length
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you check children.length twice

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can just write if(chidren.length) return children.some((child) => this.isEnabled(child));

await simulateClick(".o-menu div[data-name='root']");
expect(fixture.querySelector(".o-menu div[data-name='subMenu']")).toBeFalsy();
});
describe("'IsEnabled' is ignored on parent menu items", () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: don't use quotes in test names, we cannot use jest debugger then

Currently, if a menu is evaluated as disabled, we disable it and prevent
the possibility to see its children by hover. However, there are some
issues with this:
- the user is mislead because we keep showing the arrow that suggest the
  presence of children items
- the user can simply not navigate through the submenus to see what kind
  of feature could be available
- if a menu has several children some of which are readonlyAllowed, then
  the readonlyAllowed condition has to be set on the parent as well; the
  'enabling' condition therefore becomes a combination set on both the
  parent and children
- if a parent menu is computed as 'enabled' it will not be greyed out
  (suggests that it has useful children) even if the said children are
  not enabled.

This revision changes the computation of 'enabled' state of item by
looking at the full tree of children and applies the following logic;
A parent menu is disabled if every leaf of the tree is disabled. A
single 'enabled' leaf (that is a child without children of its own) will
make all its parent enabled as well, up to the root. We also allow all
submenus to be opened regardless of the state of the parent.

The user will therefore have a visual hint that there are active
submenus or not (if all children are disabled, so will be the parent)
and they will also have the possibility to have a look at all children
to explore the possibilities.

Task: 5331717
@rrahir rrahir force-pushed the master-ref-menu-rar branch from 770b463 to 418f89c Compare November 21, 2025 09:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants