## Problem and outcome / 问题与结果 Windows App users can now choose whether to show the capture border. The same border owner handles source previews and active capture; unsupported or denied requests keep normal capture available. The source picker distinguishes an absent/incompatible App, unavailable capture capability, failed enumeration and a genuinely empty list. Chrome's pending local-access permission no longer holds optional Viewer reception. This phase also reduces tooltip obstruction and contains a failed Linux encoder output within its own branch. Browser/server v23, Native control v9 and capture v7 remain compatible. Closes #401. ## Release notes ### 中文 这是一次分享体验更新,重点改进 Windows 采集边框、App 选源反馈和提示浮窗,并修复 Linux 采集输出的故障隔离。 - **采集边框可选。** Windows App 选源器新增「显示采集边框」,位于声音开关左侧,默认关闭。支持的系统上,来源预览也会隐藏边框。 - **找不到窗口时,提示更明确。** 区分 App 未连接、版本不兼容、采集不可用和读取失败;授权后可以刷新列表重试。改善 Chrome 首次访问时的观看连接,避免本机授权等待拖慢入座。 - **提示浮窗更顺手。** 统一 500 毫秒悬停延迟,减少对画面和控件的遮挡,改善触屏长按和关闭操作;只用于说明的控件使用普通鼠标光标。 - **Linux 分享更稳。** 修复单路编码输出失败可能连带中断其他输出的问题。 - **排查文档更完整。** 补充 App 来源列表、Windows 10 黄框及浏览器 WebRTC 设置的排查说明。 使用新的采集边框开关,请更新 Windows App 并刷新已打开的网页。Windows 10 没有对应的系统接口,边框仍由系统显示;文档中心提供可选处理方法。系统权限或其他采集会话也可能要求保留边框。 ### English This sharing update improves Windows capture borders, App source selection and tooltips, and fixes failure isolation between Linux capture outputs. - **Choose whether to show the capture border.** The Windows App source picker adds a **Show capture border** switch to the left of audio, off by default. Source previews also hide the border on supported systems. - **Clearer source-selection feedback.** The picker distinguishes an unavailable or incompatible App, unsupported capture and a failed source list. Refresh after granting access to retry. Pending local-access permission in Chrome no longer delays Browser reception for Viewers. - **Less intrusive tooltips.** A consistent 500 ms hover delay, improved placement and touch-hold behavior make guidance easier to read and dismiss. Help-only controls use the ordinary cursor. - **More resilient Linux sharing.** A failed encoder output no longer interrupts healthy sibling outputs. - **More useful troubleshooting.** The documentation covers App source lists, Windows 10 capture borders and browser WebRTC settings. Update the Windows App and refresh open pages to use the capture-border switch. Windows 10 lacks the corresponding system API and retains its system border; an optional procedure is available in the documentation center. System permission or another capture session may also require the border to remain visible. ## Verification / 验证 - `npm run check`: TypeScript, 998 tests and production Web build passed. - `npm run check:go`: Go formatting/tests/vet/target builds and Windows native capture checks passed. macOS cgo builds require their native CI runner. - Documentation, repository hygiene and website build passed. - Real Chrome 152 profiles: first-use local permission, recovery after consent and source-list refresh; optional Viewer discovery before/after consent; App Local without cross-address-space consent. - Public invitation gate: link creation, remote page and WebSocket access, App exit and link retirement passed. - Windows 11 border on/off, source preview and concurrent-capture checks have physical evidence. Tooltip hover, keyboard, touch-hold, dismissal and narrow-layout checks passed. - [Candidate CI](https://github.com/TNTcraftHIM/Piik/actions/runs/35157993032) passed at `1d159831`: Server/container, Windows/Linux/macOS packages, Go race checks and frontend validation. Publication was skipped. - Local Windows ZIP passed packaged startup, capture probing, embedded Web, helper identity/notices and clean-shutdown checks. - Windows H.264 and VP8 Host gates passed live/paused settings, background recovery, source replacement, source-end/restart, decoded Viewer frames and complete resource cleanup. - Final `0b370e6a` differs from the CI candidate only in TODO/status closure. Full Web/Go/native checks and website build passed again. The access/privacy gate passed credential-leak and cleanup checks. ## Impact / 影响 Compatible feature update for **v1.5.0**. No wire or storage version change. Older Apps retain their existing capture behavior through capability negotiation. Publication and matching deployments follow the release workflow. The independent Windows x86 experiment is excluded. Physical 32-bit Windows, macOS/Linux capture, unsupported Windows border control, and actual border-permission denial remain outside this candidate's acceptance evidence. The original missing-window, public-link timeout and URL-handler crash reports still need affected-machine diagnostics.
92 lines
5.1 KiB
JavaScript
92 lines
5.1 KiB
JavaScript
import { execFileSync } from "node:child_process";
|
|
import { appendFileSync } from "node:fs";
|
|
import { pathToFileURL } from "node:url";
|
|
import semver from "semver";
|
|
|
|
const git = (root, ...args) => execFileSync("git", args, { cwd: root, encoding: "utf8" }).trim();
|
|
export const isReleaseVersion = (value) => typeof value === "string" &&
|
|
/^v\d+\.\d+\.\d+$/.test(value) && semver.valid(value) !== null;
|
|
|
|
export function stableTags(root, ...filter) {
|
|
return git(root, "tag", ...filter).split("\n").filter(isReleaseVersion).sort(semver.rcompare);
|
|
}
|
|
|
|
// Known standalone surfaces do not change the shipped App/Server. Everything
|
|
// else stays eligible, including shared UI, public assets, licenses and build
|
|
// inputs. In particular, check-go.mjs builds the bundled capture runtime.
|
|
const nonProductPaths = [
|
|
"site/**", "docs/**", "tests/**", ".agents/**", ".codex/**", ".githooks/**",
|
|
"*.md", ".gitignore", ".env.example", "vitest.config.ts",
|
|
"cmd/**/*.md", "internal/**/*.md", "native/**/*.md", "src/**/*.md",
|
|
".github/ISSUE_TEMPLATE/**", ".github/pull_request_template.md", ".github/workflows/website.yml",
|
|
"scripts/build-website.mjs", "scripts/update-website-hero.mjs", "scripts/check-website-film.js",
|
|
"scripts/check-docs.mjs", "scripts/markdown-slug.mjs", "scripts/check-project-state.*", "scripts/install-hooks.*",
|
|
"scripts/required-project-paths.txt", "scripts/tsconfig.json",
|
|
"scripts/release-*.mjs", "scripts/publish-release.mjs", "scripts/publish-container.mjs", "scripts/mirror-release.mjs",
|
|
"scripts/*-gate.*", "scripts/*-probe.*", "scripts/browser-*", "scripts/encoded-*",
|
|
"scripts/*-gate-endpoint.ts", "scripts/embedded-sfu-page.ts", "scripts/peer-assisted-benchmark.ts",
|
|
"cmd/piik-peer-gate/**",
|
|
].map((path) => `:(top,glob,exclude)${path}`);
|
|
|
|
// Both version selection and public notes use this same set of product commits.
|
|
// Git handles deletions and moves across the boundary; no workflow path filter
|
|
// can hide an earlier product change whose publication needs to be retried.
|
|
export function releaseCommits(root, revision, previous) {
|
|
const records = git(root, "log", "--first-parent", "--reverse", "--no-renames", "--format=%H%x00%B%x00",
|
|
...(previous ? [`${previous}..${revision}`, "--", ".", ...nonProductPaths] : ["-1", revision])).split("\0");
|
|
const commits = [];
|
|
for (let index = 0; index + 1 < records.length; index += 2) {
|
|
commits.push({ revision: records[index].trim(), message: records[index + 1].trim() });
|
|
}
|
|
return commits;
|
|
}
|
|
|
|
// One input for packagers: a planned CI version, an exact public tag, or a dev build.
|
|
export function buildVersion(root, revision, requested = process.env.PIIK_BUILD_VERSION) {
|
|
const version = requested || stableTags(root, "--points-at", revision)[0] || "development";
|
|
if (version === "development") return version;
|
|
if (!isReleaseVersion(version)) throw new Error("Build version must be vMAJOR.MINOR.PATCH or development");
|
|
if (git(root, "tag", "--list", version) &&
|
|
git(root, "rev-parse", `${version}^{commit}`) !== revision) {
|
|
throw new Error("A release version cannot identify two source revisions");
|
|
}
|
|
return version;
|
|
}
|
|
|
|
export function planRelease(root) {
|
|
const revision = git(root, "rev-parse", "HEAD");
|
|
const previous = stableTags(root, "--merged", "HEAD")[0];
|
|
if (previous && git(root, "rev-parse", `${previous}^{commit}`) === revision) {
|
|
// A tag may predate its Release. Draft creation itself does not create a tag.
|
|
return { version: previous, revision, publish: true };
|
|
}
|
|
let version = "v1.0.0";
|
|
if (previous) {
|
|
// Main contains one squash commit per accepted PR. A rerun includes any
|
|
// unreleased commits, so a later fix cannot hide an earlier breaking change.
|
|
const messages = releaseCommits(root, revision, previous).map((commit) => commit.message);
|
|
if (!messages.length) return { version: "development", revision, publish: false };
|
|
const subjects = messages.map((message) => message.trim().split(/\r?\n/, 1)[0]);
|
|
const breaking = subjects.some((subject) => /^[a-z]+(?:\([^\r\n)]+\))?!: /i.test(subject)) ||
|
|
messages.some((message) => /^BREAKING[ -]CHANGE: /m.test(message));
|
|
const feature = subjects.some((subject) => /^feat(?:\([^\r\n)]+\))?: /i.test(subject));
|
|
version = `v${semver.inc(previous, breaking ? "major" : feature ? "minor" : "patch")}`;
|
|
}
|
|
return { version: buildVersion(root, revision, version), revision, publish: true };
|
|
}
|
|
|
|
if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) {
|
|
const mode = process.argv[2] ?? "build";
|
|
if (mode !== "plan" && mode !== "build") throw new Error("Use release-version.mjs plan|build [--github-output]");
|
|
const root = process.cwd();
|
|
const revision = git(root, "rev-parse", "HEAD");
|
|
const identity = mode === "plan" ? planRelease(root)
|
|
: { version: buildVersion(root, revision), revision, publish: false };
|
|
if (process.argv.includes("--github-output")) {
|
|
if (!process.env.GITHUB_OUTPUT) throw new Error("GITHUB_OUTPUT is missing");
|
|
appendFileSync(process.env.GITHUB_OUTPUT,
|
|
Object.entries(identity).map(([key, value]) => `${key}=${value}\n`).join(""));
|
|
}
|
|
process.stdout.write(`${JSON.stringify(identity)}\n`);
|
|
}
|