Automatic panel height suggestions


I have no success to automatically adapt the height of the panel to its content. After loading, the panel is cut off when I set the values in the manifest.json to a low value. Everything is contained in a wrapper-div with these settings …

div#wrapper {
position: absolute;
top: 0; left: 0; right: 0; bottom: 0;
padding: 12px;
overflow: auto;

Any ideas?

You can’t dynamically adjust the panel size (via code). The size you specify in the manifest, is the one that it will have once it’s loaded. I usually build out my whole interface, and then set the size in the manifest to a value that shows the whole interface without scrolling. The user can then resize the panel to his liking (which might cause it to show scrollbars).

1 Like

That works fine when you have a static interface, but when you have collapsible panels, this is rather annoying to have to resize the panel manually all the time.

For me personally, a “jumping” panel would be way more annoying. Wouldn’t that be as if your browser window would adjust in size all the time just because a website expands content?

And if you have scrollable content, I don’t see the need to “resize the panel manually all the time”. Just scroll instead :sweat_smile:

1 Like

Collapsible panels are quite common and as long as you yourself can collapse/expand them, they aren’t annoying but functional. A lot of programs use them to simplify the UI.

Photoshop panels do not adjust their size based on the content. They are restricted to the sizes defined by the manifest. Plugins also cannot control the size of their panel programmatically.

Users can collapse the panel if they so choose (they can double-click on the tab to collapse it), but this is entirely at the user’s discretion.

The expectation is that plugin developers will design their UI in a responsive manner – allowing the user to configure the panel to their liking. Sometimes limits must be placed on this (min/max size), but generally, it should be left to the user to control their workspace, rather than the plugin doing it.

If your plugin consists of multiple accordions in the UI, you might want to consider shipping with multiple panels instead. Then the user can group all those panels together, resize them, collapse them, etc., as they choose. (Plus they can decide the ordering.) We are working on adding a feature to the manifest that will let you specify that a plugin’s panels should be automatically grouped together at first use.

1 Like

Thanks for the reply. It only concern one smaller accordion, so separating it makes no sense. I’ll have to think about some solution. Eventually I will stay away from the collapsing option.