fix(ui): opening the chat window keeps the minimised bar's width

This commit is contained in:
sam committed 2026-11-14 12:20:47 +11:00
1 parent 67ae6afec1
commit 39bfde195c
1 file changed
+5 -1
+5 -1
View File
@@ -28,6 +28,8 @@ import {
SWIPE,
barPlacement,
fitRect,
BAR_W,
INSET,
handleOrientation,
handleValue,
keyboardCover,
@@ -118,7 +120,9 @@ const winRect = computed<Rect>(() => {
if (pinned.value) {
return { x: mode.value === "left" ? 0 : vw.value - pinW.value, y: 0, w: pinW.value, h: vh.value };
}
return fitRect(layout.value, vw.value, vh.value);
// Opening the window never narrows it below the minimised bar.
const minW = Math.min(BAR_W, vw.value - INSET * 2);
return fitRect({ ...layout.value, w: Math.max(layout.value.w, minW) }, vw.value, vh.value);
});
// The part of the layout viewport the on-screen keyboard covers, and the height