mirror of
https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak.git
synced 2026-12-02 19:42:51 +08:00
feat(kaak): add collapsible voice channel group
This commit is contained in:
1 parent
b9c017f9aa
commit
7fb5e1d6ea
8 files changed
+274
-157
No files matched your search
@@ -2,6 +2,8 @@
|
||||
|
||||
KAAK is a schema v3 open-skin package with full connection and voice-workspace surfaces. Its voice page uses a narrow server rail, a server/channel tree, a central participant stage, right-side chat attached to the current voice channel, and a lower-left voice dock. The server rail follows KOOK's rounded-square icon shape and left-edge active marker. 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; 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 large portrait tiles; KAAK's CSS styles the cards and 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.
|
||||
|
||||
The design target is the voice-client portion of KOOK, as requested by the project owner. It does not include discovery, companion/party, event, store, advertising, administrator, or other service-operator pages. It does not add a KOOK account flow, direct messages, server administration, or channels absent from the connected TeamSpeak server.
|
||||
|
||||
## Reference access note
|
||||
|
||||
Binary file not shown.
@@ -169,12 +169,19 @@
|
||||
"args": {
|
||||
"key": "chatopen"
|
||||
}
|
||||
},
|
||||
"toggle-voice-group": {
|
||||
"type": "ui.toggleState",
|
||||
"args": {
|
||||
"key": "voicegroupopen"
|
||||
}
|
||||
}
|
||||
},
|
||||
"state": {
|
||||
"selectedchannel": "",
|
||||
"message": "",
|
||||
"chatopen": true
|
||||
"chatopen": true,
|
||||
"voicegroupopen": true
|
||||
},
|
||||
"root": {
|
||||
"tag": "main",
|
||||
@@ -328,171 +335,213 @@
|
||||
},
|
||||
"children": [
|
||||
{
|
||||
"tag": "h2",
|
||||
"part": "section-label",
|
||||
"tag": "button",
|
||||
"part": "voice-channel-group-toggle",
|
||||
"attributes": {
|
||||
"type": "button",
|
||||
"aria-expanded": "{{state.voicegroupopen}}",
|
||||
"aria-label": "展开或收起语音分组 / Toggle voice group"
|
||||
},
|
||||
"events": {
|
||||
"click": "toggle-voice-group"
|
||||
},
|
||||
"children": [
|
||||
{
|
||||
"text": "频道 / CHANNELS"
|
||||
"tag": "span",
|
||||
"part": "voice-group-chevron",
|
||||
"attributes": {
|
||||
"aria-hidden": "true"
|
||||
},
|
||||
"children": [
|
||||
{
|
||||
"text": "›"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"tag": "span",
|
||||
"part": "voice-group-name",
|
||||
"children": [
|
||||
{
|
||||
"text": "语音分组"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"tag": "div",
|
||||
"part": "channel-item",
|
||||
"repeat": {
|
||||
"path": "session.channels",
|
||||
"as": "channel"
|
||||
"part": "voice-channel-list",
|
||||
"when": {
|
||||
"path": "state.voicegroupopen",
|
||||
"equals": true
|
||||
},
|
||||
"children": [
|
||||
{
|
||||
"tag": "button",
|
||||
"part": "channel-row",
|
||||
"attributes": {
|
||||
"type": "button",
|
||||
"aria-current": "{{channel.current}}",
|
||||
"aria-label": "双击加入 {{channel.name}}",
|
||||
"data-depth": "{{channel.depth}}"
|
||||
},
|
||||
"events": {
|
||||
"click": "select-channel",
|
||||
"dblclick": "join-channel"
|
||||
},
|
||||
"tag": "div",
|
||||
"part": "voice-channel-items",
|
||||
"children": [
|
||||
{
|
||||
"tag": "span",
|
||||
"part": "channel-glyph",
|
||||
"children": [
|
||||
{
|
||||
"text": "◉"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"tag": "span",
|
||||
"part": "channel-name",
|
||||
"children": [
|
||||
{
|
||||
"text": "{{channel.name}}"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"tag": "small",
|
||||
"part": "channel-count",
|
||||
"children": [
|
||||
{
|
||||
"text": "{{channel.memberCount}}"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"tag": "span",
|
||||
"part": "selected-channel-indicator",
|
||||
"when": {
|
||||
"path": "state.selectedchannel",
|
||||
"equals": "{{channel.id}}"
|
||||
},
|
||||
"attributes": {
|
||||
"aria-label": "当前频道"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"tag": "ul",
|
||||
"part": "channel-voice-members",
|
||||
"when": {
|
||||
"path": "channel.members",
|
||||
"empty": false
|
||||
},
|
||||
"attributes": {
|
||||
"aria-label": "此频道中的语音成员 / Voice members in this channel"
|
||||
},
|
||||
"children": [
|
||||
{
|
||||
"tag": "li",
|
||||
"part": "channel-voice-member",
|
||||
"tag": "div",
|
||||
"part": "channel-item",
|
||||
"repeat": {
|
||||
"path": "channel.members",
|
||||
"as": "voicemember"
|
||||
"path": "session.channels",
|
||||
"as": "channel"
|
||||
},
|
||||
"children": [
|
||||
{
|
||||
"tag": "span",
|
||||
"part": "channel-member-avatar",
|
||||
"tag": "button",
|
||||
"part": "channel-row",
|
||||
"attributes": {
|
||||
"type": "button",
|
||||
"aria-current": "{{channel.current}}",
|
||||
"aria-label": "双击加入 {{channel.name}}",
|
||||
"data-depth": "{{channel.depth}}"
|
||||
},
|
||||
"events": {
|
||||
"click": "select-channel",
|
||||
"dblclick": "join-channel"
|
||||
},
|
||||
"children": [
|
||||
{
|
||||
"text": "{{voicemember.avatarInitial}}"
|
||||
"tag": "span",
|
||||
"part": "channel-glyph",
|
||||
"children": [
|
||||
{
|
||||
"text": "◉"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"tag": "span",
|
||||
"part": "channel-name",
|
||||
"children": [
|
||||
{
|
||||
"text": "{{channel.name}}"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"tag": "small",
|
||||
"part": "channel-count",
|
||||
"children": [
|
||||
{
|
||||
"text": "{{channel.memberCount}}"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"tag": "span",
|
||||
"part": "selected-channel-indicator",
|
||||
"when": {
|
||||
"path": "state.selectedchannel",
|
||||
"equals": "{{channel.id}}"
|
||||
},
|
||||
"attributes": {
|
||||
"aria-label": "当前频道"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"tag": "span",
|
||||
"part": "channel-member-name",
|
||||
"children": [
|
||||
{
|
||||
"text": "{{voicemember.name}}"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"tag": "span",
|
||||
"part": "channel-member-muted",
|
||||
"tag": "ul",
|
||||
"part": "channel-voice-members",
|
||||
"when": {
|
||||
"path": "voicemember.status",
|
||||
"equals": "muted"
|
||||
"path": "channel.members",
|
||||
"empty": false
|
||||
},
|
||||
"attributes": {
|
||||
"aria-label": "麦克风已静音"
|
||||
"aria-label": "此频道中的语音成员 / Voice members in this channel"
|
||||
},
|
||||
"children": [
|
||||
{
|
||||
"text": "已静音"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"tag": "span",
|
||||
"part": "channel-member-away",
|
||||
"when": {
|
||||
"path": "voicemember.status",
|
||||
"equals": "away"
|
||||
},
|
||||
"attributes": {
|
||||
"aria-label": "离开"
|
||||
},
|
||||
"children": [
|
||||
{
|
||||
"text": "离开中"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"tag": "span",
|
||||
"part": "channel-member-state",
|
||||
"when": {
|
||||
"path": "voicemember.self",
|
||||
"equals": true
|
||||
},
|
||||
"children": [
|
||||
{
|
||||
"text": "你"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"tag": "span",
|
||||
"part": "channel-member-state",
|
||||
"when": {
|
||||
"path": "voicemember.speaking",
|
||||
"equals": true
|
||||
},
|
||||
"attributes": {
|
||||
"aria-label": "正在讲话"
|
||||
},
|
||||
"children": [
|
||||
{
|
||||
"text": "●"
|
||||
"tag": "li",
|
||||
"part": "channel-voice-member",
|
||||
"repeat": {
|
||||
"path": "channel.members",
|
||||
"as": "voicemember"
|
||||
},
|
||||
"children": [
|
||||
{
|
||||
"tag": "span",
|
||||
"part": "channel-member-avatar",
|
||||
"children": [
|
||||
{
|
||||
"text": "{{voicemember.avatarInitial}}"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"tag": "span",
|
||||
"part": "channel-member-name",
|
||||
"children": [
|
||||
{
|
||||
"text": "{{voicemember.name}}"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"tag": "span",
|
||||
"part": "channel-member-muted",
|
||||
"when": {
|
||||
"path": "voicemember.status",
|
||||
"equals": "muted"
|
||||
},
|
||||
"attributes": {
|
||||
"aria-label": "麦克风已静音"
|
||||
},
|
||||
"children": [
|
||||
{
|
||||
"text": "已静音"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"tag": "span",
|
||||
"part": "channel-member-away",
|
||||
"when": {
|
||||
"path": "voicemember.status",
|
||||
"equals": "away"
|
||||
},
|
||||
"attributes": {
|
||||
"aria-label": "离开"
|
||||
},
|
||||
"children": [
|
||||
{
|
||||
"text": "离开中"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"tag": "span",
|
||||
"part": "channel-member-state",
|
||||
"when": {
|
||||
"path": "voicemember.self",
|
||||
"equals": true
|
||||
},
|
||||
"children": [
|
||||
{
|
||||
"text": "你"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"tag": "span",
|
||||
"part": "channel-member-state",
|
||||
"when": {
|
||||
"path": "voicemember.speaking",
|
||||
"equals": true
|
||||
},
|
||||
"attributes": {
|
||||
"aria-label": "正在讲话"
|
||||
},
|
||||
"children": [
|
||||
{
|
||||
"text": "●"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -916,12 +965,13 @@
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"attributes": {
|
||||
"data-chat-open": "{{state.chatopen}}"
|
||||
}
|
||||
}
|
||||
],
|
||||
"attributes": {
|
||||
"data-chat-open": "{{state.chatopen}}",
|
||||
"data-voice-group-open": "{{state.voicegroupopen}}"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -3,10 +3,10 @@
|
||||
"packageType": "open-skin",
|
||||
"id": "community.kaak-voice",
|
||||
"name": "KAAK",
|
||||
"version": "3.1.8",
|
||||
"version": "3.1.9",
|
||||
"author": "WebSpeak Project",
|
||||
"license": "AGPL-3.0-only",
|
||||
"description": "A KOOK-inspired voice workspace with collapsible current voice-channel chat, TeamSpeak profile cards, and animated speaker states.",
|
||||
"description": "A KOOK-inspired voice workspace with collapsible voice groups and current voice-channel chat, TeamSpeak profile cards, and animated speaker states.",
|
||||
"entry": "skin.css",
|
||||
"components": "components.json",
|
||||
"content": "content.json",
|
||||
|
||||
@@ -363,14 +363,53 @@
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
[data-ws-plugin-part="kaak-workspace.server-subtitle"],
|
||||
[data-ws-plugin-part="kaak-workspace.section-label"] {
|
||||
[data-ws-plugin-part="kaak-workspace.server-subtitle"] {
|
||||
color: var(--skin-kaak-dim);
|
||||
font-size: 10px;
|
||||
font-weight: 800;
|
||||
letter-spacing: .08em;
|
||||
}
|
||||
|
||||
[data-ws-plugin-part="kaak-workspace.voice-channel-group-toggle"] {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 7px;
|
||||
min-height: 25px;
|
||||
margin: 0 8px 7px;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
color: var(--skin-kaak-dim);
|
||||
background: transparent;
|
||||
font: inherit;
|
||||
font-size: 10px;
|
||||
font-weight: 800;
|
||||
letter-spacing: .08em;
|
||||
text-align: left;
|
||||
cursor: pointer;
|
||||
transition: color .16s ease, background-color .16s ease;
|
||||
}
|
||||
|
||||
[data-ws-plugin-part="kaak-workspace.voice-channel-group-toggle"]:hover,
|
||||
[data-ws-plugin-part="kaak-workspace.voice-channel-group-toggle"]:focus-visible {
|
||||
color: var(--skin-kaak-text);
|
||||
}
|
||||
|
||||
[data-ws-plugin-part="kaak-workspace.voice-group-chevron"] {
|
||||
display: inline-grid;
|
||||
place-items: center;
|
||||
width: 12px;
|
||||
color: var(--skin-kaak-muted);
|
||||
font-size: 17px;
|
||||
line-height: 1;
|
||||
transition: transform .16s ease;
|
||||
}
|
||||
|
||||
[data-ws-plugin-part="kaak-workspace"][data-voice-group-open="true"] [data-ws-plugin-part="kaak-workspace.voice-group-chevron"] {
|
||||
transform: rotate(90deg);
|
||||
}
|
||||
|
||||
[data-ws-plugin-part="kaak-workspace.voice-group-name"] { min-width: 0; }
|
||||
|
||||
[data-ws-plugin-part="kaak-workspace.channel-list"] {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@@ -379,12 +418,22 @@
|
||||
padding-top: 13px;
|
||||
}
|
||||
|
||||
[data-ws-plugin-part="kaak-workspace.section-label"] { margin: 0 8px 7px; }
|
||||
|
||||
[data-ws-plugin-part="kaak-workspace.voice-channel-list"] {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-width: 0;
|
||||
animation: kaak-voice-group-open .18s ease both;
|
||||
}
|
||||
|
||||
[data-ws-plugin-part="kaak-workspace.voice-channel-items"] {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
@keyframes kaak-voice-group-open {
|
||||
from { opacity: 0; transform: translateY(-3px); }
|
||||
to { opacity: 1; transform: translateY(0); }
|
||||
}
|
||||
|
||||
[data-ws-plugin-part="kaak-workspace.channel-row"] {
|
||||
@@ -1133,8 +1182,7 @@
|
||||
}
|
||||
|
||||
[data-ws-plugin-part="kaak-workspace.server-name"] { max-width: 60%; font-size: 11px; }
|
||||
[data-ws-plugin-part="kaak-workspace.server-subtitle"],
|
||||
[data-ws-plugin-part="kaak-workspace.channel-list"] > [data-ws-plugin-part="kaak-workspace.section-label"] { display: none; }
|
||||
[data-ws-plugin-part="kaak-workspace.server-subtitle"] { display: none; }
|
||||
[data-ws-plugin-part="kaak-workspace.channel-list"] {
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
@@ -1142,11 +1190,24 @@
|
||||
overflow: auto hidden;
|
||||
padding: 0;
|
||||
}
|
||||
[data-ws-plugin-part="kaak-workspace.channel-list"] > [data-ws-plugin-part="kaak-workspace.voice-channel-group-toggle"] {
|
||||
display: grid;
|
||||
flex: 0 0 30px;
|
||||
place-items: center;
|
||||
width: 30px;
|
||||
min-height: 38px;
|
||||
margin: 0;
|
||||
border-radius: 7px;
|
||||
background: var(--skin-kaak-raised);
|
||||
}
|
||||
[data-ws-plugin-part="kaak-workspace.voice-group-name"] { display: none; }
|
||||
[data-ws-plugin-part="kaak-workspace.voice-group-chevron"] { width: auto; font-size: 20px; }
|
||||
[data-ws-plugin-part="kaak-workspace"]:has([data-chat-open="false"]) {
|
||||
grid-template-columns: 56px minmax(0, 1fr);
|
||||
grid-template-rows: 50px 126px minmax(176px, 24dvh) 44px 74px;
|
||||
}
|
||||
[data-ws-plugin-part="kaak-workspace.voice-channel-list"] { flex: 0 0 auto; flex-direction: row; align-items: flex-start; gap: 5px; }
|
||||
[data-ws-plugin-part="kaak-workspace.voice-channel-list"] { flex: 0 0 auto; }
|
||||
[data-ws-plugin-part="kaak-workspace.voice-channel-items"] { flex-direction: row; align-items: flex-start; gap: 5px; }
|
||||
[data-ws-plugin-part="kaak-workspace.channel-item"] { flex: 0 0 auto; }
|
||||
[data-ws-plugin-part="kaak-workspace.channel-row"] { width: max-content; min-width: 116px; min-height: 42px; margin: 0; }
|
||||
[data-ws-plugin-part="kaak-workspace.channel-row"][data-depth] { padding-inline-start: 9px; }
|
||||
|
||||
Binary file not shown.
@@ -46,10 +46,10 @@ export const BUILTIN_SKIN_CATALOG: SkinCatalogEntry[] = [
|
||||
{
|
||||
id: BUILTIN_KAAK_SKIN_ID,
|
||||
name: "KAAK",
|
||||
version: "3.1.8",
|
||||
version: "3.1.9",
|
||||
author: "WebSpeak Project",
|
||||
license: "AGPL-3.0-only",
|
||||
description: "A KOOK-inspired voice-room workspace with collapsible current voice-channel chat, TeamSpeak profile cards, and host-owned voice controls.",
|
||||
description: "A KOOK-inspired voice-room workspace with collapsible voice groups and current voice-channel chat, TeamSpeak profile cards, and host-owned voice controls.",
|
||||
minAppVersion: "0.2.7-preview",
|
||||
installedAt: 0,
|
||||
builtIn: true,
|
||||
|
||||
@@ -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.8");
|
||||
assert.equal(skin.version, "3.1.9");
|
||||
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");
|
||||
@@ -498,8 +498,11 @@ test("the distributable KAAK package provides full home and voice surfaces", asy
|
||||
assert.equal(channelRow?.events?.dblclick, "join-channel");
|
||||
assert.equal(findPart(voice?.root, "text-channel-group-toggle"), undefined);
|
||||
assert.equal(findPart(voice?.root, "text-channel-list"), undefined);
|
||||
assert.equal(findPart(voice?.root, "voice-channel-group-toggle"), undefined);
|
||||
assert.equal(findPart(voice?.root, "voice-channel-list")?.when, undefined);
|
||||
const voiceGroupToggle = findPart(voice?.root, "voice-channel-group-toggle");
|
||||
assert.equal(voiceGroupToggle?.events?.click, "toggle-voice-group");
|
||||
assert.equal(voiceGroupToggle?.attributes?.["aria-expanded"], "{{state.voicegroupopen}}");
|
||||
assert.deepEqual(findPart(voice?.root, "voice-channel-list")?.when, { path: "state.voicegroupopen", equals: true });
|
||||
assert.equal(voice?.root.attributes?.["data-voice-group-open"], "{{state.voicegroupopen}}");
|
||||
const chatToggle = findPart(voice?.root, "chat-panel-toggle");
|
||||
assert.equal(chatToggle?.events?.click, "toggle-chat-panel");
|
||||
assert.equal(chatToggle?.attributes?.["aria-expanded"], "{{state.chatopen}}");
|
||||
@@ -521,6 +524,7 @@ test("the distributable KAAK package provides full home and voice surfaces", asy
|
||||
assert.equal(findPart(voice?.root, "screen-share-start")?.widget, "voice.screen-share-start");
|
||||
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, /data-chat-open="false"[\s\S]*?grid-template-columns:[^;]*52px;/);
|
||||
assert.match(skin.css, /kaak-workspace\.chat-panel-toggle/);
|
||||
assert.match(skin.css, /kaak-workspace\.voice-stage[\s\S]*?grid-column: 3;/);
|
||||
|
||||
Reference in new issue
Block a user