mirror of
https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak.git
synced 2026-12-03 20:12:52 +08:00
fix(skins): expose screen-share status to custom members
This commit is contained in:
1 parent
7fe8719812
commit
8b5db8af1f
20 files changed
+295
-41
No files matched your search
@@ -528,3 +528,11 @@
|
||||
- 修改范围:给降噪按钮增加仅表示关闭状态的皮肤钩子,在 KAAK 语音坞内复用麦克风/扬声器的红色斜杠样式;同时覆盖 KAAK 移动端按钮。音频处理逻辑、默认皮肤和其他皮肤均不变。
|
||||
- 验证:KAAK 示例包和内置包已从同一源码重建;完整 `npm run verify` 通过(682/682 测试、服务端 TypeScript 构建、前端类型检查和 Vite 生产构建),`git diff --check` 通过。
|
||||
- 当前状态:实现与自动验证完成并已在本地提交;向 GitHub 推送时 HTTPS 连接被重置,SSH 方式没有已配置的密钥,网络恢复后需重试推送。3040 当前可提供新构建,活动浏览器标签尚未刷新。
|
||||
|
||||
## 本轮修复节点(2026-10-11,整页替换皮肤显示屏幕共享状态)
|
||||
|
||||
- 用户反馈:除 KAAK 外,其他皮肤看不到正在共享屏幕的成员。
|
||||
- 根因:共享状态由 WebSpeak/TeamSpeak 共用链路检测;KAAK 使用带共享状态的宿主成员卡片,其他整页替换示例则自行绘制成员行,而公开成员数据没有共享标记,导致传输层已发现的共享无法映射到自绘成员列表。
|
||||
- 修改范围:给 `session.members` 增加 `screenSharing` 与 `screenShareStreamId`,两字段单独要求 `voice.screenShare.read`;自绘皮肤用 `voice.joinScreenShare` 观看时还需 `voice.screenShare.control`。按原有限定权限投影到 Wasm,未将 TeamSpeak SDK 对象或连接信息暴露给皮肤。
|
||||
- 示例皮肤:Open Voice Surface 与 Harbor 的成员列表现可显示共享标记并提供观看按钮;KAAK 的宿主成员卡片和屏幕共享逻辑不变。
|
||||
- 验证:Open Voice Surface 与 Harbor `.wskin` 已从各自组件源码重建;共享字段权限与运行时投影专项测试通过,包含屏幕共享 UI/皮肤包测试的完整套件 684/684 通过;`npm run build`、`npm run web:build` 与 `git diff --check` 通过。没有真实共享中的频道可用于端到端观看验收。
|
||||
@@ -20,6 +20,8 @@ v3 自定义组件不是脚本插件。components.json schema v1 是既有格式
|
||||
|
||||
v1-v3 包不能提交 HTML 字符串、事件处理代码、JavaScript、WebAssembly、远程脚本、任意 URL、表单导航、浏览器存储访问或网络调用。v4 可携带本地 JS/Wasm/CSS;JS 仍只校验和缓存,Wasm 在生产构建中经本地摘要授权后运行一次性有界任务,并经宿主解析、渲染动态 UI。运行时支持 `ui.surface.replace`、限定的公开只读数据权限和首版宿主动作效果;投影前由宿主按插件清单过滤字段,总快照最多 48 KiB,`ui_input_read` 输入最多 64 KiB。动作效果限于可信 UI 事件触发的同一轮调用、单个动作,并复用现有动作权限与参数校验。所有版本都拒绝未知协议字段、权限、动作和数据路径;v1-v3 拒绝未知节点/属性,v4 Wasm 输出则对标签名做语法验证、拒绝具备脚本/导航/嵌入能力的标签与属性,并将自定义标签惰性渲染为普通 `div`。
|
||||
|
||||
自绘成员列表也可以按成员读取 `screenSharing` 和 `screenShareStreamId` 字段(需 `voice.screenShare.read`);`voice.joinScreenShare` 还需 `voice.screenShare.control`。完整页面替换后是否呈现共享标记/观看入口由皮肤组件树决定,宿主只会提供状态与受权限保护的观看动作。
|
||||
|
||||
### 2.1 插件协议(v4 包格式及有界 Wasm 生产运行路径已接入)
|
||||
|
||||
已实现的 v4 包描述为 `plugins.json` schema v1:每包 1–64 个插件,每个插件指定唯一小写 ID、语义版本、API 版本 1、`home`/`voice` 页面、`widget`/`surface` 模式、`plugins/<id>/` 下入口 JS 或 Wasm/可选 CSS、该目录中的图片/woff2 素材和现有权限表中的权限。入口扩展名决定默认运行时,也可显式写 `runtime: "javascript"` 或 `runtime: "wasm"`,且必须匹配扩展名。每页至多一个 v4 surface,且必须申请 `ui.surface.replace`;导入器也拒绝与同页 v3 surface 冲突。清单最多 256 KiB、插件入口最多 256 KiB、插件样式最多 512 KiB、每插件最多 32 个素材;引用文件必须存在且路径不重复。客户端与服务端复用同一解析器;客户端还对 Wasm 入口做固定 ABI 预检。SHA-256 摘要覆盖描述字段和入口、样式、全部素材;本机授权按皮肤、插件 ID 保存并绑定皮肤/插件版本、API 版本、文件摘要及权限策略版本。该摘要仅用于检测本机授权后包内容是否变化,不是发布者签名或来源证明。WebClient 已有逐页授权、Wasm 生命周期、schema 校验后的安全 UI 渲染和插件 CSS 装载;Wasm 只会在用户明确批准后运行,且生产执行受全局 worker 上限控制。动态 UI 可使用经过 manifest 权限校验的 `voice.screen-share-start` 宿主按钮;`voice.startScreenShare` 异步动作请求会被拒绝,屏幕采集必须由可信宿主按钮直接发起,以保留浏览器瞬时用户激活。
|
||||
|
||||
@@ -398,6 +398,8 @@ CSS 被限定在 `.ws-skin-root` 内,管理员页面不会继承皮肤。删
|
||||
|
||||
当前自动化回归涵盖 ZIP/清单验证、资源路径、CSS 隔离与拒绝规则、文案结构和服务端皮肤目录读写。视觉排版、内容遮挡和浏览器间表现仍须人工预览。
|
||||
|
||||
自绘成员列表时,`session.members` 可读取 `screenSharing` 与 `screenShareStreamId`;这两个成员字段和 `screenShare.streams` 一样要求 `voice.screenShare.read`。用 `member.screenSharing` 显示共享标记,再将 `member.screenShareStreamId` 绑定到 `voice.joinScreenShare`(还需 `voice.screenShare.control`)即可让用户观看。未声明/未获共享读取权限的皮肤不会收到这两个字段;整页替换皮肤仍须在自己的成员列表中绘制标记或观看入口。
|
||||
|
||||
## 本轮实现问题记录
|
||||
|
||||
- 整页替换必须是用户明确批准的能力;仅安装皮肤不能隐藏普通首页或语音页。schema v2 surface 应声明 `ui.surface.replace`,并验证拒绝授权和撤销后普通界面会恢复。
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Open Voice Surface scaffold
|
||||
|
||||
This importable schema v2 surface package exercises complete public home and voice pages using only declarative nodes and WebSpeak-owned controls. It includes server switching, channel navigation, visible members, chat, audio, whisper, screen sharing, connection controls, and the built-in language and skin selectors. It contains no discovery, events, shop, companion, advertising, or administration pages.
|
||||
This importable schema v3 surface package exercises complete public home and voice pages using only declarative nodes and WebSpeak-owned controls. It includes server switching, channel navigation, visible members, per-member screen-share status and a watch action, chat, audio, whisper, connection controls, and the built-in language and skin selectors. It contains no discovery, events, shop, companion, advertising, or administration pages.
|
||||
|
||||
This is an implementation scaffold for testing the open-skin format, not a pixel-matched KOOK skin. The visual reference was read in the in-app browser in the first two user-authorized voice rooms. The separate [KAAK voice sample](./KAAK-VOICE.md) records the voice-only layout findings and applies them to the channel and member sidebars. No server/room identifiers, member names, or chat contents were retained. Discovery, companion shop, events, ads, and operator/admin pages are outside the sample's scope.
|
||||
|
||||
|
||||
Binary file not shown.
@@ -85,7 +85,15 @@
|
||||
},
|
||||
"disconnect": { "type": "voice.disconnect", "args": {} },
|
||||
"whisper-on": { "type": "voice.setWhisperActive", "args": { "active": true } },
|
||||
"whisper-off": { "type": "voice.setWhisperActive", "args": { "active": false } }
|
||||
"whisper-off": { "type": "voice.setWhisperActive", "args": { "active": false } },
|
||||
"watch-screen-share": {
|
||||
"type": "voice.joinScreenShare",
|
||||
"args": { "streamId": "{{member.screenShareStreamId}}" }
|
||||
},
|
||||
"watch-channel-member-screen-share": {
|
||||
"type": "voice.joinScreenShare",
|
||||
"args": { "streamId": "{{voicemember.screenShareStreamId}}" }
|
||||
}
|
||||
},
|
||||
"state": { "selectedchannel": "", "message": "" },
|
||||
"root": {
|
||||
@@ -227,6 +235,22 @@
|
||||
"when": { "path": "voicemember.speaking", "equals": true },
|
||||
"attributes": { "aria-label": "Speaking" },
|
||||
"children": [{ "text": "●" }]
|
||||
},
|
||||
{
|
||||
"tag": "div",
|
||||
"part": "channel-member-screen-share",
|
||||
"when": { "path": "voicemember.screenSharing", "equals": true },
|
||||
"children": [
|
||||
{ "tag": "span", "part": "channel-member-screen-share-live", "children": [{ "text": "SHARING" }] },
|
||||
{
|
||||
"tag": "button",
|
||||
"part": "channel-member-screen-share-watch",
|
||||
"when": { "path": "voicemember.self", "equals": false },
|
||||
"attributes": { "type": "button", "aria-label": "Watch {{voicemember.name}}'s screen" },
|
||||
"events": { "click": "watch-channel-member-screen-share" },
|
||||
"children": [{ "text": "WATCH" }]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -363,6 +387,22 @@
|
||||
"when": { "path": "member.status", "equals": "away" },
|
||||
"attributes": { "aria-label": "Away" },
|
||||
"children": [{ "text": "AWAY" }]
|
||||
},
|
||||
{
|
||||
"tag": "div",
|
||||
"part": "member-screen-share",
|
||||
"when": { "path": "member.screenSharing", "equals": true },
|
||||
"children": [
|
||||
{ "tag": "span", "part": "member-screen-share-live", "children": [{ "text": "SHARING" }] },
|
||||
{
|
||||
"tag": "button",
|
||||
"part": "member-screen-share-watch",
|
||||
"when": { "path": "member.self", "equals": false },
|
||||
"attributes": { "type": "button", "aria-label": "Watch {{member.name}}'s screen" },
|
||||
"events": { "click": "watch-screen-share" },
|
||||
"children": [{ "text": "WATCH" }]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"packageType": "open-skin",
|
||||
"id": "community.harbor-voice",
|
||||
"name": "Harbor Voice Workspace",
|
||||
"version": "1.1.0",
|
||||
"version": "1.1.1",
|
||||
"author": "WebSpeak Project",
|
||||
"license": "AGPL-3.0-only",
|
||||
"description": "A KOOK-inspired dark voice workspace using only WebSpeak host controls and public session data.",
|
||||
|
||||
@@ -420,6 +420,35 @@
|
||||
font-weight: 800;
|
||||
}
|
||||
|
||||
[data-ws-plugin-part="harbor-workspace.channel-member-screen-share"] {
|
||||
grid-column: 2 / -1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
color: var(--skin-harbor-accent);
|
||||
font-size: 8px;
|
||||
font-weight: 800;
|
||||
}
|
||||
|
||||
[data-ws-plugin-part="harbor-workspace.channel-member-screen-share-watch"],
|
||||
[data-ws-plugin-part="harbor-workspace.member-screen-share-watch"] {
|
||||
min-height: 28px;
|
||||
padding: 0 8px;
|
||||
border: 1px solid #7ed95755;
|
||||
border-radius: 5px;
|
||||
color: var(--skin-harbor-text);
|
||||
background: var(--skin-harbor-raised);
|
||||
font-size: 9px;
|
||||
font-weight: 800;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
[data-ws-plugin-part="harbor-workspace.channel-member-screen-share-watch"]:hover,
|
||||
[data-ws-plugin-part="harbor-workspace.member-screen-share-watch"]:hover {
|
||||
color: var(--skin-harbor-accent);
|
||||
background: #313238;
|
||||
}
|
||||
|
||||
[data-ws-plugin-part="harbor-workspace.conversation"] {
|
||||
grid-column: 3;
|
||||
grid-row: 2;
|
||||
@@ -617,6 +646,16 @@
|
||||
[data-ws-plugin-part="harbor-workspace.member-away-state"],
|
||||
[data-ws-plugin-part="harbor-workspace.speaking-indicator"] { grid-column: 2 / -1; }
|
||||
|
||||
[data-ws-plugin-part="harbor-workspace.member-screen-share"] {
|
||||
grid-column: 2 / -1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
color: var(--skin-harbor-accent);
|
||||
font-size: 8px;
|
||||
font-weight: 800;
|
||||
}
|
||||
|
||||
[data-ws-plugin-part="harbor-workspace.voice-dock"] {
|
||||
z-index: 4;
|
||||
grid-column: 2;
|
||||
|
||||
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"schemaVersion": 2,
|
||||
"schemaVersion": 3,
|
||||
"components": [
|
||||
{
|
||||
"id": "open-voice-home",
|
||||
@@ -54,7 +54,17 @@
|
||||
"servers.quickList.switch",
|
||||
"session.channels.read",
|
||||
"session.members.read",
|
||||
"session.channel.join"
|
||||
"session.channel.join",
|
||||
"chat.channel.read",
|
||||
"chat.channel.send",
|
||||
"audio.status.read",
|
||||
"audio.microphone.control",
|
||||
"audio.output.control",
|
||||
"voice.whisper.status.read",
|
||||
"voice.whisper.control",
|
||||
"voice.disconnect",
|
||||
"voice.screenShare.read",
|
||||
"voice.screenShare.control"
|
||||
],
|
||||
"actions": {
|
||||
"switch-server": {
|
||||
@@ -64,6 +74,10 @@
|
||||
"join-channel": {
|
||||
"type": "voice.joinChannel",
|
||||
"args": { "channelId": "{{channel.id}}" }
|
||||
},
|
||||
"watch-screen-share": {
|
||||
"type": "voice.joinScreenShare",
|
||||
"args": { "streamId": "{{member.screenShareStreamId}}" }
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
@@ -187,6 +201,27 @@
|
||||
"when": { "path": "member.speaking", "equals": true },
|
||||
"attributes": { "aria-label": "Speaking" },
|
||||
"children": [{ "text": "Speaking" }]
|
||||
},
|
||||
{
|
||||
"tag": "div",
|
||||
"part": "member-screen-share",
|
||||
"when": { "path": "member.screenSharing", "equals": true },
|
||||
"children": [
|
||||
{
|
||||
"tag": "span",
|
||||
"part": "member-screen-share-live",
|
||||
"attributes": { "role": "status" },
|
||||
"children": [{ "text": "Sharing screen" }]
|
||||
},
|
||||
{
|
||||
"tag": "button",
|
||||
"part": "member-screen-share-watch",
|
||||
"when": { "path": "member.self", "equals": false },
|
||||
"attributes": { "type": "button", "aria-label": "Watch {{member.name}}'s screen" },
|
||||
"events": { "click": "watch-screen-share" },
|
||||
"children": [{ "text": "Watch" }]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"packageType": "open-skin",
|
||||
"id": "community.open-voice-surface",
|
||||
"name": "Open Voice Surface",
|
||||
"version": "1.0.0",
|
||||
"version": "1.0.1",
|
||||
"author": "WebSpeak Project",
|
||||
"license": "AGPL-3.0-only",
|
||||
"description": "A complete, script-free public voice client surface scaffold.",
|
||||
|
||||
@@ -231,6 +231,25 @@
|
||||
|
||||
[data-ws-plugin-part="open-voice-workspace.speaking-indicator"] { color: var(--skin-voice-live); font-size: 10px; }
|
||||
|
||||
[data-ws-plugin-part="open-voice-workspace.member-screen-share"] {
|
||||
grid-column: 2;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
color: var(--skin-voice-live);
|
||||
font-size: 10px;
|
||||
}
|
||||
|
||||
[data-ws-plugin-part="open-voice-workspace.member-screen-share-watch"] {
|
||||
min-height: 32px;
|
||||
padding: 0 10px;
|
||||
border: 1px solid color-mix(in srgb, var(--skin-voice-live) 50%, transparent);
|
||||
border-radius: 7px;
|
||||
color: var(--skin-voice-text);
|
||||
background: var(--skin-voice-raised);
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
[data-ws-plugin-part="open-voice-workspace"] [data-ws-part="voice.chat"],
|
||||
[data-ws-plugin-part="open-voice-workspace"] [data-ws-part="voice.audio-controls"],
|
||||
[data-ws-plugin-part="open-voice-workspace"] [data-ws-part="voice.connection-controls"],
|
||||
|
||||
Reference in new issue
Block a user