fix: expose server identity and refine KAAK client

This commit is contained in:
illusia committed 2026-10-11 17:14:56 +08:00
1 parent e8164abafe
commit 17fb27b89a
28 files changed
+1504 -334

No files matched your search

+24 -6
View File
@@ -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.62");
assert.equal(skin.version, "3.1.64");
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");
@@ -517,8 +517,11 @@ test("the distributable KAAK package provides full home and voice surfaces", asy
assert.equal(chatExpand?.attributes?.["aria-expanded"], "{{state.chatopen}}");
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-icon")?.attributes?.src, "{{server.icon}}");
assert.equal(findPart(voice?.root, "server-monogram-initial")?.children?.[0]?.text, "{{server.monogram}}");
assert.equal(findPart(voice?.root, "server-monogram")?.attributes?.["data-tone"], "{{server.tone}}");
assert.deepEqual(findPart(voice?.root, "identity-online")?.when, { path: "session.status.connected", equals: true });
assert.equal(findPart(voice?.root, "identity-online")?.attributes?.role, "img");
const voiceStageHeadingItem = findPart(voice?.root, "voice-stage-heading-item");
assert.equal(voiceStageHeadingItem?.repeat?.path, "session.channels");
const voiceStageHeading = findPart(voiceStageHeadingItem, "voice-stage-heading");
@@ -617,14 +620,29 @@ test("the distributable KAAK package provides full home and voice surfaces", asy
assert.match(skin.css, /kaak-workspace\.voice-channel-group-toggle/);
assert.match(skin.css, /voice-channel-list[\s\S]*?grid-template-rows: 1fr;[\s\S]*?transition: grid-template-rows \.18s ease/);
assert.match(skin.css, /data-voice-group-open="false"[\s\S]*?voice-channel-list[\s\S]*?grid-template-rows: 0fr;[\s\S]*?visibility: hidden;[\s\S]*?visibility 0s linear \.18s/);
assert.match(skin.css, /kaak-workspace\.server-monogram"\]\[data-tone="0"\]/);
assert.match(skin.css, /voice-stage-heading[\s\S]*?flex: 0 0 46px;/);
assert.doesNotMatch(skin.css, /aria-expanded="true"\]\s*[^\n]*voice-stage-heading[^\n]*display: none;/);
assert.match(skin.css, /kaak-workspace"\]:has\(\[data-ws-plugin-part="kaak-workspace\.chat-panel-toggle"\]\[aria-expanded="false"\]\)[\s\S]*?grid-template-columns: 80px 290px minmax\(280px, 1fr\) 0;/);
assert.match(skin.css, /grid-template-columns: 80px 290px/);
assert.match(skin.css, /kaak-workspace"\]:has\(\[data-ws-plugin-part="kaak-workspace\.chat-panel-toggle"\]\[aria-expanded="false"\]\)[\s\S]*?grid-template-columns: 86px 290px minmax\(280px, 1fr\) 0;/);
assert.match(skin.css, /grid-template-columns: 86px 290px/);
assert.match(skin.css, /minmax\(340px, min\(38vw, 520px\)\)/);
assert.match(skin.css, /grid-template-rows: 40px/);
assert.match(skin.css, /kaak-workspace\.server-monogram[\s\S]*?width: 48px;[\s\S]*?height: 48px;/);
assert.match(skin.css, /kaak-workspace\.server-rail"\]\s*\{[\s\S]*?--skin-kaak-rail-bg: #191a1d;[\s\S]*?--skin-kaak-rail-item-bg: #2b2d32;[\s\S]*?--skin-kaak-rail-accent: #75c900;[\s\S]*?gap: 18px;[\s\S]*?padding: 14px 0 96px;[\s\S]*?background: var\(--skin-kaak-rail-bg\);/);
assert.match(skin.css, /kaak-workspace\.quick-server-item"\]\s*\{[\s\S]*?width: 58px;[\s\S]*?height: 58px;/);
assert.match(skin.css, /kaak-workspace\.quick-server"\]\s*\{[\s\S]*?width: 58px;[\s\S]*?height: 58px;[\s\S]*?border: 2px solid transparent;[\s\S]*?border-radius: 18px;/);
assert.match(skin.css, /quick-server\"\]\:hover[\s\S]*?background: #383a40;/);
assert.match(skin.css, /quick-server\"\]\:not\(\[aria-current=\"true\"\]\):hover[\s\S]*?server-monogram[\s\S]*?background: #383a40;/);
assert.match(skin.css, /quick-server\"\]\[aria-current=\"true\"\] \{[\s\S]*?border-color: var\(--skin-kaak-rail-accent\);[\s\S]*?background: var\(--skin-kaak-rail-item-bg\);/);
assert.match(skin.css, /quick-server\"\]\[aria-current=\"true\"\][\s\S]*?server-monogram[\s\S]*?background: var\(--skin-kaak-rail-item-bg\);/);
assert.match(skin.css, /quick-server\"\]\[aria-current=\"true\"\]::before[\s\S]*?left: -16px;[\s\S]*?top: 10px;[\s\S]*?width: 4px;[\s\S]*?height: 34px;/);
assert.match(skin.css, /kaak-workspace\.identity-entry\"\]\s*\{[\s\S]*?width: 86px;[\s\S]*?background: #191a1d;/);
assert.match(skin.css, /kaak-workspace\.server-monogram[\s\S]*?width: 100%;[\s\S]*?height: 100%;[\s\S]*?border-radius: 16px;[\s\S]*?font-size: 23px;[\s\S]*?font-weight: 600;/);
assert.match(skin.css, /kaak-workspace\.server-icon[\s\S]*?width: 100%;[\s\S]*?height: 100%;[\s\S]*?border-radius: inherit;[\s\S]*?object-fit: cover;/);
assert.doesNotMatch(skin.css, /server-monogram\"\]\[data-tone=/);
assert.match(skin.css, /kaak-workspace\.identity-monogram\"\]\s*\{[\s\S]*?width: 54px;[\s\S]*?height: 54px;[\s\S]*?border-radius: 50%;[\s\S]*?background: #176a9e;[\s\S]*?font-size: 17px;/);
assert.match(skin.css, /kaak-workspace\.identity-online\"\]\s*\{[\s\S]*?right: -2px;[\s\S]*?bottom: -2px;[\s\S]*?width: 17px;[\s\S]*?height: 17px;[\s\S]*?border: 3px solid #191a1d;[\s\S]*?background: #75c900;/);
assert.match(skin.css, /kaak-workspace\.identity-name\"\]\s*\{\s*display: none;/);
assert.match(skin.css, /@media \(max-width: 820px\)[\s\S]*?grid-template-columns: 86px minmax\(0, 1fr\);[\s\S]*?grid-template-columns: 86px minmax\(0, 1fr\);/);
assert.match(skin.css, /@media \(max-height: 620px\)[\s\S]*?server-rail[\s\S]*?padding-bottom: 76px;/);
assert.match(skin.css, /voice-grid[\s\S]*?grid-template-columns: repeat\(auto-fit/);
assert.match(skin.css, /voice-card[\s\S]*?aspect-ratio: 1\.82;/);
assert.match(skin.css, /\.voice-card\s*\{[\s\S]*?transition: border-color \.18s ease, background-color \.18s ease, box-shadow \.18s ease;/);