diff --git a/src/lib/components/channel/Channel.svelte b/src/lib/components/channel/Channel.svelte index f04da31352..3229b65f90 100644 --- a/src/lib/components/channel/Channel.svelte +++ b/src/lib/components/channel/Channel.svelte @@ -290,7 +290,7 @@
diff --git a/src/lib/components/chat/Chat.svelte b/src/lib/components/chat/Chat.svelte index c2ebe59bea..1d5abcb030 100644 --- a/src/lib/components/chat/Chat.svelte +++ b/src/lib/components/chat/Chat.svelte @@ -2384,7 +2384,7 @@
diff --git a/src/lib/components/chat/MessageInput/FilesOverlay.svelte b/src/lib/components/chat/MessageInput/FilesOverlay.svelte index d8a09b0b1e..b54ec2be9a 100644 --- a/src/lib/components/chat/MessageInput/FilesOverlay.svelte +++ b/src/lib/components/chat/MessageInput/FilesOverlay.svelte @@ -18,7 +18,7 @@
{ + if ($mobile) return; + isResizing = true; + + startX = e.clientX; + startWidth = $sidebarWidth ?? 260; + + document.body.style.userSelect = 'none'; + }; + + const resizeEndHandler = () => { + if (!isResizing) return; + isResizing = false; + + document.body.style.userSelect = ''; + localStorage.setItem('sidebarWidth', String($sidebarWidth)); + }; + + const applyResize = () => { + const dx = endX - startX; + const newSidebarWidth = Math.min(MAX_WIDTH, Math.max(MIN_WIDTH, startWidth + dx)); + + sidebarWidth.set(newSidebarWidth); + document.documentElement.style.setProperty('--sidebar-width', `${newSidebarWidth}px`); + }; + let unsubscribers = []; + onMount(async () => { + try { + const width = Number(localStorage.getItem('sidebarWidth')); + if (!Number.isNaN(width) && width >= MIN_WIDTH && width <= MAX_WIDTH) { + sidebarWidth.set(width); + } + } catch {} + + document.documentElement.style.setProperty('--sidebar-width', `${$sidebarWidth}px`); + sidebarWidth.subscribe((w) => { + document.documentElement.style.setProperty('--sidebar-width', `${w}px`); + }); + await showSidebar.set(!$mobile ? localStorage.sidebar === 'true' : false); unsubscribers = [ @@ -570,6 +619,17 @@ }} /> + { + if (!isResizing) return; + endX = e.clientX; + applyResize(); + }} + on:mouseup={() => { + resizeEndHandler(); + }} +/> + {#if !$mobile && !$showSidebar}
@@ -1321,4 +1381,17 @@
+ + {#if !$mobile} +