try fix sidebar resizing issue

This commit is contained in:
pa
2026-02-01 02:05:36 +09:00
parent 0b59423f61
commit 564f5bc73c
2 changed files with 10 additions and 4 deletions
@@ -317,7 +317,7 @@
<User class="size-4" /> <User class="size-4" />
{{ t('dialog.avatar.actions.create_impostor') }} {{ t('dialog.avatar.actions.create_impostor') }}
</DropdownMenuItem> </DropdownMenuItem>
<DropdownMenuItem variant="destructive" @click="avatarDialogCommand('Trash2')"> <DropdownMenuItem variant="destructive" @click="avatarDialogCommand('Delete')">
<Trash2 class="size-4" /> <Trash2 class="size-4" />
{{ t('dialog.avatar.actions.delete') }} {{ t('dialog.avatar.actions.delete') }}
</DropdownMenuItem> </DropdownMenuItem>
+9 -3
View File
@@ -111,12 +111,18 @@ export function useMainLayoutResizable() {
if (!isSideBarTabShow.value) { if (!isSideBarTabShow.value) {
return; return;
} }
const clampedAsidePx = clampAsidePx(asideWidth.value, width); const maxAsidePx = getMaxAsidePx(width);
if (clampedAsidePx !== asideWidth.value) { const clampedAsidePx = Math.min(
maxAsidePx,
Math.max(0, asideWidth.value)
);
if (maxAsidePx > 0 && clampedAsidePx !== asideWidth.value) {
setAsideWidth(clampedAsidePx); setAsideWidth(clampedAsidePx);
} }
const asideTargetSize = const asideTargetSize =
clampedAsidePx > 0 ? pxToPercent(clampedAsidePx, width, 0) : 0; maxAsidePx > 0 && clampedAsidePx > 0
? pxToPercent(clampedAsidePx, width, 0)
: 0;
resizeAsidePanel(asideTargetSize); resizeAsidePanel(asideTargetSize);
}; };