diff --git a/docs/examples/KAAK-VOICE.md b/docs/examples/KAAK-VOICE.md index 9ed9fee..e38f1a5 100644 --- a/docs/examples/KAAK-VOICE.md +++ b/docs/examples/KAAK-VOICE.md @@ -1,6 +1,6 @@ # KAAK voice skin -KAAK is a schema v3 open-skin package with full connection and voice-workspace surfaces. Its desktop voice page follows KOOK's proportions: an 80px server rail, a 290px channel pane, a 40px top bar, a central participant stage, right-side chat attached to the current voice channel, and a lower-left voice dock. The server rail uses KOOK's rounded-square silhouette and left-edge active marker, with distinct colored monogram tiles as placeholders. WebSpeak currently exposes the saved server label but no server icon image, so these tiles do not copy KOOK's artwork or expose a connection address. The KOOK voice room is the point-to-point visual reference: composition, member presentation, styling, and motion should be compared directly, rather than treating matching component types or approximate placement as sufficient. The left tree contains the TeamSpeak voice channels only; KOOK's separate text-channel group is outside this pass because TeamSpeak has no equivalent channel type. The current voice channel's text chat remains on the right and can collapse into a narrow rail, then expand again without leaving the voice room. Its header uses the `#` channel mark and an unobtrusive close control; the composer sits at the bottom edge. Messages use author monograms, a separate identity/time line, and readable message text. The central stage uses WebSpeak's reusable member-card widget so available TeamSpeak profile avatars appear inside KAAK's participant tiles; the tiles use a wide 1.82:1 layout with a responsive grid to match KOOK's participant presentation. KAAK's CSS adds hover depth, a speaking ring, and a waveform pulse driven by live voice state. The host's screen-share player appears in the room stage when someone is sharing. The dock retains WebSpeak's trusted voice-quality, audio, screen-share, and disconnect controls. The roster shows connected TeamSpeak clients only; it does not invent an offline list. Channel selection is single-click; joining is double-click. The narrow layout keeps the host's mobile controls available while retaining readable member tiles. +KAAK is a schema v3 open-skin package with full connection and voice-workspace surfaces. Its desktop voice page follows KOOK's proportions: an 80px server rail, a 290px channel pane, a 40px top bar, a central participant stage, right-side chat attached to the current voice channel, and a lower-left voice dock. The server rail uses KOOK's rounded-square silhouette and left-edge active marker, with distinct colored monogram tiles as placeholders. WebSpeak currently exposes the saved server label but no server icon image, so these tiles do not copy KOOK's artwork or expose a connection address. The host provides a stable color-tone number derived only from the privacy-safe label, so a tile keeps its color when the saved list order changes. The KOOK voice room is the point-to-point visual reference: composition, member presentation, styling, and motion should be compared directly, rather than treating matching component types or approximate placement as sufficient. The left tree contains the TeamSpeak voice channels only; KOOK's separate text-channel group is outside this pass because TeamSpeak has no equivalent channel type. The current voice channel's text chat remains on the right and can collapse into a narrow rail, then expand again without leaving the voice room. Its header uses the `#` channel mark and an unobtrusive close control; the composer sits at the bottom edge. Messages use author monograms, a separate identity/time line, and readable message text. The central stage uses WebSpeak's reusable member-card widget so available TeamSpeak profile avatars appear inside KAAK's participant tiles; the tiles use a wide 1.82:1 layout with a responsive grid to match KOOK's participant presentation. KAAK's CSS adds hover depth, a speaking ring, and a waveform pulse driven by live voice state. The host's screen-share player appears in the room stage when someone is sharing. The dock retains WebSpeak's trusted voice-quality, audio, screen-share, and disconnect controls. The roster shows connected TeamSpeak clients only; it does not invent an offline list. Channel selection is single-click; joining is double-click. The narrow layout keeps the host's mobile controls available while retaining readable member tiles. The single TeamSpeak voice-channel group in the left tree can collapse and expand like KOOK's voice group; the separate KOOK text-channel group remains outside this pass. diff --git a/docs/examples/kaak-voice.wskin b/docs/examples/kaak-voice.wskin index 7a2a307..e57b292 100644 Binary files a/docs/examples/kaak-voice.wskin and b/docs/examples/kaak-voice.wskin differ diff --git a/docs/examples/kaak-voice/components.json b/docs/examples/kaak-voice/components.json index 0e43e5d..cf5eb6b 100644 --- a/docs/examples/kaak-voice/components.json +++ b/docs/examples/kaak-voice/components.json @@ -258,6 +258,9 @@ { "tag": "span", "part": "server-monogram", + "attributes": { + "data-tone": "{{server.tone}}" + }, "children": [ { "text": "{{server.monogram}}" diff --git a/docs/examples/kaak-voice/manifest.json b/docs/examples/kaak-voice/manifest.json index 0c6c809..1c10f20 100644 --- a/docs/examples/kaak-voice/manifest.json +++ b/docs/examples/kaak-voice/manifest.json @@ -3,7 +3,7 @@ "packageType": "open-skin", "id": "community.kaak-voice", "name": "KAAK", - "version": "3.1.12", + "version": "3.1.13", "author": "WebSpeak Project", "license": "AGPL-3.0-only", "description": "A KOOK-inspired voice workspace with collapsible voice groups and current voice-channel chat, TeamSpeak profile cards, and animated speaker states.", diff --git a/docs/examples/kaak-voice/skin.css b/docs/examples/kaak-voice/skin.css index 76a1fa6..9710650 100644 --- a/docs/examples/kaak-voice/skin.css +++ b/docs/examples/kaak-voice/skin.css @@ -276,14 +276,13 @@ transition: border-radius .18s ease, transform .18s ease, border-color .18s ease, filter .18s ease; } -[data-ws-plugin-part="kaak-workspace.quick-server-item"]:nth-of-type(8n + 1) [data-ws-plugin-part="kaak-workspace.server-monogram"] { background: linear-gradient(145deg, #b54645, #59304a); } -[data-ws-plugin-part="kaak-workspace.quick-server-item"]:nth-of-type(8n + 2) [data-ws-plugin-part="kaak-workspace.server-monogram"] { background: linear-gradient(145deg, #7756b7, #352d5e); } -[data-ws-plugin-part="kaak-workspace.quick-server-item"]:nth-of-type(8n + 3) [data-ws-plugin-part="kaak-workspace.server-monogram"] { background: linear-gradient(145deg, #268f83, #20524f); } -[data-ws-plugin-part="kaak-workspace.quick-server-item"]:nth-of-type(8n + 4) [data-ws-plugin-part="kaak-workspace.server-monogram"] { background: linear-gradient(145deg, #477fbc, #294763); } -[data-ws-plugin-part="kaak-workspace.quick-server-item"]:nth-of-type(8n + 5) [data-ws-plugin-part="kaak-workspace.server-monogram"] { background: linear-gradient(145deg, #bd5b76, #63374d); } -[data-ws-plugin-part="kaak-workspace.quick-server-item"]:nth-of-type(8n + 6) [data-ws-plugin-part="kaak-workspace.server-monogram"] { background: linear-gradient(145deg, #b97837, #64442f); } -[data-ws-plugin-part="kaak-workspace.quick-server-item"]:nth-of-type(8n + 7) [data-ws-plugin-part="kaak-workspace.server-monogram"] { background: linear-gradient(145deg, #397c9a, #304560); } -[data-ws-plugin-part="kaak-workspace.quick-server-item"]:nth-of-type(8n + 8) [data-ws-plugin-part="kaak-workspace.server-monogram"] { background: linear-gradient(145deg, #638a49, #3a513d); } +[data-ws-plugin-part="kaak-workspace.server-monogram"][data-tone="0"] { background: linear-gradient(145deg, #b54645, #59304a); } +[data-ws-plugin-part="kaak-workspace.server-monogram"][data-tone="1"] { background: linear-gradient(145deg, #7756b7, #352d5e); } +[data-ws-plugin-part="kaak-workspace.server-monogram"][data-tone="2"] { background: linear-gradient(145deg, #268f83, #20524f); } +[data-ws-plugin-part="kaak-workspace.server-monogram"][data-tone="3"] { background: linear-gradient(145deg, #477fbc, #294763); } +[data-ws-plugin-part="kaak-workspace.server-monogram"][data-tone="4"] { background: linear-gradient(145deg, #bd5b76, #63374d); } +[data-ws-plugin-part="kaak-workspace.server-monogram"][data-tone="5"] { background: linear-gradient(145deg, #b97837, #64442f); } +[data-ws-plugin-part="kaak-workspace.server-monogram"][data-tone="6"] { background: linear-gradient(145deg, #638a49, #3a513d); } [data-ws-plugin-part="kaak-workspace.quick-server"][aria-current="true"] [data-ws-plugin-part="kaak-workspace.server-monogram"] { border-color: var(--skin-kaak-accent); diff --git a/src/shared/skin-plugin.ts b/src/shared/skin-plugin.ts index 17ba5af..7411b4d 100644 --- a/src/shared/skin-plugin.ts +++ b/src/shared/skin-plugin.ts @@ -219,7 +219,7 @@ const COLLECTION_FIELDS: Record> = { "session.channels": new Set(["id", "name", "parentId", "depth", "memberCount", "current"]), "session.members": new Set(["id", "name", "avatarInitial", "channelId", "status", "speaking", "self"]), "favorites.items": new Set(["id", "label", "current", "kind"]), - "servers.quickList": new Set(["id", "label", "monogram", "current", "kind", "favorite"]), + "servers.quickList": new Set(["id", "label", "monogram", "tone", "current", "kind", "favorite"]), "chat.messages": new Set(["id", "author", "text", "time", "kind", "channelId"]), "screenShare.streams": new Set(["streamId", "source", "ownerClientId", "ownerNickname", "name", "audio", "viewerCount"]), }; diff --git a/web/public/skins/kaak-voice.wskin b/web/public/skins/kaak-voice.wskin index 7a2a307..e57b292 100644 Binary files a/web/public/skins/kaak-voice.wskin and b/web/public/skins/kaak-voice.wskin differ diff --git a/web/src/services/skin-catalog.ts b/web/src/services/skin-catalog.ts index edf83b5..832ba66 100644 --- a/web/src/services/skin-catalog.ts +++ b/web/src/services/skin-catalog.ts @@ -46,7 +46,7 @@ export const BUILTIN_SKIN_CATALOG: SkinCatalogEntry[] = [ { id: BUILTIN_KAAK_SKIN_ID, name: "KAAK", - version: "3.1.12", + version: "3.1.13", author: "WebSpeak Project", license: "AGPL-3.0-only", description: "A KOOK-inspired voice-room workspace with collapsible voice groups and current voice-channel chat, TeamSpeak profile cards, and host-owned voice controls.", diff --git a/web/src/services/skin-pack.test.ts b/web/src/services/skin-pack.test.ts index 17882ff..4f2204a 100644 --- a/web/src/services/skin-pack.test.ts +++ b/web/src/services/skin-pack.test.ts @@ -464,7 +464,7 @@ test("the distributable KAAK package provides full home and voice surfaces", asy const file = new File([archive], "kaak-voice.wskin", { type: "application/octet-stream" }); const skin = await importSkinPack(file); assert.equal(skin.id, "community.kaak-voice"); - assert.equal(skin.version, "3.1.12"); + assert.equal(skin.version, "3.1.13"); assert.equal(BUILTIN_SKIN_CATALOG.find((entry) => entry.id === skin.id)?.version, skin.version); assert.equal(skin.schemaVersion, 3); const home = skin.pluginData?.components.find((component) => component.page === "home"); @@ -509,6 +509,7 @@ test("the distributable KAAK package provides full home and voice surfaces", asy assert.deepEqual(findPart(voice?.root, "chat")?.when, { path: "state.chatopen", equals: true }); assert.equal(voice?.root.attributes?.["data-chat-open"], "{{state.chatopen}}"); assert.equal(findPart(voice?.root, "server-monogram")?.children?.[0]?.text, "{{server.monogram}}"); + assert.equal(findPart(voice?.root, "server-monogram")?.attributes?.["data-tone"], "{{server.tone}}"); assert.deepEqual(findPart(voice?.root, "channel-voice-members")?.when, { path: "channel.members", empty: false }); assert.equal(findPart(voice?.root, "channel-voice-member")?.repeat?.path, "channel.members"); assert.equal(findPart(voice?.root, "channel-member-avatar")?.children?.[0]?.text, "{{voicemember.avatarInitial}}"); @@ -528,7 +529,7 @@ test("the distributable KAAK package provides full home and voice surfaces", asy assert.equal(findPart(voice?.root, "audio-controls")?.widget, "voice.audio-controls"); assert.ok(skin.css.includes('[data-ws-plugin-part="kaak-workspace.channel-row"]')); assert.match(skin.css, /kaak-workspace\.voice-channel-group-toggle/); - assert.match(skin.css, /kaak-workspace\.quick-server-item.*nth-of-type\(8n \+ 1\)/); + assert.match(skin.css, /kaak-workspace\.server-monogram"\]\[data-tone="0"\]/); assert.match(skin.css, /grid-template-columns: 80px 290px/); assert.match(skin.css, /minmax\(340px, min\(38vw, 520px\)\)/); assert.match(skin.css, /grid-template-rows: 40px/); diff --git a/web/src/services/skin-plugin-context.ts b/web/src/services/skin-plugin-context.ts index f0ab911..6683957 100644 --- a/web/src/services/skin-plugin-context.ts +++ b/web/src/services/skin-plugin-context.ts @@ -5,6 +5,7 @@ export interface SkinPluginQuickServer { id: string; label: string; monogram: string; + tone: number; current: boolean; kind: "favorite" | "recent"; favorite: boolean; @@ -14,6 +15,12 @@ function randomOpaqueId(): string { return globalThis.crypto?.randomUUID?.() ?? `quick-server-${Math.random().toString(36).slice(2)}`; } +function safeLabelTone(label: string): number { + let hash = 0; + for (let index = 0; index < label.length; index++) hash = (Math.imul(hash, 31) + label.charCodeAt(index)) | 0; + return (hash >>> 0) % 7; +} + function containsConnectionTarget(label: string, address: string): boolean { const candidates = new Set([address.trim()]); try { candidates.add(splitTeamSpeakTarget(address).address.trim()); } catch { /* Persisted targets are validated on write. */ } @@ -47,6 +54,7 @@ export function createSkinPluginQuickServerProjection(createId: () => string = r id: opaqueId, label: safeLabel, monogram: Array.from(safeLabel)[0] ?? "?", + tone: safeLabelTone(safeLabel), current: isCurrent(server), kind: server.isFavorite ? "favorite" : "recent", favorite: server.isFavorite, diff --git a/web/src/services/skin-plugin-runtime.test.ts b/web/src/services/skin-plugin-runtime.test.ts index 8c5100c..2cb78ae 100644 --- a/web/src/services/skin-plugin-runtime.test.ts +++ b/web/src/services/skin-plugin-runtime.test.ts @@ -68,6 +68,7 @@ test("skin quick-server data redacts connection targets and resolves only host-g ["Recent 2", "R"], ["Friends", "F"], ]); + assert.ok(rows.every(({ tone }) => Number.isInteger(tone) && tone >= 0 && tone < 7)); assert.deepEqual(rows.map(({ label, kind, favorite, current }) => [label, kind, favorite, current]), [ ["Favorite 1", "favorite", true, false], ["Recent 2", "recent", false, false], @@ -75,6 +76,10 @@ test("skin quick-server data redacts connection targets and resolves only host-g ]); assert.equal(JSON.stringify(rows).includes("192.0.2.10"), false); assert.equal(JSON.stringify(rows).includes("voice.example"), false); + const friendsTone = rows.find(({ label }) => label === "Friends")?.tone; + const reorderedTone = projection.project([servers[2], servers[0], servers[1]], (server) => server.id === "voice2.example:9987") + .find(({ label }) => label === "Friends")?.tone; + assert.equal(reorderedTone, friendsTone, "a server keeps its color tone when its saved-list position changes"); assert.equal(projection.resolve("opaque-1")?.address, "192.0.2.10:9987"); assert.equal(projection.resolve("192.0.2.10:9987"), undefined); });