From 6e2278498c6eb6d4a34e63337839b348f6a1d5b7 Mon Sep 17 00:00:00 2001 From: Moepchi Date: Fri, 23 Oct 2026 18:37:09 +0000 Subject: [PATCH] Design tab: real group icons in group menus, client info tooltips Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01Hu2cuPLqpuKVfd9wWFFakU --- web/src/App.tsx | 79 +++++++++++++++++++++++++++---------------------- 1 file changed, 44 insertions(+), 35 deletions(-) diff --git a/web/src/App.tsx b/web/src/App.tsx index f6abcc6..ce38bea 100644 --- a/web/src/App.tsx +++ b/web/src/App.tsx @@ -1103,6 +1103,17 @@ function ServerIcon() { ); } +/** A group's uploaded icon, or a colored letter badge for TS's built-in icons we don't have. */ +function GroupIcon({ group, images }: { group: GroupEntry; images: Record }) { + const base64 = group.iconId >= CUSTOM_ICON_ID_THRESHOLD ? images[`/icon_${group.iconId}`] : undefined; + if (base64) return ; + return ( + + {group.name.trim().charAt(0).toUpperCase() || "?"} + + ); +} + /** Survives ChannelTree remounts when Select's setState rebuilds the tree. * Keyed per session (multi-join tab) so a click in one tab's tree can never * be paired with a click in another tab's tree as a false double-click. */ @@ -1200,6 +1211,24 @@ function ChannelTree({ const collapsedByDefault = (channelId: number) => tree.expandMode === "own" ? !ownPath.has(channelId) : tree.expandDepth > 0 && level > tree.expandDepth; + // "Tooltip Info bei Hover": a plain-text client info card in the native title tooltip. + const clientTooltip = (c: ClientInfo) => { + const groupNames = serverGroups + ? c.serverGroups.map((gid) => serverGroups.find((g) => g.id === gid)?.name).filter(Boolean) + : []; + return [ + c.name, + groupNames.length > 0 && `${t("info.serverGroups")} ${groupNames.join(", ")}`, + c.country && `${t("info.country")} ${c.country}`, + c.away && (c.awayMessage ? `${t("tree.away")}: ${c.awayMessage}` : t("tree.away")), + (c.inputMuted || !c.inputHardwareEnabled) && t("tree.micMuted"), + c.outputMuted && t("tree.soundMuted"), + c.id !== ownClientId && `${t("tree.privateChatWith")} ${c.name}`, + ] + .filter(Boolean) + .join("\n"); + }; + const toggleCollapsed = (channelId: number, event: React.SyntheticEvent) => { event.stopPropagation(); setToggled((prev) => { @@ -1399,11 +1428,7 @@ function ChannelTree({ else return; e.preventDefault(); }} - title={ - c.id === ownClientId || !tree.tooltips - ? undefined - : `${t("tree.privateChatWith")} ${c.name}` - } + title={tree.tooltips ? clientTooltip(c) : undefined} >