diff --git a/gateway/src/store.ts b/gateway/src/store.ts index 9312e23..af8e0c8 100644 --- a/gateway/src/store.ts +++ b/gateway/src/store.ts @@ -36,7 +36,7 @@ const STORE_SCREENSHOT_RE = /^data:image\/(png|jpe?g|webp);base64,[A-Za-z0-9+/]+ // grow unbounded from spam that slips past rate limiting (a fresh IP per // submission, say). Bounds worst case to ~300 * 450KB =~ 135MB in RAM. const STORE_MAX_THEMES = 300; -const STORE_BASE_THEMES = new Set(["standard", "nova", "greenteaspeak", "pulse"]); +const STORE_BASE_THEMES = new Set(["standard", "nova", "greenteaspeak", "pulse", "ide"]); // A handful of names (the operator's own) that only whoever holds // STORE_ADMIN_TOKEN may publish under - stops anyone else from impersonating diff --git a/web/src/App.tsx b/web/src/App.tsx index e3be6c0..c8fe814 100644 --- a/web/src/App.tsx +++ b/web/src/App.tsx @@ -1,6 +1,8 @@ import { useEffect, useMemo, useRef, useState, type ReactNode } from "react"; import { useRegisterSW } from "virtual:pwa-register/react"; import "./App.css"; +// After App.css: its :where() base variables have the same (zero) specificity. +import "./styles/ide.css"; const FOCUSABLE = 'button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'; @@ -396,7 +398,7 @@ const DESIGN_THEME_KEY = "webspeak3:design-theme"; const DESIGN_SELECTION_KEY = "webspeak3:design-selection"; const CUSTOM_THEMES_KEY = "webspeak3:custom-themes"; -type DesignTheme = "standard" | "nova" | "greenteaspeak" | "pulse"; +type DesignTheme = "standard" | "nova" | "greenteaspeak" | "pulse" | "ide"; /** A user-authored theme package: a name, which built-in layout it behaves like * (Standard's plain chrome, Nova's collapsed menu/splash, GreenTeaSpeak shell, @@ -436,7 +438,9 @@ const STORE_ADMIN_TOKEN_KEY = "webspeak3:store-admin-token"; const STORE_SCREENSHOT_MAX_DATA_URL_LENGTH = 400_000; function isDesignTheme(value: string): value is DesignTheme { - return value === "standard" || value === "nova" || value === "greenteaspeak" || value === "pulse"; + return ( + value === "standard" || value === "nova" || value === "greenteaspeak" || value === "pulse" || value === "ide" + ); } function loadDesignTheme(): DesignTheme { @@ -455,6 +459,7 @@ function resolveDesignThemeBase(selection: string, customThemes: CustomTheme[]): function designThemeClassName(theme: DesignTheme): string { if (theme === "nova") return " ts-design-nova"; if (theme === "pulse") return " ts-design-pulse"; + if (theme === "ide") return " ts-design-ide"; if (isGreenteaSpeakTheme(theme)) return " ts-design-greenteaspeak"; return ""; } @@ -463,6 +468,7 @@ function designThemeLabel(theme: DesignTheme, t: (key: string) => string): strin if (theme === "nova") return t("design.theme.nova"); if (theme === "greenteaspeak") return t("design.theme.greenteaspeak"); if (theme === "pulse") return t("design.theme.pulse"); + if (theme === "ide") return t("design.theme.ide"); return t("design.theme.standard"); } @@ -1335,12 +1341,24 @@ function SpeakingNowBar({ talkers, ownClientId, images, + serverGroups, + selectedClientId, + onSelect, + onOpenPrivateChat, + onContextMenu, }: { clients: ClientInfo[]; talkers: Set; ownClientId: number | null; images: Record; + /** IDE layout only: render group tags and a mic status next to the name. */ + serverGroups?: GroupEntry[] | null; + selectedClientId: number | null; + onSelect: (clientId: number) => void; + onOpenPrivateChat: (clientId: number, clientName: string) => void; + onContextMenu: (e: React.MouseEvent, clientId: number, clientName: string, isSelf: boolean) => void; }) { + const t = useT(); const own = clients.find((c) => c.id === ownClientId); if (!own) return null; const channelClients = clients.filter((c) => c.channel === own.channel); @@ -1351,11 +1369,54 @@ function SpeakingNowBar({ {channelClients.map((c) => (
onSelect(c.id)} + onDoubleClick={c.id === ownClientId ? undefined : () => onOpenPrivateChat(c.id, c.name)} + onContextMenu={(e) => onContextMenu(e, c.id, c.name, c.id === ownClientId)} > - {c.name} + {serverGroups === undefined ? ( + {c.name} + ) : ( +
+
+ {c.name} + {talkers.has(c.id) ? ( + + ) : ( + (c.inputMuted || !c.inputHardwareEnabled) && ( + + ) + )} +
+
+ {c.serverGroups + .map((gid) => serverGroups?.find((g) => g.id === gid)) + .filter((g): g is GroupEntry => !!g) + .map((g) => ( + + {g.name} + + ))} +
+ {(c.away || c.outputMuted) && ( +
+ {c.away ? `${t("tree.away")}${c.awayMessage ? `: ${c.awayMessage}` : ""}` : t("tree.soundMuted")} +
+ )} +
+ )}
))} @@ -5549,6 +5610,7 @@ function DesignPanel({ desc: t("design.theme.greenteaspeak.desc"), }, { id: "pulse", name: t("design.theme.pulse"), desc: t("design.theme.pulse.desc") }, + { id: "ide", name: t("design.theme.ide"), desc: t("design.theme.ide.desc") }, ]; const handleSaveEditing = () => { @@ -5622,6 +5684,7 @@ function DesignPanel({ +