Flyout Menu with Mutli-Panel Plugins

,

Maybe I’m doing something wrong — or this might be a bug.

When I add a flyout menu to a panel in a multi-panel plugin, the menu doesn’t appear in the panel I defined it for, but in another one. I can’t figure out how InDesign decides where to attach it, but it’s definitely not the panel I specified.

Here is an example:

manifest.json

...
  "entrypoints": [
    { "type": "command", "id": "showAlert", "label": "Show alert" },
    { "type": "panel", "id": "test_main", "label": {"default": "Test-Plugin"} },
    { "type": "panel", "id": "test_one",  "label": {"default": "Panel One"} },
    { "type": "panel", "id": "test_two",  "label": {"default": "Panel Two"} }
  ],
...

main.js

entrypoints.setup({
  commands: {
    showAlert: () => showAlert()
  },
  panels: {
    test_main: {
      show({node} = {}) {},
      menuItems: [
        {id: "setWarpFactor", label: "Warp Factor 1"},
        {id: "raiseShields", label: "Shields Up"},
        {id: "makeItSo", label: "Engage"}
      ],
      invokeMenu(id) {
        console.log(`Panel Main: ${id} selected`);
        handleFlyout(id);
      }
    },
    test_one: {
      show({node} = {}) {},
      menuItems: [
        {id: "flyout_one_1", label: "Flyout Entry 1"},
      ],
      invokeMenu(id) {
        console.log(`Panel One: ${id} selected`);
        handleFlyout(id);
      }
    },
    test_two: {
      show({node} = {}) {},
      menuItems: [
        {id: "flyout_two_1", label: "Flyout Entry 1"},
      ],
      invokeMenu(id) {
        console.log(`Panel Two: ${id} selected`);
        handleFlyout(id);
      }
    }
  }
});

When I run the setup above, the only menu that has a flyout is test_two.

When I remove the menus from all other panels and only leave the menu in test_main, then the menu defined in test_main will be added to test_two, not to test_main.

I tried it with different amounts of panels, and it seems rather random to which panel the menu gets added. It is not always the last. If I have four panels, it will be added to the third. Anyways, it is ignored in which panel I added the menu in the main.js

Did I make a mistake in the setup, or is this a bug? Has someone similar experiences?

I’m pretty sure it is a bug.

I’ve not had reason to build a multipanel plugin with flyout menus, but I’ve tried just now with a simple test plugin, and I am seeing the behaviour that you describe.

Needless to say, my test plugin works as expected in Photoshop – each panel has its own flyout menu containing the menu items defined for it in the entrypoints.setup function.

Unfortunately it looks to be (another) bug specific to how flyout menus have been implemented in InDesign.

Philip

1 Like

Thanks for confirming the bug @philipbuckley!

Thank you for confirming!

I now also created a minimal test-plugin (should have done this right away) and will upload it here.

test.indesign.multipanel-flyout-bug.zip (2.9 KB)

Bug reported at UserVoice. Please vote for the issue, if you are affected by this:

Thanks for reporting the bug. I’ve voted for it and added this comment (in the hope that emphasis might get attention!):

If a single flyout menu is defined, it is not attached to the correct panel. If multiple flyout menus are defined, only one (random) panel shows a flyout menu at all (and the menu contains the wrong menu items). This means that it is impossible to have a multi-panel plugin in which each panel has its own flyout menu.

Philip

2 Likes