From f3b3c249caea212f7b687d082dff7408de18d159 Mon Sep 17 00:00:00 2001 From: Jannis Braun <151788261+TheZwiss@users.noreply.github.com> Date: Tue, 10 Mar 2026 00:49:54 +0100 Subject: [PATCH] fix: dynamically size channel list padding from floating panel height Replace static pb-[140px] with ResizeObserver-driven padding so the last channel is never hidden behind the voice control panel. --- .../src/components/layout/ChannelSidebar.tsx | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/packages/web/src/components/layout/ChannelSidebar.tsx b/packages/web/src/components/layout/ChannelSidebar.tsx index ba8a5130..5933c686 100644 --- a/packages/web/src/components/layout/ChannelSidebar.tsx +++ b/packages/web/src/components/layout/ChannelSidebar.tsx @@ -42,6 +42,20 @@ export function ChannelSidebar() { const navigate = useNavigate(); const location = useLocation(); + const floatingPanelRef = useRef(null); + const [panelHeight, setPanelHeight] = useState(140); + + useEffect(() => { + const el = floatingPanelRef.current; + if (!el) return; + const ro = new ResizeObserver((entries) => { + const entry = entries[0]; + if (entry) setPanelHeight(entry.contentRect.height); + }); + ro.observe(el); + return () => ro.disconnect(); + }, []); + const handleMicToggle = async () => { if (isServerMuted || isServerDeafened) return; const wasDeafened = useVoiceStore.getState().isDeafened; @@ -101,7 +115,7 @@ export function ChannelSidebar() { // Floating bottom panel — shared between DM view and server view const floatingPanel = user ? ( -
+
{/* Voice controls (expands when connected) */} {(currentVoiceChannelId || activeDmCall) && } @@ -133,7 +147,7 @@ export function ChannelSidebar() { Find or start a conversation
-
+
{/* Channels */} -
+
{/* Text Channels */}