style: match KAAK password dialogs to reference

This commit is contained in:
illusia committed 2026-10-12 11:23:31 +08:00
1 parent 2f5cdcba90
commit 53324ef02b
12 files changed
+228 -12

No files matched your search

+7 -1
View File
@@ -12,7 +12,7 @@
## 当前检查点(2026-10-12)
- KAAK 当前源码版本为 3.1.77;最近新增 TeamSpeak 服务器横幅与欢迎语展示,沿用客户端握手携带的真实服务器信息并在缺少内容时隐藏卡片;同时保留真实服务器名与收藏/历史快速切换入口,并以宿主频道树呈现嵌套语音频道、频道成员头像和状态。服务器显示名过滤像地址的内容;快速切换不向皮肤暴露连接目标。控制坞保留 WebSpeak 现有分享、降噪、伴奏、麦克风、扬声器和设置操作;降噪关闭状态新增红色斜杠提示;已移除无效的录制占位,仅保留屏幕共享和伴奏入口。频道树成员行与成员卡片右键均使用 KOOK 深色浮层格式,菜单项和行为仍为 WebSpeak 原有操作;频道树成员行支持悬停反馈和跨频道拖放移动。屏幕共享播放器限定在中央语音舞台内,具有明确响应高度;成员卡片使用播放器下方剩余区域。3.1.55 的横向单行方案已被用户明确否决,不再沿用;3.1.53 已移除皮肤布局运行时对宿主控件强加的 44px 尺寸。
- KAAK 当前源码版本为 3.1.78;最近新增 TeamSpeak 服务器横幅与欢迎语展示,沿用客户端握手携带的真实服务器信息并在缺少内容时隐藏卡片;同时保留真实服务器名与收藏/历史快速切换入口,并以宿主频道树呈现嵌套语音频道、频道成员头像和状态。服务器显示名过滤像地址的内容;快速切换不向皮肤暴露连接目标。控制坞保留 WebSpeak 现有分享、降噪、伴奏、麦克风、扬声器和设置操作;降噪关闭状态新增红色斜杠提示;已移除无效的录制占位,仅保留屏幕共享和伴奏入口。频道树成员行与成员卡片右键均使用 KOOK 深色浮层格式,菜单项和行为仍为 WebSpeak 原有操作;频道树成员行支持悬停反馈和跨频道拖放移动。屏幕共享播放器限定在中央语音舞台内,具有明确响应高度;成员卡片使用播放器下方剩余区域。3.1.55 的横向单行方案已被用户明确否决,不再沿用;3.1.53 已移除皮肤布局运行时对宿主控件强加的 44px 尺寸。
- 语音布局、成员卡、频道/聊天收起、音量反馈、性能卡片、设备下拉交互和字体层级均已有对应实现;音频设置标签为 KOOK 已记录的 14px/400,表单卡与字段行按实测宽度/行高调整。
- 直接观察记录覆盖语音侧栏/频道树、成员卡与悬停姓名、当前语音频道聊天开合、语音坞、音频设置字体及设备列表尺寸和状态。独立文字频道不复刻;KOOK 的付费分享呈现不复刻,WebSpeak 自带屏幕分享入口和播放器保留。
- 设备选择菜单已按皮肤实际高度限位;KAAK 音频滑杆、性能反馈、字体和成员卡交互均有对应实现。3.1.66 完整验证为 680/680,服务端 TypeScript 构建、前端类型检查和生产构建通过。用户已明确 KOOK 音乐语音频道附带聊天默认收起、普通语音频道默认展开。TeamSpeak `ChannelInfo` 与皮肤上下文没有音乐类别字段;当前实现按频道分别记住聊天开合,尚不能判断从未设置过的频道是否为音乐频道。
@@ -622,3 +622,9 @@
- 连接和频道切换先尝试本地凭据,只有成功连接或成功切入频道后才保存。服务器或频道拒绝旧密码时删除对应记录并显示原密码输入框。切换服务器会清除当前内存密码,避免误带到另一个目标。
- 验证:`npm run verify` 通过(696/696 测试、服务端构建、前端类型检查和 Vite 生产构建);新增浏览器凭据隔离及连接对话框回归测试。3040 健康接口返回 200,线上静态入口引用的 WebClient 生产包返回 200,包内容含服务器与频道凭据实现。
- 安全边界:凭据存于浏览器本地 IndexedDB,未加密;同源脚本可访问它们。
## 本轮密码对话框样式(2026-10-12)
- 用户要求服务器密码和频道密码都按截图改成 KAAK 深色紧凑弹窗。
- 两个宿主对话框增加稳定的 `auth.password.*` 皮肤钩子;KAAK 包负责尺寸、深色表面、字段、按钮与移动视口样式。密码输入、错误文案、关闭、取消、提交和服务器重试仍使用原宿主逻辑,其他皮肤不变。KAAK 升至 3.1.78。
- 验证:重建示例和内置 KAAK 包;皮肤包与布局钩子测试通过,`npm run verify` 通过(696/696 测试、服务端构建、前端类型检查和 Vite 生产构建),`git diff --check` 通过。3040 健康接口、入口页、WebClient JS/CSS 和新版 KAAK 包均返回 HTTP 200;皮肤包大小与构建产物一致。
+4
View File
@@ -262,6 +262,10 @@ widget 的可选 `mount` 只接受这些公开锚点:`home.header.after`、`ho
下列名称来自当前前端模板。对新功能,作者可以先用通用 `control` 部件;后续新增稳定部件会更新本目录。
服务器和频道密码弹窗共用 `auth.password.backdrop`、`auth.password.dialog`、`auth.password.decoration`、`auth.password.eyebrow`、`auth.password.title`、`auth.password.lead`、`auth.password.form`、`auth.password.label`、`auth.password.field`、`auth.password.field-icon`、`auth.password.error` 和 `auth.password.actions`。
服务器和频道密码弹窗共用 `auth.password.backdrop`、`auth.password.dialog`、`auth.password.close`、`auth.password.close-icon`、`auth.password.decoration`、`auth.password.eyebrow`、`auth.password.title`、`auth.password.lead`、`auth.password.form`、`auth.password.label`、`auth.password.field`、`auth.password.field-icon`、`auth.password.input`、`auth.password.error`、`auth.password.actions`、`auth.password.cancel`、`auth.password.submit`、`auth.password.spinner` 和 `auth.password.submit-icon`。
| 页面区域 | `data-ws-part` |
| --- | --- |
| 通用 | `app`、`app.toast`、`control`、`skin.trigger`、`skin.menu`、`skin.option`、`language.trigger`、`language.menu`、`language.option` |
+1 -1
View File
@@ -30,7 +30,7 @@ The owner authorized inspection of the first two voice rooms in the KOOK server.
## Components and permissions
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, cached profile-avatar display inside the trusted member-card widget, channel joining, channel chat, voice status, microphone/output controls, whisper controls, disconnect, and screen-share status/read/control. Its member-card widget explicitly enables share status and watch actions; the KAAK dock uses the host's screen-share control. The performance panel hides only share transport metrics. The host renders trusted connection, language, skin, and audio controls. KAAK 3.1.77 keeps the shared-screen player inside the central voice-stage column with an explicit responsive height, so the player cannot collapse when the host applies its inline video sizing; member cards scroll in the remaining area. The full source image remains visible with black letterboxing. 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 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, cached profile-avatar display inside the trusted member-card widget, channel joining, channel chat, voice status, microphone/output controls, whisper controls, disconnect, and screen-share status/read/control. Its member-card widget explicitly enables share status and watch actions; the KAAK dock uses the host's screen-share control. The performance panel hides only share transport metrics. The host renders trusted connection, language, skin, and audio controls. KAAK 3.1.78 keeps the shared-screen player inside the central voice-stage column with an explicit responsive height, so the player cannot collapse when the host applies its inline video sizing; member cards scroll in the remaining area. The full source image remains visible with black letterboxing. Server and channel password prompts use the compact dark KAAK dialog style while retaining WebSpeak's trusted password, error, cancel, and retry behavior. 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 server header uses the live, privacy-filtered TeamSpeak server label and a trusted `voice.server-switcher` menu backed by favorites and recent connections. Its click handler reuses WebSpeak's existing connection flow with an opaque local ID; addresses and credentials never enter skin data. The left panel uses the trusted `voice.channel-tree` widget to retain TeamSpeak channel nesting, member counts and capacity, available avatars, and mute/speaking/away states. Expanding a branch is local UI state, a single click selects a channel, and double-click joins it. With `memberActions` enabled, right-clicking another member row opens WebSpeak's existing host-owned action menu. With `memberDragDrop` enabled, another member can be dragged onto a different channel row; the member row and target channel receive visual feedback, and the host reuses its existing move-client operation. Both options default off for other skins. The skin does not add KOOK's separate text-channel list.
Binary file not shown.
+1 -1
View File
@@ -3,7 +3,7 @@
"packageType": "open-skin",
"id": "community.kaak-voice",
"name": "KAAK",
"version": "3.1.77",
"version": "3.1.78",
"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.",
+167 -1
View File
@@ -322,7 +322,7 @@
line-height: 1;
}
[data-ws-plugin-part="kaak-workspace.identity-entry"] {
[data-ws-plugin-part="kaak-workspace.identity-entry"] {
position: absolute;
z-index: 5;
left: 0;
@@ -3125,3 +3125,169 @@
[data-ws-plugin-part="kaak-workspace.server-banner"] [data-ws-part="voice.server-banner.title"] { font-size: 11px; line-height: 15px; }
[data-ws-plugin-part="kaak-workspace.server-banner"] [data-ws-part="voice.server-banner.body"] { margin-top: 3px; font-size: 10px; line-height: 14px; }
}
[data-ws-part="auth.password.backdrop"] {
padding: 16px;
background: rgba(10, 11, 13, .54);
backdrop-filter: blur(3px);
}
[data-ws-part="auth.password.dialog"] {
position: relative;
display: flex;
flex-direction: column;
box-sizing: border-box;
width: min(438px, calc(100vw - 32px));
min-height: 204px;
max-height: min(90dvh, 380px);
overflow-y: auto;
padding: 20px;
color: #f0f1f3;
border: 1px solid #303136;
border-radius: 16px;
background: #242529;
box-shadow: 0 18px 48px rgba(0, 0, 0, .38);
}
[data-ws-part="auth.password.decoration"],
[data-ws-part="auth.password.eyebrow"],
[data-ws-part="auth.password.lead"],
[data-ws-part="auth.password.label"],
[data-ws-part="auth.password.field-icon"] {
display: none;
}
[data-ws-part="auth.password.title"] {
margin: 0 30px 18px 0;
color: #f0f1f3;
font-size: 13px;
font-weight: 700;
letter-spacing: normal;
line-height: 20px;
}
[data-ws-part="auth.password.form"] {
display: flex;
flex: 1 1 auto;
flex-direction: column;
margin: 0;
}
[data-ws-part="auth.password.field"] {
box-sizing: border-box;
height: 40px;
min-height: 40px;
gap: 0;
padding: 0 15px;
color: #d6d7db;
border: 1px solid #3b3c40;
border-radius: 12px;
background: #242529;
transition: border-color .16s ease, box-shadow .16s ease;
}
[data-ws-part="auth.password.field"]:focus-within {
border-color: #6cbf00;
background: #242529;
box-shadow: 0 0 0 2px rgba(108, 191, 0, .2);
}
[data-ws-part="auth.password.field"] input {
width: 100%;
min-width: 0;
height: 100%;
padding: 0;
color: #f0f1f3;
outline: none;
border: 0;
background: transparent;
font-size: 13px;
}
[data-ws-part="auth.password.field"] input::placeholder {
color: #777980;
}
[data-ws-part="auth.password.error"] {
margin: 10px 0 0;
padding: 8px 10px;
color: #ff9999;
border: 1px solid #57383a;
border-radius: 9px;
background: #342729;
font-size: 12px;
}
[data-ws-part="auth.password.actions"] {
display: flex;
align-items: center;
justify-content: flex-end;
gap: 24px;
margin-top: 47px;
}
[data-ws-part="auth.password.actions"] > button:first-child {
min-height: 36px;
padding: 0 12px;
color: #aeb0b6;
border: 0;
background: transparent;
font-size: 13px;
font-weight: 500;
cursor: pointer;
}
[data-ws-part="auth.password.actions"] > button:first-child:hover:not(:disabled) {
color: #f0f1f3;
}
[data-ws-part="auth.password.actions"] > button:last-child {
box-sizing: border-box;
width: 82px;
height: 36px;
min-height: 36px;
padding: 0 10px;
color: #fff;
border: 0;
border-radius: 13px;
background: #6cbf00;
font-size: 12px;
font-weight: 700;
cursor: pointer;
transition: background-color .16s ease;
}
[data-ws-part="auth.password.actions"] > button:last-child:hover:not(:disabled) {
background: #7ac51a;
}
[data-ws-part="auth.password.actions"] > button:last-child:disabled {
cursor: wait;
opacity: 1;
}
[data-ws-part="auth.password.dialog"] > button {
position: absolute;
top: 15px;
right: 16px;
display: grid;
place-items: center;
width: 24px;
height: 24px;
padding: 0;
color: #777980;
border: 0;
border-radius: 6px;
background: transparent;
box-shadow: none;
cursor: pointer;
transition: color .16s ease, background-color .16s ease;
}
[data-ws-part="auth.password.dialog"] > button:hover:not(:disabled) {
color: #f0f1f3;
background: #303137;
}
[data-ws-part="auth.password.dialog"] > button > svg {
width: 16px;
height: 16px;
}
[data-ws-part="auth.password.dialog"] > button:focus-visible,
[data-ws-part="auth.password.actions"] > button:focus-visible {
outline: 2px solid #8cda33;
outline-offset: 2px;
}
@media (max-width: 740px) {
[data-ws-part="auth.password.backdrop"] {
align-items: center;
padding: 12px;
}
[data-ws-part="auth.password.dialog"] {
width: min(438px, calc(100vw - 24px));
padding: 20px;
border-radius: 16px;
}
}
+18
View File
@@ -46,9 +46,25 @@ export interface SkinLayoutComponent {
editable: boolean;
}
const AUTH_PASSWORD_PART_IDS = [
"auth.password.backdrop",
"auth.password.dialog",
"auth.password.decoration",
"auth.password.eyebrow",
"auth.password.title",
"auth.password.lead",
"auth.password.form",
"auth.password.label",
"auth.password.field",
"auth.password.field-icon",
"auth.password.error",
"auth.password.actions",
] as const;
const PUBLIC_PART_IDS = new Set<string>([
"app",
"app.toast",
...AUTH_PASSWORD_PART_IDS,
"control",
"demo.action.poke",
"demo.action.reconnect",
@@ -306,6 +322,7 @@ const PUBLIC_PART_IDS = new Set<string>([
const CONTROL_KINDS = ["button", "link", "input", "checkbox", "range", "select", "textarea", "menuitem", "draggable"] as const;
const TRUSTED_PART_IDS = new Set([
...AUTH_PASSWORD_PART_IDS,
"app",
"app.toast",
"home.security-note",
@@ -371,6 +388,7 @@ const IDENTITY_PART_IDS = new Set([
"home.identity-import.textarea", "home.identity-import.security",
]);
const COMMON_PART_IDS = new Set([
...AUTH_PASSWORD_PART_IDS,
"app", "app.toast", "control", "skin.trigger", "skin.menu", "skin.option",
"language.trigger", "language.menu", "language.option",
]);
Binary file not shown.
@@ -1,10 +1,12 @@
<template>
<div
class="modal-backdrop channel-password-backdrop"
data-ws-part="auth.password.backdrop"
@click.self="emit('cancel')"
>
<section
class="channel-password-modal"
data-ws-part="auth.password.dialog"
ref="dialog"
tabindex="-1"
@keydown="onDialogKeydown"
@@ -24,25 +26,30 @@
:size="19"
/></button>
<div class="channel-password-icon"
data-ws-part="auth.password.decoration"
><Icon
name="lock"
:size="22"
/></div>
<span class="card-kicker">{{ t("channelPasswordPrompt") }}</span>
<h2 id="channel-password-title">{{ t("channelPasswordTitle") }}</h2>
<p>{{ t("channelPasswordLead") }}</p>
<span class="card-kicker" data-ws-part="auth.password.eyebrow">{{ t("channelPasswordPrompt") }}</span>
<h2 id="channel-password-title" data-ws-part="auth.password.title">{{ t("channelPasswordTitle") }}</h2>
<p data-ws-part="auth.password.lead">{{ t("channelPasswordLead") }}</p>
<form
class="channel-password-form"
data-ws-part="auth.password.form"
@submit.prevent="emit('submit')"
>
<label
class="field-label"
data-ws-part="auth.password.label"
for="channel-password-input"
>{{ t("channelPasswordPrompt") }}</label
>
<div class="field-wrap"
data-ws-part="auth.password.field"
><Icon
name="lock"
data-ws-part="auth.password.field-icon"
:size="17" /><input
id="channel-password-input"
v-model="password"
@@ -55,9 +62,11 @@
<div
v-if="error"
class="notice error-notice channel-password-error"
data-ws-part="auth.password.error"
><span class="notice-symbol">!</span><span>{{ error }}</span></div
>
<div class="channel-password-actions"
data-ws-part="auth.password.actions"
><button
type="button"
class="text-button"
@@ -1,10 +1,12 @@
<template>
<div
class="modal-backdrop channel-password-backdrop"
data-ws-part="auth.password.backdrop"
@click.self="emit('cancel')"
>
<section
class="channel-password-modal server-password-modal"
data-ws-part="auth.password.dialog"
ref="dialog"
tabindex="-1"
@keydown="onDialogKeydown"
@@ -24,29 +26,34 @@
:size="19"
/></button>
<div class="channel-password-icon"
data-ws-part="auth.password.decoration"
><Icon
name="lock"
:size="22"
/></div>
<span class="card-kicker">{{ t("serverPasswordPrompt") }}</span>
<h2 id="server-password-title">{{ t("serverPasswordTitle") }}</h2>
<p>{{
<span class="card-kicker" data-ws-part="auth.password.eyebrow">{{ t("serverPasswordPrompt") }}</span>
<h2 id="server-password-title" data-ws-part="auth.password.title">{{ t("serverPasswordTitle") }}</h2>
<p data-ws-part="auth.password.lead">{{
errorCode === "INVALID_SERVER_PASSWORD"
? t("serverPasswordInvalidLead")
: t("serverPasswordRequiredLead")
}}</p>
<form
class="channel-password-form"
data-ws-part="auth.password.form"
@submit.prevent="emit('submit')"
>
<label
class="field-label"
data-ws-part="auth.password.label"
for="retry-server-password-input"
>{{ t("serverPasswordPrompt") }}</label
>
<div class="field-wrap"
data-ws-part="auth.password.field"
><Icon
name="lock"
data-ws-part="auth.password.field-icon"
:size="17" /><input
id="retry-server-password-input"
v-model="password"
@@ -56,6 +63,7 @@
autofocus
/></div>
<div class="channel-password-actions"
data-ws-part="auth.password.actions"
><button
type="button"
class="text-button"
+1 -1
View File
@@ -46,7 +46,7 @@ export const BUILTIN_SKIN_CATALOG: SkinCatalogEntry[] = [
{
id: BUILTIN_KAAK_SKIN_ID,
name: "KAAK",
version: "3.1.77",
version: "3.1.78",
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.",
+6 -1
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.77");
assert.equal(skin.version, "3.1.78");
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");
@@ -584,6 +584,11 @@ test("the distributable KAAK package provides full home and voice surfaces", asy
assert.match(skin.css, /ws-voice-channel-member-avatar[\s\S]*?border-radius: 50%;/);
assert.match(skin.css, /--skin-kaak-font:[\s\S]*?PingFang SC/);
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\.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="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;/);
assert.match(skin.css, /ws-voice-channel-tree\[data-layout="server-sidebar"\] \.ws-voice-channel-line[\s\S]*?min-height: 38px;/);