Thanks, Xiangyu.
Here's the screenshot:
The submenu is created, but there's no popup attached to it, so hovering over the submenu does nothing.
Here's the screenshot from the relevant part of the Inspector window - there's no <menupopup> element where you'd expect one.
I don't think it's simply a locale problem, because the submenu item has the correct string label ("MenuManager Submenu") that I put in the relevant locale file.
Even if there was a missing locale string, one wouldn't expect that this would lead to the popup menu not being created without it generating an error or warning.
Here's the code that I used to register the menus:
// --- MenuManager submenu repro (item context only) ---
Zotero.MenuManager.registerMenu({
menuID: `${config.addonRef}-bugrepro-library-item`,
pluginID: config.addonID,
target: "main/library/item",
menus: [
// The submenu under test
{
menuType: "submenu",
l10nID: `${config.addonRef}-bugrepro-submenu`,
icon: `chrome://${config.addonRef}/content/icons/favicon.png`,
menus: [
{
menuType: "menuitem",
l10nID: `${config.addonRef}-bugrepro-child1`,
onCommand() {
Zotero.debug("[MenuManager bug repro] child1 clicked");
},
},
{
menuType: "menuitem",
l10nID: `${config.addonRef}-bugrepro-child2`,
onCommand() {
Zotero.debug("[MenuManager bug repro] child2 clicked");
},
},
],
},
],
});
Here are the locale strings from the relevant .ftl file in the build folder:
BetterNotes-bugrepro-submenu = MenuManager Submenu
BetterNotes-bugrepro-child1 = Child 1
BetterNotes-bugrepro-child2 = Child 2
As is visible in the screenshot above, the submenu locale string is found - so it would be strange if the Child 1 and Child 2 strings cannot be found and cause the popup menu to disappear.
My Zotero installation is 8.0.2-beta.5+c35d7f21e (64-bit) on Windows. I've used zotero-better-notes v3.0.2 to add my registerMenu calls to menu.ts and my l10nID labels to its mainWindow.ftl file.
If there's any other information I need to provide, please let me know.