From 701bd867fcbcd778cf9e2972d481354f866732eb Mon Sep 17 00:00:00 2001 From: Moepchi Date: Sun, 6 Sep 2026 11:57:30 +0200 Subject: [PATCH] fix: self-move channel password prompt, spacer targets, client-list memoization - handleMoveClient: route self-drags through handleSwitchChannel so moving your own client still prompts for a channel password when required, while admin moves of other clients keep bypassing the target channel's password (matches native TS3/GTS behavior - only the mover needs permission, not the password). - MoveClientDialog: disable channel spacers as move targets, they are display-only rows with no backing channel. - connector moveclient handler: carry the already-decoded password through the fallback branch (client not found in local state) instead of hardcoding an empty password, so self-moves via that path still authenticate correctly. - App.tsx: memoize treeClients/queryClientCount so they are not recomputed on every render (e.g. on unrelated "talkers" updates), and simplify the duplicated displayClientCount ternary. Co-Authored-By: Claude Sonnet 5 --- connector/src/main.rs | 9 ++++++++- web/src/App.tsx | 38 ++++++++++++++++++++++++++++---------- 2 files changed, 36 insertions(+), 11 deletions(-) diff --git a/connector/src/main.rs b/connector/src/main.rs index 9879242..df1d395 100644 --- a/connector/src/main.rs +++ b/connector/src/main.rs @@ -1130,10 +1130,17 @@ async fn run(args: Args) -> Result<()> { } None => { // Still try with raw ids if the client left our view. + // Carry through the already-decoded password instead of + // dropping it - this path is also used for self-moves + // via drag-and-drop, which still need the password to + // reach the server when the target channel requires one. Some(OutClientMovePart { client_id: ClientId(clid), channel_id: ChannelId(cid), - channel_password: Some(Cow::Borrowed("")), + channel_password: Some(match &password { + Some(pwd) => Cow::Owned(pwd.clone()), + None => Cow::Borrowed(""), + }), }) } }, diff --git a/web/src/App.tsx b/web/src/App.tsx index 6807853..ebbc653 100644 --- a/web/src/App.tsx +++ b/web/src/App.tsx @@ -1,4 +1,4 @@ -import { useEffect, useRef, useState } from "react"; +import { useEffect, useMemo, useRef, useState } from "react"; import "./App.css"; /** Only dismiss on a genuine backdrop click, not a text-selection drag that @@ -2397,7 +2397,7 @@ function MoveClientDialog({