diff --git a/.github/workflows/atomgit-mirror.yml b/.github/workflows/atomgit-mirror.yml index 37ca4cc0e..fe8459508 100644 --- a/.github/workflows/atomgit-mirror.yml +++ b/.github/workflows/atomgit-mirror.yml @@ -27,8 +27,7 @@ jobs: github.repository == 'TNTcraftHIM/Piik' && github.ref == 'refs/heads/main' && (github.event_name == 'workflow_dispatch' || (github.event.workflow_run.event == 'push' && - github.event.workflow_run.head_branch == 'main' && - github.event.workflow_run.conclusion == 'success')) + github.event.workflow_run.head_branch == 'main')) runs-on: ubuntu-latest timeout-minutes: 30 steps: diff --git a/docs/deployment.md b/docs/deployment.md index 5ffb3e2a4..47fa95257 100644 --- a/docs/deployment.md +++ b/docs/deployment.md @@ -237,6 +237,13 @@ node --env-file=.env.maintenance.private.local scripts/release-maintenance.mjs s The website's latest-version card reads GitHub metadata and cannot establish which release either service is running. +Download mirrors have a separate completion check: the AtomGit stable/latest +release must match the published version and source, and every package must pass +the mirror publisher's anonymous download and checksum verification. A green +workflow that skipped its upload step is not mirror completion. Keep a failed +mirror in the active TODO ledger until recovery and postflight succeed; source +synchronization alone does not publish download attachments. + Verify only the surfaces relevant to the release: - local and public `/healthz` return `{"status":"ok"}`; diff --git a/docs/guide/README.md b/docs/guide/README.md index 2fd4a7ac1..da487f575 100644 --- a/docs/guide/README.md +++ b/docs/guide/README.md @@ -28,8 +28,8 @@ Choose a guide to start sharing, use room tools or solve a problem. ## Get help -- **App, sharing or sound problems:** start with the [symptom index](./troubleshooting.md#common-problems). -- **Campus networks, media connections or virtual LANs:** use [network checks](./network.md) to choose a connection option. +- **Cannot join, share or hear a friend:** [find the checks for your problem](./troubleshooting.md#common-problems). +- **The page opens, but picture or voice still will not connect:** after the basic checks, use [network checks](./network.md) to compare browsers, networks or a virtual LAN. Still stuck? [Report a problem](https://github.com/TNTcraftHIM/Piik/issues/new/choose) with your version, system, browser and reproduction steps. Follow the diff --git a/docs/guide/README.zh-CN.md b/docs/guide/README.zh-CN.md index 270dc66bd..7fddcb26e 100644 --- a/docs/guide/README.zh-CN.md +++ b/docs/guide/README.zh-CN.md @@ -28,8 +28,8 @@ ## 遇到问题 -- **App、分享或声音异常:** 从[问题排查的症状索引](./troubleshooting.zh-CN.md#常见问题)开始。 -- **校园网、画面连不上或虚拟局域网:** 查看[进阶网络排查](./network.zh-CN.md),按现象选择连接方案。 +- **进不了房间、无法分享或听不到朋友:** 先看[对应的排查步骤](./troubleshooting.zh-CN.md#常见问题)。 +- **网页能打开,基本检查后画面或语音仍连不上:** 再看[进阶网络排查](./network.zh-CN.md),对照浏览器、网络或虚拟局域网。 仍然没解决?可以[反馈问题](https://github.com/TNTcraftHIM/Piik/issues/new/choose), 附上版本、系统、浏览器和复现步骤。需要收集报告时,按[反馈说明](./troubleshooting.zh-CN.md#反馈问题)导出。 diff --git a/docs/guide/getting-started.md b/docs/guide/getting-started.md index 1ec2b5a0d..3301bb64d 100644 --- a/docs/guide/getting-started.md +++ b/docs/guide/getting-started.md @@ -40,6 +40,10 @@ you do not need to create a room in your App to watch them. second device or send it to a friend. 4. Select **Stop sharing** when finished. +On iPhone/iPad, screen sharing requires **Safari on iOS/iPadOS 27 or later**. +See [iPhone and iPad screen sharing](./sharing.md#iphone-and-ipad-screen-sharing) +for sound support and the separate requirements for watching and cameras. + The online version is provided by the project. Media travels only between participants (P2P); restrictive networks may load the page but block video. diff --git a/docs/guide/getting-started.zh-CN.md b/docs/guide/getting-started.zh-CN.md index e06ee554c..00e10efaa 100644 --- a/docs/guide/getting-started.zh-CN.md +++ b/docs/guide/getting-started.zh-CN.md @@ -36,6 +36,9 @@ Piik 支持一位房主分享屏幕,最多 20 位受邀观众观看。先选 3. 确认预览后,点击 **复制邀请链接**,用另一台设备打开,或发送给朋友。 4. 分享结束后,点击 **停止分享**。 +iPhone/iPad 屏幕分享需使用 **iOS/iPadOS 27 及以上的 Safari**。 +声音支持及观看、摄像头的区别,见 [iPhone 与 iPad 屏幕分享](./sharing.zh-CN.md#iphone-与-ipad-屏幕分享)。 + 在线版由项目提供,画面仅通过设备间直连(P2P)传输。 在受限网络下,可能出现页面能打开、画面无法连接的情况。 diff --git a/docs/guide/network.md b/docs/guide/network.md index 2c010d834..fff3fd633 100644 --- a/docs/guide/network.md +++ b/docs/guide/network.md @@ -2,22 +2,21 @@ English · [简体中文](./network.zh-CN.md) · [Troubleshooting](./troubleshooting.md) -Use this page when **the page opens, but picture or voice will not connect**. -Choose the relevant check: +Start with the [basic connection checks](./troubleshooting.md#common-problems). +If you still cannot connect, choose what matches: -- **Campus/work network, or the same invite works on a hotspot:** [connection options](#campus-networks-and-strict-nat). - **The same invite works in another browser:** [browser restrictions](#browser-webrtc-restrictions). +- **The same invite works on a hotspot:** [connection options](#campus-networks-and-strict-nat). +- **Friends in another location cannot reach your local invitation:** [connect through a virtual LAN](#optional-a-virtual-lan). - **Logs mention STUN, or you manage the router:** [discovery and router checks](#stun-ipv6-and-router-checks). -- **Using Tailscale, ZeroTier or UU:** [virtual LAN steps](#optional-a-virtual-lan). -Web pages and chat use a separate connection from picture and sound. -For media failures, check WebRTC UDP and the route options below. +If a [public-invitation page will not open](./troubleshooting.md#public-invitation-fails-or-shows-1033) +or [video plays but blurs or stutters](./troubleshooting.md#picture-blurs-stutters-or-stops), follow that symptom instead. + +Web pages and chat use a separate connection from picture and sound: ![The Host and friend access the site for web and chat; picture and sound use a separate direct or forwarded media connection.](../assets/guide/network-paths.en.svg) -If the [invitation page will not open](./troubleshooting.md#public-invitation-fails-or-shows-1033), -or [video already plays but blurs or stutters](./troubleshooting.md#picture-blurs-stutters-or-stops), start with that symptom instead. - ## Campus networks and strict NAT **Open the same invitation on a phone hotspot first.** If it works there but not @@ -26,7 +25,7 @@ on the original network, investigate that network's shared gateway or firewall. For regular use, choose an option that fits your group: - **You have a Piik site:** ask its operator to [enable server media forwarding (SFU)](../operations/self-hosting.md#optional-media-fallback). The Host turns off **Privacy mode** so forwarding can be tried if direct connections fail. For App capture, [approve the new site](./getting-started.md#use-app-with-an-existing-site), then send its invitation. -- **Everyone can install a networking tool:** use the [virtual LAN steps](#optional-a-virtual-lan) below with the App's **Local room**. +- **No usable forwarding site, and direct media still will not connect:** a [virtual LAN](#optional-a-virtual-lan) offers another path. Everyone joins the same virtual network, then uses the App's **Local room**. - **The required connections are blocked:** use an available network or ask its administrator to review access. > **Media requires UDP.** `demo.piik.tv` and App **Public invite** use P2P-only media. @@ -102,8 +101,10 @@ and [double NAT](https://www.tp-link.com/us/support/faq/3113/). ## Optional: a virtual LAN -A virtual LAN connects devices in different places, so you can share through -Piik App's **Local room**. The tool must provide reachable virtual IPv4 addresses +If friends elsewhere cannot reach your local invitation, or direct media still +will not connect after the basic checks, try a virtual LAN. It connects your +devices so you can use Piik App's **Local room** instead of the public-invite path. +The tool must provide reachable virtual IPv4 addresses and carry both web traffic and WebRTC UDP; acceleration limited to one game does not suffice. Choose a tool available to everyone in your group: diff --git a/docs/guide/network.zh-CN.md b/docs/guide/network.zh-CN.md index 329e334c2..840e3edea 100644 --- a/docs/guide/network.zh-CN.md +++ b/docs/guide/network.zh-CN.md @@ -2,19 +2,20 @@ [English](./network.md) · 简体中文 · [问题排查](./troubleshooting.zh-CN.md) -本页用于排查 **网页能打开,但画面或语音连接不上**。按你的情况选择: +先做[连接问题的基本检查](./troubleshooting.zh-CN.md#常见问题)。 +仍然连不上时,再按现象选择: -- **校园网、公司网络,或换成热点就能看:** [选择连接方案](#校园网或严格-nat)。 - **同一邀请在别的浏览器里正常:** [检查浏览器限制](#浏览器限制了-webrtc)。 +- **换成热点就能看:** [选择连接方案](#校园网或严格-nat)。 +- **异地朋友打不开你的本地邀请:** [通过虚拟局域网连接](#可选虚拟局域网)。 - **日志提到 STUN,或准备检查自家路由器:** [地址发现与路由器](#stunipv6-与路由器检查)。 -- **准备使用 UU、Tailscale 或 ZeroTier:** [虚拟局域网使用步骤](#可选虚拟局域网)。 -网页与聊天、画面与声音使用不同的连接。媒体连接失败时,检查 WebRTC UDP 和下方的连接方案。 +如果是[公网邀请网页打不开](./troubleshooting.zh-CN.md#公网邀请创建失败或出现-1033),或[有画面但模糊、卡顿](./troubleshooting.zh-CN.md#画面模糊卡顿或中断),先按对应症状排查。 + +网页与聊天、画面与声音使用不同的连接: ![房主和朋友通过站点访问网页与聊天;画面和声音使用独立的直连或转发连接。](../assets/guide/network-paths.zh-CN.svg) -如果是[邀请网页打不开](./troubleshooting.zh-CN.md#公网邀请创建失败或出现-1033),或[画面已经出现但模糊、卡顿](./troubleshooting.zh-CN.md#画面模糊卡顿或中断),先按对应症状排查。 - ## 校园网或严格 NAT **先用手机热点打开同一邀请。** 热点能看、原网络不能看时,原网络的共享出口或防火墙限制更值得检查。 @@ -22,7 +23,7 @@ 需要长期使用时,可以选择以下方案: - **有可用的 Piik 站点:** 请管理员[启用服务器媒体转发(SFU)](../operations/self-hosting.zh-CN.md#可选启用媒体兜底),房主关闭 **隐私模式**,直连失败时即可尝试转发。使用 App 采集时,[授权新站点](./getting-started.zh-CN.md#通过已有站点使用-app),再发送该站点的邀请。 -- **朋友们可以安装组网工具:** 按下方[虚拟局域网步骤](#可选虚拟局域网),通过 App 的 **本地房间** 分享。 +- **没有可用的转发站点,直连仍然失败:** 可尝试[虚拟局域网](#可选虚拟局域网)。朋友们加入同一个虚拟网络,再通过 App 的 **本地房间** 分享。 - **所需的连接被网络阻断:** 换用可用网络,或请网络管理员检查放行。 > **媒体需要 UDP。** `demo.piik.tv` 和 App 的 **公网邀请** 使用纯 P2P。 @@ -89,7 +90,8 @@ STUN 服务会接收到参与者的公网 IP,请选择信任的服务。 ## 可选:虚拟局域网 -虚拟局域网让异地设备像在同一网络中一样互访,再通过 Piik App 的 **本地房间** 分享。 +异地朋友打不开本地邀请,或基本检查后画面、语音仍然连不上时,可以尝试虚拟局域网。 +它让设备像在同一网络中一样互访,改用 Piik App 的 **本地房间** 分享。 工具必须提供可互访的虚拟 IPv4 地址,同时支持网页访问和 WebRTC UDP;只加速某个游戏的功能不适用。 选择朋友们都能使用的工具即可: diff --git a/docs/guide/sharing.md b/docs/guide/sharing.md index 795005f2b..8e2d7114d 100644 --- a/docs/guide/sharing.md +++ b/docs/guide/sharing.md @@ -41,6 +41,18 @@ sharing. Viewers hear it through the picture's sound without joining room voice. Room voice remains independent. If you enable both microphones, listeners may hear you twice; Piik warns you and leaves the choice to you. +## iPhone and iPad screen sharing + +Use **Safari on iOS/iPadOS 27 or later** and select **Browser** to share your screen. +Watching a friend and camera sharing use the browser's existing capabilities +and do not require this screen-sharing version. + +Safari screen sharing does **not** capture system audio. To speak with the picture, +explicitly enable [Include my microphone](#include-your-microphone). +MDN's [verified Safari 27 support](https://github.com/mdn/browser-compat-data/pull/30732) +and [screen/audio compatibility data](https://github.com/mdn/browser-compat-data/blob/main/api/MediaDevices.json) +distinguish screen capture from audio capture. + ## Cameras and virtual audio inputs Picture sound and conversation use separate controls. Muting one does not mute the other. diff --git a/docs/guide/sharing.zh-CN.md b/docs/guide/sharing.zh-CN.md index 920412718..890fddab7 100644 --- a/docs/guide/sharing.zh-CN.md +++ b/docs/guide/sharing.zh-CN.md @@ -34,6 +34,15 @@ 每次开始新的分享时默认关闭,停止分享也会停止这路麦克风。观众通过画面声音收听,无须加入房间语音。 房间语音独立运行。如果同时开启两路麦克风,听众可能听到两次你的声音;Piik 会提示,由你决定保留哪一路。 +## iPhone 与 iPad 屏幕分享 + +请使用 **iOS/iPadOS 27 及以上的 Safari**,选择 **浏览器** 分享屏幕。 +观看朋友的画面和分享摄像头使用浏览器已有能力,不受此屏幕分享版本门槛限制。 + +Safari 屏幕分享**不采集系统声音**。需要随画面讲话时,可主动开启[分享麦克风](#分享麦克风)。 +依据 MDN 的 [Safari 27 实测记录](https://github.com/mdn/browser-compat-data/pull/30732) +及[屏幕/音频兼容数据](https://github.com/mdn/browser-compat-data/blob/main/api/MediaDevices.json),两者支持情况不同。 + ## 摄像头与虚拟音频输入 ![来源声音与分享麦克风随画面传输,使用播放音量;房间语音使用独立的收听音量。](../assets/guide/audio-paths.zh-CN.svg) diff --git a/docs/guide/troubleshooting.md b/docs/guide/troubleshooting.md index fd8835de0..d3b9954df 100644 --- a/docs/guide/troubleshooting.md +++ b/docs/guide/troubleshooting.md @@ -516,7 +516,8 @@ Read discovery logs or check a router you manage. [View steps](./network.md#stun ### Optional: a virtual LAN -Use Local room over Tailscale, ZeroTier or UU. [View steps](./network.md#optional-a-virtual-lan). +Friends elsewhere cannot reach a local invitation, or direct media still will not +connect? A virtual LAN provides another connection option. [View steps](./network.md#optional-a-virtual-lan). ## Reporting a problem diff --git a/docs/guide/troubleshooting.zh-CN.md b/docs/guide/troubleshooting.zh-CN.md index 2490686b2..53514f4ab 100644 --- a/docs/guide/troubleshooting.zh-CN.md +++ b/docs/guide/troubleshooting.zh-CN.md @@ -425,7 +425,8 @@ Piik 的麦克风静音不会关闭这条独立来源。 ### 可选:虚拟局域网 -通过 UU 等组网工具使用本地房间。 [查看步骤](./network.zh-CN.md#可选虚拟局域网)。 +异地朋友打不开本地邀请,或直连始终失败时,可尝试通过虚拟局域网连接。 +[查看步骤](./network.zh-CN.md#可选虚拟局域网)。 ## 反馈问题 diff --git a/docs/operations/github.md b/docs/operations/github.md index ac9b77ce6..20430500a 100644 --- a/docs/operations/github.md +++ b/docs/operations/github.md @@ -97,9 +97,11 @@ the **AtomGit mirror** GitHub workflow separately copies published binary assets Its repository Actions secret is `ATOMGIT_TOKEN`. Never put this token in source, a remote URL or a distributed package. GitHub publication keeps its scoped token. -After a successful main-push CI run, the workflow downloads that run's complete +After a completed main-push CI run, the workflow checks whether that run published +the current stable GitHub release. A later failed container step does not prevent +mirroring already-published packages. It downloads the matching run's complete original Server and App artifacts and invokes `scripts/mirror-release.mjs`. -It skips runs that did not publish the current GitHub release. GitHub publication +Runs without the current published release are skipped. GitHub publication and **Website** do not depend on mirror success. An unfinished mirror remains a prerelease until every package passes anonymous full-download SHA-256 validation. This includes the original signed APK and its already-built ZIP wrapper. diff --git a/docs/standards/visual-language.md b/docs/standards/visual-language.md index f355fd363..05306efa0 100644 --- a/docs/standards/visual-language.md +++ b/docs/standards/visual-language.md @@ -66,6 +66,35 @@ Keep existing controls in their established positions as a room becomes active. Represent missing room identity with a passive placeholder in its own slot; do not move unrelated controls into that space to fill an empty state. +### Space Priority + +Assign space by meaning before choosing a breakpoint. The containing row or +toolbar owns its layout; the shared control declares whether its caption may +collapse. Primary styling, a quiet appearance or a particular icon does not +determine that priority. + +| Content or action | Behavior when space is limited | +| --- | --- | +| A name, selected device or other object being acted on | Give the value space before its supporting action's caption. After that, keep the group together where possible; long names may use the full available line and then ellipsis with their existing full-value hint. | +| Exact short values, units, entry fields and validation | Keep the value and unit together; preserve usable editing width. Wrap the field group or explanation instead of clipping the value or shrinking its type. | +| Contextual actions with a familiar icon, such as Edit or Copy | Explicitly allow the caption to collapse first. Retain the same icon, accessible name, hint and normal click target. | +| Primary, destructive or unfamiliar choices | Keep enough visible identity to distinguish the action and its scope; retain wording when an icon would be ambiguous. Wrap complete actions or their group. | +| Secondary utilities and detail settings | Reuse the surface's existing More/settings disclosure when needed. Keep frequent playback, mute and stop/release controls directly reachable. | + +Use this order: remove surplus spacing, collapse eligible supporting captions, +reflow coherent groups, then shorten long descriptive values. Do not reduce all +children equally or use blanket `nowrap` to force a row to fit. For example, +the nickname gets space before the word **Edit**; the pencil remains beside it +until the whole identity group needs its own line. + +`Btn` owns optional caption collapse and button geometry. Layout owners select +the applicable container state; they must not copy per-page glyph sizes or hide +all captions indiscriminately. Header overflow remains its existing single +disclosure and focus owner. The website and room UI follow these same priorities +while keeping their distinct layouts. Check real short/long values, translated +labels, active/editing states and text zoom; fitting inside the viewport alone +does not prove the important content stayed readable. + ### Control Selection Choose by the user's task, then reuse its interaction and visual primitive. @@ -817,6 +846,11 @@ stationary and manually scrollable instead of discarding the hidden words. ## Interaction References +[Fluent toolbars](https://fluent2.microsoft.design/components/web/react/core/toolbar/usage) +and [Atlassian navigation layout](https://atlassian.design/components/navigation-system/layout/code) +distinguish directly available actions from overflow. Piik applies those priorities +through its existing controls and layout owners, not a second toolbar framework. + [Radix colour roles](https://www.radix-ui.com/colors/docs/palette-composition/understanding-the-scale) separate surfaces, interaction states, borders and text instead of tinting every layer with the accent. Native [text selection](https://developer.mozilla.org/en-US/docs/Web/CSS/user-select) diff --git a/docs/todo.md b/docs/todo.md index aa3301a69..e82f1721c 100644 --- a/docs/todo.md +++ b/docs/todo.md @@ -1,12 +1,17 @@ # Current TODO Ledger -Last reviewed: 2026-11-04 +Last reviewed: 2026-11-07 This ledger contains unfinished work and explicit owner holds. Product modules own behavior; research and Git/PRs own evidence and completed history. ## Now +- [ ] **Blue-tinted sharing (#529).** Identify the source and affected receive + path from [#529](https://github.com/TNTcraftHIM/Piik/issues/529): Piik version, + platform, capture choice and matching source/Viewer screenshots. Compare + those pixels with the existing colour controls; increased bitrate did not + resolve the reported tint. - [ ] **Browser sharing falls to low source FPS during motion.** Capture original track, isolated capture-input and sender counters during the same low-FPS episode on Windows Chrome with mixed direct/SFU delivery. The observed sender diff --git a/scripts/release-mirror-source.mjs b/scripts/release-mirror-source.mjs index f3a8d0a14..0d5364462 100644 --- a/scripts/release-mirror-source.mjs +++ b/scripts/release-mirror-source.mjs @@ -16,12 +16,11 @@ export function resolveMirrorSource(runId, automatic = false) { if (run.id !== Number(runId) || run.repository?.full_name !== repository || run.head_repository?.full_name !== repository || run.event !== "push" || run.head_branch !== "main" || run.path !== ".github/workflows/repository-hygiene.yml" || - run.status !== "completed" || !/^[a-f0-9]{40}$/.test(run.head_sha) || - (automatic && run.conclusion !== "success")) { + run.status !== "completed" || !/^[a-f0-9]{40}$/.test(run.head_sha)) { throw new Error("Mirror artifacts must come from a completed main push in this repository's CI workflow"); } - // A legacy CI run may be red because its mirror failed after GitHub published. - // The published release, not that aggregate result, owns manual retry identity. + // A later publication step can fail after GitHub has published the packages. + // The matching stable release owns mirror identity, not the CI aggregate result. const release = gh("releases/latest"); if (release.draft !== false || release.prerelease !== false || !isReleaseVersion(release.tag_name) || !/^[a-f0-9]{40}$/.test(release.target_commitish)) { diff --git a/site/film/ui/main.tsx b/site/film/ui/main.tsx index 806af46be..c84993059 100644 --- a/site/film/ui/main.tsx +++ b/site/film/ui/main.tsx @@ -319,7 +319,7 @@ function Screen({ shot }: { shot: Shot }) {
- +
diff --git a/site/index.html b/site/index.html index 344068bf0..b1b3d07f0 100644 --- a/site/index.html +++ b/site/index.html @@ -638,11 +638,12 @@

Piik App is available for Windows, macOS, Linux and Android. Friends can watch in a computer or phone browser. - Physical-device coverage for the macOS and Linux apps is still limited; if you have a device, - we'd welcome your test results and feedback.sharing guide. + If something goes wrong, let us know.Piik App 提供 Windows、macOS、Linux 和 Android 版本,朋友可使用电脑或手机浏览器观看。 - macOS 和 Linux 版 Piik App 仍需更多实机测试,欢迎有设备的朋友试用并反馈问题。分享指南。 + 遇到问题欢迎反馈。

@@ -745,19 +746,19 @@
-

Campus or restricted network?校园网或受限网络?

-

If direct connections fail, explore sites with media forwarding or a virtual LAN.直连不通时,可尝试支持媒体转发的站点或虚拟局域网。

- Explore connection options - 查看连接方案 +

Can't join a friend's room?进不了朋友的房间?

+

The page opens, but picture or voice won't connect? Check the browser and network.网页能打开,但画面或语音连不上?检查浏览器与网络。

+ Troubleshoot joining + 排查连接问题
-

Another sharing problem?其他分享或连接问题?

-

Find steps for invitations, sharing failures, picture and sound.按现象查找步骤:打不开邀请、无法分享、画面或声音异常。

- - Open troubleshooting查看问题排查 - +

More questions?更多问题

+

Find help with sharing, sound, picture quality and remote control.分享、声音、画质与远程控制,按遇到的问题查找。

+ Browse troubleshooting + 查看疑难解答
+

Still stuck? Report a problem仍未解决?反馈问题

@@ -905,13 +906,13 @@

iPhone / iPad

Use online使用在线版 -

Use Piik in your browser. No installation needed.无需安装,在浏览器中直接使用。

+

Screen sharing requires Safari on iOS/iPadOS 27 or later.屏幕分享需 iOS/iPadOS 27 及以上的 Safari。

View on GitHubGitHub 项目 -

Found a problem? Let us know.遇到问题?欢迎反馈。

+

Need help? Start with troubleshooting, or report a problem.遇到问题?先看问题排查,或向我们反馈。

diff --git a/site/styles.css b/site/styles.css index 968dac60f..9e4aa4141 100644 --- a/site/styles.css +++ b/site/styles.css @@ -175,6 +175,8 @@ h3 { font-size: 21px; font-weight: 700; letter-spacing: -.03em; line-height: 1.3 .faq-more > section { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 20px; border: 1px solid var(--line); border-radius: 18px; } .faq-more h3 { color: var(--ink); font-size: 15px; font-weight: 650; } .faq-more a { margin-top: auto; color: var(--ink); } +.faq-feedback { margin-top: 12px; color: var(--muted); font-size: 12px; } +.faq-feedback a { display: inline-block; padding-block: 8px; } summary { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 21px 0; font-size: 15px; font-weight: 650; list-style: none; } summary::-webkit-details-marker { display: none; } summary::after { content: "+"; flex: none; width: 22px; font-size: 21px; font-weight: 400; text-align: center; color: var(--action-text); } diff --git a/src/client/components/living/FloatingPanel.tsx b/src/client/components/living/FloatingPanel.tsx index 2aa00b370..c751e7c8d 100644 --- a/src/client/components/living/FloatingPanel.tsx +++ b/src/client/components/living/FloatingPanel.tsx @@ -98,6 +98,9 @@ export function FloatingPanel({ id, trigger, title, icon, compact = false, ancho // resizing the living room or taking ownership of scrolling/focus. const viewport = window.visualViewport; const place = (change?: PanelChange) => { + // Native hiding/adoption can precede React's effect cleanup. Only this + // document's visible panel can update its remembered in-page position. + if (panel.ownerDocument !== document || !panel.matches(":popover-open")) return; const layout = document.documentElement; const width = viewport?.width ?? layout.clientWidth, height = viewport?.height ?? layout.clientHeight; const maxWidth = Math.max(0, width - 24), maxHeight = Math.max(0, height - 24); diff --git a/src/client/components/living/Header.tsx b/src/client/components/living/Header.tsx index e94efcb1e..1c4900d56 100644 --- a/src/client/components/living/Header.tsx +++ b/src/client/components/living/Header.tsx @@ -85,7 +85,7 @@ const webVersion = import.meta.env.VITE_PIIK_VERSION ?? "development"; const webRelease = /^v\d+\.\d+\.\d+$/.test(webVersion) ? `https://github.com/TNTcraftHIM/Piik/releases/tag/${webVersion}` : null; -function BrowserHelpContent({ active }: { active: boolean }) { +function BrowserHelpContent({ active, diagnosticControl }: { active: boolean; diagnosticControl?: React.ReactNode }) { const { lang, vis, t } = useCopy(); const guide = useProjectLink(`/docs/${lang === "zh" ? "zh/" : ""}troubleshooting.html`, `https://github.com/TNTcraftHIM/Piik/blob/main/docs/guide/troubleshooting${lang === "zh" ? ".zh-CN" : ""}.md`, active); @@ -101,13 +101,13 @@ function BrowserHelpContent({ active }: { active: boolean }) { {!vis && {t("help.troubleshooting")}} - + {diagnosticControl === undefined ? : diagnosticControl} } ; } -function BrowserHelpMenu() { +function BrowserHelpMenu({ diagnosticControl }: { diagnosticControl?: React.ReactNode }) { const { vis, t } = useCopy(); const id = useId(); const trigger = useRef(null); @@ -125,7 +125,7 @@ function BrowserHelpMenu() { className="lr-anchored-card lr-help-menu" onToggle={event => { if (event.target === event.currentTarget) setOpen(event.newState === "open"); }}> - + , document.body)} ; } @@ -198,7 +198,7 @@ export function HeaderControls({ diagnosticControl, appControl }: { diagnosticCo {themeButton} - {diagnosticControl === undefined ? compact ? : : diagnosticControl} + {compact ? : } ); diff --git a/src/client/components/living/NumberControl.tsx b/src/client/components/living/NumberControl.tsx index ce4da5e44..10967aa6f 100644 --- a/src/client/components/living/NumberControl.tsx +++ b/src/client/components/living/NumberControl.tsx @@ -1,5 +1,6 @@ import { useEffect, useId, useRef, useState, type ReactNode } from "react"; import { useCopy } from "../../ui/copy"; +import { Glyph } from "../../ui/icons"; export function NumberControl({ value, min, max, step, unit, showUnit = true, name, label, disabled, onChange, className, children }: { value: number; @@ -19,6 +20,7 @@ export function NumberControl({ value, min, max, step, unit, showUnit = true, na const [invalid, setInvalid] = useState(false); const errorId = useId(); const input = useRef(null); + useEffect(() => { input.current!.value = String(value); }, [value]); useEffect(() => setInvalid(false), [value, min, max, step]); const reset = () => { input.current!.value = String(value); setInvalid(false); }; const select = (next: number) => { @@ -26,8 +28,14 @@ export function NumberControl({ value, min, max, step, unit, showUnit = true, na reset(); if (next !== value) onChange(next); }; - const number = ; + event.preventDefault()}> + + + + ; return
{ if (event.currentTarget.contains(event.relatedTarget)) return; const field = input.current!; diff --git a/src/client/components/living/button.css b/src/client/components/living/button.css index 81626e822..dd3aed701 100644 --- a/src/client/components/living/button.css +++ b/src/client/components/living/button.css @@ -45,6 +45,10 @@ button { -webkit-user-select: none; user-select: none; -webkit-touch-callout: no .lr-btn > .lr-glyph { width: var(--button-icon-size, var(--control-icon-size)); height: var(--button-icon-size, var(--control-icon-size)); } .lr-btn.is-compact { --button-size: var(--control-compact-size); --button-padding: 10px; } .lr-btn.is-dense { --button-size: var(--control-dense-size); --button-padding: 8px; --button-icon-size: 16px; } +@container value-actions (max-width: 420px) { + .lr-btn[data-caption="collapsible"] { width: var(--button-size, var(--control-size)); padding-inline: 0; } + .lr-btn[data-caption="collapsible"] > .lr-cap { display: none; } +} .lr-btn.is-quiet { border-radius: 12px; } .lr-btn.is-quiet:not(.is-on):not(.is-primary):not(.is-danger) { background: transparent; border-color: transparent; color: var(--muted); box-shadow: none; } .lr-btn.is-quiet:not(.is-on):not(.is-primary):not(.is-danger):is(:hover, :focus-visible):not(:disabled):not([aria-disabled="true"]) { background: var(--control-hover); border-color: transparent; color: var(--ink); } diff --git a/src/client/components/living/primitives.tsx b/src/client/components/living/primitives.tsx index af6ad9d7b..891bec49f 100644 --- a/src/client/components/living/primitives.tsx +++ b/src/client/components/living/primitives.tsx @@ -43,6 +43,7 @@ export function Btn({ id, icon, cap, + collapsibleCaption = false, tone, size, quiet = false, @@ -66,6 +67,8 @@ export function Btn({ id?: string; icon: GlyphName; cap?: CopyKey; + /** Auxiliary caption may yield space while its icon, label and hint remain. */ + collapsibleCaption?: boolean; tone?: "primary" | "danger" | "on"; size?: "compact" | "dense"; quiet?: boolean; @@ -100,6 +103,7 @@ export function Btn({ id={id} type={type} className={`lr-btn${size ? ` is-${size}` : ""}${quiet ? " is-quiet" : ""}${activeTone ? ` is-${activeTone}` : ""}`} + data-caption={collapsibleCaption ? "collapsible" : undefined} aria-label={label} disabled={disabled && !softDisabled} aria-disabled={softDisabled || undefined} diff --git a/src/client/components/living/use-anchored-popover.ts b/src/client/components/living/use-anchored-popover.ts index 9600a934f..a46d9320b 100644 --- a/src/client/components/living/use-anchored-popover.ts +++ b/src/client/components/living/use-anchored-popover.ts @@ -31,7 +31,10 @@ export function useAnchoredPopover( const left = (viewport?.offsetLeft ?? 0) + 8, top = (viewport?.offsetTop ?? 0) + 8; const right = left + (viewport?.width ?? view.innerWidth) - 16; const bottom = top + (viewport?.height ?? view.innerHeight) - 16; - if (!anchor.getClientRects().length || rect.bottom < top || rect.top > bottom || rect.right < left || rect.left > right) { + const anchorOutside = rect.bottom < top || rect.top > bottom || rect.right < left || rect.left > right; + // A keyboard can cover the anchor while its popover still owns input. + // Keep that editing surface placed in view; a removed trigger still closes it. + if (!anchor.getClientRects().length || (anchorOutside && !menu.contains(menu.ownerDocument.activeElement))) { menu.hidePopover(); return; } @@ -44,7 +47,7 @@ export function useAnchoredPopover( const preferredHeight = Math.min(height, minVisibleHeight); const openAbove = side === "above" ? above >= preferredHeight || above > below : below < preferredHeight && above > below; const beside = openAbove ? above : below; - menu.style.maxHeight = `${Math.min(maxHeight, beside >= preferredHeight ? beside : bottom - top)}px`; + menu.style.maxHeight = `${Math.min(maxHeight, bottom - top, beside >= preferredHeight ? beside : bottom - top)}px`; menu.classList.toggle("is-above", openAbove); const x = align === "center" ? rect.left + (rect.width - menu.offsetWidth) / 2 : rect.right - menu.offsetWidth; menu.style.left = `${Math.max(left, Math.min(x, right - menu.offsetWidth))}px`; diff --git a/src/client/lib/release-update.ts b/src/client/lib/release-update.ts index 0061b7a28..bcfe8a631 100644 --- a/src/client/lib/release-update.ts +++ b/src/client/lib/release-update.ts @@ -80,7 +80,7 @@ export function parseMirrorReleaseMetadata(value: unknown, packageTarget?: strin if (release.prerelease !== false || typeof release.body !== "string") return null; const sources = [...release.body.matchAll(/^\r?$/gm)]; if (sources.length !== 1) return null; - // The mirror tag identifies its README commit, never the original Piik source. + // The mirror publisher records original source identity in this marker. const normalized = parseReleaseMetadata({ tag_name: release.tag_name, html_url: RELEASE_PAGE + String(release.tag_name), target_commitish: sources[0][1], diff --git a/src/client/locales/en.ts b/src/client/locales/en.ts index 0595974e4..71aef416a 100644 --- a/src/client/locales/en.ts +++ b/src/client/locales/en.ts @@ -217,6 +217,8 @@ export const en: Record = { "notice.dismiss": "Dismiss notice", "common.enable": "Enable {name}", "common.disable": "Disable {name}", + "common.increase": "Increase {name}", + "common.decrease": "Decrease {name}", "host.join.hide": "Hide room entry", "host.advanced.hide": "Hide sharing settings", "host.password.settingsHide": "Hide password settings", diff --git a/src/client/locales/zh.ts b/src/client/locales/zh.ts index 1dc08b90e..a305e3c7a 100644 --- a/src/client/locales/zh.ts +++ b/src/client/locales/zh.ts @@ -217,6 +217,8 @@ export const zh = { "notice.dismiss": "关闭提示", "common.enable": "开启{name}", "common.disable": "关闭{name}", + "common.increase": "增大{name}", + "common.decrease": "减小{name}", "host.join.hide": "收起加入房间", "host.advanced.hide": "收起分享设置", "host.password.settingsHide": "收起密码设置", diff --git a/src/client/media/capture-stream.ts b/src/client/media/capture-stream.ts new file mode 100644 index 000000000..9a1e9b577 --- /dev/null +++ b/src/client/media/capture-stream.ts @@ -0,0 +1,18 @@ +/** Retire the caller immediately; a late permission grant still owns real tracks. */ +export async function acquireMediaStream(start: () => Promise, signal?: AbortSignal): Promise { + signal?.throwIfAborted(); + const pending = start(); + return new Promise((resolve, reject) => { + const abort = () => { signal?.removeEventListener("abort", abort); reject(signal!.reason); }; + signal?.addEventListener("abort", abort, { once: true }); + if (signal?.aborted) abort(); + pending.then(stream => { + signal?.removeEventListener("abort", abort); + if (signal?.aborted) stream.getTracks().forEach(track => track.stop()); + else resolve(stream); + }, error => { + signal?.removeEventListener("abort", abort); + reject(error); + }); + }); +} diff --git a/src/client/media/host-audio.ts b/src/client/media/host-audio.ts index 896846c38..97fcd01fb 100644 --- a/src/client/media/host-audio.ts +++ b/src/client/media/host-audio.ts @@ -1,6 +1,7 @@ import type { BrowserCaptureSource } from "./quality"; import { audioInputConstraints } from "./audio-capture"; import { MicrophoneInput } from "./microphone-input"; +import { acquireMediaStream } from "./capture-stream"; export interface CommentaryInput { deviceId: string; volume: number; voiceProcessing: boolean } @@ -14,7 +15,7 @@ export class HostAudio { private sourceNode: MediaStreamAudioSourceNode | null = null; private microphone: MicrophoneInput | null = null; private microphoneNode: MediaStreamAudioSourceNode | null = null; - private microphoneRequest = 0; + private microphoneRequest: AbortController | null = null; private closed = false; constructor(private source: MediaStream, private kind: BrowserCaptureSource = "browser", private availabilityChanged: (available: boolean) => void = () => {}, @@ -63,21 +64,22 @@ export class HostAudio { } } async setMicrophone(enabled: boolean, settings: CommentaryInput): Promise { - const request = ++this.microphoneRequest; + this.microphoneRequest?.abort(); + this.microphoneRequest = null; if (!enabled) { this.clearMicrophone(); return; } if (!this.context || !this.destination || this.closed) throw new Error("Shared audio is unavailable"); + const request = this.microphoneRequest = new AbortController(); const context = new AudioContext(); let stream: MediaStream | undefined, input: MicrophoneInput | undefined; try { - const resumed = context.resume().then(() => true, () => false); - await this.context.resume(); - stream = await navigator.mediaDevices.getUserMedia({ audio: { ...audioInputConstraints(settings.voiceProcessing), - ...(settings.deviceId ? { deviceId: { exact: settings.deviceId } } : {}) }, video: false }); + const resumed = Promise.all([context.resume(), this.context.resume()]).then(() => true, () => false); + stream = await acquireMediaStream(() => navigator.mediaDevices.getUserMedia({ audio: { ...audioInputConstraints(settings.voiceProcessing), + ...(settings.deviceId ? { deviceId: { exact: settings.deviceId } } : {}) }, video: false }), request.signal); if (!await resumed) throw new Error("Microphone audio could not start"); - if (this.closed || request !== this.microphoneRequest) return; + request.signal.throwIfAborted(); if (!stream.getAudioTracks().some(track => track.readyState === "live")) throw new Error("No live microphone"); input = new MicrophoneInput(stream, context, settings.volume, () => { - if (this.microphone === input) { ++this.microphoneRequest; this.clearMicrophone(); } + if (this.microphone === input) { this.microphoneRequest?.abort(); this.clearMicrophone(); } }); const node = this.context.createMediaStreamSource(input.stream); node.connect(this.gain!); @@ -87,8 +89,10 @@ export class HostAudio { previousNode?.disconnect(); previousInput?.close(); this.microphoneChanged(true); this.reportAvailability(); } catch (error) { - input?.close(); throw error; + input?.close(); + if (!request.signal.aborted) throw error; } finally { + if (this.microphoneRequest === request) this.microphoneRequest = null; if (!input) { stream?.getTracks().forEach(track => track.stop()); void context.close().catch(() => {}); } } } @@ -119,7 +123,7 @@ export class HostAudio { } dispose(): void { if (this.closed) return; - this.closed = true; ++this.microphoneRequest; + this.closed = true; this.microphoneRequest?.abort(); this.microphoneRequest = null; this.unwatchSource(); this.clearMicrophone(); this.closeGraph(); this.source.getAudioTracks().forEach(track => track.stop()); diff --git a/src/client/pages/AppLauncherPage.tsx b/src/client/pages/AppLauncherPage.tsx index 6aa9e560b..99145baf7 100644 --- a/src/client/pages/AppLauncherPage.tsx +++ b/src/client/pages/AppLauncherPage.tsx @@ -229,10 +229,13 @@ export function AppLauncherPage() { const finish = beginStateChange(); setSiteBusy(true); setSiteError(undefined); + const controller = new AbortController(); + const timer = setTimeout(() => controller.abort(), 8_000); async function save(setting: "site" | "startup-site"): Promise { const response = await fetch(`/api/client-launcher/${setting}`, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ site: nextSite, ...(setting === "site" ? { allowed } : {}) }), + signal: controller.signal, }); const result = launcherStateSchema.pick({ sites: true, startupSite: true }).safeParse(await response.json().catch(() => null)); if (result.success) { @@ -251,7 +254,7 @@ export function AppLauncherPage() { } catch { setSiteError(t("client.connect.saveFailed")); return false; - } finally { finish(); setSiteBusy(false); } + } finally { clearTimeout(timer); finish(); setSiteBusy(false); } } async function approveSite(site: string): Promise { @@ -264,7 +267,7 @@ export function AppLauncherPage() { return (
void enableDebug()} /> diff --git a/src/client/pages/ControlsPreview.tsx b/src/client/pages/ControlsPreview.tsx index 65ebad677..6c1e07607 100644 --- a/src/client/pages/ControlsPreview.tsx +++ b/src/client/pages/ControlsPreview.tsx @@ -1,7 +1,7 @@ import { useLayoutEffect, useRef, useState } from "react"; import type { VideoFit, VideoRotation } from "../media/video-geometry"; -import { BackButton, Btn, Chip, NameTag, Pill, SwitchItem } from "../components/living/primitives"; -import { RoomChip, RoomCodePlaceholder, RoomAdmissionBadge } from "../components/living/RoomChip"; +import { BackButton, Btn, Chip, FieldCap, NameTag, Pill, SwitchItem } from "../components/living/primitives"; +import { Lcd, RoomChip, RoomCodePlaceholder, RoomAdmissionBadge } from "../components/living/RoomChip"; import { CaptureSourcePicker, type NativeSourceList } from "../components/living/CaptureSourcePicker"; import { LedStrip } from "../components/living/Header"; import { StageOverlay, StageTv } from "../components/living/Stage"; @@ -90,6 +90,7 @@ export function ControlsPreview() { const [paused, setPaused] = useState(false); const [passwordVisible, setPasswordVisible] = useState(false); const [name, setName] = useState("Piik friend"); + const [editingName, setEditingName] = useState(false); const [invalid, setInvalid] = useState(false); const [sourceOpen, setSourceOpen] = useState(displayPreview); const [sourceRevision, setSourceRevision] = useState(0); @@ -269,6 +270,25 @@ export function ControlsPreview() {
+ {(["host", "viewer"] as const).map(role =>
+
+ {role === "host" ? : }
+ {role === "viewer" &&
+ {name || "Piik friend"}
} +
+ {editingName ? <> + setName(event.target.value)} /> + setEditingName(false)} /> + setEditingName(false)} /> + : <> + setEditingName(true)} />} +
+
+ + +
+
)}