mirror of
https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak.git
synced 2026-12-03 03:52:50 +08:00
feat(skins): refine KAAK voice workspace fidelity
This commit is contained in:
1 parent
ad0aa5c120
commit
7f5d3e1b3c
14 files changed
+134
-35
No files matched your search
@@ -48,7 +48,7 @@ v4 当前运行路径已不使用 v3 固定标签/属性/状态/动作表来构
|
||||
|
||||
- session.status.read:连接状态、当前频道和显示名称。
|
||||
- session.channels.read:公开频道树、频道名称、层级、人数和当前频道标志。
|
||||
- session.members.read:可见成员名称、所在频道、在线状态、说话状态及本人标志。
|
||||
- session.members.read:可见成员名称、由名称派生的首字标记、所在频道、在线状态、说话状态及本人标志;不提供成员头像图像。
|
||||
- chat.channel.read:当前公开文字频道中可见的消息。
|
||||
- favorites.read:收藏项名称、类型、是否当前项和随机不透明本地令牌;不提供地址或凭据。
|
||||
- servers.quickList.read:统一后的收藏和最近连接名称、当前项、分类与随机不透明本地令牌;不提供地址或凭据。
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# KAAK voice skin
|
||||
|
||||
KAAK is a schema v3 open-skin package with full connection and voice-workspace surfaces. Its voice page uses a narrow server rail, grouped TeamSpeak channels with inline voice participants, a central text chat, an online-member column, and a lower-left voice dock. Channel selection is single-click; joining is double-click. The narrow layout keeps the host's mobile controls available.
|
||||
KAAK is a schema v3 open-skin package with full connection and voice-workspace surfaces. Its voice page uses a narrow server rail, hierarchical TeamSpeak channels with inline participants under every occupied channel, a central text chat, an online-member column, and a lower-left voice dock. The dock includes WebSpeak's host-owned voice-quality panel. The roster labels connected clients as online; it does not fabricate an offline list because TeamSpeak only supplies connected members. Channel selection is single-click; joining is double-click. The narrow layout keeps the host's mobile controls available.
|
||||
|
||||
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.
|
||||
|
||||
@@ -12,7 +12,7 @@ The owner authorized inspection of the first two voice rooms in the KOOK server.
|
||||
|
||||
The connection page and voice workspace are full-page declarative surfaces in [components.json](./kaak-voice/components.json). The voice surface requests only the capabilities it uses: visible server shortcuts, channel and member data, channel joining, channel chat, voice status, microphone/output controls, whisper controls, disconnect, and screen sharing. The host renders trusted connection, language, skin, audio, and screen-share controls. It rechecks permissions and connection state when each action runs; approval is local to this skin version and can be revoked from the host access control.
|
||||
|
||||
The skin does not receive server addresses, passwords, identity keys, raw audio, private messages, or arbitrary network/storage APIs. Its markup is data-only; it contains no executable JavaScript or Wasm. The `/demo` page uses synthetic data and does not connect to TeamSpeak.
|
||||
Member avatar circles use the first character derived from the visible nickname; KAAK does not read profile image files. The skin does not receive server addresses, passwords, identity keys, raw audio, private messages, or arbitrary network/storage APIs. Its markup is data-only; it contains no executable JavaScript or Wasm. The `/demo` page uses synthetic data and does not connect to TeamSpeak.
|
||||
|
||||
## Files
|
||||
|
||||
|
||||
Binary file not shown.
@@ -245,7 +245,7 @@
|
||||
"part": "server-monogram",
|
||||
"children": [
|
||||
{
|
||||
"text": "{{server.label}}"
|
||||
"text": "{{server.monogram}}"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -394,8 +394,8 @@
|
||||
"tag": "ul",
|
||||
"part": "channel-voice-members",
|
||||
"when": {
|
||||
"path": "channel.current",
|
||||
"equals": true
|
||||
"path": "channel.members",
|
||||
"empty": false
|
||||
},
|
||||
"attributes": {
|
||||
"aria-label": "此频道中的语音成员 / Voice members in this channel"
|
||||
@@ -414,7 +414,7 @@
|
||||
"part": "channel-member-avatar",
|
||||
"children": [
|
||||
{
|
||||
"text": "{{voicemember.name}}"
|
||||
"text": "{{voicemember.avatarInitial}}"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -681,6 +681,15 @@
|
||||
"tag": "ul",
|
||||
"part": "member-list",
|
||||
"children": [
|
||||
{
|
||||
"tag": "li",
|
||||
"part": "member-group-label",
|
||||
"children": [
|
||||
{
|
||||
"text": "在线 / ONLINE"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"tag": "li",
|
||||
"part": "member-row",
|
||||
@@ -694,7 +703,7 @@
|
||||
"part": "member-avatar",
|
||||
"children": [
|
||||
{
|
||||
"text": "{{member.name}}"
|
||||
"text": "{{member.avatarInitial}}"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -844,6 +853,10 @@
|
||||
"text": "语音已连接"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"widget": "voice.performance-panel",
|
||||
"part": "performance-panel"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"packageType": "open-skin",
|
||||
"id": "community.kaak-voice",
|
||||
"name": "KAAK",
|
||||
"version": "3.0.1",
|
||||
"version": "3.0.6",
|
||||
"author": "WebSpeak Project",
|
||||
"license": "AGPL-3.0-only",
|
||||
"description": "A complete dark voice-client workspace inspired by modern voice apps, built with WebSpeak host controls and public TeamSpeak data.",
|
||||
|
||||
@@ -171,13 +171,12 @@
|
||||
|
||||
[data-ws-plugin-part="kaak-workspace.quick-server"] {
|
||||
display: grid;
|
||||
justify-items: center;
|
||||
gap: 3px;
|
||||
width: 52px;
|
||||
min-height: 54px;
|
||||
padding: 4px;
|
||||
place-items: center;
|
||||
width: 50px;
|
||||
min-height: 50px;
|
||||
padding: 1px;
|
||||
border: 0;
|
||||
border-radius: 13px;
|
||||
border-radius: 50%;
|
||||
color: var(--skin-kaak-muted);
|
||||
background: transparent;
|
||||
cursor: pointer;
|
||||
@@ -191,26 +190,31 @@
|
||||
|
||||
[data-ws-plugin-part="kaak-workspace.quick-server"][aria-current="true"] {
|
||||
color: var(--skin-kaak-text);
|
||||
background: var(--skin-kaak-raised);
|
||||
box-shadow: inset 3px 0 var(--skin-kaak-accent);
|
||||
}
|
||||
|
||||
[data-ws-plugin-part="kaak-workspace.server-monogram"] {
|
||||
display: grid;
|
||||
place-items: center;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
width: 42px;
|
||||
height: 42px;
|
||||
overflow: hidden;
|
||||
border: 1px solid #ffffff12;
|
||||
border-radius: 13px;
|
||||
border-radius: 50%;
|
||||
color: var(--skin-kaak-text);
|
||||
background: linear-gradient(145deg, #383a40, #222429);
|
||||
font-size: 11px;
|
||||
font-size: 15px;
|
||||
font-weight: 800;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
[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);
|
||||
background: color-mix(in srgb, var(--skin-kaak-accent) 18%, #222429);
|
||||
}
|
||||
|
||||
[data-ws-plugin-part="kaak-workspace.server-kind"] {
|
||||
display: none;
|
||||
color: var(--skin-kaak-dim);
|
||||
font-size: 8px;
|
||||
line-height: 1;
|
||||
@@ -570,6 +574,16 @@
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
[data-ws-plugin-part="kaak-workspace.member-group-label"] {
|
||||
grid-column: 1 / -1;
|
||||
margin: 8px 5px 2px;
|
||||
color: var(--skin-kaak-dim);
|
||||
font-size: 9px;
|
||||
font-weight: 800;
|
||||
letter-spacing: .08em;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
[data-ws-plugin-part="kaak-workspace.member-row"] {
|
||||
display: grid;
|
||||
grid-template-columns: 32px minmax(0, 1fr);
|
||||
@@ -636,11 +650,39 @@
|
||||
[data-ws-plugin-part="kaak-workspace.voice-dock-heading"] {
|
||||
grid-column: 1 / -1;
|
||||
display: grid;
|
||||
grid-template-columns: 10px minmax(0, 1fr);
|
||||
grid-template-columns: 10px minmax(0, 1fr) auto;
|
||||
align-items: center;
|
||||
gap: 2px 7px;
|
||||
}
|
||||
|
||||
[data-ws-plugin-part="kaak-workspace.performance-panel"] {
|
||||
grid-column: 3;
|
||||
grid-row: 1 / 3;
|
||||
align-self: center;
|
||||
}
|
||||
|
||||
[data-ws-plugin-part="kaak-workspace.performance-panel"] [data-ws-part="voice.performance"] > button {
|
||||
min-height: 28px;
|
||||
padding: 0 7px;
|
||||
border-color: var(--skin-kaak-border);
|
||||
border-radius: 7px;
|
||||
color: var(--skin-kaak-muted);
|
||||
background: var(--skin-kaak-raised);
|
||||
font-size: 9px;
|
||||
}
|
||||
|
||||
[data-ws-plugin-part="kaak-workspace.performance-panel"] [data-ws-part="voice.performance.panel"] {
|
||||
top: auto;
|
||||
right: auto;
|
||||
left: 0;
|
||||
bottom: calc(100% + 8px);
|
||||
width: min(380px, calc(100vw - 96px));
|
||||
z-index: 20;
|
||||
color: var(--skin-kaak-text);
|
||||
background: var(--skin-kaak-panel);
|
||||
border-color: var(--skin-kaak-border);
|
||||
}
|
||||
|
||||
[data-ws-plugin-part="kaak-workspace.voice-dock-actions"] {
|
||||
grid-column: 1 / -1;
|
||||
display: flex;
|
||||
@@ -852,6 +894,7 @@
|
||||
overflow: auto hidden;
|
||||
margin: 0;
|
||||
}
|
||||
[data-ws-plugin-part="kaak-workspace.member-group-label"] { align-self: center; margin: 0 3px; white-space: nowrap; }
|
||||
[data-ws-plugin-part="kaak-workspace.member-row"] { flex: 0 0 auto; grid-template-columns: 28px auto; min-height: 38px; padding: 2px 4px; }
|
||||
[data-ws-plugin-part="kaak-workspace.member-avatar"] { width: 26px; height: 26px; }
|
||||
[data-ws-plugin-part="kaak-workspace.speaking-indicator"] { display: none; }
|
||||
@@ -871,7 +914,7 @@
|
||||
border-right: 0;
|
||||
border-bottom: 0;
|
||||
}
|
||||
[data-ws-plugin-part="kaak-workspace.voice-dock-heading"] { grid-column: auto; grid-row: auto; }
|
||||
[data-ws-plugin-part="kaak-workspace.voice-dock-heading"] { grid-column: auto; grid-row: auto; grid-template-columns: 10px minmax(0, 1fr) auto; }
|
||||
[data-ws-plugin-part="kaak-workspace.voice-dock-actions"] { grid-column: 2; grid-row: 1; justify-content: flex-end; gap: 3px; }
|
||||
[data-ws-plugin-part="kaak-workspace.voice-dock-caption"] { display: none; }
|
||||
[data-ws-plugin-part="kaak-workspace.disconnect-control"] { grid-column: 2; grid-row: 1; }
|
||||
|
||||
@@ -255,12 +255,31 @@ test("skin plugins can repeat channel members only under a channel alias and wit
|
||||
children: [{
|
||||
tag: "li",
|
||||
repeat: { path: "channel.members", as: "member" },
|
||||
children: [{ text: "{{channel.name}} — {{member.name}}" }],
|
||||
children: [{ text: "{{channel.name}} — {{member.avatarInitial}} {{member.name}}" }],
|
||||
}],
|
||||
}];
|
||||
const parsed = parseSkinPluginDocument(document);
|
||||
const nestedMember = parsed.components[0].root.children?.[0].children?.[0];
|
||||
assert.deepEqual(nestedMember?.repeat, { path: "channel.members", as: "member" });
|
||||
assert.equal(nestedMember?.children?.[0]?.text, "{{channel.name}} — {{member.avatarInitial}} {{member.name}}");
|
||||
|
||||
const membersOnly = structuredClone(document);
|
||||
membersOnly.components[0].root.children = [{
|
||||
tag: "ul",
|
||||
when: { path: "channel.members", empty: false },
|
||||
children: [{ tag: "li", repeat: { path: "channel.members", as: "member" } }],
|
||||
}];
|
||||
const parsedCondition = parseSkinPluginDocument(membersOnly).components[0].root.children?.[0];
|
||||
assert.deepEqual(parsedCondition?.when, { path: "channel.members", empty: false });
|
||||
|
||||
const missingConditionPermission = structuredClone(membersOnly);
|
||||
missingConditionPermission.components[0].permissions = ["session.channels.read", "session.channel.join"];
|
||||
missingConditionPermission.components[0].root.children![0].children = [];
|
||||
errorCode(() => parseSkinPluginDocument(missingConditionPermission), "SKIN_PLUGIN_PERMISSION_MISSING");
|
||||
|
||||
const invalidNestedCondition = structuredClone(membersOnly);
|
||||
invalidNestedCondition.components[0].root.children![0].when = { path: "channel.members" };
|
||||
errorCode(() => parseSkinPluginDocument(invalidNestedCondition), "SKIN_PLUGIN_CONDITION_INVALID");
|
||||
|
||||
const missingPermission = structuredClone(document);
|
||||
missingPermission.components[0].permissions = ["session.channels.read", "session.channel.join"];
|
||||
|
||||
+17
-10
@@ -16,7 +16,7 @@ export const SKIN_PLUGIN_PERMISSIONS = Object.freeze({
|
||||
"ui.input.read": Object.freeze({ policyVersion: 1, description: "Read values entered or autofilled in this plugin's own input fields. Never enter passwords or other secrets." }),
|
||||
"session.status.read": Object.freeze({ policyVersion: 1, description: "Read the current connection and channel summary." }),
|
||||
"session.channels.read": Object.freeze({ policyVersion: 1, description: "Read the public TeamSpeak channel tree; the demo page uses synthetic sample data." }),
|
||||
"session.members.read": Object.freeze({ policyVersion: 1, description: "Read visible member names and speaking states; the demo page uses synthetic sample data." }),
|
||||
"session.members.read": Object.freeze({ policyVersion: 1, description: "Read visible member names, initials derived from those names, and speaking states; the demo page uses synthetic sample data." }),
|
||||
"chat.channel.read": Object.freeze({ policyVersion: 1, description: "Read the current public text channel; the demo page uses synthetic sample data." }),
|
||||
"chat.channel.send": Object.freeze({ policyVersion: 1, description: "Send to the current public text channel; the demo page only simulates this action." }),
|
||||
"favorites.read": Object.freeze({ policyVersion: 1, description: "Read favorite labels and opaque local identifiers, without server addresses or credentials." }),
|
||||
@@ -216,9 +216,9 @@ const COLLECTION_PERMISSION: Record<string, SkinPluginPermission> = {
|
||||
};
|
||||
const COLLECTION_FIELDS: Record<string, ReadonlySet<string>> = {
|
||||
"session.channels": new Set(["id", "name", "parentId", "depth", "memberCount", "current"]),
|
||||
"session.members": new Set(["id", "name", "channelId", "status", "speaking", "self"]),
|
||||
"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", "current", "kind", "favorite"]),
|
||||
"servers.quickList": new Set(["id", "label", "monogram", "current", "kind", "favorite"]),
|
||||
"chat.messages": new Set(["id", "author", "text", "time", "kind", "channelId"]),
|
||||
"screenShare.streams": new Set(["streamId", "source", "ownerClientId", "ownerNickname", "name", "audio", "viewerCount"]),
|
||||
};
|
||||
@@ -249,6 +249,12 @@ function identifier(value: unknown, field: string): string {
|
||||
if (!/^[a-z][a-z0-9-]*$/.test(result)) fail("SKIN_PLUGIN_FIELD_INVALID", `${field} must use a lowercase identifier.`);
|
||||
return result;
|
||||
}
|
||||
function isNestedChannelMembersPath(path: string, aliases: ReadonlyMap<string, string>): boolean {
|
||||
const separator = path.lastIndexOf(".");
|
||||
return separator > 0
|
||||
&& path.slice(separator + 1) === "members"
|
||||
&& aliases.get(path.slice(0, separator)) === "session.channels";
|
||||
}
|
||||
function bindingPermissions(value: string, aliases: ReadonlyMap<string, string>, stateKeys: ReadonlySet<string>): SkinPluginPermission[] {
|
||||
const found = new Set<SkinPluginPermission>();
|
||||
for (const match of value.matchAll(/\{\{\s*([a-z][a-z0-9]*(?:\.[a-z][a-zA-Z0-9]*){0,5})\s*\}\}/g)) {
|
||||
@@ -442,9 +448,7 @@ export function parseSkinPluginDocument(input: unknown): SkinPluginDocument {
|
||||
if (!isRecord(rawNode.repeat)) fail("SKIN_PLUGIN_REPEAT_INVALID", "A repeat declaration must be an object.");
|
||||
onlyKeys(rawNode.repeat, new Set(["path", "as"]), "Repeat declaration");
|
||||
const path = boundedText(rawNode.repeat.path, "repeat.path", 120);
|
||||
const nestedChannelMembers = path.split(".").length === 2
|
||||
&& path.endsWith(".members")
|
||||
&& aliases.get(path.slice(0, path.lastIndexOf("."))) === "session.channels";
|
||||
const nestedChannelMembers = isNestedChannelMembersPath(path, aliases);
|
||||
if (!(path === "session.channels" || path === "session.members" || path === "favorites.items" || path === "servers.quickList" || path === "chat.messages" || path === "screenShare.streams" || nestedChannelMembers)) {
|
||||
fail("SKIN_PLUGIN_REPEAT_INVALID", "A component may repeat only a registered public collection or the members of a repeated channel.");
|
||||
}
|
||||
@@ -458,20 +462,23 @@ export function parseSkinPluginDocument(input: unknown): SkinPluginDocument {
|
||||
if (!isRecord(rawNode.when)) fail("SKIN_PLUGIN_CONDITION_INVALID", "A condition must be an object.");
|
||||
onlyKeys(rawNode.when, new Set(inputSchemaVersion >= 3 ? ["path", "equals", "empty"] : ["path", "equals"]), "Component condition");
|
||||
const path = boundedText(rawNode.when.path, "condition.path", 120);
|
||||
for (const permission of bindingPermissions(`{{${path}}}`, aliases, stateKeys)) {
|
||||
if (!permissions.includes(permission)) fail("SKIN_PLUGIN_PERMISSION_MISSING", `The condition data requires ${permission}.`);
|
||||
}
|
||||
const equals = rawNode.when.equals;
|
||||
if (equals !== undefined && typeof equals !== "string" && typeof equals !== "number" && typeof equals !== "boolean") fail("SKIN_PLUGIN_CONDITION_INVALID", "A condition comparison must be scalar.");
|
||||
const empty = rawNode.when.empty;
|
||||
if (empty !== undefined && (inputSchemaVersion < 3 || typeof empty !== "boolean" || equals !== undefined)) fail("SKIN_PLUGIN_CONDITION_INVALID", "An empty-collection condition must be a schema v3 boolean and cannot also compare a scalar.");
|
||||
const nestedChannelMembers = isNestedChannelMembersPath(path, aliases);
|
||||
if (nestedChannelMembers && empty === undefined) fail("SKIN_PLUGIN_CONDITION_INVALID", "Nested channel member conditions must test whether the collection is empty.");
|
||||
const conditionPermissions = nestedChannelMembers ? ["session.members.read" as const] : bindingPermissions(`{{${path}}}`, aliases, stateKeys);
|
||||
for (const permission of conditionPermissions) {
|
||||
if (!permissions.includes(permission)) fail("SKIN_PLUGIN_PERMISSION_MISSING", `The condition data requires ${permission}.`);
|
||||
}
|
||||
if (typeof equals === "string") {
|
||||
if (inputSchemaVersion < 3 && equals.includes("{{")) fail("SKIN_PLUGIN_SCHEMA_UNSUPPORTED", "Data-bound condition comparisons require schema v3.");
|
||||
for (const permission of bindingPermissions(equals, aliases, stateKeys)) {
|
||||
if (!permissions.includes(permission)) fail("SKIN_PLUGIN_PERMISSION_MISSING", `The condition comparison data requires ${permission}.`);
|
||||
}
|
||||
}
|
||||
if (empty !== undefined && !["chat.messages", "session.channels", "session.members", "favorites.items", "servers.quickList", "screenShare.streams"].includes(path)) {
|
||||
if (empty !== undefined && !nestedChannelMembers && !["chat.messages", "session.channels", "session.members", "favorites.items", "servers.quickList", "screenShare.streams"].includes(path)) {
|
||||
fail("SKIN_PLUGIN_CONDITION_INVALID", "An empty condition must reference a registered public collection.");
|
||||
}
|
||||
node.when = { path, ...(equals === undefined ? {} : { equals }), ...(empty === undefined ? {} : { empty }) };
|
||||
|
||||
Binary file not shown.
@@ -46,7 +46,7 @@ export const BUILTIN_SKIN_CATALOG: SkinCatalogEntry[] = [
|
||||
{
|
||||
id: BUILTIN_KAAK_SKIN_ID,
|
||||
name: "KAAK",
|
||||
version: "3.0.1",
|
||||
version: "3.0.6",
|
||||
author: "WebSpeak Project",
|
||||
license: "AGPL-3.0-only",
|
||||
description: "A complete dark voice workspace with server switching, channels, chat, members, and host-owned voice controls.",
|
||||
|
||||
@@ -4,6 +4,7 @@ import test from "node:test";
|
||||
import { strToU8, zipSync } from "fflate";
|
||||
import { importSkinPack, resolveSkinCssAssets, SkinPackError } from "./skin-pack.js";
|
||||
import { scopeBuiltinThemeForCustomSkin } from "./skin-cascade.js";
|
||||
import { BUILTIN_SKIN_CATALOG } from "./skin-catalog.js";
|
||||
import type { SkinPluginDocument, SkinPluginNode } from "../../../src/shared/skin-plugin.js";
|
||||
import { createSkinExtensionWasmPrefixByteImmediateProbe } from "../../test/skin-extension-wasm-fixture.js";
|
||||
|
||||
@@ -463,7 +464,8 @@ 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.0.1");
|
||||
assert.equal(skin.version, "3.0.6");
|
||||
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");
|
||||
const voice = skin.pluginData?.components.find((component) => component.page === "voice");
|
||||
@@ -493,6 +495,13 @@ test("the distributable KAAK package provides full home and voice surfaces", asy
|
||||
const channelRow = findPart(voice?.root, "channel-row");
|
||||
assert.equal(channelRow?.events?.click, "select-channel");
|
||||
assert.equal(channelRow?.events?.dblclick, "join-channel");
|
||||
assert.equal(findPart(voice?.root, "server-monogram")?.children?.[0]?.text, "{{server.monogram}}");
|
||||
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}}");
|
||||
assert.equal(findPart(voice?.root, "member-group-label")?.children?.[0]?.text, "在线 / ONLINE");
|
||||
assert.equal(findPart(voice?.root, "member-avatar")?.children?.[0]?.text, "{{member.avatarInitial}}");
|
||||
assert.equal(findPart(voice?.root, "performance-panel")?.widget, "voice.performance-panel");
|
||||
assert.equal(findPart(voice?.root, "chat-input")?.bindValue, "message");
|
||||
assert.equal(findPart(voice?.root, "screen-share-start")?.widget, "voice.screen-share-start");
|
||||
assert.equal(findPart(voice?.root, "audio-controls")?.widget, "voice.audio-controls");
|
||||
|
||||
@@ -4,6 +4,7 @@ import { splitTeamSpeakTarget } from "./teamspeak-target.js";
|
||||
export interface SkinPluginQuickServer {
|
||||
id: string;
|
||||
label: string;
|
||||
monogram: string;
|
||||
current: boolean;
|
||||
kind: "favorite" | "recent";
|
||||
favorite: boolean;
|
||||
@@ -45,6 +46,7 @@ export function createSkinPluginQuickServerProjection(createId: () => string = r
|
||||
return {
|
||||
id: opaqueId,
|
||||
label: safeLabel,
|
||||
monogram: Array.from(safeLabel)[0] ?? "?",
|
||||
current: isCurrent(server),
|
||||
kind: server.isFavorite ? "favorite" : "recent",
|
||||
favorite: server.isFavorite,
|
||||
|
||||
@@ -63,6 +63,11 @@ test("skin quick-server data redacts connection targets and resolves only host-g
|
||||
const projection = createSkinPluginQuickServerProjection(() => `opaque-${++sequence}`);
|
||||
const rows = projection.project(servers, (server) => server.id === "voice2.example:9987");
|
||||
|
||||
assert.deepEqual(rows.map(({ label, monogram }) => [label, monogram]), [
|
||||
["Favorite 1", "F"],
|
||||
["Recent 2", "R"],
|
||||
["Friends", "F"],
|
||||
]);
|
||||
assert.deepEqual(rows.map(({ label, kind, favorite, current }) => [label, kind, favorite, current]), [
|
||||
["Favorite 1", "favorite", true, false],
|
||||
["Recent 2", "recent", false, false],
|
||||
|
||||
@@ -1532,6 +1532,7 @@ const skinPluginFavorites = computed(() => skinPluginQuickList.value
|
||||
const skinPluginMembers = computed(() => memberChannels.value.flatMap((item) => item.members.map((member) => ({
|
||||
id: String(member.id),
|
||||
name: member.nickname,
|
||||
avatarInitial: Array.from(member.nickname.trim())[0] ?? "?",
|
||||
channelId: item.id,
|
||||
status: member.away ? "away" : member.inputMuted ? "muted" : speakingIds.has(member.id) ? "speaking" : "online",
|
||||
speaking: speakingIds.has(member.id),
|
||||
|
||||
Reference in new issue
Block a user