# Improved showPanel() Flow

**URL:** <https://forums.creativeclouddeveloper.com/t/improved-showpanel-flow/7208>\
**Category:** UXP Plugin API\
**Created:** [December 2, 2023, 6:49pm UTC](https://forums.creativeclouddeveloper.com/t/improved-showpanel-flow/7208 "2023-12-02T18:49:00Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![justin2taylor](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/justin2taylor/32/2031_2.png) [@justin2taylor](https://forums.creativeclouddeveloper.com/u/justin2taylor)\
**Post date:** [December 2, 2023, 6:49pm UTC](https://forums.creativeclouddeveloper.com/t/improved-showpanel-flow/7208/1 "2023-12-02T18:49:00Z")

</div>

Currently the only way I could find to open a UXP panel from another UXP panel is like this:

```auto
const uxp = require("uxp");
const plugin = Array.from(uxp.pluginManager.plugins).pop();
await plugin.showPanel(id);

```

Firstly this is mostly undocumented, and secondly this syntax is just overcomplicated and doesn’t make much sense.

If we could have a more straightforward way to open a panel directly like:

```auto
uxp.pluginManager.showPanel(id);

```

Or if the request has to come from our active panel, then something like:

```auto
uxp.pluginManager.currentPanel.showPanel(id)

```

That would be a lot more straightforward and similar to how we would open panels in CEP.

Thanks!

---

<div class="post-metadata">

**Author:** ![haller](https://avatars.discourse-cdn.com/v4/letter/h/53a042/32.png) [@haller](https://forums.creativeclouddeveloper.com/u/haller)\
**Post date:** [December 3, 2023, 9:24am UTC](https://forums.creativeclouddeveloper.com/t/improved-showpanel-flow/7208/2 "2023-12-03T09:24:43Z")

</div>

I’m also banging my head and I can’t find any effective solutions, I tried with the panel ID but after restarting the PC it doesn’t work anymore, Is your code stable and does it open the chosen panel even after restarting the PC?

It’s even easier to put the name of the panel to open it.

---

<div class="post-metadata">

**Author:** ![justin2taylor](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/justin2taylor/32/2031_2.png) [@justin2taylor](https://forums.creativeclouddeveloper.com/u/justin2taylor)\
**Post date:** [December 3, 2023, 9:38pm UTC](https://forums.creativeclouddeveloper.com/t/improved-showpanel-flow/7208/3 "2023-12-03T21:38:13Z")

</div>

Seems to work after a restart for me, not saying it’s a great solution but the only one I could find so far.

---

<div class="post-metadata">

**Author:** ![justin2taylor](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/justin2taylor/32/2031_2.png) [@justin2taylor](https://forums.creativeclouddeveloper.com/u/justin2taylor)\
**Post date:** [December 11, 2023, 4:12pm UTC](https://forums.creativeclouddeveloper.com/t/improved-showpanel-flow/7208/4 "2023-12-11T16:12:19Z")

</div>

Turns out you need `requiredPermissions.ipc.enablePluginCommunication` enabled in your manifest for this to work:

```js
"requiredPermissions": {
    "ipc": {
      "enablePluginCommunication": true
    },
},

```

---

<div class="post-metadata">

**Author:** ![justin2taylor](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/justin2taylor/32/2031_2.png) [@justin2taylor](https://forums.creativeclouddeveloper.com/u/justin2taylor)\
**Post date:** [February 22, 2024, 5:43pm UTC](https://forums.creativeclouddeveloper.com/t/improved-showpanel-flow/7208/5 "2024-02-22T17:43:59Z")

</div>

Also found a more reliable method for doing this since the secondary panel must be triggered from the main panel, you have to find it in the array of panels and it’s not always the last one so .pop() doesn’t work all the time:

```auto
export const openUXPPanel = async (id: string) => {
  const uxp = require("uxp") as typeof import("uxp");
  const plugins = Array.from(uxp.pluginManager.plugins);

  const plugin = plugins.find(
    (plugin) => plugin.id === uxp.entrypoints._pluginInfo.id
  );
  console.log("plugin", plugin, "opening panel: ", id);
  if (plugin) await plugin.showPanel(id);
  else console.error("No plugin found");
};

```

And make sure you still have ipc enabled in your manifest:

```js
"requiredPermissions": {
    "ipc": {
      "enablePluginCommunication": true
    },
},

```

---

<div class="post-metadata">

**Author:** ![Karmalakas](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/karmalakas/32/1048_2.png) [@Karmalakas](https://forums.creativeclouddeveloper.com/u/Karmalakas)\
**Post date:** [February 23, 2024, 7:47am UTC](https://forums.creativeclouddeveloper.com/t/improved-showpanel-flow/7208/6 "2024-02-23T07:47:09Z")

</div>

It’s reliable until Adobe decides to change the `uxp.entrypoints._pluginInfo`. Any property starting in underscore is internal and should not be used by 3rd party. Most likely it’s here to stay, but you’ve been warned 😃 I think I use it too in one of my plugins 😅

---

<div class="post-metadata">

**Author:** ![justin2taylor](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/justin2taylor/32/2031_2.png) [@justin2taylor](https://forums.creativeclouddeveloper.com/u/justin2taylor)\
**Post date:** [February 23, 2024, 3:46pm UTC](https://forums.creativeclouddeveloper.com/t/improved-showpanel-flow/7208/7 "2024-02-23T15:46:55Z")

</div>

Yep, but it’s all we’ve got

---

<div class="post-metadata">

**Author:** ![justin2taylor](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/justin2taylor/32/2031_2.png) [@justin2taylor](https://forums.creativeclouddeveloper.com/u/justin2taylor)\
**Post date:** [March 27, 2024, 3:28pm UTC](https://forums.creativeclouddeveloper.com/t/improved-showpanel-flow/7208/8 "2024-03-27T15:28:15Z")

</div>

This function has been added to the lib functions where we’ll be adding other useful UXP functions in our new boilerplate Bolt UXP

> **[Bolt UXP — Resources | Hyper Brew](https://hyperbrew.co/resources/bolt-uxp)**
>
> A lightning-fast boilerplate for building Adobe UXP Plugins in Svelte, React, or Vue built on Vite + TypeScript + Sass
