From ea1f2d8adcca2c8f163dba9efa548ecc81ab75c3 Mon Sep 17 00:00:00 2001 From: Jannis Braun <151788261+TheZwiss@users.noreply.github.com> Date: Tue, 10 Mar 2026 00:26:58 +0100 Subject: [PATCH] feat: collapse "Move to" into hover flyout submenu in voice context menu Replace the flat channel list with a single "Move to" trigger that opens a cascading flyout on hover, preventing the menu from bloating vertically when many voice channels exist. --- .../components/voice/VoiceModContextMenu.tsx | 109 ++++++++++++++++-- 1 file changed, 100 insertions(+), 9 deletions(-) diff --git a/packages/web/src/components/voice/VoiceModContextMenu.tsx b/packages/web/src/components/voice/VoiceModContextMenu.tsx index a370d5b5..1f4e7beb 100644 --- a/packages/web/src/components/voice/VoiceModContextMenu.tsx +++ b/packages/web/src/components/voice/VoiceModContextMenu.tsx @@ -1,4 +1,4 @@ -import React, { useEffect, useLayoutEffect, useRef } from 'react'; +import React, { useCallback, useEffect, useLayoutEffect, useRef, useState } from 'react'; import ReactDOM from 'react-dom'; import { useVoiceStore } from '../../stores/voiceStore'; import { useSpaceStore, getChannelOrigin } from '../../stores/spaceStore'; @@ -85,20 +85,111 @@ export function VoiceModMenuItems({ targetUserId, channelId, onAction }: VoiceMo )} {canMoveMembers && otherVoiceChannels.length > 0 && ( - <> -
-
- Move to... -
- {otherVoiceChannels.map((ch) => ( - + {open && ReactDOM.createPortal( +
+ {channels.map((ch) => ( + ))} - +
, + document.body, )} );