mirror of
https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak.git
synced 2026-12-03 12:02:50 +08:00
Fix screen-share letterboxing across skins
This commit is contained in:
1 parent
acdc7a2330
commit
833357e278
22 files changed
+67
-65
No files matched your search
@@ -21,12 +21,16 @@ test("built-in appearance manifests and catalog versions match the bundled share
|
||||
for (const manifest of [lightManifest, darkManifest]) {
|
||||
assert.equal(BUILTIN_SKIN_CATALOG.find((skin) => skin.id === manifest.id)?.version, manifest.version);
|
||||
}
|
||||
assert.equal(lightManifest.version, "1.0.1");
|
||||
assert.equal(darkManifest.version, "1.0.1");
|
||||
assert.equal(lightManifest.version, "1.0.2");
|
||||
assert.equal(darkManifest.version, "1.0.2");
|
||||
assert.match(lightCss, /\.screen-share-live-indicator\s*\{[^}]*background:/s);
|
||||
assert.match(lightCss, /\.screen-share-card-button\.viewing\s*\{[^}]*background:/s);
|
||||
assert.match(darkCss, /\.screen-share-live-indicator\s*\{[^}]*background:/s);
|
||||
assert.match(darkCss, /\.screen-share-card-button\.viewing\s*\{[^}]*background:/s);
|
||||
assert.match(lightCss, /screen-player\.stage"\] \{ background: #000; \}/);
|
||||
assert.match(lightCss, /screen-player\.video"\] \{ object-fit: contain; background: #000; \}/);
|
||||
assert.match(darkCss, /screen-player\.stage"\] \{ background: #000; \}/);
|
||||
assert.match(darkCss, /screen-player\.video"\] \{ object-fit: contain; background: #000; \}/);
|
||||
});
|
||||
|
||||
test("skin catalog always includes protected built-ins and exposes only enabled custom skins", async () => {
|
||||
|
||||
@@ -9,7 +9,7 @@ export const BUILTIN_SKIN_CATALOG: SkinCatalogEntry[] = [
|
||||
{
|
||||
id: "builtin.light",
|
||||
name: "Day mode",
|
||||
version: "1.0.1",
|
||||
version: "1.0.2",
|
||||
author: "WebSpeak",
|
||||
license: "AGPL-3.0-only",
|
||||
description: "The default light appearance.",
|
||||
@@ -21,7 +21,7 @@ export const BUILTIN_SKIN_CATALOG: SkinCatalogEntry[] = [
|
||||
{
|
||||
id: "builtin.dark",
|
||||
name: "Night mode",
|
||||
version: "1.0.1",
|
||||
version: "1.0.2",
|
||||
author: "WebSpeak",
|
||||
license: "AGPL-3.0-only",
|
||||
description: "The default dark appearance.",
|
||||
@@ -33,7 +33,7 @@ export const BUILTIN_SKIN_CATALOG: SkinCatalogEntry[] = [
|
||||
{
|
||||
id: BUILTIN_ILLUSIA_SKIN_ID,
|
||||
name: "ILLUSIA风",
|
||||
version: "2.0.1",
|
||||
version: "2.0.2",
|
||||
author: "WebSpeak Project",
|
||||
license: "All rights reserved",
|
||||
description: "A bright original-character art skin with a safe declarative live-channel badge.",
|
||||
@@ -46,7 +46,7 @@ export const BUILTIN_SKIN_CATALOG: SkinCatalogEntry[] = [
|
||||
{
|
||||
id: BUILTIN_KAAK_SKIN_ID,
|
||||
name: "KAAK",
|
||||
version: "3.1.73",
|
||||
version: "3.1.74",
|
||||
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.",
|
||||
|
||||
@@ -77,12 +77,23 @@ test("custom skins can override theme appearance without !important or private c
|
||||
);
|
||||
});
|
||||
|
||||
test("community skins use a scoped light fallback instead of inheriting the night skin", async () => {
|
||||
test("community skins use a scoped light fallback instead of inheriting the night skin", async () => {
|
||||
const lightCss = await readFile(new URL("../skins/builtin/light/skin.css", import.meta.url), "utf8");
|
||||
const scoped = scopeBuiltinThemeForCustomSkin(lightCss, "light", "community.illusia-voice");
|
||||
assert.match(scoped, /:where\(\.ws-skin-root\[data-ws-skin="community\.illusia-voice"\]\) \{\s*color-scheme: light;/);
|
||||
assert.match(scoped, /:where\(\.ws-skin-root\[data-ws-skin="community\.illusia-voice"\]\) \.settings-content/);
|
||||
});
|
||||
});
|
||||
|
||||
test("built-in light and dark skins keep letterbox areas black", async () => {
|
||||
const [light, dark] = await Promise.all([
|
||||
readFile(new URL("../skins/builtin/light/skin.css", import.meta.url), "utf8"),
|
||||
readFile(new URL("../skins/builtin/dark/skin.css", import.meta.url), "utf8"),
|
||||
]);
|
||||
for (const [css, id] of [[light, "builtin.light"], [dark, "builtin.dark"]] as const) {
|
||||
assert.match(css, new RegExp(`data-ws-skin="${id}"[^{}]*\\[data-ws-part="voice\\.screen-player\\.stage"\\] \\{ background: #000; \\}`));
|
||||
assert.match(css, new RegExp(`data-ws-skin="${id}"[^{}]*\\[data-ws-part="voice\\.screen-player\\.video"\\] \\{ object-fit: contain; background: #000; \\}`));
|
||||
}
|
||||
});
|
||||
|
||||
async function componentSources(directory: string): Promise<string> {
|
||||
const componentRoot = new URL(directory, import.meta.url);
|
||||
@@ -141,7 +152,7 @@ test("the ILLUSIA v3 example and bundled package import without replacing WebSpe
|
||||
const skin = await importSkinPack(new File([exampleBytes], "illusia-voice.wskin", { type: "application/octet-stream" }));
|
||||
assert.equal(skin.id, "community.illusia-voice");
|
||||
assert.equal(skin.name, "ILLUSIA风");
|
||||
assert.equal(skin.version, "2.0.1");
|
||||
assert.equal(skin.version, "2.0.2");
|
||||
assert.equal(skin.schemaVersion, 3);
|
||||
assert.equal(skin.packageType, "open-skin");
|
||||
assert.equal(skin.layoutData, undefined);
|
||||
@@ -171,6 +182,8 @@ test("the ILLUSIA v3 example and bundled package import without replacing WebSpe
|
||||
assert.match(skin.css, /data-ws-plugin-part="illusia-now-playing\.channel-name"/);
|
||||
assert.match(skin.css, /data-ws-part="voice\.member\.live-indicator"\]\s*\{[^}]*border-color:[^}]*background:/s);
|
||||
assert.match(skin.css, /data-ws-part="voice\.member\.share-actions"\] \.screen-share-card-button\.viewing\s*\{[^}]*background:/s);
|
||||
assert.match(skin.css, /data-ws-part="voice\.screen-player\.stage"\]\s*\{[^}]*background: #000/);
|
||||
assert.match(skin.css, /data-ws-part="voice\.screen-player\.video"\]\s*\{[^}]*object-fit: contain;[^}]*background: #000/);
|
||||
assert.match(skin.css, /data-ws-part="home\.server-history\.item"/);
|
||||
assert.match(skin.css, /data-ws-part="home\.server-history\.favorite-toggle"\]\[data-ws-state="saved"\]/);
|
||||
assert.match(skin.css, /data-ws-part="voice\.favorite-servers\.favorite-toggle"\]\[data-ws-state="saved"\]/);
|
||||
@@ -225,8 +238,8 @@ test("the activity artwork layer floats above room content without intercepting
|
||||
assert.match(css, /:deep\(\.app-shell \.chat-panel \.section-heading\),[\s\S]*?:deep\(\.app-shell \.chat-panel \.message-composer\)\s*\{\s*position: relative;\s*z-index: 3;/);
|
||||
assert.match(css, /\.screen-share-player\)?\s*\{[^}]*background: var\(--surface-1\)/);
|
||||
assert.match(css, /\.screen-share-player-exit\)?\s*\{[^}]*z-index: 3;/);
|
||||
assert.match(css, /\.screen-share-player-stage\)?\s*\{[^}]*var\(--accent\)[^}]*var\(--surface-2\)/);
|
||||
assert.match(css, /\.screen-share-player-video\)?\s*\{[^}]*background: var\(--surface-2\)/);
|
||||
assert.match(css, /\.screen-share-player-stage\)?\s*\{[^}]*background: #000/);
|
||||
assert.match(css, /\.screen-share-player-video\)?\s*\{[^}]*object-fit: contain;[^}]*background: #000/);
|
||||
assert.match(css, /@media \(min-width: 741px\)\s*\{\s*\/\* Keep header menus above the independently stacked screen-share stage\. \*\/\s*\.app-shell \.workspace-header\s*\{\s*position: relative;\s*z-index: 40;/);
|
||||
});
|
||||
|
||||
@@ -466,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.73");
|
||||
assert.equal(skin.version, "3.1.74");
|
||||
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");
|
||||
@@ -695,6 +708,8 @@ test("the distributable KAAK package provides full home and voice surfaces", asy
|
||||
assert.match(skin.css, /kaak-workspace\.member-cards[\s\S]*?\.voice-card[\s\S]*?aspect-ratio: 1\.82;/);
|
||||
assert.match(skin.css, /kaak-workspace\.member-cards[\s\S]*?\.screen-share-live-indicator[\s\S]*?background: #20251e;/);
|
||||
assert.match(skin.css, /kaak-workspace\.member-cards[\s\S]*?\.screen-share-card-button\.viewing[\s\S]*?background: #8be31e;/);
|
||||
assert.match(skin.css, /kaak-workspace"\] \[data-ws-part="voice\.screen-player\.stage"\]\s*\{[^}]*background: #000/);
|
||||
assert.match(skin.css, /kaak-workspace"\] \[data-ws-part="voice\.screen-player\.video"\]\s*\{[^}]*object-fit: contain;[^}]*background: #000/);
|
||||
assert.match(skin.css, /@keyframes ws-community-kaak-voice-kaak-member-speaking-wave/);
|
||||
assert.ok(skin.css.includes("animation: ws-community-kaak-voice-kaak-performance-refresh-spin .72s linear infinite;"));
|
||||
assert.ok(skin.css.includes("performance-refresh:disabled .ui-icon { animation: none; }"));
|
||||
|
||||
Reference in new issue
Block a user