feat(skins): add persistent voice workspace API and align KAAK

This commit is contained in:
illusia committed 2026-10-24 13:30:50 +08:00
1 parent 0af3236c30
commit 452e6f09ca
24 files changed
+451 -21

No files matched your search

+6
View File
@@ -28,6 +28,12 @@ The existing WebSpeak noise-suppression switch is available in the audio setting
The owner authorized inspection of the first two voice rooms in the KOOK server. Both rooms were entered and viewed; the microphone remained off and no message was sent. The in-room view confirmed a single large participant tile in the center, a separate right-side panel for the active voice channel's text chat, a narrow server rail, grouped voice channels, and a compact voice-control dock near the lower left. The chat was empty, so no message contents were recorded. Server/room identifiers and member names were not recorded.
## Returning to the workspace
KAAK 3.1.125 requires WebSpeak 0.2.8 with workspace API v1. Its manifest opts into the generic persistent workspace policy: first-time visitors keep the connection home until a successful voice connection; returning visitors and disconnected users retain the workspace and server rail. Restoring the workspace never starts a connection or captures the microphone. The host restores the recent target only for ordinary visits, preserving explicit invitation and target links. Clearing browser data resets this history.
The permission-gated `voice.connection-status` host widget provides the connection state, nickname and explicit reconnect button beside server navigation at desktop and narrow widths. Open-mode server switching and adding servers reuse the host connection flow, including saved-password lookup and trusted password prompts; fixed mode retains its restrictions. All KAAK layout and styling remain in the package.
## 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. When a screen-share peer is active, the performance panel shows browser-side video codec and transport metrics. The host renders trusted connection, language, skin, and audio controls. KAAK 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.
Binary file not shown.
+7 -1
View File
@@ -395,6 +395,7 @@
"audio.microphone.control",
"audio.output.control",
"audio.settings.open",
"voice.connect",
"voice.disconnect",
"voice.screenShare.status.read",
"voice.screenShare.read",
@@ -501,7 +502,8 @@
"attributes": {
"type": "button",
"aria-current": "{{server.current}}",
"aria-label": "切换到 {{server.label}}"
"aria-label": "{{server.switchTitle}}",
"title": "{{server.switchTitle}}"
},
"events": {
"click": "switch-server"
@@ -862,6 +864,10 @@
"widget": "voice.server-banner",
"part": "server-banner"
},
{
"widget": "voice.connection-status",
"part": "connection-status"
},
{
"tag": "nav",
"part": "channel-list",
+6 -2
View File
@@ -3,12 +3,16 @@
"packageType": "open-skin",
"id": "community.kaak-voice",
"name": "KAAK",
"version": "3.1.122",
"version": "3.1.125",
"author": "WebSpeak Project",
"license": "AGPL-3.0-only",
"description": "A KOOK-inspired WebSpeak skin with a split-screen connection home, searchable server header, TeamSpeak banner, nested channel members, unified chat with local history, and a compact audio dock.",
"entry": "skin.css",
"components": "components.json",
"content": "content.json",
"minAppVersion": "0.2.7"
"minAppVersion": "0.2.8",
"workspace": {
"apiVersion": 1,
"mode": "persistent"
}
}
+72
View File
@@ -4567,3 +4567,75 @@
inset-inline-start: 70px;
}
}
/* Workspace API v1: reconnect stays beside server navigation on every width. */
[data-ws-plugin-part="kaak-workspace.connection-status"] {
flex: 0 0 auto;
min-width: 0;
margin: 10px 8px;
}
[data-ws-plugin-part="kaak-workspace.connection-status"]:not(:has([data-ws-part="voice.connection-status"])) { display: none; }
[data-ws-plugin-part="kaak-workspace.connection-status"] [data-ws-part="voice.connection-status"] {
display: flex;
flex-direction: column;
align-items: stretch;
gap: 12px;
width: 100%;
min-width: 0;
margin: 0;
padding: 16px;
border: 1px solid var(--skin-kaak-border);
border-radius: 12px;
color: var(--skin-kaak-text);
background: var(--skin-kaak-raised);
box-shadow: none;
font-family: var(--skin-kaak-font);
}
[data-ws-plugin-part="kaak-workspace.connection-status"] [data-ws-part="voice.connection-status.message"] {
flex: 0 0 auto;
margin: 0;
color: var(--skin-kaak-muted);
font-size: 13px;
line-height: 1.5;
overflow-wrap: anywhere;
}
[data-ws-plugin-part="kaak-workspace.connection-status"] [data-ws-state="failed"] [data-ws-part="voice.connection-status.message"] { color: #ffaaaa; }
[data-ws-plugin-part="kaak-workspace.connection-status"] [data-ws-part="voice.connection-status.nickname"] {
display: grid;
gap: 6px;
min-width: 0;
width: 100%;
color: var(--skin-kaak-muted);
font-size: 12px;
}
[data-ws-plugin-part="kaak-workspace.connection-status"] input {
width: 100%;
min-width: 0;
min-height: 44px;
padding: 9px 10px;
border: 1px solid #4b4e55;
border-radius: 7px;
color: var(--skin-kaak-text);
background: var(--skin-kaak-panel);
font: inherit;
font-size: 14px;
}
[data-ws-plugin-part="kaak-workspace.connection-status"] button {
justify-content: center;
min-width: 0;
min-height: 44px;
padding: 10px 12px;
border-radius: 7px;
color: #152000;
background: var(--skin-kaak-accent);
font: inherit;
font-weight: 700;
white-space: normal;
overflow-wrap: anywhere;
}
[data-ws-plugin-part="kaak-workspace.connection-status"] button:hover:not(:disabled) { background: var(--skin-kaak-accent-hover); }
[data-ws-plugin-part="kaak-workspace.connection-status"] input:focus-visible,
[data-ws-plugin-part="kaak-workspace.connection-status"] button:focus-visible { outline: 2px solid #a8ed50; outline-offset: 3px; }
@media (max-width: 820px) {
[data-ws-plugin-part="kaak-workspace.connection-status"] { margin: 10px 4px; }
}