Files
client/scripts/official-ts6-runtime-capture.mjs
T
omar e6464bc4ed feat: checkpoint account-free client workflows and source-matched UI
Preserve accumulated client implementation since v0.1.4, including local identities, multi-server state, chat, administration, audio and streaming controls. Refine official-source layout, original artwork, responsive composer overflow, settings navigation and chat scroll anchoring.

Current verification: Node suite passes; isolated packaged chat and responsive control smokes pass without device capture. Native core is reused, not rebuilt in this pass. Strict whole-screen visual parity remains incomplete; no 1:1 or cross-platform acceptance claim. Local checkpoint only; no release or push.
2026-11-01 19:43:18 +03:00

53 lines
3.1 KiB
JavaScript

// QA-ONLY: capture screens of the INSTALLED official TeamSpeak 6 UI through the reference runtime
// harness (scripts/lib/official-ts6-runtime.mjs). Output is private reference evidence; never copy it
// into the product. Usage:
// node scripts/official-ts6-runtime-capture.mjs --out <dir> [--themes dark,light] [--locales en,ru]
// [--sizes 1553x998,1280x800] [--screens main,menu,act:cs>universal.edit,view:server.BanList,...]
// Writes <out>/<theme>-<locale>-<WxH>/<screen>.png, manifest-chat-<variant>.json per launch,
// <out>/index.json and <out>/fixture-data.json (canonical synthetic scenario data).
import { existsSync, mkdirSync, writeFileSync } from 'node:fs';
import path from 'node:path';
import { launchOfficialRuntime } from './lib/official-ts6-runtime.mjs';
const args = Object.fromEntries(process.argv.slice(2).reduce((acc, a, i, all) => (a.startsWith('--') ? [...acc, [a.slice(2), all[i + 1]]] : acc), []));
const list = (v, d) => (v ? v.split(',') : d);
const out = path.resolve(args.out ?? 'official-runtime');
const themes = list(args.themes, ['dark', 'light']);
const locales = list(args.locales, ['en', 'ru']);
const sizes = list(args.sizes, ['1553x998', '1280x800']).map(s => s.split('x').map(Number));
// A screen may carry a chat-history variant: main@few, main@empty (default full). Each variant is a
// separate launch because the history is part of the fixture state at connect time.
const screens = list(args.screens, [
'main', 'menu', 'act:cs>universal.edit', 'view:client-Alex.Info', 'view:server.Info', 'view:server.ClientList',
'view:server.BanList', 'view:server.Permissions', 'settings:audio', 'settings:appearance', 'broadcast', 'broadcast:settings',
'main@few', 'main@empty',
]);
const byChat = Map.groupBy(screens, s => s.split('@')[1] ?? 'full');
const index = [];
for (const theme of themes) for (const locale of locales) for (const [width, height] of sizes) {
const dir = path.join(out, `${theme}-${locale}-${width}x${height}`);
mkdirSync(dir, { recursive: true });
for (const [chat, group] of byChat) {
const ref = await launchOfficialRuntime({ theme, locale, width, height, chat });
try {
const shots = [];
for (const spec of group) {
const screen = spec.split('@')[0];
const result = await ref.open(screen);
const file = `${spec.replace(/[:/@>]/g, '-')}.png`;
await ref.page.screenshot({ path: path.join(dir, file) });
shots.push({ ...result, spec, file });
console.log(`${theme}-${locale}-${width}x${height} ${spec}`);
}
const manifest = { ...(await ref.manifest()), shots };
if (!existsSync(path.join(out, 'fixture-data.json'))) writeFileSync(path.join(out, 'fixture-data.json'), JSON.stringify(await ref.fixtureData(), null, 2));
writeFileSync(path.join(dir, `manifest-chat-${chat}.json`), JSON.stringify(manifest, null, 2));
index.push({ dir: path.basename(dir), chat, shots: shots.map(s => s.file), unanswered: manifest.bridge.unanswered, blocked: manifest.blocked.length, errors: manifest.errors.length });
} finally {
await ref.close();
}
}
}
writeFileSync(path.join(out, 'index.json'), JSON.stringify(index, null, 2));