feat: refine KAAK navigation and join experience

This commit is contained in:
illusia committed 2026-10-12 13:49:35 +08:00
1 parent 319a16f384
commit 458f95c2dc
21 files changed
+2017 -996

No files matched your search

+43
View File
@@ -641,3 +641,46 @@
- open 模式沿用现有添加对话框,保存收藏后连接新目标。fixed 模式点击加号只显示“该功能已被管理员关闭”,不会打开表单、保存收藏或连接;固定目标策略仍由服务端执行,未放宽。
- fixed 模式下收藏服务器入口保留可点击事件并以禁用态样式呈现;点击其他服务器的快速入口(通用侧栏、窄屏栏、服务器切换器及皮肤服务器轨道)显示“管理员不允许切换TS服务器”。
- 验证:服务器轨道注入、可信点击、受限状态无原生禁用、指定中文提示、受限数据投影和 KAAK 分发包定向测试通过(78/78);`npm run verify` 全部通过(698/698 测试、服务端 TypeScript、前端类型检查与 Vite 生产构建);`git diff --check` 通过。
## 本轮 KAAK 首页与 myTS 按钮(2026-10-12)
- 用户提供首页示例,要求 KAAK 首页按示例改造。首页采用左右分栏、绿色品牌展示区和白色服务器连接卡片,沿用宿主原有连接表单、密码处理、身份和中继选择逻辑,并由宿主显示真实连接状态;窄屏自动纵向排列。
- 连接卡片右上绿色装饰区新增“使用myts登录”按钮和 `myts` 字样,仅点击时提示“这个功能还在开发中”,不实现或调用 myTS 登录。
- KAAK 升至 3.1.80,重建示例皮肤和内置分发包。
- 验证:定向皮肤测试 51/51 通过;完整 `npm run verify` 通过(701/701 测试、服务端 TypeScript 构建、前端 Vue 类型检查与 Vite 生产构建);3040 的健康接口、首页和 WebClient JS 均返回 HTTP 200,服务端 JS 字节数与本地构建一致,包含按钮和提示文案;示例与内置 KAAK 包完全一致,版本 3.1.80。
### myTS 入口按截图收紧
- 用户要求移除卡片上的胶囊按钮外观,将 `myts` 字样完全放进右上角绿色三角,并倾斜显示。
- 去掉按钮底色、边框和额外徽标;保留该区域的无底色键盘可达按钮与“使用myts登录”无障碍名称,点击仍提示“这个功能还在开发中”。文字向左上倾斜 45° 并裁切在绿色角内。
- KAAK 升至 3.1.81;定向皮肤测试 51/51、完整 `npm run verify`(701/701 测试、服务端构建、前端类型检查与生产构建)通过,`git diff --check` 通过。3040 首页、健康接口、WebClient JS 与皮肤包均返回 HTTP 200;3040 上的皮肤包字节与源包一致。
### 首页表单收尾(2026-10-12)
- 按用户截图将右上角 `myts` 文字改为顺时针旋转 45°。
- KAAK 首页服务器密码框改为白底浅色样式,并覆盖浏览器自动填充背景和文字色,避免保存密码时出现黑边或蓝底。
- 将“目标频道”字段移出“设备身份选项”折叠区;身份记忆、导入和导出仍留在折叠区内。
- KAAK 升至 3.1.82。定向皮肤测试 51/51、完整 `npm run verify`(701/701 测试、服务端构建、前端类型检查与生产构建)通过,`git diff --check` 通过。3040 健康接口、首页和 WebClient JS 返回 HTTP 200;3040 皮肤包与本地分发包 SHA-256 一致。
### 服务器密码弹窗改为浅色(2026-10-12)
- 用户要求将服务器密码弹窗从深色改为浅色。服务器密码弹窗新增明确的公开状态标记,KAAK 仅对服务器密码弹窗应用白色卡片、浅色输入框、深色文字和匹配的取消/关闭悬停样式;频道密码弹窗继续保留深色方案,绿色“确定”按钮和原有密码重试逻辑不变。
- KAAK 升至 3.1.83;定向皮肤测试 51/51、完整 `npm run verify`(701/701 测试、服务端构建、前端类型检查与生产构建)通过。3040 健康接口、首页和 WebClient JS 返回 HTTP 200,分发包与本地构建一致。
### 语音页工具移入左侧导航栏(2026-10-12)
- 移除 KAAK 语音页顶栏,将服务器列表改为独立滚动;左侧服务器栏底部固定显示宿主提供的加号、皮肤切换和语言切换工具,并以分隔线与服务器列表隔开。
- 语言按钮沿用宿主现有语言选项、切换和保存逻辑,按钮视觉标签为“文/A”;语言菜单和皮肤菜单都从工具方块旁弹出,并在较矮窗口中调整位置。
- KAAK 升至 3.1.85;`npm run skin:kaak:build` 与完整 `npm run verify` 通过(701/701 测试、服务端 TypeScript、前端类型检查和 Vite 生产构建),`git diff --check` 通过。3040 健康接口、首页、WebClient JS 和 KAAK 皮肤包均返回 HTTP 200;服务器皮肤包 SHA-256 与本地一致。
### 频道树成员屏幕共享标记(2026-10-12)
- 频道树成员正在共享时,在成员行末尾显示带绿色底色的显示器图标;状态由 WebSpeak 当前活跃共享流的成员归属驱动,普通成员不显示。覆盖常规与 KAAK 侧栏两种频道树布局,保留成员右键菜单及拖放行为。
- 将新标记纳入公开皮肤部件注册表和皮肤开发文档,标记自带通用样式,因此内置和自定义皮肤都可见。
- 屏幕共享 UI 定向测试 10/10 通过;完整 `npm run verify` 通过(702/702 测试、服务端构建、前端类型检查与生产构建);`git diff --check` 通过。3040 健康接口、首页、新版 WebClient JS/CSS 均返回 HTTP 200,生产资源含共享标记和绿色样式。
### KAAK 语言切换入口使用翻译图标(2026-10-12)
- 用户要求把 KAAK 语音页左侧栏语言入口改为截图中的翻译图标,并在连接首页右上角增加同款入口,方便其他语言用户切换界面。
- 沿用 WebSpeak 已有语言菜单、选择事件和语言偏好保存逻辑;只在 KAAK 皮肤中显示纯翻译符号,不使用参考图的青绿色背景。侧栏沿用深灰工具块,首页在右上角提供中性色按钮。通用语言控件默认继续隐藏该图标,其他皮肤不受视觉影响。
- KAAK 升至 3.1.86;`npm run skin:kaak:build` 和完整 `npm run verify` 通过(702/702 测试、服务端构建、前端类型检查与 Vite 生产构建),`git diff --check` 通过。3040 健康接口、首页、WebClient JS/CSS 和新版皮肤包均返回 HTTP 200;3040 皮肤包与本地分发包 SHA-256 一致。
+1 -1
View File
@@ -271,7 +271,7 @@ widget 的可选 `mount` 只接受这些公开锚点:`home.header.after`、`ho
| 通用 | `app`、`app.toast`、`control`、`skin.trigger`、`skin.menu`、`skin.option`、`language.trigger`、`language.menu`、`language.option` |
| 首页 | `home`、`home.header`、`home.brand`、`home.header-tools`、`home.gateway-status`、`home.content`、`home.hero`、`home.hero.eyebrow`、`home.hero.title`、`home.hero.description`、`home.features`、`home.feature`、`home.visitors`、`home.join-card`、`home.join-card.waveform`、`home.join-card.sonar`、`home.join-title`、`home.join-description`、`home.notice`、`home.form`、`home.server-target`、`home.field-label`、`home.field`、`home.relay-choice`、`home.relay-choice.copy`、`home.server-history`、`home.server-history.group`、`home.server-history.item`、`home.server-history.select`、`home.server-history.favorite-toggle`、`home.favorite-toggle`、`home.identity`、`home.identity-actions`、`home.identity-import.open`、`home.identity-export.button`、`home.identity-import-dialog`、`home.identity-import.header`、`home.identity-import.close`、`home.identity-import.textarea`、`home.identity-import.drop-zone`、`home.identity-import.file-button`、`home.identity-import.error`、`home.identity-import.security`、`home.identity-import.footer`、`home.identity-import.cancel`、`home.identity-import.submit`、`home.connect`、`home.security-note`、`home.footer`、`home.community-dialog` |
| 语音工作区 | `voice.shell`、`voice.workspace`、`voice.header`、`voice.header-actions`、`voice.breadcrumbs`、`voice.performance`、`voice.performance.panel`、`voice.performance.route`、`voice.performance.metrics`、`voice.performance.status`、`voice.performance.webrtc-stats`、`voice.connection-status`、`voice.audio-status`、`voice.poke`、`voice.scroll`、`voice.content`、`voice.activity`、`voice.activity.artwork`、`voice.activity-heading`、`voice.screen-share-error`、`voice.members`、`voice.members.empty`、`voice.member`、`voice.member.action-trigger`、`voice.member.avatar-wrap`、`voice.member.avatar`、`voice.member.mic-status`、`voice.member.name`、`voice.member.status`、`voice.member.live-indicator`、`voice.member.stop-share`、`voice.member.share-actions`、`voice.member-panel`、`voice.member-panel.heading`、`voice.member-panel.search`、`voice.member-panel.channels`、`voice.channel-group`、`voice.channel-group.heading`、`voice.channel-group.members`、`voice.member-row`、`voice.member-row.avatar`、`voice.member-row.copy`、`voice.member-row.flags`、`voice.member-row.volume`、`voice.whisper-strip`、`voice.audio-dock`、`voice.audio-dock.microphone`、`voice.audio-dock.microphone-panel`、`voice.audio-dock.output`、`voice.audio-dock.output-panel`、`voice.audio-settings`、`voice.audio-settings.device-select`、`voice.audio-settings.device-select-trigger`、`voice.audio-settings.device-select-chevron`、`voice.audio-settings.device-select-menu`、`voice.audio-settings.device-select-option`、`voice.mobile-more`、`voice.mobile-nav` |
| KOOK 频道树与服务器切换 | `voice.server-switcher`、`voice.server-switcher.trigger`、`voice.server-switcher.menu`、`voice.server-switcher.item`、`voice.server-switcher.icon`、`voice.server-switcher.label`、`voice.server-switcher.current`、`voice.server-switcher.empty`、`voice.channel-tree.list`、`voice.channel-tree.empty`、`voice.channel-tree.node`、`voice.channel-tree.line`、`voice.channel-tree.expander`、`voice.channel-tree.row`、`voice.channel-tree.icon`、`voice.channel-tree.join-hint`、`voice.channel-tree.name`、`voice.channel-tree.count`、`voice.channel-tree.branch`、`voice.channel-tree.member`、`voice.channel-tree.avatar`、`voice.channel-tree.member-name`、`voice.channel-tree.member-muted`、`voice.channel-tree.member-speaking`、`voice.channel-tree.member-away` |
| KOOK 频道树与服务器切换 | `voice.server-switcher`、`voice.server-switcher.trigger`、`voice.server-switcher.menu`、`voice.server-switcher.item`、`voice.server-switcher.icon`、`voice.server-switcher.label`、`voice.server-switcher.current`、`voice.server-switcher.empty`、`voice.channel-tree.list`、`voice.channel-tree.empty`、`voice.channel-tree.node`、`voice.channel-tree.line`、`voice.channel-tree.expander`、`voice.channel-tree.row`、`voice.channel-tree.icon`、`voice.channel-tree.join-hint`、`voice.channel-tree.name`、`voice.channel-tree.count`、`voice.channel-tree.branch`、`voice.channel-tree.member`、`voice.channel-tree.avatar`、`voice.channel-tree.member-name`、`voice.channel-tree.member-muted`、`voice.channel-tree.member-screen-share`、`voice.channel-tree.member-speaking`、`voice.channel-tree.member-away` |
| 快速服务器 | `voice.favorite-servers.rail`、`voice.favorite-servers.rail.list`、`voice.favorite-servers.rail.item`、`voice.favorite-servers.server`、`voice.favorite-servers.avatar`、`voice.favorite-servers.tooltip`、`voice.favorite-servers.favorite-toggle`、`voice.favorite-servers.add`、`voice.favorite-servers.strip`、`voice.favorite-servers.strip.item`、`voice.favorite-servers.strip.server`、`voice.favorite-servers.strip.favorite-toggle`、`voice.favorite-servers.strip.add`、`voice.favorite-servers.switch-status`、`voice.favorite-servers.current-toggle`、`voice.favorite-servers.dialog-backdrop`、`voice.favorite-servers.dialog`、`voice.favorite-servers.dialog.header`、`voice.favorite-servers.dialog.close`、`voice.favorite-servers.dialog.form`、`voice.favorite-servers.dialog.field`、`voice.favorite-servers.dialog.input`、`voice.favorite-servers.dialog.target`、`voice.favorite-servers.dialog.hint`、`voice.favorite-servers.dialog.actions`、`voice.favorite-servers.dialog.cancel`、`voice.favorite-servers.dialog.submit` |
| 聊天与菜单 | `voice.chat`、`voice.chat.tabs`、`voice.chat.tab`、`voice.chat.heading`、`voice.chat.messages`、`voice.chat.event`、`voice.chat.message`、`voice.chat.message-avatar`、`voice.chat.message-body`、`voice.chat.message-bubble`、`voice.chat.empty`、`voice.chat.composer`、`voice.chat.status`、`voice.context-menu-backdrop`、`voice.context-menu`、`voice.context-menu.header`、`voice.context-menu.move-submenu` |
| 屏幕共享 | `voice.screen-share-settings`、`voice.screen-share-settings.heading`、`voice.screen-share-settings.fields`、`voice.screen-share-settings.note`、`voice.screen-share-settings.actions`、`voice.screen-player`、`voice.screen-player.stage`、`voice.screen-player.video`、`voice.screen-player.placeholder`、`voice.screen-player.exit`、`voice.screen-player.viewers`、`voice.screen-player.viewer-avatar`、`voice.screen-player.live`、`voice.screen-player.source`、`voice.screen-player.controls`、`voice.screen-player.volume`、`voice.screen-player.fullscreen` |
Binary file not shown.
File diff suppressed because it is too large. Load diff
+2 -2
View File
@@ -3,10 +3,10 @@
"packageType": "open-skin",
"id": "community.kaak-voice",
"name": "KAAK",
"version": "3.1.79",
"version": "3.1.86",
"author": "WebSpeak Project",
"license": "AGPL-3.0-only",
"description": "A KOOK-inspired voice workspace with a searchable server header, TeamSpeak banner and welcome message, nested channel members, attached channel chat, and a compact WebSpeak audio dock.",
"description": "A KOOK-inspired WebSpeak skin with a split-screen connection home, searchable server header, TeamSpeak banner, nested channel members, attached channel chat, and a compact audio dock.",
"entry": "skin.css",
"components": "components.json",
"content": "content.json",
File diff suppressed because it is too large. Load diff
+1
View File
@@ -200,6 +200,7 @@ const PUBLIC_PART_IDS = new Set<string>([
"voice.channel-tree.member-away",
"voice.channel-tree.member-muted",
"voice.channel-tree.member-name",
"voice.channel-tree.member-screen-share",
"voice.channel-tree.member-speaking",
"voice.channel-tree.name",
"voice.channel-tree.node",
+68 -12
View File
@@ -1,12 +1,13 @@
import assert from "node:assert/strict";
import { readFile } from "node:fs/promises";
import test from "node:test";
import {
parseSkinPluginDocument,
parseSkinPluginJson,
type SkinPluginDocument,
type SkinPluginNode,
} from "./skin-plugin.js";
import {
parseSkinPluginDocument,
parseSkinPluginJson,
skinPluginWidgetPermissions,
type SkinPluginDocument,
type SkinPluginNode,
} from "./skin-plugin.js";
function validDocument(): SkinPluginDocument {
return {
@@ -182,6 +183,52 @@ test("server banner host widget only exposes public session status fields", () =
const parsed = parseSkinPluginDocument(document);
assert.equal(parsed.components[0].root.children?.[0].widget, "voice.server-banner");
});
test("home connection status widget requires the public session status permission", () => {
const document = validDocument();
document.schemaVersion = 3;
document.components[0].page = "home";
document.components[0].actions = {};
document.components[0].root = { tag: "main", children: [{ widget: "home.connection-status" }] };
errorCode(() => parseSkinPluginDocument(document), "SKIN_PLUGIN_PERMISSION_MISSING");
document.components[0].permissions = ["session.status.read"];
assert.equal(parseSkinPluginDocument(document).components[0].root.children?.[0].widget, "home.connection-status");
assert.deepEqual(skinPluginWidgetPermissions("home.connection-status"), ["session.status.read"]);
});
test("MyTS login is a host button with no connection permission or skin action", () => {
const document = validDocument();
document.schemaVersion = 3;
document.components[0].page = "home";
document.components[0].permissions = [];
document.components[0].actions = {};
document.components[0].root = { tag: "main", children: [{ widget: "home.myts-login" }] };
const parsed = parseSkinPluginDocument(document);
assert.equal(parsed.components[0].root.children?.[0].widget, "home.myts-login");
assert.deepEqual(skinPluginWidgetPermissions("home.myts-login"), []);
assert.deepEqual(Object.keys(parsed.components[0].actions), []);
});
test("skin SVG illustrations support bounded path and circle geometry attributes", () => {
const document = validDocument();
document.schemaVersion = 3;
document.components[0].root = {
tag: "svg",
attributes: { viewbox: "0 0 100 100", role: "img" },
children: [
{ tag: "circle", attributes: { cx: 25, cy: 30, r: 12, fill: "#b0f49b" } },
{ tag: "path", attributes: { d: "M10 20h30v40", stroke: "white", "stroke-width": 2, fill: "none" } },
],
};
const parsed = parseSkinPluginDocument(document).components[0].root;
assert.equal(parsed.children?.[0].attributes?.cx, 25);
assert.equal(parsed.children?.[1].attributes?.d, "M10 20h30v40");
document.components[0].root.children![1].attributes!.d = "x".repeat(513);
errorCode(() => parseSkinPluginDocument(document), "SKIN_PLUGIN_ATTRIBUTE_INVALID");
});
test("schema v3 host audio controls require read and control permissions while v2 remains compatible", () => {
const document = validDocument();
@@ -379,12 +426,21 @@ test("KAAK v3 example declares the connection home and complete voice workspace"
const parsed = parseSkinPluginJson(source);
const home = parsed.components.find((component) => component.id === "kaak-home");
const workspace = parsed.components.find((component) => component.id === "kaak-workspace");
assert.ok(home);
assert.ok(workspace);
assert.equal(home.page, "home");
assert.equal(home.mode, "surface");
assert.deepEqual(home.permissions, ["ui.surface.replace"]);
assert.equal(home.root.children?.[1].children?.[3].widget, "home.connection-form");
assert.ok(home);
assert.ok(workspace);
assert.equal(home.page, "home");
assert.equal(home.mode, "surface");
assert.deepEqual(home.permissions, ["ui.surface.replace", "session.status.read"]);
const connectionCard = home.root.children?.[1].children?.[0].children?.[1];
assert.equal(connectionCard?.part, "connection-card");
assert.equal(connectionCard?.children?.[0].part, "card-heading");
assert.equal(connectionCard?.children?.[0].children?.[0].part, "connection-title");
assert.equal(connectionCard?.children?.[0].children?.[1].widget, "home.myts-login");
assert.equal(connectionCard?.children?.[2].widget, "home.connection-form");
assert.equal(connectionCard?.children?.[4].widget, "home.connection-status");
const heroMedia = home.root.children?.[0].children?.[2];
assert.equal(heroMedia?.part, "hero-media");
assert.equal(heroMedia?.children?.[0].tag, "svg");
assert.equal(workspace.page, "voice");
assert.equal(workspace.mode, "surface");
+10 -7
View File
@@ -40,8 +40,10 @@ export const SKIN_PLUGIN_PERMISSIONS = Object.freeze({
export type SkinPluginPermission = keyof typeof SKIN_PLUGIN_PERMISSIONS;
export type SkinPluginPage = "home" | "voice" | "demo";
export type SkinPluginComponentMode = "widget" | "surface";
export const SKIN_PLUGIN_HOST_WIDGETS = Object.freeze([
"home.connection-form",
export const SKIN_PLUGIN_HOST_WIDGETS = Object.freeze([
"home.connection-form",
"home.connection-status",
"home.myts-login",
"app.skin-switcher",
"app.language-switcher",
"voice.server-switcher",
@@ -72,6 +74,7 @@ export interface SkinPluginWidgetOptions {
}
const widgetPermissions = (...permissions: SkinPluginPermission[]): readonly SkinPluginPermission[] => Object.freeze(permissions);
export const SKIN_PLUGIN_HOST_WIDGET_PERMISSIONS: Partial<Record<SkinPluginHostWidget, readonly SkinPluginPermission[]>> = Object.freeze({
"home.connection-status": widgetPermissions("session.status.read"),
"voice.channel-tree": widgetPermissions("session.channels.read", "session.members.read", "session.memberAvatars.read", "session.channel.join"),
"voice.server-switcher": widgetPermissions("servers.quickList.read", "servers.quickList.switch"),
"voice.server-header": widgetPermissions("session.status.read", "servers.quickList.read", "servers.quickList.switch"),
@@ -175,11 +178,11 @@ export const SKIN_PLUGIN_ALLOWED_ELEMENTS = Object.freeze([
] as const);
const ELEMENTS = new Set<string>(SKIN_PLUGIN_ALLOWED_ELEMENTS);
const VOID_ELEMENTS = new Set(["br", "circle", "hr", "img", "input", "line", "path", "polyline", "rect", "wbr"]);
const ATTRIBUTES = new Set([
"alt", "aria-current", "aria-expanded", "aria-hidden", "aria-label", "aria-pressed", "aria-selected", "autocomplete", "checked", "class", "colspan", "disabled", "draggable", "fill", "height", "inputmode", "max", "maxlength", "min",
"minlength", "multiple", "name", "open", "placeholder", "required", "role", "rows", "rowspan", "step", "stroke", "stroke-linecap", "stroke-linejoin",
"src", "stroke-width", "tabindex", "title", "type", "value", "viewbox", "width", "x", "x1", "x2", "y", "y1", "y2",
]);
const ATTRIBUTES = new Set([
"alt", "aria-current", "aria-expanded", "aria-hidden", "aria-label", "aria-pressed", "aria-selected", "autocomplete", "checked", "class", "colspan", "cx", "cy", "d", "disabled", "draggable", "fill", "height", "inputmode", "max", "maxlength", "min",
"minlength", "multiple", "name", "open", "placeholder", "required", "role", "rows", "rowspan", "step", "stroke", "stroke-linecap", "stroke-linejoin",
"r", "rx", "src", "stroke-width", "tabindex", "title", "type", "value", "viewbox", "width", "x", "x1", "x2", "y", "y1", "y2",
]);
const EVENTS = new Set<string>([
"click", "dblclick", "change", "input", "submit", "keydown", "keyup", "contextmenu", "focus", "blur", "pointerdown", "pointerup",
"pointerenter", "pointerleave", "dragstart", "dragover", "drop",
Binary file not shown.
+3 -2
View File
@@ -89,8 +89,9 @@
<path d="M12 2v2m0 16v2M4.93 4.93l1.42 1.42m11.3 11.3 1.42 1.42M2 12h2m16 0h2M4.93 19.07l1.42-1.42m11.3-11.3 1.42-1.42" />
</template>
<path v-else-if="name === 'moon'" d="M20.4 15.2A8.5 8.5 0 0 1 8.8 3.6 8.5 8.5 0 1 0 20.4 15.2Z" />
<path v-else-if="name === 'monitor'" d="M4 4h16v12H4zM8 20h8M12 16v4" />
<path v-else-if="name === 'fullscreen'" d="M4 9V4h5M15 4h5v5M20 15v5h-5M9 20H4v-5" />
<path v-else-if="name === 'monitor'" d="M4 4h16v12H4zM8 20h8M12 16v4" />
<path v-else-if="name === 'translate'" fill="currentColor" stroke="none" d="M12.87 15.07l-2.54-2.51.03-.03c1.74-1.94 2.99-4.17 3.71-6.53H17V4h-7V2H8v2H1v1.99h11.17C11.14 8.44 10 10.47 8 12.1c-1.31-1.08-2.39-2.39-3.2-3.91H2.8c.93 2.07 2.26 3.9 4.05 5.41l-3.74 3.71L4.5 18.7 8 15.2l2.18 2.18.69-2.31zm4.63-6.07h-2L11 22h2l1.12-3h4.75L20 22h2l-4.5-13zm-2.62 8 1.62-4.33L18.12 17h-3.24z" />
<path v-else-if="name === 'fullscreen'" d="M4 9V4h5M15 4h5v5M20 15v5h-5M9 20H4v-5" />
<path v-else-if="name === 'fullscreen-exit'" d="M9 4v5H4M20 9h-5V4M15 20v-5h5M4 15h5v5" />
<path v-else-if="name === 'github'" fill="currentColor" stroke="none" d="M12 .5C5.65.5.5 5.65.5 12c0 5.08 3.29 9.39 7.86 10.91.58.11.79-.25.79-.56 0-.28-.01-1.02-.02-2-3.2.7-3.88-1.54-3.88-1.54-.53-1.33-1.28-1.68-1.28-1.68-1.04-.71.08-.7.08-.7 1.15.08 1.75 1.18 1.75 1.18 1.02 1.75 2.68 1.24 3.33.95.1-.74.4-1.24.73-1.52-2.55-.29-5.23-1.28-5.23-5.68 0-1.25.45-2.27 1.18-3.07-.12-.29-.51-1.45.11-3.03 0 0 .96-.31 3.15 1.17.91-.25 1.88-.38 2.85-.38.97 0 1.94.13 2.85.38 2.19-1.48 3.15-1.17 3.15-1.17.62 1.58.23 2.74.11 3.03.73.8 1.18 1.82 1.18 3.07 0 4.41-2.69 5.38-5.25 5.67.41.35.78 1.04.78 2.1 0 1.52-.01 2.75-.01 3.12 0 .3.21.67.8.56C20.71 21.39 24 17.08 24 12 24 5.65 18.35.5 12 .5Z" />
<template v-else-if="name === 'qq'">
+7 -2
View File
@@ -11,6 +11,7 @@
:aria-controls="menuId"
@click.stop="toggle"
>
<Icon class="language-current-icon" name="translate" :size="24" />
<span class="language-current-flag" aria-hidden="true">{{ currentLanguage.flag }}</span>
<span class="language-current-code">{{ currentLanguage.code }}</span>
<Icon name="chevron-down" :size="13" />
@@ -130,12 +131,12 @@ onUnmounted(() => document.removeEventListener("pointerdown", onDocumentPointerD
box-shadow: 0 7px 16px rgba(0, 106, 100, .16);
}
.language-trigger .ui-icon {
.language-trigger > .ui-icon:last-child {
margin-left: auto;
transition: transform .16s;
}
.language-switcher.open .language-trigger .ui-icon {
.language-switcher.open .language-trigger > .ui-icon:last-child {
transform: rotate(180deg);
}
@@ -145,6 +146,10 @@ onUnmounted(() => document.removeEventListener("pointerdown", onDocumentPointerD
line-height: 1;
}
.language-current-icon {
display: none;
}
.language-current-flag {
font-size: 15px;
}
+16 -11
View File
@@ -169,21 +169,26 @@
/>
</div>
<details
class="identity-options"
data-ws-part="home.identity"
><summary>{{ t("identityOptions") }}</summary
><label
class="field-label"
data-ws-part="home.field-label"
for="channel"
>{{ t("targetChannel") }} <span>{{ t("optional") }}</span></label
><div class="field-wrap" data-ws-part="home.field"><Icon name="hash" :size="17" /><input
<label
class="field-label"
data-ws-part="home.field-label"
for="channel"
>{{ t("targetChannel") }} <span>{{ t("optional") }}</span></label
>
<div class="field-wrap" data-ws-part="home.field">
<Icon name="hash" :size="17" />
<input
id="channel"
v-model="channel"
:placeholder="t('emptyDefault')"
@keyup.enter="emit('connect')"
/></div
/>
</div>
<details
class="identity-options"
data-ws-part="home.identity"
><summary>{{ t("identityOptions") }}</summary
><div class="identity-controls"
><label class="remember-identity"
><input
@@ -2,11 +2,13 @@
<div
class="modal-backdrop channel-password-backdrop"
data-ws-part="auth.password.backdrop"
data-ws-state="server-password"
@click.self="emit('cancel')"
>
<section
class="channel-password-modal server-password-modal"
data-ws-part="auth.password.dialog"
data-ws-state="server-password"
ref="dialog"
tabindex="-1"
@keydown="onDialogKeydown"
@@ -19,6 +19,7 @@
:avatar-style="avatarStyle"
:avatar-initial="avatarInitial"
:is-speaking="isSpeaking"
:is-screen-sharing="isScreenSharing"
:show-member-actions="showMemberActions"
:member-drag-drop="memberDragDrop"
:dragged-member-id="draggedMemberId"
@@ -58,6 +59,7 @@ const props = defineProps<{
avatarStyle: (name: string, isSelf?: boolean, avatar?: string) => CSSProperties;
avatarInitial: (name: string) => string;
isSpeaking: (member: ChannelMember) => boolean;
isScreenSharing?: (member: ChannelMember) => boolean;
showMemberActions?: boolean;
memberDragDrop?: boolean;
draggedMemberId?: number | null;
@@ -89,6 +89,14 @@
:size="13"
:title="t('microphoneActive')"
/>
<span
v-if="isScreenSharing?.(member)"
class="ws-voice-channel-member-screen-share"
data-ws-part="voice.channel-tree.member-screen-share"
role="img"
:aria-label="t('screenShare')"
:title="t('screenShare')"
><Icon name="monitor" :size="12" /></span>
</li>
</ul>
<div
@@ -110,6 +118,7 @@
:avatar-style="avatarStyle"
:avatar-initial="avatarInitial"
:is-speaking="isSpeaking"
:is-screen-sharing="isScreenSharing"
:show-member-actions="showMemberActions"
:member-drag-drop="memberDragDrop"
:dragged-member-id="draggedMemberId"
@@ -176,6 +185,14 @@
aria-hidden="true"
></span>
<span v-if="member.away" class="ws-voice-channel-member-away" data-ws-part="voice.channel-tree.member-away" aria-hidden="true">·</span>
<span
v-if="isScreenSharing?.(member)"
class="ws-voice-channel-member-screen-share"
data-ws-part="voice.channel-tree.member-screen-share"
role="img"
:aria-label="t('screenShare')"
:title="t('screenShare')"
><Icon name="monitor" :size="12" /></span>
</li>
<VoiceChannelTreeItem
v-for="child in node.children"
@@ -189,6 +206,7 @@
:avatar-style="avatarStyle"
:avatar-initial="avatarInitial"
:is-speaking="isSpeaking"
:is-screen-sharing="isScreenSharing"
:show-member-actions="showMemberActions"
:member-drag-drop="memberDragDrop"
:dragged-member-id="draggedMemberId"
@@ -228,6 +246,7 @@ const props = defineProps<{
avatarStyle: (name: string, isSelf?: boolean, avatar?: string) => CSSProperties;
avatarInitial: (name: string) => string;
isSpeaking: (member: ChannelMember) => boolean;
isScreenSharing?: (member: ChannelMember) => boolean;
showMemberActions?: boolean;
memberDragDrop?: boolean;
draggedMemberId?: number | null;
@@ -282,3 +301,18 @@ function handleChannelDrop(event: DragEvent): void {
if (props.memberDragDrop) emit("channelDrop", { channel: props.node.channel, event });
}
</script>
<style scoped>
.ws-voice-channel-member-screen-share {
display: inline-grid;
box-sizing: border-box;
width: 18px;
height: 18px;
flex: 0 0 18px;
place-items: center;
border-radius: 5px;
color: #fff;
background: #72c800;
line-height: 0;
}
</style>
+4
View File
@@ -26,6 +26,8 @@ export const webClientTranslations: Record<string, Record<string, string>> = {
notConfigured: "WebSpeak 尚未配置 TeamSpeak 目标。",
configureNow: "打开管理控制台",
privateAudio: "私密社区语音",
mytsLogin: "使用myts登录",
featureInDevelopment: "这个功能还在开发中",
joinLine1: "连接服务器,",
joinLine2: "马上开始交流。",
joinDescription: "无需安装 TeamSpeak 客户端,打开浏览器即可加入语音频道。低延迟、轻量、专注于每一次对话。",
@@ -439,6 +441,8 @@ export const webClientTranslations: Record<string, Record<string, string>> = {
notConfigured: "The WebSpeak TeamSpeak target has not been configured.",
configureNow: "Open admin console",
privateAudio: "Private community audio",
mytsLogin: "Sign in with myTS",
featureInDevelopment: "This feature is still in development.",
joinLine1: "Connect to your server,",
joinLine2: "start the conversation.",
joinDescription: "No TeamSpeak client installation required. Open your browser and join a voice channel with low-latency audio built for conversation.",
+2 -2
View File
@@ -46,10 +46,10 @@ export const BUILTIN_SKIN_CATALOG: SkinCatalogEntry[] = [
{
id: BUILTIN_KAAK_SKIN_ID,
name: "KAAK",
version: "3.1.79",
version: "3.1.86",
author: "WebSpeak Project",
license: "AGPL-3.0-only",
description: "A KOOK-inspired voice-room workspace with a searchable server header, TeamSpeak banner and welcome message, nested channel members, attached channel chat, and a compact WebSpeak audio dock.",
description: "A KOOK-inspired WebSpeak skin with a split-screen connection home, searchable server header, TeamSpeak banner, nested channel members, attached channel chat, and a compact audio dock.",
minAppVersion: "0.2.7-preview",
installedAt: 0,
builtIn: true,
+30 -5
View File
@@ -479,7 +479,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.79");
assert.equal(skin.version, "3.1.86");
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");
@@ -510,9 +510,14 @@ test("the distributable KAAK package provides full home and voice surfaces", asy
for (const child of node.children ?? []) {
const found = findPart(child, part);
if (found) return found;
}
}
return undefined;
}
assert.equal(findPart(home?.root, "home-language")?.widget, "app.language-switcher", "the KAAK connection home has a language switcher in its top corner");
assert.equal(findPart(voice?.root, "topbar"), undefined, "the KAAK voice surface has no top bar");
assert.equal(findPart(voice?.root, "rail-skin")?.widget, "app.skin-switcher", "skin selection lives in the server rail");
assert.equal(findPart(voice?.root, "rail-language")?.widget, "app.language-switcher", "language selection lives in the server rail");
assert.equal(findPart(voice?.root, "server-list")?.children?.[0]?.repeat?.path, "servers.quickList");
assert.deepEqual(findPart(voice?.root, "member-cards")?.options, { screenShare: true, memberActions: true });
assert.equal(findPart(voice?.root, "server-summary")?.widget, "voice.server-header");
assert.equal(findPart(voice?.root, "server-banner")?.widget, "voice.server-banner");
@@ -586,9 +591,13 @@ test("the distributable KAAK package provides full home and voice surfaces", asy
assert.match(skin.css, /--skin-kaak-accent: #6cbf00;/);
assert.match(skin.css, /\[data-ws-part="auth\.password\.backdrop"\]\s*\{[^}]*background: rgba\(10, 11, 13, \.54\);/);
assert.match(skin.css, /\[data-ws-part="auth\.password\.dialog"\]\s*\{[^}]*width: min\(438px, calc\(100vw - 32px\)\);[^}]*min-height: 204px;[^}]*background: #242529;/);
assert.match(skin.css, /\[data-ws-part="auth\.password\.dialog"\]\[data-ws-state="server-password"\]\s*\{[^}]*color: #273248;[^}]*border-color: #e3e8ec;[^}]*background: #fff;/);
assert.match(skin.css, /\[data-ws-part="auth\.password\.title"\]\s*\{[^}]*font-size: 13px;[^}]*font-weight: 700;/);
assert.match(skin.css, /\[data-ws-part="auth\.password\.field"\]\s*\{[^}]*height: 40px;[^}]*border: 1px solid #3b3c40;[^}]*border-radius: 12px;/);
assert.match(skin.css, /\[data-ws-part="home\.form"\] \[data-ws-part="home\.field"\]:has\(input\[type="password"\]\)\s*\{[^}]*height: 40px;[^}]*border-radius: 12px;[^}]*background: #242529;/);
assert.match(skin.css, /auth\.password\.dialog"\]\[data-ws-state="server-password"\][\s\S]*?auth\.password\.field"\]\s*\{[^}]*border-color: #e3e8ec;[^}]*background: #fff;/);
assert.match(skin.css, /auth\.password\.dialog"\]\[data-ws-state="server-password"\][\s\S]*?input:-webkit-autofill[\s\S]*?-webkit-box-shadow: 0 0 0 1000px #fff inset;/);
assert.match(skin.css, /\[data-ws-part="home\.form"\] \[data-ws-part="home\.field"\]:has\(input\[type="password"\]\)\s*\{[^}]*height: 42px;[^}]*border-radius: 11px;[^}]*background: #fff;/);
assert.match(skin.css, /home\.field"\]:has\(input\[type="password"\]\) input:-webkit-autofill[\s\S]*?-webkit-box-shadow: 0 0 0 1000px #fff inset;[\s\S]*?-webkit-text-fill-color: #273248;/);
assert.match(skin.css, /\[data-ws-part="auth\.password\.actions"\] > button:last-child\s*\{[^}]*width: 82px;[^}]*height: 36px;[^}]*background: #6cbf00;/);
assert.match(skin.css, /\[data-ws-plugin-part="kaak-workspace\.voice-dock"\] \{[\s\S]*?width: min\(282px, calc\(100% - 22px\)\);[\s\S]*?margin-bottom: 11px;[\s\S]*?border-radius: 17px;/);
assert.match(skin.css, /\[data-ws-plugin-part="kaak-workspace\.voice-dock-actions"\] \{[\s\S]*?grid-template-columns: minmax\(0, 1fr\) 28px 28px 36px;[\s\S]*?grid-template-rows: 29px 26px;[\s\S]*?row-gap: 21px;/);
@@ -634,7 +643,9 @@ test("the distributable KAAK package provides full home and voice surfaces", asy
assert.match(skin.css, /\.settings-select:hover:not\(:disabled\) \{\s*border-color: #6cbf00;/);
assert.match(skin.css, /\.microphone-toggle:not\(\.muted\):active,[\s\S]*?background: #60ab00;\s*border-color: #60ab00;/);
assert.doesNotMatch(skin.css, /#58c877/);
assert.match(skin.css, /\[data-ws-plugin-part="kaak-home"\] \{[^}]*font-family: var\(--skin-kaak-font\);/);
assert.match(skin.css, /\[data-ws-plugin-part="kaak-home"\] \{[^}]*font-family: Arial, "Microsoft YaHei", sans-serif;/);
assert.match(skin.css, /\.kaak-myts-login\s*\{[^}]*width: 60px;[^}]*height: 60px;[^}]*background: transparent;[^}]*clip-path: polygon\(0 0, 100% 0, 100% 100%\);/);
assert.match(skin.css, /\.kaak-myts-wordmark\s*\{[^}]*color: #fff;[^}]*transform: rotate\(45deg\);/);
assert.match(skin.css, /settings-select-menu[\s\S]*?background: #25262a/);
assert.match(skin.css, /settings-select-option[\s\S]*?min-height: 32px/);
assert.match(skin.css, /settings-header h2 \{\s*color: #f2f3f5;\s*font-size: 32px;\s*font-weight: 600;/);
@@ -668,9 +679,23 @@ test("the distributable KAAK package provides full home and voice surfaces", asy
assert.match(skin.css, /grid-template-columns: 86px 304px minmax\(280px, 1fr\) 0;/);
assert.match(skin.css, /grid-template-columns: 86px 304px/);
assert.match(skin.css, /minmax\(340px, min\(38vw, 520px\)\)/);
assert.match(skin.css, /grid-template-rows: 40px/);
assert.match(skin.css, /grid-template-rows: minmax\(0, 1fr\)/);
assert.doesNotMatch(skin.css, /kaak-workspace\.topbar/);
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\.server-add"\]\s*\{[\s\S]*?width: 58px;[\s\S]*?height: 58px;[\s\S]*?border-radius: 18px;/);
assert.match(skin.css, /kaak-workspace\.rail-skin"\]\s*\{[\s\S]*?width: 58px;[\s\S]*?height: 58px;[\s\S]*?flex: 0 0 58px;/);
assert.match(skin.css, /kaak-workspace\.rail-language"\]\s*\{[\s\S]*?order: 4;[\s\S]*?width: 58px;[\s\S]*?height: 58px;[\s\S]*?flex: 0 0 58px;/);
assert.match(skin.css, /rail-language"\] \.language-trigger\s*\{[^}]*width: 58px;[^}]*height: 58px;[^}]*border-radius: 18px;[^}]*background: var\(--skin-kaak-rail-item-bg\);/);
assert.match(skin.css, /rail-language"\] \.language-trigger > \.language-current-icon\s*\{\s*display: block;[^}]*width: 24px;[^}]*height: 24px;/);
assert.match(skin.css, /kaak-home\.home-language"\]\s*\{[^}]*position: fixed;[^}]*top: 18px;[^}]*right: 18px;/);
assert.match(skin.css, /kaak-home\.home-language"\] \.language-trigger\s*\{[^}]*width: 48px;[^}]*height: 48px;[^}]*background: #fff;/);
assert.match(skin.css, /kaak-home\.home-language"\] \.language-trigger > \.language-current-icon\s*\{\s*display: block;/);
assert.doesNotMatch(skin.css, /language-trigger::before\s*\{\s*content: "文\/A";/);
assert.match(skin.css, /skin-add-divider"\]\s*\{\s*order: 1;/);
assert.match(skin.css, /kaak-workspace\.server-add"\]\s*\{\s*order: 2;/);
assert.match(skin.css, /kaak-workspace\.rail-skin"\]\s*\{\s*order: 3;/);
assert.match(skin.css, /rail-language"\] \.language-dropdown\s*\{[^}]*position: fixed;[^}]*bottom: 161px;[^}]*left: 94px;/);
assert.match(skin.css, /rail-skin"\] \.skin-dropdown\s*\{[^}]*position: fixed;[^}]*bottom: 179px;[^}]*left: 94px;/);
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;/);
+29 -8
View File
@@ -1740,10 +1740,19 @@ const skinPluginActions = {
if (!voiceState.connected || typeof args.streamId !== "string") return;
if (screenShareStreams.some((stream) => stream.streamId === args.streamId)) joinScreenShare(args.streamId);
},
"voice.leaveScreenShare": () => { if (screenShareViewing.value) leaveScreenShare(); },
};
const skinPluginWidgets = {
"voice.leaveScreenShare": () => { if (screenShareViewing.value) leaveScreenShare(); },
};
const homeConnectionStatus = computed(() => {
if (voiceState.connecting) return t("connecting");
if (voiceState.error) return localizedMessage(voiceState.error);
if (browserError.value) return localizedMessage(browserError.value);
if (!serverConfigLoading.value && !initialized.value) return t("notConfigured");
if (!localPersistenceAvailable) return t("localPersistenceUnavailable");
return "";
});
const skinPluginWidgets = {
"voice.screen-share-start": () => h("button", {
type: "button",
class: "skin-runtime-screen-share-start",
@@ -1784,10 +1793,21 @@ const skinPluginWidgets = {
onSelectServer: selectLocalServer,
onToggleFavorite: toggleFavorite,
onToggleQuickFavorite: toggleQuickFavorite,
onImportIdentity: openIdentityImport,
onExportIdentity: exportIdentity,
}),
"app.skin-switcher": () => h(SkinSwitcher, {
onImportIdentity: openIdentityImport,
onExportIdentity: exportIdentity,
}),
"home.connection-status": () => h("p", {
class: "kaak-home-status",
role: "status",
"aria-live": "polite",
}, homeConnectionStatus.value),
"home.myts-login": () => h("button", {
type: "button",
class: "kaak-myts-login",
"aria-label": t("mytsLogin"),
onClick: () => showToast(t("featureInDevelopment")),
}, [h("span", { class: "kaak-myts-wordmark", "aria-hidden": "true" }, "myts")]),
"app.skin-switcher": () => h(SkinSwitcher, {
modelValue: activeSkinId.value,
"onUpdate:modelValue": (value: string) => { activeSkinId.value = value; },
class: "skin-switcher",
@@ -1841,6 +1861,7 @@ const skinPluginWidgets = {
avatarStyle,
avatarInitial,
isSpeaking,
isScreenSharing: (member: ChannelMember) => Boolean(screenShareControls.streamForMember(member)),
showMemberActions: options?.memberActions === true,
memberDragDrop: options?.memberDragDrop === true,
draggedMemberId: memberControls.draggedMember.value?.id ?? null,
+30 -1
View File
@@ -6,12 +6,13 @@ import vue from "@vitejs/plugin-vue";
import { createServer } from "vite";
import { createRenderer, createSSRApp, nextTick, shallowRef, markRaw } from "vue";
import { renderToString } from "@vue/server-renderer";
let vite, useWebClientScreenShare, VoiceMemberCards;
let vite, useWebClientScreenShare, VoiceMemberCards, VoiceChannelTree;
const renderer = createRenderer({ createComment: text => ({ text }), createText: text => ({ text }), createElement: () => ({}), insert() {}, remove() {}, setText() {}, setElementText() {}, patchProp() {}, parentNode: () => null, nextSibling: () => null });
before(async () => {
vite = await createServer({ configFile: false, plugins: [vue()], root: fileURLToPath(new URL("../", import.meta.url)), server: { middlewareMode: true, hmr: false, ws: false, watch: null }, optimizeDeps: { noDiscovery: true, include: [] }, appType: "custom" });
({ useWebClientScreenShare } = await vite.ssrLoadModule("/src/composables/useWebClientScreenShare.ts"));
({ default: VoiceMemberCards } = await vite.ssrLoadModule("/src/components/web-client/VoiceMemberCards.vue"));
({ default: VoiceChannelTree } = await vite.ssrLoadModule("/src/components/web-client/VoiceChannelTree.vue"));
});
after(async () => { await vite?.close(); });
function mount(t, initialStream = null) {
@@ -125,6 +126,34 @@ test("member cards detect and expose a remote share without depending on local s
assert.doesNotMatch(html, /startScreenShare/);
});
test("channel tree marks only members who own an active screen share", async () => {
const component = await readFile(new URL("../src/components/web-client/VoiceChannelTreeItem.vue", import.meta.url), "utf8");
const html = await renderToString(createSSRApp(VoiceChannelTree, {
channels: [{
id: "channel-1",
parentID: "0",
depth: 0,
name: "General",
members: [
{ id: 7, nickname: "MeissS" },
{ id: 8, nickname: "NoShare" },
],
}],
currentChannelId: "channel-1",
layout: "server-sidebar",
avatarStyle: () => ({}),
avatarInitial: nickname => nickname[0],
isSpeaking: () => false,
isScreenSharing: member => member.id === 7,
t: key => key,
}));
assert.equal((html.match(/data-ws-part="voice\.channel-tree\.member-screen-share"/g) ?? []).length, 1);
assert.match(html, /aria-label="screenShare"/);
assert.match(html, /d="M4 4h16v12H4zM8 20h8M12 16v4"/);
assert.match(component, /background:\s*#72c800/);
});
test("a skin can explicitly opt the member-card widget out of screen-share UI", async () => {
const html = await renderToString(createSSRApp(VoiceMemberCards, {
currentMembers: [{ id: 7, nickname: "Remote sharer", isSelf: false, inputMuted: false }],