From 6bf29b20af3cdd3ad99e46d33ac30a3aec652be8 Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Wed, 10 Jul 2024 18:15:46 +1000 Subject: [PATCH] fix(ui): fix edge case in panels Not sure why I didn't figure out how to do this before - we only should reset a panel if it's too small. --- .../frontend/web/src/features/ui/hooks/usePanel.ts | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/invokeai/frontend/web/src/features/ui/hooks/usePanel.ts b/invokeai/frontend/web/src/features/ui/hooks/usePanel.ts index f9ebe97064..bd6af152fd 100644 --- a/invokeai/frontend/web/src/features/ui/hooks/usePanel.ts +++ b/invokeai/frontend/web/src/features/ui/hooks/usePanel.ts @@ -113,18 +113,9 @@ export const usePanel = (arg: UsePanelOptions): UsePanelReturn => { } const minSizePct = getSizeAsPercentage(arg.minSize, arg.panelGroupRef, arg.panelGroupDirection); - _setMinSize(minSizePct); - /** - * TODO(psyche): Ideally, we only resize the panel if there is not enough room for it in the - * panel group. This is a bit tricky, though. We'd need to track the last known panel size - * and compare it to the new size before resizing. This introduces some complexity that I'd - * rather not need to maintain. - * - * For now, we'll just resize the panel to the min size every time the panel group is resized. - */ - if (!panelHandleRef.current.isCollapsed()) { + if (!panelHandleRef.current.isCollapsed() && panelHandleRef.current.getSize() < minSizePct && minSizePct > 0) { panelHandleRef.current.resize(minSizePct); } });