Free, open-source screen sharing for private live streams with friends. Watch together in a browser or self-host Piik. 免费开源的私密屏幕共享,支持游戏直播、一起看电影与自部署。
fix(app): stabilize sharing startup and align shared controls
AAA4bc0fd1e41cc
diff --git a/.github/pull_request_template.md b/.github/pull_request_template.mdindex 4d294d8c..9b54d3c8 100644--- a/.github/pull_request_template.md+++ b/.github/pull_request_template.md@@ -8,7 +8,18 @@<!-- Required for product-changing PRs; omit this section for standalone website/docs/maintenance work. Public copy, automatically published in GitHub Releases. Keep this exact heading; use ### for subsections. Describe user benefits, fixes and required upgrade actions in concise Chinese and English. Omit internal logs, audit prompts and unverified claims. 产品改动需填写公开的中英文更新说明;仅官网、文档或外围维护可删去此节。 -->-<!-- Start each language with a short introduction: what kind of update this is, its emphasis and who benefits. Then group relevant highlights/fixes/upgrade notes; omit empty headings. Use ### for languages and #### for categories. An internal refactor is not automatically a breaking change. Review the final release as one coherent description, including any earlier unpublished changes. 中英文分别先介绍本次更新的性质和重点,再按需分组写新功能、修复与升级事项;别用提交日志代替版本介绍。 -->+<!-- Follow docs/standards/versioning.md#release-notes. Keep the public Release title Piik vX.Y.Z.+An optional editorial headline opens the body as two bold plain-text paragraphs: English, then Chinese.+Keep/change/omit it by editorial relevance, independently of semver. A released feature, verified community+milestone, thanks or light aside is fine; do not present an old feature as new or promise a prototype.+Then use ### English followed by ### 中文 to explain THIS update: actual benefits, fixes and required actions.+Group details only when useful. Serious upgrade instructions take precedence over playful copy.+Preview the complete generated release, including earlier unpublished changes: one bilingual headline at most.+The last product PR supplies that headline (or omits it); earlier PRs retain their actual changes.+正文可先写一组双语主题:先英文、后中文,各一个 **纯文本粗体段落**。按内容决定沿用、换掉或省略,与版本位无关。+主题可以讲已上线功能、真实社区里程碑或轻松小事;随后必须明确“本次更新”改了什么,不用俏皮话代替事实。+合并前检查整份生成文案和官网摘句,勿重复主题、误报新功能或手工复制另一份文案。+-->## Verification / 验证diff --git a/CONTRIBUTING.md b/CONTRIBUTING.mdindex 62c1a150..2de43482 100644--- a/CONTRIBUTING.md+++ b/CONTRIBUTING.md@@ -180,11 +180,14 @@ reserve `spike/` for experiments. No issue number is required. 中文说明:PRA pull request should explain the problem, the chosen design, verification performed, user-visible or operational effects, and remaining risks.Before a product-changing integration PR is accepted, fill its exact `## Release notes` section-with concise public copy in Chinese and English: user-visible changes, fixes and-required upgrade actions. Use `###` for subsections. Review this text as product+with concise public copy in English followed by Chinese: user-visible changes,+fixes and required upgrade actions. Use `###` for subsections. Review this text as productcopy; it is published automatically from the squash commit, without PR discussionor verification logs. The [release-note policy](./docs/standards/versioning.md#release-notes)-owns aggregation and preview. Do not add a changelog file or release-note archive.+owns the optional editorial headline, aggregation and preview. Review the+generated whole release and its website excerpt together before publication;+keep at most one bilingual theme and make this update's actual changes easy to find.+Do not add a changelog file or release-note archive.Standalone website, documentation and maintenance phases do not need productrelease notes; their public description stays in the PR.diff --git a/cmd/piik-app/README.md b/cmd/piik-app/README.mdindex fd816db2..30f1f08b 100644--- a/cmd/piik-app/README.md+++ b/cmd/piik-app/README.md@@ -129,8 +129,8 @@ For codec-specific failures, see [Windows H264 troubleshooting](../../docs/guideEnable **Debug launch** in the launcher before starting a room or connecting a Site, reproduce theproblem, then press `D` in the interactive terminal to export a local ZIP.Use `--debug` for failures before the selector opens. Exporting does not stop-the share or upload the archive. For Browser diagnostics, click the **Debug**-chip icon after the theme control, confirm the reload, then use **Web report** to download.+the share or upload the archive. For Browser diagnostics, open **Help → Debug**+after the theme control, confirm the reload, then use **Help → Web report** to download.For cooperation failures, include both reports from the same reproduction. The[diagnostic reference](../../docs/standards/configuration.md#diagnostics) ownslog locations, export commands, retention and privacy boundaries.diff --git a/cmd/piik-app/README.zh-CN.md b/cmd/piik-app/README.zh-CN.mdindex d6e9a064..ceb75924 100644--- a/cmd/piik-app/README.zh-CN.md+++ b/cmd/piik-app/README.zh-CN.md@@ -100,7 +100,7 @@ App 在独立 Windows 控制台中启动时,启动或运行错误会保留在在启动房间或连接站点前,先在启动页开启 **诊断启动**,复现问题后在交互终端按 `D` 导出本地 ZIP。启动页出现前就失败时,使用 `--debug`。导出不会停止分享或上传文件。-浏览器诊断通过主题按钮后的 **诊断** 芯片图标开启:确认重新加载后,使用 **网页报告** 下载。+浏览器诊断通过主题按钮后的 **帮助 → 诊断** 开启:确认重新加载后,使用 **帮助 → 网页报告** 下载。调查浏览器与 App 配合的问题时,请提供同一次复现的两份报告。[诊断参考](../../docs/standards/configuration.md#diagnostics)说明日志位置、导出命令、保留规则与隐私边界。diff --git a/docs/assets/room-en-dark.png b/docs/assets/room-en-dark.pngindex 8587f75d..c9d40c7a 100644Binary files a/docs/assets/room-en-dark.png and b/docs/assets/room-en-dark.png differdiff --git a/docs/assets/room-en-light.png b/docs/assets/room-en-light.pngindex 07dc73c6..de2858c7 100644Binary files a/docs/assets/room-en-light.png and b/docs/assets/room-en-light.png differdiff --git a/docs/assets/room-zh-dark.png b/docs/assets/room-zh-dark.pngindex 4b0adb45..cc095021 100644Binary files a/docs/assets/room-zh-dark.png and b/docs/assets/room-zh-dark.png differdiff --git a/docs/assets/room-zh-light.png b/docs/assets/room-zh-light.pngindex bf333277..80f3abc8 100644Binary files a/docs/assets/room-zh-light.png and b/docs/assets/room-zh-light.png differdiff --git a/docs/operations/website.md b/docs/operations/website.mdindex dea62831..5f196e1e 100644--- a/docs/operations/website.md+++ b/docs/operations/website.md@@ -160,7 +160,8 @@ native latest-attachment route:Both links follow provider publication without a website rebuild. Supported Apparchitecture choices stay visible; one selection updates both providers' links.-An optional GitHub metadata request supplies only the latest version/date;+An optional GitHub metadata request supplies the latest version/date and its+authored editorial headline;failure does not disable architecture selection. Without JavaScript, the defaultlinks remain Windows x64, Apple silicon and Linux x64. Publish a newly listed Apppackage before deploying its website option. ARM64 Server packages alone do notdiff --git a/docs/research/nat-traversal.md b/docs/research/nat-traversal.mdindex 7f8cd998..cae6f120 100644--- a/docs/research/nat-traversal.md+++ b/docs/research/nat-traversal.md@@ -424,6 +424,58 @@ No new transport or universal success-rate claim is accepted by this review.The [retired Go experiment](#integration-cost-and-recovery-controls) establishesreuse feasibility and its cost, not a Browser-compatible reachability gain.+### External Forwarding And Participant Relays++The October 19 review and isolated Linux check of+[frp v0.71.1](https://github.com/fatedier/frp/releases/tag/v0.71.1)+establish fixed-UDP forwarding feasibility, not an integrated Piik provider:++- HTTP/WebSocket can use a normal reverse-proxy entry with the correct HTTPS+ public origin. A fixed SFU UDP forward is a deployment candidate when+ `SFU_PUBLIC_IP` advertises the reachable frps address and the external and local+ ports both match `SFU_UDP_PORT`; Piik does not separately advertise a remote port.+- Do not expose Piik's STUN listeners through ordinary frp UDP forwarding. Its+ [forwarder opens a local socket](https://github.com/fatedier/frp/blob/v0.71.1/pkg/proto/udp/udp.go)+ for each remote endpoint, so the backend observes frpc's address instead of the+ participant's mapping. Piik's STUN listener does not parse Proxy Protocol.+ Keep STUN directly reachable.+- The [UDP proxy](https://github.com/fatedier/frp/blob/v0.71.1/client/proxy/udp.go)+ frames datagrams into a work connection; choosing QUIC does not turn this into+ QUIC DATAGRAM or establish immunity to ordered-stream blocking. App edge+ sockets also remain dynamic: forwarding the page alone is not media integration.+ [XTCP requires frpc at both ends](https://gofrp.org/en/docs/examples/xtcp/), so+ it cannot replace ICE for an ordinary Browser invitation.++The direct/frp control used Piik's embedded SFU with one Pion publisher and two+subscribers. Both paths delivered at least 30 complete, byte-identical VP8 frames+and 30 Opus packets per subscriber, with an explicit Viewer PLI reaching the+publisher. The frp arm blocked direct backend-to-client traffic, used the default+TCP work connection, and preserved a sibling when one subscriber retired.+The same check against Piik's STUN listener returned the actual client mapping+directly and frpc's backend socket through frp, confirming the STUN limitation+above. These loopback controls do not establish Browser decoding, audible audio,+public-network performance, loss recovery or QUIC behavior.++A well-connected participant already can help through the existing Viewer relay.+Browser relays reuse WebRTC senders; Native relays can forward suitable encoded+media. Any voluntary capacity control should feed the existing room controller,+with its endpoint cap and current-edge retirement. Bandwidth alone does not prove+reachability. A separate App-hosted SFU would need remote-worker admission,+authorized commands and capacity/retirement ownership that the current embedded+SFU does not expose. [Tailscale Peer Relays](https://tailscale.com/docs/features/peer-relay)+likewise require configured reachability and authorization; they are not arbitrary+high-bandwidth peers. This review does not accept a second graph or relay service.++A controlled Native relay check blocked only Host-to-target traffic in Pion+vnet. The unmodified controller retired that silent candidate after its existing+five-second head start, selected a friend and committed only after 30 received+VP8 frames decoded. Reverse PLI reached the Host. Friend departure retired the+Native Source/Edge/Receiver path; the ordinary Host recovery exhausted its+existing 20-second budget. A new friend session restored decoded video and PLI;+old reports and media writes were rejected, with no remaining edges or sockets.+This establishes controller/transport composition, not room WebSocket admission,+Browser relay behavior or a field NAT success rate.+### Coordinated Native Punching AssessmentThe October 12, 2026 scope includes optional Native transport at both ends when@@ -593,12 +645,20 @@ against that same endpoint pair and relay policy.#### Stable Pion Interoperability-The candidate uses Pion WebRTC v4.2.24 / ICE v4.4.7. The-[upstream changes](https://github.com/pion/ice/compare/v4.4.0...v4.4.7) include+The candidate uses Pion WebRTC v4.2.24 / ICE v4.4.8. The+[upstream changes](https://github.com/pion/ice/compare/v4.4.0...v4.4.8) includeSTUN retransmission, gathering-generation ownership, Chromium mDNS compatibilityand pre-created mux lifetime corrections. This updates the shared Native/SFUcomposition; ordinary Browser-to-Browser ICE remains Browser-owned.+ICE v4.4.8 also [corrects Binding-request PRIORITY](https://github.com/pion/ice/pull/1026)+to use the peer-reflexive preference instead of the source candidate's preference.+The old value could tie a peer-reflexive pair with a host pair and add an+unnecessary acceptance wait. The upstream regression fails with the old pin and+passes with the correction, as do Piik's existing Native, STUN and SFU checks.+This corrects candidate selection; it does not establish a new reachable NAT+class or a field success rate.+WebRTC's DTLS v3.1.13 dependency also includes[queued-buffer ownership and handshake-retransmission corrections](https://github.com/pion/dtls/compare/v3.1.10...v3.1.13).They address loss/reordering during transport establishment and strengthendiff --git a/docs/research/native-client-lifecycle.md b/docs/research/native-client-lifecycle.mdindex 1689a854..cfb29dc2 100644--- a/docs/research/native-client-lifecycle.md+++ b/docs/research/native-client-lifecycle.md@@ -293,6 +293,17 @@ reproduce the new v2.0.0 `app/capture/failed` report. That key reports a failedNative source lifetime; the App's capture-process and share-ended diagnosticsare needed to identify which capture, codec or stream operation failed.+The 2026-10-19 window gate exposed a different restoration failure: WGC queued+a minimized 146x21 placeholder after the target had returned to 1251x1365.+Clearing the pool once still admitted it and H.264 rejected the resulting+encoder size. Frame admission now compares the+[rendered content size](https://learn.microsoft.com/en-us/uwp/api/windows.graphics.capture.direct3d11captureframe.contentsize)+with the [current target size](https://learn.microsoft.com/en-us/uwp/api/windows.graphics.capture.graphicscaptureitem.size)+before reconfiguring the pool or encoder, replacing the one-shot restoration+flag. The Auto/H.264 window gate then passed restoration, profile changes,+resizing, source replacement and source-exit recovery on the same media object.+This local reproduction does not identify the unmatched game/driver reports.+## Keyframe Request OwnershipA direct Native source delivers a requested physical output through itsdiff --git a/docs/research/native-client-media.md b/docs/research/native-client-media.mdindex 9172a065..1421077b 100644--- a/docs/research/native-client-media.md+++ b/docs/research/native-client-media.md@@ -121,6 +121,47 @@ encodes into a caller-owned Opus buffer, and can be replaced without changingthe media edge or control wire. The dependency is BSD-3-Clause licensed;App CI follows the toolchain declared in [go.mod](../../go.mod).+## macOS Audio Startup++[Issue #486](https://github.com/TNTcraftHIM/Piik/issues/486) reports successful+video-only startup but audio and then video timeouts with source audio enabled.+Darwin previously confirmed audio readiness only after collecting 20 ms of PCM.+The local correction instead confirms successful ScreenCaptureKit/AVAudioEngine+startup on the existing sample queue, before admitting PCM. A silent input can+therefore become ready without samples; failed or cancelled startup still cannot.+This follows [Apple's startup contract](https://developer.apple.com/documentation/screencapturekit/scstream/startcapture%28completionhandler%3A%29)+and the [upstream audio-capture lifecycle](https://github.com/obsproject/obs-studio/blob/master/plugins/mac-capture/mac-sck-audio-capture.m).++Existing Go pipe fixtures now cover ready-but-silent audio, audio that never+becomes ready, video startup in both cases and cancellation of blocked readers.+Both controls pass without changing Go startup deadlines or adding retries.+They do not reproduce the report's additional video timeout. Its display-audio+attempt and window-filter crash refer to different processes; they do not+establish one failure or an App bundle-identity collision. The native audio+self-test is part of the Mac capture check. Both Darwin architectures compiled+and passed that self-test in candidate CI on 2026-10-19; actual source/microphone+capture and permissions remain unverified on this Windows workstation.++The remaining video timeout needs a separate Mac reproduction. Darwin emits+`StartingStatus` after `SCShareableContent` enumeration and filter construction,+before creating or starting its video stream. Native Host currently starts both+helpers before reading video status, so their initial enumerations can overlap.+An [Apple Developer Forums report](https://developer.apple.com/forums/thread/772365)+reproduces an unresponsive `replayd` and similar 4097 errors using repeated+concurrent enumeration from multiple processes, without capturing media+(FB16310901). This is a candidate mechanism, not an established cause of #486;+Apple has not confirmed its cause or a fix.++The smallest Mac comparison uses the existing `piik-capture --list`: run one+helper, then two concurrently, under the same parent with bounded attempts.+Discard source metadata and retain only timing and errors. Separately compare+current startup with waiting for the video's existing `StartingStatus` before+starting audio. Keep deadlines, bundle identity and permissions unchanged in+these comparisons. Terminal versus App launch is a separate variable:+[Apple DTS describes TCC's responsible-process attribution](https://developer.apple.com/forums/thread/125438),+so a successful manual helper does not establish identical permission context.+No same-parent comparison or startup-order fix has yet been verified on a Mac.+## Current BoundaryWindows supports hardware H264 and software VP8 behind the same capture,@@ -149,6 +190,27 @@ shutdown cannot be preempted by that deadline. Slow-output rejection has fixturecoverage; native AMD/Intel physical acceptance and game-load behavior remainopen. This evidence does not establish the cause of reported system-wide lag.+Auto's cadence probe borrows the selected hardware codec through a temporary+WebRTC pipeline. That pipeline is destroyed before the same hardware instance+moves into the ordinary live output, avoiding a second driver activation while+keeping synthetic frame-dropper and adaptation history out of live capture.+An October 19 comparison on the local NVIDIA device reduced hardware creation+from two instances to one. Single real inputs at 1 and 30 fps produced decodable+IDRs about 34–39 ms after selection; 30/60 fps output and explicit H264/VP8 also+passed. Total healthy Auto startup remained around 1.8 seconds, so this proves+less initialization and a valid handoff, not a material speedup or a repair for+an uninterruptible driver call. Concurrent cadence benchmarks are not adopted:+shared-device contention would change the capability being measured.++The current v2.2.1 report in [#437](https://github.com/TNTcraftHIM/Piik/issues/437)+records device loss after about 3.25 seconds, before the Auto selection finishes.+The selector could then enter another candidate despite lacking time for its+required cadence measurement. Admission now uses that same measurement schedule+before synchronous setup, preserving the existing VP8 fallback. A 750 ms+remaining-budget control rejects Auto at 30 fps but retains manual H264 and the+immediate 1 fps probe. This fixes budget admission, not the physical+`DEVICE_HUNG`; the later blocked API and reporter-device outcome remain unknown.+The `input-texture-create / 0x887a0005` report identifies a lost D3D device duringcandidate preparation, not a failed room route or proof that every candidatefailed. Following Microsoft's [device-loss guidance](https://learn.microsoft.com/en-us/windows/uwp/gaming/handling-device-lost-scenarios),@@ -173,8 +235,8 @@ across those adapter entries and all five resolutions. Forty activation/retiremecycles included cancellation and shutdown with an input still in flight; thedevice remained healthy. Five selections, including AMD rejection, alsosucceeded while another process continued H264 encoding.-The reported stage creates probe textures before actual WGC capture; Auto's-cadence textures are prepared before MFT activation. These results narrow the+The reported stage creates probe textures before actual WGC capture; texture+synthesis remains outside the measured cadence. These results narrow thetested mechanisms but do not cover the failing device, driver reset or exhaustion.Repeated NVIDIA MFT activation retained about two process handles per cycle.diff --git a/docs/research/room-interactions.md b/docs/research/room-interactions.mdindex 39f4741f..16c99280 100644--- a/docs/research/room-interactions.md+++ b/docs/research/room-interactions.md@@ -247,10 +247,132 @@ danmaku or reaction effects. Current behavior remains the no-history contract ab## Audio Boundary-The Host microphone remains commentary mixed into the shared source.-Bidirectional room voice is not part of the product plan.-Text, reactions and danmaku introduce no microphone capture, voice-admission or additional media peers.+The published Host microphone remains commentary mixed into the shared source.+Text, reactions and danmaku introduce no microphone capture or additional media+peers. Room voice is an isolated prototype, not a published capability.++### Room Voice Transport Assessment++Reviewed 2026-10-19. The owner requested optional self-hosted voice and assessment+of App-hosted voice. The local prototype forwards independent Opus publications,+uses existing room identities, and enforces Host admission and speaking grants.+It demonstrates decoded voice before, during and after synthetic screen sharing;+production integration and external-network reachability remain unverified.++The proposed ownership is one room and membership authority, independent screen+and voice publications. Starting or stopping a share must not create or destroy+voice membership. The separate-forwarder prototype retires a disconnected voice+session while approved Viewers can continue talking; explicitly ending the room+retires all voice sessions. The room-tree experiment below retains healthy media+during a signaling interruption and separates that from confirmed departure.+Host-only video and participant-owned voice can+coexist without turning every speaker into a screen publisher.++| Transport | Benefit | Boundary |+| --- | --- | --- |+| Self-hosted SFU | Each participant connects to one configured service; independent tracks allow local mute | The service's media endpoint must be reachable; an HTTP connection alone is insufficient |+| Host App as voice forwarder | The same forwarding module could run locally without a mandatory public media server | Every participant must reach the Host App; existing relayed video does not prove this |+| Participant mesh | No forwarding process | Pairwise reachability and upload fan-out grow with the room; partial audibility is possible |+| Room-owned bidirectional tree (candidate) | Reuses reachable neighbors and distributes forwarding upload | Requires room-owned connections, independent voice publications and explicit relay/listening permission; it is not an input-channel extension |++For example, `Host <-> A <-> B` may carry video and remote input while `Host <-> B`+cannot connect. A Host-App voice star would leave B without voice. Before sharing,+there may be no video tree at all. The current `HostPeer` sends one video and one+source-audio track; `ViewerRelay` uses that same sender. The reverse input channel+carries bounded encrypted commands, not audio playout, jitter buffering or media+feedback. Sending audio bytes there would introduce another audio transport stack.++[RTP topology guidance](https://www.rfc-editor.org/rfc/rfc7667.html#section-3.7)+describes forwarding independent streams without mixing them. This preserves+per-person mute and avoids returning a speaker's own track. A single mixed+broadcast would lose that control unless each listener received a separate mix.+For scale, a four-person App hub forwarding three 32 kbps voice tracks to each+of three guests sends 288 kbps; 21 participants require 12.8 Mbps in the same+all-speaking case. These are payload calculations, not measured performance;+packet overhead and shared-screen upload are additional.++The owner proposed lifting the existing route and connection lifetime to the+room on 2026-10-19. This is a candidate design, not a published contract: keep+one graph and one serial operation owner, with video and voice as separate+consumers. WebRTC already supports bidirectional tracks over shared transports+([WebRTC transceivers](https://www.w3.org/TR/webrtc/#dom-rtcrtptransceiver),+[BUNDLE](https://www.rfc-editor.org/rfc/rfc8843.html)). The graph can retain its+rooted, acyclic orientation for placement while voice travels both ways over an+edge. Host authority and the single screen source remain unchanged.++Under that design, admitted voice or screen-sharing demand can acquire room+connections. Stopping video retires its tracks and quality work, not connections+still serving voice or another participant. Microphone mute does not leave the+voice session. Once no media consumer or transit demand remains, physical+connections retire while room chat can continue. Connection epochs are distinct+from individual publication generations. Route changes retain one prepare/commit+operation; video still needs decoded-frame proof, while silent voice cannot+depend on a video frame or audible microphone samples. Current share-wide pause,+first-frame admission and `HostPeer`/`ViewerRelay` stream ownership are the+concrete extraction points, rather than reasons to reject transport reuse.++Independent voice tracks retain speaker identity and local mute. Forwarding on+the committed tree excludes the ingress branch; it need not send every packet+to the Host and back. Candidate overlap must not create duplicate forwarding or+let a retired publication survive. A video relay without listening permission+must not receive decodable voice: relay eligibility or end-to-end encryption+still needs a deliberate choice. Multi-track congestion and mixed-capability+production paths remain to be exercised. No generic transport framework, second route+planner or automatic root migration is implied by this candidate.++The isolated `prototypes/room-media` experiment on `spike/room-voice` reuses the+production route controller without modifying it. Actual room admission and+loopback Pion connections carry two independent Opus publications in both+directions, followed by VP8 video on the same PeerConnections. Video pause,+stop and replacement preserve voice; an actual edge interruption lets the same+controller select an available alternate relay. Publication identity survives+that change, while a replacement source gets a fresh identity. Stopping video+during candidate preparation also re-evaluates readiness for remaining voice+demand, rather than waiting for another connection event. Room retirement closes+the actual connections as well as clearing their plan.+After signaling loss and physical connection failure coincide, reauthentication+reconciles the transport's existing failure fact with the controller's current+session guard. This repairs an experiment caller omission; production Viewer+reconciliation already has the corresponding behavior. No second retry owner+or timer is needed.++This experiment excludes nodes without listening permission from voice paths,+including an unjoined Host. It reports the affected listeners unavailable,+preserves video, and restores voice on the same connections after approval.+The Browser follow-up uses independently decoded 330/660 Hz voice, VP8 video and+separate 880 Hz source audio on the same connections, with either a Browser or+an independent Pion process as the intermediate participant. Local mute,+listening revocation/reapproval and relay departure during video preserve the+publication boundaries; the existing controller commits replacement routes only+after that candidate's decoded-frame evidence. Stopping sharing retires video+and source audio while voice continues. Receive bindings include connection and+publication identity so a candidate cannot replace committed transit media.+The Pion worker receives only authorized plans and SDP through private inherited+pipes; it holds neither room credentials nor another route controller.++The existing downstream-copy cap remains a connection bound, not a guarantee+of balanced multi-track bandwidth. These synthetic loopback results establish+Browser/Pion decoding and forwarding, not production App control integration,+public-network reachability, physical echo cancellation or 21-person capacity.+Production decoded-frame admission remains unchanged.++The current separate-forwarder experiment remains a useful control. It+uses the same Opus forwarder in a separate local process. Private inherited pipes+carry already-authenticated commands; the room service remains the identity+authority. This establishes a replaceable media owner, not an implemented public+App-to-Site control path or a new accepted product route. The controlled trial+keeps `Host -> A -> B` video decoding while B's direct voice ICE is denied;+lifting that denial and explicitly rejoining restores voice. A connected video+route therefore cannot be displayed as proof of an available voice endpoint.++Voice integration also needs one Host microphone publication, rather than both+commentary and room voice carrying the same capture. System-audio capture can+recapture received voices even with headphones; reuse supported audio exclusion+and validate simultaneous capture/playback before making an echo-free claim.+In the synthetic sharing trial, moving the Host microphone out of commentary+removed its frequency from source audio. Deliberately feeding received voice+into loopback put it back into that source; excluding that input removed it.+These are routing observations, not physical-device echo-cancellation acceptance.## Detached Interaction Window@@ -553,9 +675,10 @@ that API alone does not establish a portable-App backend or independent slotsaccepted by desktop games. Linux can create devices through its existing[uinput module](https://docs.kernel.org/input/uinput.html), subject to devicepermissions. Dependencies therefore follow the platform and supported games.-Per-player virtual keyboards, mice and gamepads remain deferred; keep-that future integration at the platform input boundary without prebuilding a-device registry, driver installer or alternate transport.+Per-player virtual keyboards and mice do not make an arbitrary game recognize+independent players. Steam's [direct-input interface](https://partner.steamgames.com/doc/api/isteamremoteplay#BEnableRemotePlayTogetherDirectInput)+can expose separate input events to an integrated game; it is not a general+desktop-game backend. Independent gamepads are the more useful next assessment.[Moonlight's input implementation](https://github.com/moonlight-stream/moonlight-common-c/blob/aeba988e0a302145eff2e70fa3e11cd98ec01f5d/src/InputStream.c)accumulates relative movement and sends the latest absolute pointer position;@@ -566,12 +689,34 @@ patterns for bounded queues and grant retirement. Their GameStream transportis not a Browser WebRTC input component; both implementations remain study-onlyunder the project's license policy.-Virtual gamepads are a separate platform cost. [Sunshine's input configuration](https://docs.lizardbyte.dev/projects/sunshine/master/md_docs_2configuration.html#gamepad_driver)-documents Windows/macOS driver or broker dependencies; its Windows ViGEmBus-fallback is end-of-life. Independent gamepads were deferred by the owner on-2026-10-17; there is no driver integration in this phase. A future gamepad-prototype needs an accepted backend and supported-game checks. This does not-require multiple screen publishers or a replacement media transport.+The owner authorized an optional virtual-gamepad backend prototype on+2026-10-19, with dependencies supplied by the Host. Installing or bundling a+kernel driver is not part of that authorization; product integration remains+undecided. [Parsec documents a virtual USB driver](https://support.parsec.app/hc/en-us/articles/32381705301908-Setup-Gamepad),+not a driver-free Host. [ViGEmBus is end-of-life](https://docs.nefarius.at/projects/ViGEm/End-of-Life/).+The current [libvirtualhid platform matrix](https://github.com/LizardByte/libvirtualhid/blob/dfff3ea8c34022c915799740806c17c0ed5c2492/docs/platform-support.md)+offers a common API, but Windows/macOS require installed licensed components;+Linux uses kernel input facilities and device permissions. Its library is MIT,+while drivers/brokers have a [separate source-available license](https://github.com/LizardByte/libvirtualhid/blob/dfff3ea8c34022c915799740806c17c0ed5c2492/LICENSE.md).+It is a candidate to evaluate, not an accepted free portable dependency.+The local experiment can use an explicitly supplied ViGEmClient user-mode SDK+with an already-installed ViGEmBus. This is a legacy compatibility backend,+not a recommendation to install an end-of-life driver. Browser reports through+the existing encrypted input route reach two temporary devices with independent+XInput state; each can be neutralized and removed without changing the other.+Logical slots and SDK handles identify ownership;+an early SDK user-index value does not establish the game's player number.++The proposed path is Browser Gamepad API (or a later keyboard/touch mapping) ->+existing encrypted input route -> Host-approved player slot -> platform gamepad+backend. The Host assigns device identity; a guest cannot select another player's+slot. Reuse input-grant retirement to neutralize buttons/axes and dispose owned+devices. Keep current keyboard/mouse input unchanged. Batch analog samples without+discarding button transitions, as the cited Moonlight input implementation does.+No new media route, port or multiple screen publisher is required. Slot capacity+follows the backend and game, including physical controllers already in use;+it is not the room capacity. A prototype still needs real-game recognition,+concurrent-player and disconnect acceptance before claiming four-player support.### Window Capture And Game Inputdiff --git a/docs/standards/configuration.md b/docs/standards/configuration.mdindex 95aaeecf..753af3fd 100644--- a/docs/standards/configuration.md+++ b/docs/standards/configuration.md@@ -181,7 +181,7 @@ Diagnostics are local and opt-in. Enable them **before** reproducing the problem| Surface | Enable | Export || --- | --- | --- || App | Enable **Debug launch** with the small chip icon after the theme control in the mode selector, or start with `--debug` / `PIIK_DEBUG=client` | Press `D` in the terminal for a ZIP |-| Browser Host/Viewer | Click the **Debug** chip icon after the theme control and confirm the reload, or add `?debug=1` before any invitation fragment | The same control becomes a download arrow for the web report |+| Browser Host/Viewer | Open **Help → Debug** after the theme control and confirm the reload, or add `?debug=1` before any invitation fragment | **Help → Web report** downloads the browser report || Hosted Server | Start with `--debug`, `PIIK_DEBUG=server` or `PIIK_DEBUG=route` | On Unix, `kill -USR1 <pid>`; also exported at orderly shutdown |App **Debug launch** starts App collection immediately, including while waitingdiff --git a/docs/standards/media-quality.md b/docs/standards/media-quality.mdindex c7277344..03de67b7 100644--- a/docs/standards/media-quality.md+++ b/docs/standards/media-quality.md@@ -250,8 +250,10 @@ deadline still bounds warmup and hardware input/output waits. A candidate whosemeasured delivery falls outside that allowance is rejected and the next candidateis tried within the four-second budget. A measured frame deficit beyond thatallowance ends the probe immediately: remaining frames cannot change its result.-The probe retires before the live encoder is prepared and proved, so selection-requires only one hardware session at a time.+Do not start another candidate unless the remaining budget can cover its+measurement. A successful probe hands the same hardware encoder to live output;+only its synthetic adaptation history is retired, so selection needs one hardware+session and does not repeat unproven activation.Without a sustaining candidate, Auto starts the ordinary VP8 path directly, as manual VP8 does. Afaster software encode never replaces a sustaining H264 encoder. Encoder readinessuses Media Foundation events rather than timer-based polling.diff --git a/docs/standards/public-introduction.md b/docs/standards/public-introduction.mdindex ae7a8464..40fbdd76 100644--- a/docs/standards/public-introduction.md+++ b/docs/standards/public-introduction.md@@ -73,10 +73,12 @@ and link its complete guide. The existing-site guide links there for visitorswho want to run their own site. Explain what App and site each provide; optional SFUfallback requires the site to enable it and is not a connectivity guarantee.Keep architecture choices beside each platform's download buttons, with one-centered link for more downloads below the cards. Tutorials remain in their own+centered repository link below the cards. Tutorials remain in their ownsections. Keep section navigation available on phones rather than hiding theonly route to documentation.-The film can use bolder composition, but must show real operations and concrete+The release film must work without seeing an earlier film: establish screen+sharing and how a friend joins before introducing new ways to interact.+It can use bolder composition, but must show real operations and concretebenefits before its closing action. The [copy guide](./naming.md#voice-and-terminology)owns technical disclosure; a dramatic heading does not exempt copy from it.@@ -166,8 +168,11 @@ are not automatically included in the website artifact.The [website operations guide](../operations/website.md) owns Pages publication,public destinations and the separate P2P-only demo. The primary action leadsto the platform download section. The website operations guide owns each-platform's latest download routes and provider labels. Link release notes-separately and verify destinations as part of publication.+platform's latest download routes and provider labels. The download entry may+show the current Release's [editorial headline](./versioning.md#release-notes),+read from the same metadata request as its version and date. Keep the full+release-note link and verify destinations as part of publication. Without that+metadata, the ordinary download links remain usable.Online, App and self-hosting walkthroughsuse real action names and explain the first sharing and viewing steps. Keepplatform requirements and connection limitations beside the relevant steps.diff --git a/docs/standards/versioning.md b/docs/standards/versioning.mdindex caa9af36..b8c85826 100644--- a/docs/standards/versioning.md+++ b/docs/standards/versioning.md@@ -26,7 +26,7 @@ authorization counters for visual consistency can invalidate data or stale-workfences. A room number is a user-facing address, not a software version.The private tooling-only npm package carries no independent product version.The App launcher displays its installed version from the existing launcher state;-the Web footer displays its bundled build version without a network lookup.+the Web help menu displays its bundled build version without a network lookup.Server startup logs retain the running version and revision. The website maydisplay GitHub's latest stable tag and `published_at` as optional metadata, nevera manually maintained version or the installed App's identity. Publication time@@ -240,7 +240,7 @@ apply. Preserve the original image and packages for retries.## Release NotesGitHub Releases owns the published changelog. Each product-changing PR supplies reviewed-Chinese and English user-facing copy under the exact `## Release notes` heading+English and Chinese user-facing copy under the exact `## Release notes` headingin its squash commit; `###` headings structure that copy. Explain benefits,fixes and required upgrade actions, including breaking changes. Keep internalwork logs, audit handoffs and unverified claims outside this public section.@@ -270,27 +270,49 @@ remain unchanged. An exact tag does not movethe changelog's starting point. Keep no `CHANGELOG.md`, versioned note directoryor generated history commits. PRs and Git retain editorial provenance.-Release notes introduce the release before listing changes. In each language,-open with one or two sentences explaining its actual emphasis and who benefits:-a maintenance update, a feature addition, or a compatibility-changing release.-Match that description to the user-visible impact; an internal refactor alone-does not justify calling a release breaking or major.+Keep the Release title `Piik vX.Y.Z`. The body may open with one short bilingual+editorial headline. Its lifetime is independent of semver: keep, replace or omit+it based on what is worth telling readers, not whether the version is a patch+or minor update. An already-published feature, a verified community milestone,+thanks or an occasional light aside can lead. Keep Piik's friendly tone without+forced jokes; never turn an old feature into a claim that it is new in this+update, advertise an unfinished prototype or trivialize a serious failure.++When used, write the headline as the first two bold paragraphs, English then+Chinese, with plain text inside `**...**`. The website reads this same pair from+the published Release body and displays the current language; it does not keep+another copy, interpret arbitrary Markdown or guess a headline from older+releases. Gitee retains the same body. Do not add a campaign registry or automatic+version-based inheritance; review any reused headline when preparing the PR.++Then introduce **this update** in each language with one or two factual sentences:+its actual changes, who benefits and any required upgrade action. A headline is+optional; that explanation is not. An internal refactor alone does not justify+calling a release breaking or major. Urgent security, data-loss or compatibility+instructions take precedence over a playful opening.Then group concrete changes under useful headings such as highlights, fixes,upgrade instructions or known limitations. Omit empty categories and routineimplementation/test inventories. A small fix may need only its introduction anda few bullets. Required upgrade steps or interruptions must be easy to find.-Chinese and English cover the same release facts with natural phrasing. Use-`###` for language sections and `####` for categories when both are needed.+English and Chinese cover the same release facts with natural phrasing, with+English first. Use `###` for language sections and `####` for categories when+both are needed.The approved final description must read as one release when several unpublished-commits are included. Preview the rendered aggregate; do not let repeated-introductions or raw commit titles become its narrative. The existing pipeline+commits are included. Preview the rendered aggregate with at most one bilingual+headline. The last included product PR owns that choice, including omission;+aggregation removes earlier headlines but retains all actual change details in+order. Do not let repeated introductions or raw commit titles become its narrative. The existing pipelinepreserves authored Markdown and appends identity/checksums; it does not infer aneditorial summary from a version number. Keep provenance and the full changeloglink after the user-facing explanation.Piik's release scope and upgrade instructions come from its own accepted changes.+Editorial references reviewed on 2026-10-19: [Discord's update](https://discord.com/blog/discord-update-september-25-2026)+combines a friendly voice with concrete changes; [VS Code's version notes](https://code.visualstudio.com/updates/v1_95)+keep feature highlights alongside subsequent patch fixes. These inform the+presentation, not Piik's version selection or feature claims.## Release Sourcesdiff --git a/docs/standards/visual-language.md b/docs/standards/visual-language.mdindex 8e8bdf2e..ea52befc 100644--- a/docs/standards/visual-language.md+++ b/docs/standards/visual-language.md@@ -64,6 +64,11 @@ do not move unrelated controls into that space to fill an empty state.Choose by the user's task, then reuse its interaction and visual primitive.A sliding selection track shows a discrete choice; a range slider adjusts anumber. Similar shapes do not make their responsibilities interchangeable.+The catalogue renders production controls with sample data, including their+meaningfully different variants and surfaces; dedicated playback and status+previews remain linked from it. Keep a new control family discoverable there+instead of leaving its only example in an ignored prototype. Platform-owned+permissions and window chrome are verified in the actual platform, not imitated.| Task | Control and existing owner || --- | --- |@@ -78,6 +83,26 @@ number. Similar shapes do not make their responsibilities interchangeable.Selection, expansion and pending operations describe different facts. Use theappropriate native/ARIA semantics even when controls share their styling.+Shared control geometry and motion live in `button.css`; `Btn` selects their+variants. Use the regular size for standalone actions, compact for page/room+toolbars, and dense for secondary panel/list actions. These are defaults, not a+requirement for identical silhouettes: round icon actions keep equal width and+height, captions may form pills, and embedded tools may use quiet rounded+rectangles. Preserve proportions when space is tight; do not compress one axis+of a circle. Header utilities share compact alignment and icon scale with the+language track. Low-frequency help stays unframed and quiet; it need not carry+the outline or shadow of direct settings. Narrow layouts shorten captions or+spacing before changing that hierarchy.+Keep App, language, theme and help together; narrow room headers place connection+status beside the brand above this utility group instead of wrapping each action.+`segmented-control.css` owns the sliding treatment for language, mode selection,+tabs and native radio groups. Consumers supply selection and layout; they must+not duplicate the selected colours or press animation. Language choices keep+circular selection marks; settings and source tabs expand to fit their content+and available space.+Theme colours remain owned by `palette.css`. Rich choices, keyboard keys and+responsive media tools keep their task-specific layout without creating another+button or selection palette.Button labels and drag handles are not selectable text, including on touchbrowsers. Keep message text and editors selectable. Held-input controls ownrelease on pointer-up, cancellation, lost capture and surface blur; a browser@@ -203,8 +228,8 @@ threshold or quality verdict.### Sharing And Playback-Shared buttons and chips use pill shapes and a quiet lower edge. Standalone-buttons, chips and option tiles lift 2 px on hover or keyboard focus, sink 2 px+Shared buttons and chips use pill shapes and a quiet lower edge.+Standalone buttons, chips and option tiles lift 2 px on hover or keyboard focus, sink 2 pxon press, and spring back over 260 ms on release. Selected and unselected statesuse the same motion; selection changes only their colour and outline.Inputs and option tiles share softer corners. Press feedback uses the shared@@ -413,6 +438,7 @@ type checking rather than silently render a warning triangle.| Repeat and disclosure / 重试与展开 | `refresh`, `chevron`, `arrowRight` | Repeat/refresh, expand/collapse, proceed/enter. Direction follows the control's action; no arrow alone establishes delivery. || Transfer and upgrade / 传输与更新 | `arrowUp`, `arrowDown` | Outbound/inbound or upload/download, qualified by the adjacent label. An explicit update label may use the upward arrow for upgrade; neither arrow is a connection-quality rating. || Diagnostics / 诊断 | `cpu` | Technical diagnostics in the labelled diagnostic control; in metrics the same processor identifies encoding work. The surrounding control or measured field states the scope. |+| Help / 帮助 | `help`, `book` | Open product help or read a guide, respectively; current build identity belongs with this low-frequency information, separate from media settings and App connection state. || Settings / 设置 | `sliders`, `mountain`, `balance`, `frames` | Settings, preserve image detail, balanced preference, preserve frame rate. The frame-rate preference uses the same frames as the measured value. || Progress and result / 进度与结果 | `loader`, `alert`, `check`, `x` | In progress, a problem, confirmation/positive result, cancellation/negative result. The status owner supplies severity; the shape alone cannot set it. || Theme / 主题 | `sun`, `moon` | Light/dark appearance in theme controls. A moon in an idle-room scene means rest, with the idle scene providing that context. |@@ -563,8 +589,9 @@ blue fill and white foreground in both themes; theme selection must not erasetheir identity. The active remote-input outline uses that same fixed blue;suspended input uses the muted state. Use the shared foreground/background pairsfor both themes.-Selected choices use the shared face and inset outline; sliding segments use-inverse ink/paper with the same accent outline. Subtle surface highlights+Selected choices, including sliding segments and language shortcuts, use the+shared `--control-selected` / `--control-selected-ink` pair and accent outline.+Unselected hover uses `--control-hover`. Subtle surface highlightsand shadows add depth without changing control geometry or press feedback.Gold upholstery, illustration and badge artwork retain their own palettes.@@ -574,7 +601,8 @@ shortcut keys form separate reading levels. Use terminal-theme blue for linksand actions, neutral rules, and the same success/wait/failure colour meanings.Preserve monochrome output and compact layouts without changing their behavior.-Use the semantic theme tokens in `src/client/styles.css`. The shared+Use the semantic theme tokens in `src/client/ui/palette.css`. Status colours+keep their meaning independently of control selection and focus. The shared`comic-presentation.ts` maps meanings to those tokens for tooltip outlines,carets, result panels and verdict marks. Do not choose independent hex coloursor animation rules inside an individual scene.@@ -585,7 +613,7 @@ or animation rules inside an individual scene.| Confirmed completion or delivered media | Green `--live` / `live` | Neutral before, green result; check or completed object || Still usable with a limitation, unavailable optional capability, or intentional media pause | Amber `--warn` / `warn` | Neutral before, amber result; limit, pause, lock or unavailable mark on the affected part || Confirmed failed or blocked action | Red `--danger` / `bad` | Neutral before, red result; cross, broken path or other explicit failure mark |-| Work in progress or awaiting an action/frame | Blue `--action` / `busy` | Neutral before, blue current/result panel; connection, progress or play symbol |+| Work in progress or awaiting an action/frame | Blue `--busy` / `busy` | Neutral before, blue current/result panel; connection, progress or play symbol |Recovery retains amber because service is interrupted while work continues.Waiting for a Host and unknown observations remain neutral. A control'sdiff --git a/docs/status.md b/docs/status.mdindex 103b5002..9ce3ff1d 100644--- a/docs/status.md+++ b/docs/status.md@@ -1,6 +1,6 @@# Current Status-Last updated: 2026-10-19+Last updated: 2026-10-20This is the compact execution/deployment index. Product modules own behavior,[verification status](./verification-status.md) owns unresolved physical limits,@@ -49,21 +49,28 @@ also accepts an optional SFU-only policy through the same route controller.Windows native capture and thumbnails now share automatic HDR-to-SDR conversion;synthetic GPU and Browser reception checks pass, with physical HDR displayacceptance still pending in [verification status](./verification-status.md).-Room voice is outside the product plan; Host microphone commentary remains.+Room voice is outside this published phase; Host microphone commentary remains.These features are published; physical device limits remain open.Release artifacts and operator deployment records own delivery completion;[TODO](./todo.md#now) owns remaining work.## Current Work-The published v2.2.0 includes attended keyboard/mouse control, Viewer playback-settings and the interaction window. Current maintenance retains the existing-2.x protocol and route owners and audits the repository alongside scoped media,-interaction and lifecycle repairs. On 2026-10-19 the owner authorized publishing-v2.2.1 once this audit and acceptance are complete. The promotional film remains-a local draft pending review. [TODO](./todo.md) owns upstream follow-up, device-acceptance and deferred work. Release artifacts and operator records own delivery-results.+The current 2.x release line retains attended keyboard/mouse control, Viewer+playback settings and the interaction window, with the maintenance media and lifecycle+repairs. The accepted maintenance phase preserves the published protocols and+route owners; release artifacts and operator records establish publication and+postflight completion. Current implementation work turns to room-owned routing+and voice in the isolated prototype, while device/reporter follow-up remains in+the TODO ledger. The promotional film remains an online-review draft; export+follows owner acceptance.+Separate local prototypes assess room voice and shared-keyboard/virtual-gamepad+co-play. A room-owned tree experiment now reuses the existing route controller+for bidirectional voice and video on shared Pion connections. Local media-owner+experiments do not establish public App-hosted voice;+neither prototype changes the published feature or protocol boundary.+[TODO](./todo.md) owns upstream follow-up, device acceptance and deferred work;+release artifacts and operator records own exact delivery results.2.0 separates numeric media requests from presets and bounded runtime admission,retains successfully applied quality settings, and lets App serve an approveddiff --git a/docs/todo.md b/docs/todo.mdindex 79af1b34..c3829455 100644--- a/docs/todo.md+++ b/docs/todo.md@@ -1,6 +1,6 @@# Current TODO Ledger-Last reviewed: 2026-10-19+Last reviewed: 2026-10-20Explicit owner holds remain in force; an investigation does not itselfaccept a new feature or architecture. A missing device or reporter trace blocks@@ -14,14 +14,6 @@ Release artifacts and operator records own exact delivery; remaining productwork is listed below. Broader device coverage does not override the owner'splatform deferrals or establish a diagnosis for unmatched reports.-- [ ] **macOS bundle startup acceptance (#479).** The package now contains the- actual Mach-O entry and helpers inside `.app`, replacing the shell launcher's- dependency on an external sibling executable. A moved-bundle assembly check- passes, and release CI has built and packaged both Mac architectures.- Verify Finder launch on macOS, including a downloaded/quarantined bundle and- capture permissions. The packaging defect- is established; its correction has not yet been matched to the reporter's Mac.-- [ ] **Return LiveKit to an upstream pin.** Native publication now suppliesunmet encoder demand to the existing allocator through the scoped dependencyrevision submitted in [upstream #5016](https://github.com/livekit/livekit/pull/5016).@@ -30,40 +22,20 @@ platform deferrals or establish a diagnosis for unmatched reports.own that boundary; this local repair does not diagnose the unmatched fieldreports below.-- [ ] **Early repaired-media startup.** Release postflight reproduced an SFU- publication failure before the subscriber offer. A deterministic Pion trial- established that repair can queue before primary RID admission, retaining a- zero SSRC. The shared RTP reader now restores the admitted primary identity;- focused forwarding and Browser SFU lifecycle checks pass. Complete this repository- audit and acceptance, publish v2.2.1, and repeat the affected deployment check. The- production logs match this failure boundary but do not identify the packet fields.--- [ ] **SFU recovery rollout.** Shared forwarding now gives DownTrack one- owner for video sender reports and RR/RTT accounting, with Pion scheduling.- Matched SFU logs established clock contamination blocking layer changes and- missing RTT updates. RTCP, constrained recovery and the current App/Server- lifecycle checks pass locally. After the approved release, verify the affected- deployment with both corrected App and Server; an ICE restart does not replace- the affected upstream clock. This does not diagnose every unmatched- sustained-quality report below.--- [ ] **New promotional film.** Review the local 54-second Chinese/English- motion draft, which introduces screen sharing, invitation, interaction and- single-controller keyboard/mouse use with explicit Host consent. Confirm the- pacing and soundtrack before replacing the existing online film. The current- draft uses product components and staged scenes, not a recorded live session.+- [ ] **New promotional film.** Refine the accepted short proof's art direction+ into a standalone Chinese/English introduction that assumes no earlier film.+ Functional and mechanism work takes priority. Keep the draft in the online+ review player; export video only after the owner accepts that preview.+ Keep sharing, invitation, Host consent+ and playing together causally connected, using product components with staged+ content for actual operations. The local 36-second cut now carries this story,+ including a real reaction picker and a friend's tomato throw;+ refine the two-player party-game vignette, motion, reading time and soundtrack+ before replacing the online film. Depict the published local-Host plus one+ remote-friend keyboard flow; experimental multi-controller features are not claims.## Held By Owner-- [ ] **Theme-role consistency.** Deferred to the next minor update by- the owner on 2026-10-19. Keep this release's accepted palette. Sliding- segments should reuse the theme's selected-control colour pair rather than- inverse text/paper colours; review related App, Web and website choices at- their shared owners. Define primary, secondary, selection and status roles- once; preserve primary-action and semantic-status identities. Bridge the- same-origin website/docs appearance preference through their existing theme- adapters rather than keeping independent explicit choices.-- [ ] **Remote-control latency and responsiveness.** Scheduled after this release.Compare input-to-visible-response timing on the same endpoints, source andnetwork against a mature remote-control implementation. Separate input@@ -80,11 +52,6 @@ platform deferrals or establish a diagnosis for unmatched reports.- [ ] **Multiple remote-control screens.** Deferred by the owner on 2026-10-17.Keep one shared source and the existing Host source picker; Viewer-initiatedscreen switching and simultaneous multi-screen streams are later work.-- [ ] **Independent virtual input devices for remote co-play.** Deferred by the owner on- 2026-10-17. This phase uses keyboard/mouse only and adds no virtual gamepad- driver. Per-player virtual keyboards, mice and gamepads are later work.- The [input assessment](./research/room-interactions.md#remote-co-play) owns- platform dependencies and the distinction from shared keyboard/mouse control.- [ ] **32-bit Windows/Linux Apps.** Deferred by the owner on 2026-10-02;no package or website option is planned. Browser use remains available wherethe OS/browser supports the required media APIs. Retain the isolated@@ -103,6 +70,21 @@ These physical checks or reporter diagnoses remain unverified. A local repair orsuccessful test is not proof of a reporter's cause; research owns the completedexperiments and their limits.+- [ ] **macOS bundle startup acceptance (#479).** Verify Finder launch,+ quarantine and capture permissions on a physical Mac. The Mach-O entry and+ helpers are inside `.app`; moved-bundle assembly and both architecture builds+ pass. The corrected packaging has not yet been matched to the reporter's Mac.++- [ ] **macOS sharing with source audio (#486).** Verify actual screen/window+ audio plus microphone startup. Both Darwin architectures compile and pass the+ audio self-test in candidate CI.+ The local repair confirms audio readiness when platform startup succeeds,+ rather than waiting for samples. Go pipe controls preserve video with silent+ or unavailable audio. The reporter's full start-share timeout and separate+ window-filter crash remain unconfirmed; do not close the report on this partial+ correction. [Evidence](./research/native-client-media.md#macos-audio-startup)+ separates the confirmed readiness defect from the unresolved system failures.+- [ ] **Remote-control device acceptance.** Verify physical Android/iOScontrollers, mixed-DPI displays, commercial games and an actual remote-devicesession. macOS needs Finder/Accessibility, focus, Retina and input checks;@@ -161,8 +143,9 @@ experiments and their limits.[#453](https://github.com/TNTcraftHIM/Piik/issues/453) need paired transport traces;the v1.6.3 timeout also needs share-start/SDP evidence.[#471](https://github.com/TNTcraftHIM/Piik/issues/471) reports working STUN and- a router mapping on v2.1.0, but no ICE check responses. Obtain the retained- paired reports; that summary alone does not distinguish NAT filtering,+ a router mapping on v2.1.0, but no ICE check responses. Its single STUN URL+ enables ordinary discovery, not the three-destination prediction survey.+ Obtain the retained paired reports; that summary alone does not distinguish NAT filtering,upstream mapping or a blocked path.[#468](https://github.com/TNTcraftHIM/Piik/issues/468) needs the complete join/reauthentication trace on repaired connection-opportunity accounting.@@ -191,7 +174,11 @@ experiments and their limits.permissions, control capacity, enumeration and startup. The v1.6.5 Auto-to-VP8report needs the Browser exception/assets and actual output; its early`stop-share` is not proof of a no-frame timeout. [#419](https://github.com/TNTcraftHIM/Piik/issues/419)- and [#437](https://github.com/TNTcraftHIM/Piik/issues/437) need matched App reports.+ still needs a matched App report. The v2.2.1 log in+ [#437](https://github.com/TNTcraftHIM/Piik/issues/437) exposed Auto admitting a+ hardware probe with insufficient measurement time. Its local correction+ preserves the existing VP8 fallback; retest on the affected device. The+ underlying `DEVICE_HUNG` and subsequent blocked API remain unconfirmed.For `input-texture-create / 0x887a0005`, obtain subsequent candidates and thefinal result; [native media research](./research/native-client-media.md#current-boundary)owns hardware evidence and limits.@@ -209,8 +196,65 @@ experiments and their limits.relevant Go runtime using the [GC attribution boundary](./research/realtime-quality-adaptation.md#go-gc-attribution);no field report currently establishes GC as its cause.+## Local Interaction Prototypes++- [ ] **Optional room voice (#484).** Continue the isolated self-hosted voice+ and room-owned tree experiments. Keep production,+ public invitations and the public Demo unchanged; do not recreate the previous+ P2P voice mesh. The Host approves voice admission+ and speaking, and can mute or revoke participants; each listener can also mute+ another participant locally. Voice remains separate from shared-source audio.+ The isolated prototype carries actual multi-publisher audio with server-enforced+ consent and retirement. Synthetic voice/sharing coexistence and a separate local+ media process are exercised; review the experience before product integration.+ Physical microphones and external networks remain unverified.+ Reuse the existing room authority and mature media transport; keep voice+ publications outside the screen-capture lifetime.+ Assess an App-hosted instance of the same voice forwarder separately, including+ Viewers reachable only through a video relay and voice without an active share.+ The room-tree experiment reuses the unmodified controller for Browser/Pion+ voice, video and separate source audio, including decoded playback, relay+ departure and independent publication retirement. Its authenticated Browser+ control now handles negotiation and first-frame commit without a test runner+ routing SDP or declaring media ready. Unauthorized voice relays+ make that path unavailable without disturbing video; approval restores it on+ the same connections. Before integration, complete production App authorization+ and control, multi-track upload budgeting, physical audio and external-network+ acceptance under those owners.+ The [transport assessment](./research/room-interactions.md#room-voice-transport-assessment)+ separates this local evidence from a production P2P voice path.+ [Issue #484](https://github.com/TNTcraftHIM/Piik/issues/484)+ describes the use case; the published product contract is unchanged.++- [ ] **Shared-keyboard remote co-play.** Prototype several consented Viewers+ using the existing input channel and media route. Keep one Host source and+ one grant/retirement owner, track held keys per participant, and release a key+ only after its last holder lets go. Give the shared pointer one explicit owner.+ The local Host-plus-two-Viewer trial covers actual decoded video and encrypted+ input, individual revoke/disconnect, source replacement and stop/rejoin. Review+ the prototype before product integration; its recording sink does not establish+ desktop injection, physical Host key overlap or game compatibility.+ Multiple screens remain deferred. This experiment+ does not accept a new published grant model or claim universal game support.++- [ ] **Optional virtual gamepads for remote co-play.** The owner authorized an+ isolated input-backend experiment on 2026-10-19. Let the Host supply the+ optional dependency; do not install or bundle a kernel driver. Reuse the+ encrypted input route and grant owner, with Host-assigned independent devices+ and neutralization/removal on retirement. Evaluate maintained backends,+ licensing, privileges and real-game recognition before product integration.+ The [input assessment](./research/room-interactions.md#remote-co-play) owns+ platform dependencies and the distinction from shared keyboard/mouse control.+## Next: P2P Connection And Feedback Evidence+- [ ] **External forwarding and participant relays.** Complete Browser and+ external-network acceptance for existing friend relays. Before adopting frp+ for a deployment, compare loss/recovery and performance on that network; the+ local SFU media/feedback and STUN controls establish feasibility and the address+ limitation, not public-network performance. Keep the [forwarding assessment](./research/nat-traversal.md#external-forwarding-and-participant-relays)+ as the evidence owner; no second graph or App-hosted SFU is integrated.+- [ ] **Coordinated Native retry acceptance.**Compare the same difficult-network peers with enhancement enabled/disabled,including mixed stable/sequential observations in both directions and decoded@@ -273,3 +317,9 @@ remains; do not add another retry/transport owner to bypass these limits.picture per Viewer and shared endpoint upload limits. Define publication andsubscription lifecycles before a prototype. The current one-Host contractremains; names and UI follow the model decision.+12. **Windows x64 Server packaging (#485).** Review the contributor's package+ extension separately from the maintenance release, including descriptors,+ container filtering, mirror inventory and Windows runtime acceptance.+ Remove the unrelated history-check fallback before integration; an absent+ push base is not a Windows packaging requirement. Existing Linux Server+ packages and Windows App support are unchanged.diff --git a/go.mod b/go.modindex 53f1c2b9..ad6e2ed3 100644--- a/go.mod+++ b/go.mod@@ -21,7 +21,7 @@ require (github.com/livekit/protocol v1.52.2-0.20261012065025-9bb708cdb819github.com/livekit/server-sdk-go/v2 v2.14.0github.com/netbirdio/go-nat v0.0.0-20260821095157-6b2c8c5c74e8- github.com/pion/ice/v4 v4.4.7+ github.com/pion/ice/v4 v4.4.8github.com/pion/interceptor v0.1.49github.com/pion/logging v0.2.4github.com/pion/rtcp v1.2.19diff --git a/go.sum b/go.sumindex 14083105..fbe93f98 100644--- a/go.sum+++ b/go.sum@@ -280,6 +280,8 @@ github.com/pion/dtls/v3 v3.1.13 h1:oWNjsoF3xUPDhzOuE8U42ql1BtVzWc8X4Asiz9BKwYk=github.com/pion/dtls/v3 v3.1.13/go.mod h1:iKFQNYrjsN2TiA2YKKMqB9MOZaFpjFULBI/A4sW0eyc=github.com/pion/ice/v4 v4.4.7 h1:JiI6VId3XnIztxKE8RjTC0SeXrp7ppkAO0jGez3/sIE=github.com/pion/ice/v4 v4.4.7/go.mod h1:zCRRg4Mkpdbx9B+75fd4z2APvIXeIraeUOB7IMPt8mU=+github.com/pion/ice/v4 v4.4.8 h1:NB22Ze5WrgMjcf9L+O+1B29bl6anq+sbyvddImDLdhc=+github.com/pion/ice/v4 v4.4.8/go.mod h1:zCRRg4Mkpdbx9B+75fd4z2APvIXeIraeUOB7IMPt8mU=github.com/pion/interceptor v0.1.49 h1:iyBsNHRoLNNXZiJA/DdGvJgdyfS8YWDCzxIAlVjt5nY=github.com/pion/interceptor v0.1.49/go.mod h1:MZ6PJkja/TCo350HAnBrs/rUIyad9mWjpcvytrf3ViQ=github.com/pion/logging v0.2.4 h1:tTew+7cmQ+Mc1pTBLKH2puKsOvhm32dROumOZ655zB8=diff --git a/internal/app/app_test.go b/internal/app/app_test.goindex d715b19e..63dcbdae 100644--- a/internal/app/app_test.go+++ b/internal/app/app_test.go@@ -782,8 +782,8 @@ func TestLocalServerOwnsItsSTUNConfiguration(t *testing.T) {},{name: "custom survey", link: true,- override: "stun:a.test:3478, stun:b.test:3478, stun:c.test:3478",- stunURLs: []string{"stun:a.test:3478", "stun:b.test:3478", "stun:c.test:3478"},+ override: "stun:a.test:19302, stun:b.test:3478, stun:c.test:3478, stun:fallback.test:3478",+ stunURLs: []string{"stun:a.test:19302", "stun:b.test:3478", "stun:c.test:3478", "stun:fallback.test:3478"},natPredictionSTUNURLs: []string{"stun:b.test:3478", "stun:c.test:3478"},},} {diff --git a/internal/app/nativehost/audio_test.go b/internal/app/nativehost/audio_test.goindex a51ed096..13b7a0b6 100644--- a/internal/app/nativehost/audio_test.go+++ b/internal/app/nativehost/audio_test.go@@ -67,6 +67,10 @@ func runAudioRecoveryCapture() {_ = os.WriteFile(marker, []byte(os.Args[3]+":"+os.Args[4]), 0600)}}+ if audio && os.Getenv("PIIK_AUDIO_STARTUP") == "no-ready" {+ <-stopped+ return+ }period := time.Second / 30status := []byte(`{"state":"active","audio":true}`)if audio {@@ -78,6 +82,10 @@ func runAudioRecoveryCapture() {Width: 1280, Height: 720, FPS: 30, Outputs: outputs})}write(nativecapture.Frame{Kind: nativecapture.FrameStatus, Data: status})+ if audio && os.Getenv("PIIK_AUDIO_STARTUP") == "silent" {+ <-stopped+ return+ }ticker := time.NewTicker(period)defer ticker.Stop()for pts := period; ; pts += period {@@ -99,6 +107,42 @@ func runAudioRecoveryCapture() {}}+func TestAudioStartupDoesNotRequireSamplesOrStopVideo(t *testing.T) {+ t.Setenv("PIIK_NATIVEHOST_PIPE_FIXTURE", "audio-recovery")+ executable, err := os.Executable()+ if err != nil {+ t.Fatal(err)+ }+ for _, mode := range []string{"silent", "no-ready"} {+ t.Run(mode, func(t *testing.T) {+ t.Setenv("PIIK_AUDIO_STARTUP", mode)+ ctx, cancel := context.WithTimeout(t.Context(), 10*time.Second)+ defer cancel()+ video := nativecapture.VideoOptions{Codec: "vp8", Profile: audioRecoveryProfile(),+ Target: nativecapture.CaptureTarget{Kind: "display", SourceID: "1", Title: "Silent fixture"}}+ session, err := Start(ctx, Options{ShareID: "audio-startup", CaptureProcess: executable,+ Video: video, Profile: QualityProfile{Video: video.Profile, AudioBitrate: 64_000},+ AudioEnabled: true, EdgeCapacity: 1, BindAddress: "127.0.0.1:0"})+ if err != nil {+ t.Fatal(err)+ }+ defer session.Close()+ if session.Codec() != "vp8" || session.HasAudio() != (mode == "silent") {+ t.Fatalf("codec=%s audio=%v for %s", session.Codec(), session.HasAudio(), mode)+ }+ cancel()+ select {+ case err := <-session.Done():+ if err != nil {+ t.Fatal(err)+ }+ case <-time.After(3 * time.Second):+ t.Fatal("Stop did not release the silent audio and video readers")+ }+ })+ }+}+func TestAudioEOFWaitsForExplicitSourceReplacement(t *testing.T) {t.Setenv("PIIK_NATIVEHOST_PIPE_FIXTURE", "audio-recovery")check := func(err error) {diff --git a/internal/media/forwarding/publication_test.go b/internal/media/forwarding/publication_test.goindex b388c155..ef0ae072 100644--- a/internal/media/forwarding/publication_test.go+++ b/internal/media/forwarding/publication_test.go@@ -488,11 +488,13 @@ func TestPublicationSimulcastReuseAudioDemandAndClose(t *testing.T) {}}publication.bandwidth.OnCongestionStateChange(bwe.CongestionStateNone, bwe.CongestionStateCongested, 1_000)- for publication.tracks[0].BandwidthRequested()+publication.tracks[1].BandwidthRequested() > 1_000 {+ // Empty allocations also request zero while the allocator's event is queued.+ // Wait for the committed deficit as well as its shared capacity bound.+ for publication.tracks[0].BandwidthRequested()+publication.tracks[1].BandwidthRequested() > 1_000 || !publication.Counters().Limited {select {case <-time.After(5 * time.Millisecond):case <-ctx.Done():- t.Fatal("simulcast allocations exceeded their shared video capacity")+ t.Fatal("simulcast allocation did not commit its shared capacity limit")}}if publication.LowestLayerBudget() != 1_000 {diff --git a/native/capture/darwin/README.md b/native/capture/darwin/README.mdindex a72a03dc..83b6af5b 100644--- a/native/capture/darwin/README.md+++ b/native/capture/darwin/README.md@@ -15,6 +15,7 @@ machine's architecture:```shsh native/capture/darwin/build.sh /outside/repository/build/outside/repository/build/piik-capture --geometry-self-test+/outside/repository/build/piik-capture --audio-self-test/outside/repository/build/piik-capture --self-test/outside/repository/build/piik-capture --probe```@@ -26,7 +27,9 @@ before sending encoded input to the helper; CoreMedia can normalize SPS croppingin its format description. `--self-test`encodes successive landscape, portrait, ultrawide and small 420v buffers throughone output worker, requiring the fitted dimensions and a constrained-baseline-SPS/PPS/IDR after each size change. Neither needs Screen Recording permission.+SPS/PPS/IDR after each size change. `--audio-self-test` checks silent startup,+ready-before-PCM ordering and stopped input without using an audio device.+These checks need no Screen Recording permission.Real source selection, window resizing, display-scale changes and recovery stillrequire a physical macOS gate.diff --git a/native/capture/darwin/main.swift b/native/capture/darwin/main.swiftindex 9e2fdc18..747a37f0 100644--- a/native/capture/darwin/main.swift+++ b/native/capture/darwin/main.swift@@ -1227,6 +1227,14 @@ private final class AudioCaptureOutput: NSObject, SCStreamOutput, SCStreamDelegapending.reserveCapacity(960 * 2 * MemoryLayout<Int16>.size * 2)}+ // The platform confirms startup; silence is not a failed capture. Call on+ // the sample queue so the ready status always precedes admitted PCM.+ func start() throws {+ guard !done.isStopped else { return }+ try writer.writeStatus(AudioStatus())+ active = true+ }+private func append(_ sample: Float32) {let clipped = max(-1, min(1, sample))var value = Int16((clipped * Float32(Int16.max)).rounded()).littleEndian@@ -1361,7 +1369,7 @@ private final class AudioCaptureOutput: NSObject, SCStreamOutput, SCStreamDelega// Microphone conversion and ScreenCaptureKit audio use the same PCM framing.func appendPCM(_ buffer: AVAudioPCMBuffer) throws {- guard !done.isStopped, let samples = buffer.int16ChannelData else { return }+ guard active, !done.isStopped, let samples = buffer.int16ChannelData else { return }pending.append(UnsafeRawPointer(samples[0]).assumingMemoryBound(to: UInt8.self),count: Int(buffer.frameLength) * 4)try flushFrames()@@ -1370,10 +1378,6 @@ private final class AudioCaptureOutput: NSObject, SCStreamOutput, SCStreamDelegaprivate func flushFrames() throws {let frameBytes = 960 * 2 * MemoryLayout<Int16>.sizewhile pending.count >= frameBytes {- if !active {- try writer.writeStatus(AudioStatus())- active = true- }let payload = pending.prefix(frameBytes)try writer.writePCM(Data(payload),@@ -1390,7 +1394,7 @@ private final class AudioCaptureOutput: NSObject, SCStreamOutput, SCStreamDelegadidOutputSampleBuffer sampleBuffer: CMSampleBuffer,of outputType: SCStreamOutputType) {- guard outputType == .audio, sampleBuffer.isValid else { return }+ guard active, !done.isStopped, outputType == .audio, sampleBuffer.isValid else { return }do {try append(sampleBuffer)try flushFrames()@@ -1404,6 +1408,41 @@ private final class AudioCaptureOutput: NSObject, SCStreamOutput, SCStreamDelega}}+private func audioSelfTest() throws {+ let collector = EnvelopeCollector()+ let done = StopSignal()+ let output = AudioCaptureOutput(writer: ProtocolWriter(output: { collector.append($0) }), done: done)+ guard let format = AVAudioFormat(commonFormat: .pcmFormatInt16, sampleRate: 48_000,+ channels: 2, interleaved: true),+ let buffer = AVAudioPCMBuffer(pcmFormat: format, frameCapacity: 960),+ let samples = buffer.int16ChannelData else {+ throw CaptureFailure(description: "audio self-test buffer is unavailable")+ }+ buffer.frameLength = 960+ memset(samples[0], 0, 960 * 4)+ try output.appendPCM(buffer)+ guard collector.snapshot().isEmpty else {+ throw CaptureFailure(description: "audio was admitted before startup succeeded")+ }+ try output.start()+ let started = collector.snapshot()+ guard started.count == 1, started[0][5] == 3,+ let status = try JSONSerialization.jsonObject(with: Data(started[0].dropFirst(32))) as? [String: Any],+ status["state"] as? String == "active", status["audio"] as? Bool == true else {+ throw CaptureFailure(description: "silent audio did not become ready")+ }+ try output.appendPCM(buffer)+ let frames = collector.snapshot()+ guard frames.count == 2, frames[1][5] == 1, frames[1].count == 32 + 960 * 4 else {+ throw CaptureFailure(description: "audio ready did not precede PCM exactly once")+ }+ done.signal()+ try output.appendPCM(buffer)+ guard collector.snapshot().count == 2 else {+ throw CaptureFailure(description: "stopped audio continued writing PCM")+ }+}+private final class CaptureOutput: NSObject, SCStreamOutput, SCStreamDelegate {private let encoders: EncoderGroupprivate let done: StopSignal@@ -2037,6 +2076,7 @@ private func captureMicrophone(deviceUID: String = "") throws {}tapped = truetry capture.start()+ try worker.sync { try output.start() }} catch { done.signal(error) }}}@@ -2095,6 +2135,7 @@ private func captureAudio(_ arguments: [String]) async throws {try await stream.startCapture()do {+ try queue.sync { try output.start() }try done.wait()} catch {try? await stream.stopCapture()@@ -2114,6 +2155,8 @@ private struct PiikCapture {try selfTest()} else if arguments.count == 2, arguments[1] == "--geometry-self-test" {try geometrySelfTest()+ } else if arguments.count == 2, arguments[1] == "--audio-self-test" {+ try audioSelfTest()} else if arguments.count == 2, arguments[1] == "--list" {try await listSources()} else if arguments.count == 2, arguments[1] == "--list-microphones" {diff --git a/native/capture/windows/main.cpp b/native/capture/windows/main.cppindex 2a49b017..3b0e6c35 100644--- a/native/capture/windows/main.cpp+++ b/native/capture/windows/main.cpp@@ -1235,20 +1235,58 @@ UINT32 CadenceLagFrames(UINT32 frame_rate) {return std::max<UINT32>(1, (frame_rate + 9) / 10);}-bool SustainsEncodedCadence(const AdaptiveEncoder::Factory& create, ID3D11Device* device,+struct CadenceTiming final {+ explicit CadenceTiming(const VideoProfile& profile)+ : warmup_frames((profile.frame_rate + 1) / 2),+ sample_frames(profile.frame_rate),+ interval(profile.frame_duration_100ns() * 100) {}++ std::chrono::nanoseconds MinimumDuration() const {+ // Each phase submits its first frame immediately; the measured phase+ // starts a fresh schedule after warmup.+ return interval * (warmup_frames + sample_frames - 2);+ }++ UINT32 warmup_frames;+ UINT32 sample_frames;+ std::chrono::nanoseconds interval;+};++// Only the probe borrows the hardware codec. Destroy its synthetic adaptation+// history before the same codec moves into the ordinary live output pipeline.+class ProbeEncoder final : public VideoEncoder {+ public:+ explicit ProbeEncoder(VideoEncoder& encoder)+ : VideoEncoder(encoder.kind, encoder.name, encoder.identity), encoder_(encoder) {}++ EncodedAccessUnit Encode(ID3D11Texture2D* texture, UINT64 timestamp, bool key,+ EncoderClock::time_point deadline) override {+ return encoder_.Encode(texture, timestamp, key, deadline);+ }+ void SetBitrate(UINT32 bitrate) override { encoder_.SetBitrate(bitrate); }++ private:+ VideoEncoder& encoder_;+};++bool SustainsEncodedCadence(VideoEncoder& hardware, ID3D11Device* device,const VideoProfile& profile, EncoderClock::time_point deadline) {RequireEncoderTime(deadline);- const UINT32 warmup_frames = (profile.frame_rate + 1) / 2;- const UINT32 sample_frames = profile.frame_rate;+ const auto [warmup_frames, sample_frames, interval] = CadenceTiming(profile);const UINT32 lag = CadenceLagFrames(profile.frame_rate);// Synthesis is CPU work of the probe, not the encoder; prepare it before pacing.std::array<ComPtr<ID3D11Texture2D>, 8> textures;for (UINT32 index = 0; index < textures.size(); ++index) {textures[index] = CreateSyntheticTexture(device, index * 7, profile);}- AdaptiveEncoder encoder(OutputKind::h264, profile, device, create);- const auto interval = std::chrono::nanoseconds(- static_cast<INT64>(profile.frame_duration_100ns()) * 100);+ AdaptiveEncoder encoder(OutputKind::h264, profile, device,+ [&](const VideoProfile& selected) -> std::unique_ptr<VideoEncoder> {+ if (selected.width != profile.width || selected.height != profile.height ||+ selected.frame_rate != profile.frame_rate)+ Fail("codec-probe-output", "encoder changed the probe profile");+ hardware.SetBitrate(selected.bit_rate);+ return std::make_unique<ProbeEncoder>(hardware);+ });auto start = EncoderClock::now();UINT32 delivered = 0;for (UINT32 frame = 0; frame < warmup_frames + sample_frames; ++frame) {@@ -1299,12 +1337,15 @@ void LogEncoderRejection(EncoderCandidate candidate, const GateFailure& error) {// keeps its selected device/encoder; source replacement owns any later change.template <typename Prepare>EncoderCandidate SelectEncoderCandidate(std::vector<EncoderCandidate> candidates,- EncoderCandidate preferred, EncoderClock::time_point deadline, Prepare prepare) {+ EncoderCandidate preferred, EncoderClock::time_point deadline, Prepare prepare,+ EncoderClock::duration minimum_time = EncoderClock::duration::zero()) {const auto first = std::find(candidates.begin(), candidates.end(), preferred);if (first != candidates.end()) std::rotate(candidates.begin(), first, first + 1);std::exception_ptr failure;for (const auto& candidate : candidates) {- RequireEncoderTime(deadline);+ // Do not enter synchronous device setup for a probe that cannot finish+ // its required measurement. Preserve the remaining startup time for VP8.+ RequireEncoderTime(deadline - minimum_time);try {prepare(candidate);RequireEncoderTime(deadline);@@ -1346,25 +1387,21 @@ VideoEncoderSelection SelectVideoEncoder(auto next_device = CreateDevice(adapter);try {const auto encoders = EnumerateHardwareEncoders(adapter);- // Retire the Auto probe before preparing the live encoder, so selection- // does not require two simultaneous hardware sessions on this device.+ auto selected = ActivateTransform(encoders, candidate.second, next_device.manager.Get());+ auto next = std::make_unique<LiveEncoder>(std::move(selected), arguments.profile);if (arguments.codec == "auto" && !SustainsEncodedCadence(- [&](const VideoProfile& profile) -> std::unique_ptr<VideoEncoder> {- auto activations = EnumerateHardwareEncoders(adapter);- return std::make_unique<LiveEncoder>(ActivateTransform(- activations, candidate.second, next_device.manager.Get()), profile);- },+ *next,next_device.device.Get(), arguments.profile, deadline)) {Fail("codec-probe-cadence", "hardware H264 did not sustain the target frame rate");}- RequireEncoderTime(deadline);- auto selected = ActivateTransform(encoders, candidate.second, next_device.manager.Get());- auto next = std::make_unique<LiveEncoder>(std::move(selected), arguments.profile);- // Enumeration and activation alone do not prove usable H264 output.- const auto texture = CreateSyntheticTexture(next_device.device.Get(), 0, arguments.profile);- next->Encode(texture.Get(), 0, true, deadline);+ if (arguments.codec == "h264") {+ // Explicit H264 validates output without Auto's cadence measurement.+ const auto texture = CreateSyntheticTexture(next_device.device.Get(), 0, arguments.profile);+ next->Encode(texture.Get(), 0, true, deadline);+ }RequireEncoderTime(deadline);device = std::move(next_device);+ // Keep the proven hardware instance; the probe's VSE is already gone.hardware = std::move(next);} catch (const GateFailure& error) {// Query before destroying this candidate's device: the failing API@@ -1376,7 +1413,8 @@ VideoEncoderSelection SelectVideoEncoder(<< std::setfill('0') << std::setw(8) << static_cast<UINT32>(reason);throw GateFailure(error.stage(), detail.str(), error.result());}- });+ }, arguments.codec == "auto" ? CadenceTiming(arguments.profile).MinimumDuration()+ : EncoderClock::duration::zero());arguments.adapter_index = chosen.first;arguments.mft_index = chosen.second;return {OutputKind::h264, std::move(hardware)};@@ -1459,7 +1497,6 @@ class OutputWorker final {const auto& input = work.input;if (codec_generation != work.generation) {encoder.reset();- initial.reset();converter.reset();codec_generation = work.generation;}@@ -1952,10 +1989,7 @@ void RunVideoCapture(ProductArguments arguments) {const HANDLE window_waits[] = {process.get(), shutdown->get(), frame_ready->get()};const HANDLE display_waits[] = {shutdown->get(), frame_ready->get()};- bool source_was_minimized = false;for (;;) {- if (window_target && IsIconic(reinterpret_cast<HWND>(- static_cast<UINT_PTR>(arguments.source_id)))) source_was_minimized = true;for (const auto& control : controls.Read()) {if (control.kind == 'Q') {cleanup();@@ -2007,21 +2041,12 @@ void RunVideoCapture(ProductArguments arguments) {latest = std::move(next);}if (!latest) continue;- // Minimized content is a placeholder, including queued frames after- // restoration. Retire that pool generation before admitting pictures.+ // A minimized window has no capturable picture.if (window_target && IsIconic(reinterpret_cast<HWND>(static_cast<UINT_PTR>(arguments.source_id)))) {- source_was_minimized = true;latest.Close();continue;}- if (source_was_minimized) {- latest.Close();- latest = nullptr;- pool.Recreate(capture_device, static_cast<DirectXPixelFormat>(pool_format), 2, pool_size);- source_was_minimized = false;- continue;- }INT64 signed_timestamp = latest.SystemRelativeTime().count();if (signed_timestamp <= 0) {Fail("capture-timestamp", "captured frame has no QPC timestamp");@@ -2035,6 +2060,15 @@ void RunVideoCapture(ProductArguments arguments) {}auto content_size = latest.ContentSize();if (content_size.Width <= 0 || content_size.Height <= 0) continue;+ // ContentSize belongs to the rendered frame; Size belongs to the current+ // target. Queued minimize/resize frames must not reconfigure the encoder+ // after the target has already changed again.+ const auto target_size = item.Size();+ if (content_size.Width != target_size.Width ||+ content_size.Height != target_size.Height) {+ latest.Close();+ continue;+ }const auto color = display_color.Resolve();if (content_size.Width != pool_size.Width ||content_size.Height != pool_size.Height || color.Format() != pool_format) {diff --git a/native/capture/windows/output_worker.test.cpp b/native/capture/windows/output_worker.test.cppindex 9c2072c2..76bacdd3 100644--- a/native/capture/windows/output_worker.test.cpp+++ b/native/capture/windows/output_worker.test.cpp@@ -13,13 +13,14 @@namespace piik::capture::windows {class AdaptiveEncoder::Impl final {public:- explicit Impl(Factory create, VideoProfile profile) : encoder(create(profile)) {}+ explicit Impl(Factory create, VideoProfile profile, std::unique_ptr<VideoEncoder> initial)+ : encoder(initial ? std::move(initial) : create(profile)) {}std::unique_ptr<VideoEncoder> encoder;};AdaptiveEncoder::AdaptiveEncoder(OutputKind, VideoProfile profile, ID3D11Device*,- Factory create, std::unique_ptr<VideoEncoder>, int)- : impl_(std::make_unique<Impl>(std::move(create), profile)) {}+ Factory create, std::unique_ptr<VideoEncoder> initial, int)+ : impl_(std::make_unique<Impl>(std::move(create), profile, std::move(initial))) {}AdaptiveEncoder::~AdaptiveEncoder() = default;std::optional<AdaptiveAccessUnit> AdaptiveEncoder::Encode(FrameProducer,@@ -53,7 +54,7 @@ class FixtureEncoder final : public VideoEncoder {std::shared_future<void> released_;};-void CheckWorkerFailureGeneration(ID3D11Device* device, bool replace) {+void CheckWorkerFailureGeneration(ID3D11Device* device, bool replace, bool active = true) {std::promise<void> entered, release, output, failure;auto began = entered.get_future();auto released = release.get_future().share();@@ -63,10 +64,14 @@ void CheckWorkerFailureGeneration(ID3D11Device* device, bool replace) {HANDLE sink = CreateFileW(L"NUL", GENERIC_WRITE, 0, nullptr, OPEN_EXISTING, 0, nullptr);assert(sink != INVALID_HANDLE_VALUE);ProtocolWriter writer(sink);+ const AdaptiveEncoder::Factory create = [&](const VideoProfile&) -> std::unique_ptr<VideoEncoder> {+ return std::make_unique<FixtureEncoder>(created++ == 0 ? &entered : nullptr, released);+ };+ // The selected codec moves into its worker without recreation. Retirement+ // still rebuilds it from the same factory.+ auto prepared = create(VideoProfile{});OutputWorker worker(0, VideoProfile{}, OutputKind::h264, device, writer,- [&](const VideoProfile&) -> std::unique_ptr<VideoEncoder> {- return std::make_unique<FixtureEncoder>(created++ == 0 ? &entered : nullptr, released);- }, nullptr, true, [&](const EncodedAccessUnit&) { output.set_value(); },+ create, std::move(prepared), active, [&](const EncodedAccessUnit&) { output.set_value(); },[&](std::exception_ptr error) {try { std::rethrow_exception(error); }catch (const GateFailure& actual) { assert(actual.result() == E_FAIL); }@@ -77,6 +82,7 @@ void CheckWorkerFailureGeneration(ID3D11Device* device, bool replace) {input->height = 720;input->presentation = {1280, 720};input->timestamp = 333'333;+ if (!active) assert(worker.SetActive(true));worker.Submit(input);assert(began.wait_for(std::chrono::seconds(2)) == std::future_status::ready);if (replace) {@@ -223,6 +229,29 @@ void CheckEncoderCandidates() {assert(error.stage() == "codec-probe-timeout");}assert(tried.empty());++ // A slow failed candidate can leave 750 ms of the four-second selection+ // budget. Auto at 30 fps cannot fit its cadence measurement into that time;+ // manual H264 and the immediate two-frame 1 fps probe still can proceed.+ for (const auto [automatic, frame_rate] :+ {std::pair{true, 30U}, std::pair{false, 30U}, std::pair{true, 1U}}) {+ VideoProfile profile;+ profile.frame_rate = frame_rate;+ const auto minimum_time = automatic ? CadenceTiming(profile).MinimumDuration()+ : EncoderClock::duration::zero();+ tried.clear();+ bool expired = false;+ try {+ const auto selected = SelectEncoderCandidate(candidates, preferred,+ EncoderClock::now() + std::chrono::milliseconds(750),+ [&](EncoderCandidate candidate) { tried.push_back(candidate); }, minimum_time);+ assert(selected == preferred);+ } catch (const GateFailure& error) {+ expired = error.stage() == "codec-probe-timeout";+ }+ assert(expired == (automatic && frame_rate == 30));+ assert(tried.size() == (expired ? 0U : 1U));+ }}class CadenceFixtureEncoder final : public VideoEncoder {@@ -260,9 +289,8 @@ void CheckAutoCadenceProbe(ID3D11Device* device) {auto probe = [&](std::chrono::milliseconds latency, UINT32 dropped,EncoderClock::time_point deadline, bool cold_only = false) {calls = 0;- return SustainsEncodedCadence([=, &calls](const VideoProfile&) -> std::unique_ptr<VideoEncoder> {- return std::make_unique<CadenceFixtureEncoder>(latency, dropped, cold_only, calls);- }, device, profile, deadline);+ CadenceFixtureEncoder encoder(latency, dropped, cold_only, calls);+ return SustainsEncodedCadence(encoder, device, profile, deadline);};const auto deadline = EncoderClock::now() + std::chrono::seconds(30);// Valid output at a fraction of the source rate is the driver defect Auto rejects.@@ -467,6 +495,7 @@ int main() {CheckAutoCadenceProbe(device.Get());CheckWorkerFailureGeneration(device.Get(), false);CheckWorkerFailureGeneration(device.Get(), true);+ CheckWorkerFailureGeneration(device.Get(), false, false);CheckWorkerDimensions(device.Get(), {1080, 1920}, {404, 720});CheckWorkerDimensions(device.Get(), {3440, 1440}, {1280, 534});CheckWorkerDimensions(device.Get(), {640, 480}, {640, 480});diff --git a/scripts/app-native-host-gate.ts b/scripts/app-native-host-gate.tsindex 68003168..cce5eb81 100644--- a/scripts/app-native-host-gate.ts+++ b/scripts/app-native-host-gate.ts@@ -781,6 +781,9 @@ async function main(): Promise<void> {`document.querySelector('button[aria-controls="host-advanced-door"]')?.click()`,Date.now() + 5_000,);+ await clickHostControl(cdp, host,+ `document.querySelector('#host-advanced-door .lr-sharing-picture-details > summary')`,+ );result.preSharePreferenceEnabled = await waitForValue((deadline) => evaluate<boolean>(cdp!,@@ -799,10 +802,8 @@ async function main(): Promise<void> {// ceilings. Native capture no longer pads/upscales every source to 16:9.await clickHostControl(cdp, host, `document.querySelector('button.lr-chip[aria-label="1440p"]')`);await clickHostControl(cdp, host, `document.querySelector('button[name="degradationPreference"][value="maintain-resolution"]')`);- await clickHostControl(cdp, host, `document.querySelector('.lr-sharing-technical > summary')`);await clickHostControl(cdp, host,- `([...document.querySelectorAll('button.lr-chip')].find((button) =>- button.textContent?.trim() === ${JSON.stringify(requestedCodec.toUpperCase())}))`,+ `document.querySelector('button[name="videoCodec"][value="${requestedCodec}"]')`,);await evaluate<void>(cdp,@@ -972,6 +973,9 @@ async function main(): Promise<void> {result.livePresetChanges += 1;}stage = "native-quality-controls";+ await clickHostControl(cdp, host,+ `document.querySelector('#host-advanced-door .lr-sharing-picture-details > summary')`,+ );await waitForValue((deadline) => evaluate<boolean>(cdp!,diff --git a/scripts/check-go.mjs b/scripts/check-go.mjsindex dc050543..0fbdc98e 100644--- a/scripts/check-go.mjs+++ b/scripts/check-go.mjs@@ -194,6 +194,7 @@ function checkPlatformCapture() {}if (process.platform === "darwin") {run(executable, ["--geometry-self-test"]);+ run(executable, ["--audio-self-test"]);if (probe.adapters.some(adapter => adapter.hardwareH264.length > 0)) {run(executable, ["--self-test"]);} else {diff --git a/scripts/peer-assisted-benchmark.ts b/scripts/peer-assisted-benchmark.tsindex 609471c4..737043c6 100644--- a/scripts/peer-assisted-benchmark.ts+++ b/scripts/peer-assisted-benchmark.ts@@ -2545,15 +2545,13 @@ async function startHost(5_000, "sharing settings", signal);if (codecMode !== "auto") {await evaluate(cdp, page, `(() => {- const technical = document.querySelector('#host-advanced-door .lr-sharing-technical');- if (technical instanceof HTMLDetailsElement && !technical.open) technical.querySelector('summary')?.click();+ const picture = document.querySelector('#host-advanced-door .lr-sharing-picture-details');+ if (picture instanceof HTMLDetailsElement && !picture.open) picture.querySelector('summary')?.click();})()`);await waitForPage(cdp,page,- `Array.from(document.querySelectorAll('#host-advanced-door button')).some(- (button) => button instanceof HTMLButtonElement && button.getAttribute('aria-label')?.startsWith('${codecMode.toUpperCase()}')- )`,+ `document.querySelector('#host-advanced-door button[name="videoCodec"][value="${codecMode}"]') instanceof HTMLButtonElement`,5_000,`${codecMode} codec control`,signal,@@ -2562,9 +2560,7 @@ async function startHost(cdp,page,`(() => {- const button = Array.from(document.querySelectorAll('#host-advanced-door button')).find(- (candidate) => candidate instanceof HTMLButtonElement && candidate.getAttribute('aria-label')?.startsWith('${codecMode.toUpperCase()}')- );+ const button = document.querySelector('#host-advanced-door button[name="videoCodec"][value="${codecMode}"]');if (!(button instanceof HTMLButtonElement)) throw new Error('Codec mode button missing');button.click();return true;diff --git a/scripts/release-headline.mjs b/scripts/release-headline.mjsnew file mode 100644index 00000000..83a20944--- /dev/null+++ b/scripts/release-headline.mjs@@ -0,0 +1,11 @@+// The release editor owns two leading bold paragraphs: English, then Chinese.+// Read only that pair; older release prose is not an inferred headline.+export function splitReleaseHeadline(body) {+ if (typeof body !== "string") return { headline: null, notes: "" };+ const opening = /^\s*\*\*([^*\r\n]+)\*\*[ \t]*\r?\n(?:[ \t]*\r?\n)+\*\*([^*\r\n]+)\*\*(?:[ \t]*\r?\n(?:[ \t]*\r?\n)+|[ \t]*$)/.exec(body);+ if (!opening || !opening[1].trim() || !opening[2].trim()) return { headline: null, notes: body };+ return {+ headline: { en: opening[1].trim(), "zh-CN": opening[2].trim() },+ notes: body.slice(opening[0].length).trimStart(),+ };+}diff --git a/scripts/release-notes.mjs b/scripts/release-notes.mjsindex f6ab4fb0..64f0a18a 100644--- a/scripts/release-notes.mjs+++ b/scripts/release-notes.mjs@@ -2,6 +2,7 @@ import { appendFileSync, readFileSync } from "node:fs";import { pathToFileURL } from "node:url";import semver from "semver";import { hasProductChanges, isReleaseVersion, releaseCommits, stableTags } from "./release-version.mjs";+import { splitReleaseHeadline } from "./release-headline.mjs";export function releaseNotesSection(message, source) {const sections = message.replace(/\r\n/g, "\n").split(/^## /m).slice(1)@@ -9,7 +10,8 @@ export function releaseNotesSection(message, source) {const body = sections.length === 1? sections[0].split("\n").slice(1).join("\n").replace(/<!--[\s\S]*?-->/g, "").trim(): "";- if (!body || !body.split("\n").some((line) => line.trim() && !/^#{1,6}(\s|$)/.test(line))) {+ const { notes } = splitReleaseHeadline(body);+ if (!notes || !notes.split("\n").some((line) => line.trim() && !/^#{1,6}(\s|$)/.test(line))) {throw new Error(`${source} needs one nonempty ## Release notes section`);}if (/\uFFFD|\?{3,}/u.test(body)) {@@ -35,8 +37,13 @@ export function releaseNotes(root, version, revision, repository, { allowEmpty =// Exclude this release's tag so retrying after publication keeps the same range.const previous = stableTags(root, "--merged", revision).find((tag) => semver.lt(tag, version));const bodies = [];+ let headline = null;for (const commit of releaseCommits(root, revision, previous)) {- bodies.push(releaseNotesSection(commit.message, `Commit ${commit.revision}`));+ const section = splitReleaseHeadline(releaseNotesSection(commit.message, `Commit ${commit.revision}`));+ // The final product PR is the editorial decision for this release, including+ // deliberate omission. Earlier PRs retain all their actual update details.+ headline = section.headline;+ bodies.push(section.notes);}if (!bodies.length) {if (allowEmpty) return "";@@ -44,9 +51,10 @@ export function releaseNotes(root, version, revision, repository, { allowEmpty =}const url = `https://github.com/${repository}`;const source = previous- ? `[完整变更 / Full changelog](${url}/compare/${previous}...${revision})`- : `[源代码 / Source](${url}/tree/${revision})`;- return `${bodies.join("\n\n")}\n\n---\n\n${source}\n`;+ ? `[Full changelog / 完整变更](${url}/compare/${previous}...${revision})`+ : `[Source / 源代码](${url}/tree/${revision})`;+ const opening = headline ? `**${headline.en}**\n\n**${headline["zh-CN"]}**\n\n` : "";+ return `${opening}${bodies.join("\n\n")}\n\n---\n\n${source}\n`;}if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) {diff --git a/site/docs/.vitepress/config.mjs b/site/docs/.vitepress/config.mjsindex c1ba6af2..6ff030d4 100644--- a/site/docs/.vitepress/config.mjs+++ b/site/docs/.vitepress/config.mjs@@ -1,6 +1,7 @@import { defineConfig } from 'vitepress';import { pages, documentLink, repository } from '../pages.mjs';import { githubSlug } from '../../../scripts/markdown-slug.mjs';+import { THEME_STORAGE_KEY } from '../../../src/client/ui/theme.ts';const editPattern = ({ frontmatter }) => `https://github.com/TNTcraftHIM/Piik/edit/main/${frontmatter.source}`;const base = process.env.PIIK_DOCS_BASE || '/docs/';@@ -32,7 +33,18 @@ export default defineConfig({],description: 'Piik guides, troubleshooting and self-hosting.',cleanUrls: false,- appearance: true,+ appearance: { storageKey: THEME_STORAGE_KEY },+ transformHead({ head }) {+ // VitePress 1's startup script ignores appearance.storageKey. Keep its+ // first paint on the same preference as the native runtime and homepage.+ const appearance = head.find(([tag, attrs]) => tag === 'script' && attrs.id === 'check-dark-mode');+ if (appearance) appearance[2] = `;(() => {+ let preference;+ try { preference = localStorage.getItem(${JSON.stringify(THEME_STORAGE_KEY)}); } catch {}+ const dark = preference === 'dark' || (preference !== 'light' && window.matchMedia('(prefers-color-scheme: dark)').matches);+ document.documentElement.classList.toggle('dark', dark);+ })()`;+ },lastUpdated: false,vite: { publicDir: false },locales: {diff --git a/site/docs/.vitepress/theme/index.js b/site/docs/.vitepress/theme/index.jsindex 0f868112..e4ce0d67 100644--- a/site/docs/.vitepress/theme/index.js+++ b/site/docs/.vitepress/theme/index.js@@ -1,6 +1,8 @@import DefaultTheme from 'vitepress/theme-without-fonts';import { useData, withBase } from 'vitepress';-import { h } from 'vue';+import { h, provide } from 'vue';+import { useStorage } from '@vueuse/core';+import { THEME_STORAGE_KEY } from '../../../../src/client/ui/theme.ts';import { brandMarkup } from '../../../assets/brand.js';import { initialLanguage, rememberLanguage } from '../../../assets/language.js';import '../../../assets/brand.css';@@ -8,6 +10,17 @@ import './style.css';export default {extends: DefaultTheme,+ setup() {+ const { isDark } = useData();+ const preference = useStorage(THEME_STORAGE_KEY, 'auto', undefined, { flush: 'sync' });+ provide('toggle-appearance', () => {+ const selected = isDark.value ? 'light' : 'dark';+ isDark.value = selected === 'dark';+ // useDark queues auto when a mode matches the OS. Commit synchronously+ // so that queued write cannot erase the deliberate shared choice.+ preference.value = selected;+ });+ },Layout() {const { lang } = useData();return h(DefaultTheme.Layout, null, {diff --git a/site/docs/package-lock.json b/site/docs/package-lock.jsonindex 9f507bb0..b2d6cd51 100644--- a/site/docs/package-lock.json+++ b/site/docs/package-lock.json@@ -6,6 +6,7 @@"": {"name": "piik-docs","devDependencies": {+ "@vueuse/core": "12.8.2","vitepress": "1.6.4","vue": "3.5.42"}diff --git a/site/docs/package.json b/site/docs/package.jsonindex 1ad7f92d..5368bded 100644--- a/site/docs/package.json+++ b/site/docs/package.json@@ -3,6 +3,7 @@"private": true,"type": "module","devDependencies": {+ "@vueuse/core": "12.8.2","vitepress": "1.6.4","vue": "3.5.42"},diff --git a/site/film/README.md b/site/film/README.mdindex 73606d9c..6167c99b 100644--- a/site/film/README.md+++ b/site/film/README.md@@ -39,7 +39,8 @@ picks up their styling and copy. Review scene selection and camera framing whenthe product workflow changes. Cursor targets follow component elements, notscreenshot coordinates.-The README's four room screenshots use this same fixture. Open+The README's four room screenshots use this same fixture. In an isolated Browser+profile without saved presentation preferences, open`/film/ui/index.html?still=viewer&lang=en&theme=light` at **1160 × 1040** and capturethe full page; repeat with `lang=zh` and `theme=dark` for the corresponding`docs/assets/room-{en,zh}-{light,dark}.png` files. The still view uses natural pagediff --git a/site/film/film.css b/site/film/film.cssindex 1e410c93..9e3f0ed6 100644--- a/site/film/film.css+++ b/site/film/film.css@@ -4,7 +4,6 @@@media (prefers-color-scheme:dark) { :root:not([data-theme="light"]) { color-scheme:dark; --wall:var(--piik-dark-wall); --paper:var(--piik-dark-paper); --ink:var(--piik-dark-ink); --accent:#f28d66; } }:root[data-theme="dark"] { color-scheme:dark; --accent:#f28d66; }* { box-sizing:border-box; }-:root { --spring:cubic-bezier(.3,1.45,.45,1); }body { margin:0; background:var(--wall); color:var(--ink); font:15px/1.6 ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif; -webkit-font-smoothing:antialiased; }[hidden] { display:none !important; }html[lang="en"] [lang="zh-CN"], html[lang="zh-CN"] [lang="en"] { display:none; }diff --git a/site/index.html b/site/index.htmlindex 2275f682..9ab2bcc0 100644--- a/site/index.html+++ b/site/index.html@@ -64,7 +64,7 @@<button type="button" data-language="zh-CN" lang="zh-CN" aria-label="简体中文" aria-pressed="false">中</button><button type="button" data-language="en" lang="en" aria-label="English" aria-pressed="true" class="is-selected">EN</button></span>- <button id="theme" class="lr-btn lr-theme-toggle" type="button"></button>+ <button id="theme" class="lr-btn is-compact lr-theme-toggle" type="button"></button><template id="theme-light"></template><template id="theme-dark"></template></div>@@ -86,7 +86,7 @@><span lang="zh-CN">游戏高光、周末电影、旅行照片。<br />开个房间,叫朋友来一起看。</span></p><div class="hero-actions">- <a class="button primary" href="#download"+ <a class="lr-btn is-primary button" href="#download"><span lang="en">Download Piik App</span><span lang="zh-CN">下载 Piik App</span><svg aria-hidden="true"><use href="#download-mark" /></svg></a><a class="text-link" href="https://demo.piik.tv" target="_blank" rel="noopener noreferrer"@@ -352,7 +352,7 @@<span lang="en">Self-hosted Piik sites can <a href="./docs/self-hosting.html#optional-media-fallback">enable media forwarding (SFU)</a> as a fallback when a direct connection cannot be established.</span><span lang="zh-CN">自行部署的 Piik 站点可以<a href="./docs/zh/self-hosting.html#可选启用媒体兜底">启用媒体转发(SFU)</a>,为直连失败提供兜底。</span></p>- <a class="button download-button" href="https://demo.piik.tv" aria-describedby="demo-status"+ <a class="lr-btn button download-button" href="https://demo.piik.tv" aria-describedby="demo-status"><span lang="en">Use Piik online</span><span lang="zh-CN">直接在线使用</span><span aria-hidden="true"> ↗</span></a>@@ -724,18 +724,21 @@<div class="section-heading"><p class="eyebrow"><span lang="en">Download</span><span lang="zh-CN">下载 Piik App</span></p><h2 id="download-title"><span lang="en">Get Piik App.</span><span lang="zh-CN">下载 Piik App。</span></h2>- <div class="download-release">- <span id="download-release" hidden>- <strong><span lang="en">Latest release </span><span lang="zh-CN">最新版本 </span><b></b></strong>- <span class="release-date"><span lang="en">Released </span><span lang="zh-CN">发布于 </span><time></time></span>- </span>- <a href="https://github.com/TNTcraftHIM/Piik/releases/latest"><span lang="en">Release notes</span><span lang="zh-CN">版本说明</span></a>- </div><p><span lang="en">Host from your computer, with controls in your browser.<br />Friends only need a browser to watch.</span><span lang="zh-CN">在电脑上运行 Piik App,在浏览器里操作。<br />观看朋友的分享,无须安装 Piik App。</span></p>+ <a class="download-release" href="https://github.com/TNTcraftHIM/Piik/releases/latest">+ <span class="download-headline" id="download-headline" hidden><span lang="en"></span><span lang="zh-CN"></span></span>+ <span class="download-release-meta">+ <span id="download-release" hidden>+ <span><span lang="en">Latest </span><span lang="zh-CN">最新版本 </span><b></b></span>+ <time></time>+ </span>+ <span class="download-release-action"><span lang="en">Release notes</span><span lang="zh-CN">更新内容</span><span aria-hidden="true"> ↗</span></span>+ </span>+ </a></div><p class="release-note" id="download-status"><span lang="en">Choose your system, then download and extract.<br /><strong>2.x and 1.x are incompatible.</strong> When upgrading from 1.x, update the App and its Site together, then refresh your browser. <a href="./docs/getting-started.html?lang=en#upgrading">Upgrade guide</a></span>@@ -749,12 +752,12 @@</svg></div><h3 id="download-windows">Windows</h3>- <fieldset class="download-architecture" disabled>+ <fieldset class="lr-toggle download-architecture" disabled><legend class="sr-only"><span lang="en">Windows architecture</span><span lang="zh-CN">Windows 架构</span></legend><label><input type="radio" name="windows-architecture" value="windows-amd64" checked /><span><span lang="en">64-bit (x64)</span><span lang="zh-CN">64 位(x64)</span></span></label></fieldset><a- class="button download-button"+ class="lr-btn button download-button"href="https://github.com/TNTcraftHIM/Piik/releases/latest/download/piik-app-windows-amd64.zip"aria-describedby="download-status"><svg aria-hidden="true"><use href="#download-mark" /></svg><span lang="en">Download from GitHub</span@@ -778,13 +781,13 @@</svg></div><h3 id="download-macos">macOS</h3>- <fieldset class="download-architecture" disabled>+ <fieldset class="lr-toggle download-architecture" disabled><legend class="sr-only"><span lang="en">Mac processor</span><span lang="zh-CN">Mac 芯片</span></legend><label><input type="radio" name="macos-architecture" value="darwin-arm64" checked /><span><span lang="en">Apple silicon</span><span lang="zh-CN">Apple 芯片</span></span></label><label><input type="radio" name="macos-architecture" value="darwin-amd64" /><span>Intel</span></label></fieldset><a- class="button download-button"+ class="lr-btn button download-button"href="https://github.com/TNTcraftHIM/Piik/releases/latest/download/piik-app-darwin-arm64.zip"aria-describedby="download-status"><svg aria-hidden="true"><use href="#download-mark" /></svg><span lang="en">Download from GitHub</span@@ -809,13 +812,13 @@</svg></div><h3 id="download-linux">Linux</h3>- <fieldset class="download-architecture" disabled>+ <fieldset class="lr-toggle download-architecture" disabled><legend class="sr-only"><span lang="en">Linux architecture</span><span lang="zh-CN">Linux 架构</span></legend><label><input type="radio" name="linux-architecture" value="linux-amd64" checked /><span><span lang="en">64-bit (x64)</span><span lang="zh-CN">64 位(x64)</span></span></label><label><input type="radio" name="linux-architecture" value="linux-arm64" /><span>ARM64</span></label></fieldset><a- class="button download-button"+ class="lr-btn button download-button"href="https://github.com/TNTcraftHIM/Piik/releases/latest/download/piik-app-linux-amd64.zip"aria-describedby="download-status"><svg aria-hidden="true"><use href="#download-mark" /></svg><span lang="en">Download from GitHub</span@@ -826,7 +829,7 @@</article></div><div class="download-help">- <a class="button" href="https://github.com/TNTcraftHIM/Piik"><span lang="en">View on GitHub</span><span lang="zh-CN">GitHub 项目</span><span aria-hidden="true"> ↗</span></a>+ <a class="lr-btn button" href="https://github.com/TNTcraftHIM/Piik"><span lang="en">View on GitHub</span><span lang="zh-CN">GitHub 项目</span><span aria-hidden="true"> ↗</span></a><p><span lang="en">Physical-device coverage for the macOS and Linux apps is still limited. If you have a device, we'd welcome your <a href="https://github.com/TNTcraftHIM/Piik/issues">test results and feedback</a>.</span><span lang="zh-CN">macOS 和 Linux 版 Piik App 仍需更多实机测试,欢迎有设备的朋友试用并<a href="https://github.com/TNTcraftHIM/Piik/issues">反馈问题</a>。</span></p></div></section>diff --git a/site/main.js b/site/main.jsindex fb7ad960..4d8cecba 100644--- a/site/main.js+++ b/site/main.js@@ -3,6 +3,7 @@ import { initialLanguage, rememberLanguage } from './assets/language.js';import { createTextCycle } from '../src/client/ui/text-rotation.ts';import { applyTheme, currentTheme, currentThemePreference, initTheme, subscribeTheme } from '../src/client/ui/theme.ts';import { DEFAULT_RELEASE_API_URL, parseReleaseMetadata } from '../src/client/lib/release-update.ts';+import { splitReleaseHeadline } from '../scripts/release-headline.mjs';mountBrands();const architecturePickers = document.querySelectorAll('.download-architecture');function syncDownloadLinks(picker) {@@ -26,17 +27,21 @@ if (releaseLabel) {void fetch(DEFAULT_RELEASE_API_URL, {credentials: 'omit', referrerPolicy: 'no-referrer', redirect: 'error',signal: controller.signal, headers: { Accept: 'application/vnd.github+json' },- }).then(async response => {- if (!response.ok) return null;- return parseReleaseMetadata(await response.json());- })- .then(release => {+ }).then(response => response.ok ? response.json() : null)+ .then(metadata => {+ const release = parseReleaseMetadata(metadata);if (!release?.publishedAt) return;releaseLabel.querySelector('b').textContent = release.version;const date = releaseLabel.querySelector('time');date.dateTime = release.publishedAt;date.textContent = release.publishedAt.slice(0, 10);releaseLabel.hidden = false;+ const { headline } = splitReleaseHeadline(metadata.body);+ if (headline) {+ const label = document.getElementById('download-headline');+ for (const text of label.querySelectorAll('[lang]')) text.textContent = headline[text.lang];+ label.hidden = false;+ }}).catch(() => {}).finally(() => clearTimeout(timeout));}const root = document.documentElement;diff --git a/site/styles.css b/site/styles.cssindex 8f05e9a7..dfe8614c 100644--- a/site/styles.css+++ b/site/styles.css@@ -1,6 +1,6 @@@import "../src/client/ui/palette.css";-@import "../src/client/components/living/language-control.css";@import "../src/client/components/living/button.css";+@import "../src/client/components/living/segmented-control.css";@import "../src/client/ui/glyph.css";:root {@@ -17,7 +17,6 @@--couch: #e9ad63;--couch-dark: #cd8845;--comic-beat: 3.2s;- --spring: cubic-bezier(.3, 1.45, .45, 1);}@media (prefers-color-scheme: dark) {:root:not([data-theme="light"]) { color-scheme: dark; --wall: var(--piik-dark-wall); --paper: var(--piik-dark-paper); --ink: var(--piik-dark-ink); --wall-2: var(--piik-dark-wall-2); --control-hover: var(--piik-dark-hover); --action: var(--piik-dark-action); --action-deep: var(--piik-dark-action); --action-ink: var(--piik-dark-action-ink); --action-text: var(--piik-dark-action-text); --control-selected: var(--piik-dark-selected); --control-selected-ink: var(--piik-dark-selected-ink); --orange: #f28d66; --soft-orange: #3d342c; }@@ -52,7 +51,7 @@ svg { display: block; }.site-header nav a { display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; font-weight: 600; text-decoration: none; }.site-header nav a:is(:hover, :focus-visible), .footer-links a:is(:hover, :focus-visible) { color: var(--action-text); }.preferences { display: flex; align-items: center; flex: none; gap: 10px; border-left: 1px solid var(--line); padding-left: 24px; }-.preferences .lr-lang { --lang-count: 2; }+.preferences .lr-lang { --lr-segments: 2; }.hero { display: grid; grid-template-columns: 1fr 1.08fr; align-items: center; gap: 18px; padding-block: 76px 77px; }.hero-copy { position: relative; z-index: 1; min-width: 0; padding-bottom: 9px; }.eyebrow { display: flex; align-items: center; gap: 9px; color: var(--action-text); font-size: 11px; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; }@@ -63,11 +62,8 @@ h1 { font-size: clamp(49px, 5.7vw, 76px); line-height: 1.06; margin-block: 22px.hero-description { font-size: 18px; line-height: 1.8; color: var(--muted); margin-bottom: 28px; }.hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 16px 24px; }.text-link { display: inline-flex; align-items: center; min-height: 44px; font-size: 13px; font-weight: 650; }-.button { display: inline-flex; justify-content: center; align-items: center; gap: 29px; min-height: 54px; padding: 12px 25px; border: 2px solid var(--ink); border-radius: 999px; text-decoration: none; font-size: 14px; font-weight: 700; transition: var(--control-motion); }+.button { display: inline-flex; gap: 29px; height: auto; min-height: 54px; padding: 12px 25px; font-size: 14px; font-weight: 700; }.button svg { width: 22px; height: 22px; }-.primary { border-color: var(--primary); background: var(--primary); color: var(--primary-ink); box-shadow: var(--control-shadow); }-.button:not(:disabled):is(:hover, :focus-visible) { transform: var(--control-hover-transform); box-shadow: var(--control-shadow); }-.button:not(:disabled):active { transform: var(--control-press-transform); box-shadow: none; transition-duration: 80ms; }.hero-note { color: var(--muted); font-size: 12px; line-height: 1.7; margin-top: 18px; }.film-actions { display:flex; align-items:center; flex-wrap:wrap; gap:0 20px; margin-top:18px; }.film-link { display:inline-flex; align-items:center; gap:10px; min-height:44px; text-decoration:none; font-size:12px; font-weight:650; }@@ -110,11 +106,13 @@ h2 { font-size: clamp(30px, 3.25vw, 42px); line-height: 1.2; margin-top: 12px; }h3 { font-size: 21px; font-weight: 700; letter-spacing: -.03em; line-height: 1.35; }.steps li > p:last-child { margin-top: 12px; font-size: 14px; line-height: 1.75; color: var(--muted); }.download-section { padding-block: 76px 60px; }-.download-release { display: flex; justify-content: center; align-items: baseline; flex-wrap: wrap; gap: 6px 16px; margin-top: 16px; color: var(--muted); font-size: 12px; }-#download-release:not([hidden]) { display: flex; justify-content: center; align-items: baseline; flex-wrap: wrap; gap: 6px 16px; }-#download-release strong { color: var(--ink); font-weight: 650; }-#download-release b { font: inherit; }-.release-date { white-space: nowrap; }+.download-release { display: inline-flex; max-width: 100%; flex-direction: column; align-items: center; gap: 5px; margin-top: 20px; color: var(--muted); font-size: 12px; text-decoration: none; }+.download-headline { max-width: 40em; color: var(--ink); font-size: 17px; font-weight: 650; text-wrap: balance; overflow-wrap: anywhere; }+.download-release-meta, #download-release:not([hidden]) { display: inline-flex; justify-content: center; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; }+#download-release > span, #download-release time { white-space: nowrap; }+#download-release b { color: var(--ink); font-weight: 650; }+.download-release-action { text-decoration: underline; text-underline-offset: 4px; }+.download-release:is(:hover, :focus-visible) .download-release-action { color: var(--action-text); }.release-note { display: flex; justify-content: center; align-items: baseline; flex-wrap: wrap; gap: 8px 13px; margin: 27px auto; color: var(--muted); font-size: 13px; text-align: center; }.download-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }.download-card { display: grid; grid-row: span 6; grid-template-rows: subgrid; row-gap: 0; justify-items: start; align-items: start; padding: 28px; background: var(--paper); border: 1px solid var(--line); border-radius: 24px; box-shadow: 0 4px 0 color-mix(in srgb, var(--line) 40%, transparent); }@@ -122,18 +120,9 @@ h3 { font-size: 21px; font-weight: 700; letter-spacing: -.03em; line-height: 1.3.platform-mark svg { width: 30px; height: 30px; }.download-card h3 { font-size: 25px; }.download-card > p { margin-top: 8px; color: var(--muted); font-size: 12px; line-height: 1.8; }-.download-architecture { position: relative; display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; min-width: 0; max-width: 100%; margin: 16px 0 20px; padding: 4px; border: 1px solid var(--line); border-radius: 24px; background: var(--wall); }-.download-architecture:not(:disabled)::before { content: ""; position: absolute; inset: 4px auto 4px 4px; box-sizing: border-box; width: calc((100% - 8px) / 2); border: 1px solid var(--action); border-radius: 18px; background: var(--control-selected); box-shadow: 0 2px 0 color-mix(in srgb, var(--line) 40%, transparent); transition: transform 260ms var(--spring); pointer-events: none; }-.download-architecture:has(> label:nth-of-type(2) input:checked)::before { transform: translateX(100%); }-.download-architecture label { position: relative; min-width: 0; }-.download-architecture input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }-.download-architecture input:disabled { cursor: default; }-.download-architecture label > span { position: relative; display: flex; align-items: center; justify-content: center; height: 100%; min-height: 36px; padding: 6px 12px; border: 1px solid transparent; border-radius: 18px; font-size: 12px; font-weight: 600; pointer-events: none; transition: color 140ms ease, transform 180ms var(--spring); }-.download-architecture input:checked + span { color: var(--control-selected-ink); }-.download-architecture input:enabled:is(:hover, :focus-visible) + span { transform: translateY(-1px); }-.download-architecture input:enabled:not(:checked):is(:hover, :focus-visible) + span { color: var(--action-text); }-.download-architecture input:enabled:active + span { transform: var(--control-press-transform); transition-duration: 80ms; }-.download-architecture input:focus-visible + span { outline: 3px solid var(--action); outline-offset: 3px; }+.download-architecture { --selection-item-size: var(--control-dense-size); --control-border-width: 1px; min-width: 0; max-width: 100%; margin: 16px 0 20px; border-color: var(--line); border-radius: 24px; background: var(--wall); box-shadow: none; }+.download-architecture::before { border-radius: 18px; }+.download-architecture label > span { height: 100%; padding: 6px 12px; border-radius: 18px; font-size: 12px; }.download-architecture:disabled { border-color: transparent; background: transparent; padding-inline: 0; }.download-architecture:disabled label > span { padding-inline: 0; border-color: transparent; background: transparent; color: var(--muted); box-shadow: none; }.download-button { width: 100%; gap: 10px; padding: 12px 15px; border-width: 1.5px; min-height: 48px; font-size: 13px; }@@ -238,9 +227,6 @@ html[lang="zh-CN"] .eyebrow { letter-spacing: .13em; }.site-header nav { order:3; flex-basis:100%; justify-content:space-between; gap:0 12px; }.site-header nav a { font-size:12px; }.preferences { margin-left: auto; border-left: 0; padding-left: 0; gap: 10px; }- .preferences .lr-lang { padding: 2px; border-width: 2px; }- .preferences .lr-lang::before { top: 2px; bottom: 2px; left: 2px; width: calc((100% - 4px) / var(--lang-count)); }- .preferences .lr-lang > button { min-width: 30px; height: 32px; padding-inline: 5px; }.hero { grid-template-columns: 1fr; gap: 0; padding-block: 44px 35px; }.hero-copy { text-align: center; }.hero .eyebrow { justify-content: center; font-size: 10px; }@@ -340,8 +326,7 @@ html[lang="zh-CN"] .eyebrow { letter-spacing: .13em; }@media (prefers-reduced-motion: reduce) {html { scroll-behavior: auto; }*, *::before, *::after { transition: none !important; }- .button:not(:disabled):is(:hover, :focus-visible, :active), .download-architecture input:enabled:is(:hover, :focus-visible, :active) + span { transform: none; }}html[data-reduced-motion] { scroll-behavior: auto; }html[data-reduced-motion] *, html[data-reduced-motion] *::before, html[data-reduced-motion] *::after { animation: none !important; transition: none !important; }-html[data-reduced-motion] :is(.button, .lr-btn, .film-play, .project-tv, .download-architecture label > span) { transform: none !important; }+html[data-reduced-motion] :is(.film-play, .project-tv) { transform: none !important; }diff --git a/src/client/App.tsx b/src/client/App.tsxindex c91a9940..25130dfd 100644--- a/src/client/App.tsx+++ b/src/client/App.tsx@@ -115,16 +115,11 @@ export function App() {}, [lang, vis, launchedByClient]);return (- <div className="lr-app-shell">- <RouteBoundary>- <Suspense fallback={<RouteLoader />}>- <AppRoute />- </Suspense>- </RouteBoundary>- {appRoute.kind !== "client" && <footer className="lr-web-version">- Piik Web {import.meta.env.VITE_PIIK_VERSION ?? "development"}- </footer>}- </div>+ <RouteBoundary>+ <Suspense fallback={<RouteLoader />}>+ <AppRoute />+ </Suspense>+ </RouteBoundary>);}diff --git a/src/client/components/living/AppConnectionButton.tsx b/src/client/components/living/AppConnectionButton.tsxindex 31369c9e..42cd9389 100644--- a/src/client/components/living/AppConnectionButton.tsx+++ b/src/client/components/living/AppConnectionButton.tsx@@ -138,7 +138,7 @@ function AppConnectionControl({ sourcePicker = false, onConnected }: AppConnectireturn <><Tooltip kind={state === "ready" ? "hint-app-ready" : state === "unavailable" ? "signal-failed" : state === "incompatible" ? "warning" : "hint-client-site"}text={vis ? undefined : label} disabled={helpOpen}place={sourcePicker ? "above" : "below"} align="end">- <button ref={trigger} type="button" className={`${sourcePicker ? "lr-source-picker-refresh lr-source-app-connect" : "lr-btn lr-app-connect"}${state === "ready" ? " is-ready" : ""}`}+ <button ref={trigger} type="button" className={`${sourcePicker ? "lr-btn is-dense lr-source-picker-refresh lr-source-app-connect" : "lr-btn is-compact lr-app-connect"}${state === "ready" ? " is-ready" : ""}`}aria-label={sourcePicker ? t("client.connect.action") : label} aria-busy={state === "busy" || undefined}popoverTarget={failed ? helpId : undefined} aria-haspopup={failed ? "dialog" : undefined}onClick={failed ? undefined : event => {@@ -153,14 +153,14 @@ function AppConnectionControl({ sourcePicker = false, onConnected }: AppConnecti</button></Tooltip><div ref={help} id={helpId} popover="auto" role="dialog" aria-label={t("client.connect.action")} aria-describedby={`${helpId}-message`}- className="lr-app-connect-help" onToggle={event => {+ className="lr-anchored-card lr-app-connect-help" onToggle={event => {setHelpOpen(event.newState === "open");if (event.newState !== "open" || !trigger.current) return;event.currentTarget.querySelector<HTMLButtonElement>("button")?.focus();}}><div className="lr-app-connect-head"><div className="lr-app-connect-scene" aria-hidden="true">{helpOpen && <Comic kind={state === "incompatible" ? "warning" : "signal-failed"} theme="paper" />}</div>- <button type="button" className="lr-btn lr-app-connect-close" aria-label={t("common.close")}+ <button type="button" className="lr-btn is-dense is-quiet lr-app-connect-close" aria-label={t("common.close")}popoverTarget={helpId} popoverTargetAction="hide"><Glyph name="x" size={16} /></button>diff --git a/src/client/components/living/CaptureSourcePicker.tsx b/src/client/components/living/CaptureSourcePicker.tsxindex 8addc673..32515086 100644--- a/src/client/components/living/CaptureSourcePicker.tsx+++ b/src/client/components/living/CaptureSourcePicker.tsx@@ -150,7 +150,7 @@ export function CaptureSourcePicker({const refreshButton = (<buttontype="button"- className="lr-source-picker-refresh"+ className="lr-btn is-dense lr-source-picker-refresh"aria-label={refreshLabel}disabled={refreshing}onClick={activeTab === "camera" ? cameraSources.refresh : onRefresh}@@ -161,7 +161,7 @@ export function CaptureSourcePicker({const closeButton = (<buttontype="button"- className="lr-source-picker-close"+ className="lr-btn is-dense is-quiet lr-source-picker-close"aria-label={t("common.cancel")}onClick={onCancel}autoFocusdiff --git a/src/client/components/living/Comic.tsx b/src/client/components/living/Comic.tsxindex 26bdfacf..c2706782 100644--- a/src/client/components/living/Comic.tsx+++ b/src/client/components/living/Comic.tsx@@ -1456,7 +1456,7 @@ ${rmBlock(["vls-source-host"], [], false)}{state === "switching" ? <BrowserWindow x={225} y={24} w={71} h={47}><circle cx={260} cy={50} r={11} fill={SKY} /></BrowserWindow> : <MiniTv x={225} y={26} w={71} h={43} />}- {state === "failed" ? <RedX cx={185} cy={51} arm={11} /> : <g stroke="var(--comic-tone, var(--action))" strokeWidth={3} strokeLinecap="round" strokeLinejoin="round" fill="none">+ {state === "failed" ? <RedX cx={185} cy={51} arm={11} /> : <g stroke="var(--comic-tone, var(--busy))" strokeWidth={3} strokeLinecap="round" strokeLinejoin="round" fill="none"><path className="vls-source-switch" d={state === "switching" ? "M158 42h51m-9-8 9 8-9 8" : "M158 51h51m-9-8 9 8-9 8"} />{state === "switching" && <path className="vls-source-switch vls-source-return" d="M209 61h-51m9-8-9 8 9 8" />}</g>}diff --git a/src/client/components/living/FloatingPanel.tsx b/src/client/components/living/FloatingPanel.tsxindex a23914e4..1e32ddc6 100644--- a/src/client/components/living/FloatingPanel.tsx+++ b/src/client/components/living/FloatingPanel.tsx@@ -210,12 +210,12 @@ export function FloatingPanel({ id, trigger, title, icon, compact = false, ancho<span id={`${id}-move-hint`} className="visually-hidden">{t("floating.moveHint")}</span>{detachable && !detached && panelWindowAPI(typeof window === "undefined" ? null : window) &&<Tooltip kind="hint-window-detach" place="below" text={vis ? undefined : t("floating.detach")}>- <button type="button" className="lr-popover-close" disabled={panelWindow.opening}+ <button type="button" className="lr-btn is-dense is-quiet lr-popover-close" disabled={panelWindow.opening}aria-label={t("floating.detach")} onClick={() => { void panelWindow.open(); }}><Glyph name="pip" size={18} /></button></Tooltip>}- {!detached && <button type="button" className="lr-popover-close" aria-label={t("common.close")} onClick={() => {+ {!detached && <button type="button" className="lr-btn is-dense is-quiet lr-popover-close" aria-label={t("common.close")} onClick={() => {panelRef.current?.hidePopover(); focusTrigger();}}><Glyph name="x" size={16} /></button>}</header>diff --git a/src/client/components/living/Header.tsx b/src/client/components/living/Header.tsxindex a6d95925..fa53a8d3 100644--- a/src/client/components/living/Header.tsx+++ b/src/client/components/living/Header.tsx@@ -1,5 +1,6 @@// App header: brand mark, LED connection state, language selection and theme.-import { useState, useSyncExternalStore } from "react";+import { useId, useRef, useState, useSyncExternalStore } from "react";+import { createPortal } from "react-dom";import { browserDebugEnabled, debugError, downloadBrowserDebug, withBrowserDebug } from "../../lib/debug";import { BrandMark } from "./BrandMark";import { Tooltip } from "./Tooltip";@@ -9,6 +10,8 @@ import { LanguageControl } from "./LanguageControl";import { applyTheme, currentTheme, subscribeTheme } from "../../ui/theme";import { Glyph } from "../../ui/icons";import { AppConnectionButton } from "./AppConnectionButton";+import { useAnchoredPopover } from "./use-anchored-popover";+import { useProjectLink } from "../../lib/use-project-link";export type LedState = "live" | "busy" | "warn" | "bad" | "off";@@ -45,14 +48,14 @@ export function LedStrip({}/** Shared explicit opt-in/export action; starting diagnostics reloads the page. */-export function BrowserDiagnosticsButton() {+export function BrowserDiagnosticsButton({ quiet = false }: { quiet?: boolean } = {}) {const { vis, t } = useCopy();const [debugExport, setDebugExport] = useState<"idle" | "busy" | "failed">("idle");const debugTitle = t(!browserDebugEnabled ? "debug.startHint" :debugExport === "failed" ? "debug.exportFailed" : "debug.exportHint");const debugButton = (<button- type="button" className={`lr-btn${browserDebugEnabled ? " is-on" : ""}`} disabled={debugExport === "busy"}+ type="button" className={`lr-btn is-compact${quiet ? " is-quiet" : ""}${browserDebugEnabled ? " is-on" : ""}`} disabled={debugExport === "busy"}aria-label={debugTitle} aria-busy={debugExport === "busy" || undefined}onClick={() => {if (!browserDebugEnabled) {@@ -82,14 +85,56 @@ export function BrowserDiagnosticsButton() {text={vis ? undefined : debugTitle} place="below" align="end">{debugButton}</Tooltip>;}-export function HeaderControls({ diagnosticControl }: { diagnosticControl?: React.ReactNode } = {}) {+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 BrowserHelpMenu() {+ const { lang, vis, t } = useCopy();+ const id = useId();+ const trigger = useRef<HTMLButtonElement>(null);+ const panel = useRef<HTMLDivElement>(null);+ const [open, setOpen] = useState(false);+ useAnchoredPopover(trigger, panel);+ const guide = useProjectLink(`/docs/${lang === "zh" ? "zh/" : ""}troubleshooting.html`,+ `https://github.com/TNTcraftHIM/Piik/blob/main/docs/guide/troubleshooting${lang === "zh" ? ".zh-CN" : ""}.md`, open);+ return <>+ <Tooltip kind="hint-help" text={vis ? undefined : t("help.hint")} disabled={open} place="below" align="end">+ <button ref={trigger} type="button" className="lr-btn is-compact is-quiet"+ popoverTarget={id} aria-haspopup="dialog" aria-expanded={open} aria-label={t("help.title")}>+ <Glyph name="help" />+ </button>+ </Tooltip>+ {createPortal(<div ref={panel} id={id} popover="auto" role="dialog" aria-label={t("help.title")}+ className={`lr-anchored-card lr-help-menu${vis ? " is-visual" : ""}`} onToggle={event => {+ if (event.target === event.currentTarget) setOpen(event.newState === "open");+ }}>+ <header><strong>Piik Web</strong>+ {webRelease ? <a href={webRelease} target="_blank" rel="noopener noreferrer"+ aria-label={`Piik Web ${webVersion}`}>{webVersion}</a> : <span>{webVersion}</span>}+ </header>+ <nav aria-label={t("help.title")}>+ {open && <>+ <Tooltip kind="hint-help" text={vis ? undefined : t("shareHelp.guide")} place="below" align="end">+ <a className="lr-btn is-compact is-quiet" href={guide} target="_blank" rel="noopener noreferrer" aria-label={t("shareHelp.guide")}>+ <Glyph name="book" size={16} />{!vis && <span className="lr-cap">{t("help.troubleshooting")}</span>}+ </a>+ </Tooltip>+ <BrowserDiagnosticsButton quiet />+ </>}+ </nav>+ </div>, document.body)}+ </>;+}++export function HeaderControls({ diagnosticControl, appControl }: { diagnosticControl?: React.ReactNode; appControl?: React.ReactNode } = {}) {const { vis, t } = useCopy();const theme = useSyncExternalStore(subscribeTheme, currentTheme);const themeTitle = t(theme === "dark" ? "theme.light" : "theme.dark");const themeButton = (<buttontype="button"- className="lr-btn lr-theme-toggle"+ className="lr-btn is-compact lr-theme-toggle"aria-label={themeTitle}onClick={(event) => {// Pointer activation must not pin the hint open; keyboard keeps focus.@@ -107,13 +152,12 @@ export function HeaderControls({ diagnosticControl }: { diagnosticControl?: Reac);return (<span className="lr-top-right lr-header-controls">+ {appControl}<LanguageControl /><Tooltip kind={theme === "dark" ? "hint-theme-light" : "hint-theme-dark"} text={vis ? undefined : themeTitle} place="below" align="end">{themeButton}</Tooltip>- {diagnosticControl !== null && <span className="lr-header-diagnostic">- {diagnosticControl === undefined ? <BrowserDiagnosticsButton /> : diagnosticControl}- </span>}+ {diagnosticControl === undefined ? <BrowserHelpMenu /> : diagnosticControl}</span>);}@@ -145,8 +189,8 @@ export function AppHeader({</a>}<span className="lr-top-right">{led}- {homeHref !== "/client" && showAppConnection && <AppConnectionButton />}- <HeaderControls diagnosticControl={diagnosticControl} />+ <HeaderControls diagnosticControl={diagnosticControl}+ appControl={homeHref !== "/client" && showAppConnection ? <AppConnectionButton /> : undefined} /></span></header>);diff --git a/src/client/components/living/HostRemoteControl.tsx b/src/client/components/living/HostRemoteControl.tsxindex fc9e0d25..d19f08a0 100644--- a/src/client/components/living/HostRemoteControl.tsx+++ b/src/client/components/living/HostRemoteControl.tsx@@ -128,11 +128,11 @@ export function HostRemoteControl({ mode, platform, requests, disabled, onPolicydisabled={busy || disabled} onChange={event => setPassword(event.target.value)} /></label>}{(draft !== mode || draft === "password") && <div className="lr-remote-policy-actions">- {preparing && !busy && <Btn icon="x" title="common.cancel" cap="common.cancel" onClick={() => {+ {preparing && !busy && <Btn icon="x" title="common.cancel" cap="common.cancel" size="compact" onClick={() => {setPreparing(false); setPassword(""); setDraft(readRoomPreferences().remoteControlMode);(surfaceDocument ?? document).getElementById(id)?.querySelector<HTMLButtonElement>('[role="switch"]')?.focus();}} />}- <Btn icon="check" title="remote.apply" cap="remote.apply" type="submit" tone="primary"+ <Btn icon="check" title="remote.apply" cap="remote.apply" type="submit" tone="primary" size="compact"hint="hint-remote-control" disabled={busy || disabled || (draft === "password" && !password)} /></div>}</form>}diff --git a/src/client/components/living/LauncherForm.tsx b/src/client/components/living/LauncherForm.tsxindex c8b8b732..ca31b5e2 100644--- a/src/client/components/living/LauncherForm.tsx+++ b/src/client/components/living/LauncherForm.tsx@@ -124,9 +124,9 @@ export function LauncherForm({{site && <div className="lr-client-approved-site"><a href={`${site}/#piik-client=1`} target="_blank" rel="noopener noreferrer" onClick={onOpen}>{site}<span aria-hidden="true"> ↗</span></a><div className="lr-client-site-actions">- <Btn icon="star" title="client.connect.openOnStart" pressed={openSiteOnStart}+ <Btn icon="star" title="client.connect.openOnStart" size="dense" pressed={openSiteOnStart}hint="hint-client-site" disabled={siteBusy} onClick={onToggleStartupSite} />- <Btn icon="x" title="client.connect.remove" hint="hint-client-site" disabled={siteBusy} onClick={onRemoveSite} />+ <Btn icon="x" title="client.connect.remove" size="dense" hint="hint-client-site" disabled={siteBusy} onClick={onRemoveSite} /></div></div>}</section>diff --git a/src/client/components/living/PawnDetail.tsx b/src/client/components/living/PawnDetail.tsxindex 9149a72f..26a60da6 100644--- a/src/client/components/living/PawnDetail.tsx+++ b/src/client/components/living/PawnDetail.tsx@@ -107,7 +107,7 @@ export function PawnDetail({<Tooltip kind="hint-close" text={vis ? undefined : t("common.close")}><buttontype="button"- className="lr-pawn-detail-close"+ className="lr-btn is-dense is-quiet"aria-label={t("common.close")}onClick={(event) => {// Pointer activation must not pin the hint open; keyboard keeps focus.diff --git a/src/client/components/living/PlaybackControls.tsx b/src/client/components/living/PlaybackControls.tsxindex 061de242..e9eedac0 100644--- a/src/client/components/living/PlaybackControls.tsx+++ b/src/client/components/living/PlaybackControls.tsx@@ -246,7 +246,7 @@ function PlaybackMore({ panel, children, settings, overlaySettings, onReconnect,const { t, vis } = useCopy();const id = useId();const [open, setOpen] = useState(false);- const reconnect = <Btn icon="refresh" title="viewer.reconnect" hint="hint-reconnect" draw="playback-reconnect"+ const reconnect = <Btn icon="refresh" title="viewer.reconnect" size="dense" hint="hint-reconnect" draw="playback-reconnect"cap="viewer.reconnect" disabled={!reconnectAvailable} onClick={() => {panel.current?.hidePopover();onReconnect();diff --git a/src/client/components/living/QualityPresets.tsx b/src/client/components/living/QualityPresets.tsxindex eb44ea05..10426946 100644--- a/src/client/components/living/QualityPresets.tsx+++ b/src/client/components/living/QualityPresets.tsx@@ -238,7 +238,7 @@ export function VideoRateControls({ value, limits, disabled, onChange }: {{hasCommonRange ? <Tooltip kind={control.hint} text={vis ? undefined : t("host.video.returnCommonHint", {value: String(commonValue), unit: control.unit,})}>- <button type="button" className="lr-btn" disabled={disabled}+ <button type="button" className="lr-btn is-dense" disabled={disabled}aria-label={`${t(control.label)} · ${t("host.video.returnCommonHint", { value: String(commonValue), unit: control.unit })}`}onClick={event => {const group = event.currentTarget.closest(".lr-quality-rate");diff --git a/src/client/components/living/RemoteControl.tsx b/src/client/components/living/RemoteControl.tsxindex 66ecf4c4..d1650c9d 100644--- a/src/client/components/living/RemoteControl.tsx+++ b/src/client/components/living/RemoteControl.tsx@@ -217,7 +217,7 @@ export function RemoteControl({ channel, videoRef, available, pictureFit }: {}}><div className="lr-remote-panel-header"><strong><Glyph name="key" size={18} />{vis ? null : t("remote.password")}</strong>- <button type="button" className="lr-popover-close" aria-label={t("common.cancel")}+ <button type="button" className="lr-btn is-dense is-quiet lr-popover-close" aria-label={t("common.cancel")}onClick={() => { setPasswordOpen(false); setPassword(""); release(); }}><Glyph name="x" size={17} /></button>@@ -228,7 +228,7 @@ export function RemoteControl({ channel, videoRef, available, pictureFit }: {value={password} aria-label={t("remote.password")} disabled={state.state === "pending"}onChange={event => setPassword(event.target.value)} /></label>- <Btn icon="check" title="remote.request" hint="hint-remote-control" type="submit" disabled={!password || state.state === "pending"} />+ <Btn icon="check" title="remote.request" size="compact" hint="hint-remote-control" type="submit" disabled={!password || state.state === "pending"} /></div>{state.reason && <p role="status" className={state.reason === "password" ? "is-bad" : undefined}><Glyph name={statusIcon} size={16} /><span className={vis ? "visually-hidden" : undefined}>{t(`remote.reason.${state.reason}`)}</span></p>}@@ -301,7 +301,7 @@ export function RemoteControl({ channel, videoRef, available, pictureFit }: {</div>}{active && keyboardOpen && <RemoteKeyboard input={input} touch={touchControls} platform={state.platform}onSurfaceChange={keyboardSurfaceChanged}- mouseControl={!touchControls && "requestPointerLock" in HTMLElement.prototype && <span className="lr-remote-game-mouse"><Btn icon="gamepad"+ mouseControl={!touchControls && "requestPointerLock" in HTMLElement.prototype && <span className="lr-remote-game-mouse"><Btn icon="gamepad" size="compact"title={lockFailed ? "remote.lockFailed" : locked ? "remote.releaseMouse" : "remote.gameMouse"}cap={locked ? "remote.releaseMouse" : "remote.gameMouse"} pressed={locked}hint={locked ? "hint-remote-mouse-release" : "hint-remote-mouse-lock"}diff --git a/src/client/components/living/RemoteKeyboard.tsx b/src/client/components/living/RemoteKeyboard.tsxindex beefd9a4..662f0f3a 100644--- a/src/client/components/living/RemoteKeyboard.tsx+++ b/src/client/components/living/RemoteKeyboard.tsx@@ -41,6 +41,7 @@ export function RemoteKeyboard({ input, close, mouseControl, touch, platform, onconst { t, vis } = useCopy();const id = useId();const mac = platform === "darwin";+ const metaKeyTitle = t(mac ? "remote.key.Command" : platform === "windows" ? "remote.key.Windows" : "remote.key.Super");const command = mac ? "MetaLeft" : "ControlLeft";const modifiersKeys: Key[] = [["Ctrl", "ControlLeft"],[mac ? "Cmd" : platform === "windows" ? "Win" : "Super", "MetaLeft"], [mac ? "Opt" : "Alt", "AltLeft"], ["Shift", "ShiftLeft"]];@@ -92,7 +93,7 @@ export function RemoteKeyboard({ input, close, mouseControl, touch, platform, onconst name = `remote.key.${code}`;const caption = shifted && modifiers.includes("ShiftLeft") ? shifted : label;return <button key={code} type="button" className="lr-chip"- data-key={code} aria-label={isCopyKey(name) ? t(name) : caption}+ data-key={code} aria-label={code === "MetaLeft" ? metaKeyTitle : isCopyKey(name) ? t(name) : caption}onPointerDown={event => {if (event.button !== 0) return;event.preventDefault(); event.currentTarget.setPointerCapture(event.pointerId);@@ -109,7 +110,7 @@ export function RemoteKeyboard({ input, close, mouseControl, touch, platform, on};const modifier = ([label, code]: Key, index: number) => <span className="lr-remote-modifier-key" key={code}>- {combineKeys ? <Chip title={mac && code === "AltLeft" ? "Option" : label} selected={modifiers.includes(code)} onClick={() => {+ {combineKeys ? <Chip title={code === "MetaLeft" ? metaKeyTitle : code === "ShiftLeft" ? t("remote.key.ShiftLeft") : mac && code === "AltLeft" ? "Option" : label} selected={modifiers.includes(code)} onClick={() => {const selected = modifiers.includes(code);if (selected) presses.up(-2 - index);else presses.down(-2 - index, [code], false);@@ -138,10 +139,10 @@ export function RemoteKeyboard({ input, close, mouseControl, touch, platform, on<strong><Glyph name="keyboard" size={18} />{vis ? null : t("remote.keyboard")}</strong>{!panelWindow.detached && <>{panelWindowAPI(window) && <Tooltip kind="hint-window-detach" place="below" text={vis ? undefined : t("floating.detach")}>- <button type="button" className="lr-popover-close" aria-label={t("floating.detach")} disabled={panelWindow.opening}+ <button type="button" className="lr-btn is-dense is-quiet lr-popover-close" aria-label={t("floating.detach")} disabled={panelWindow.opening}onClick={() => { presses.reset(); setModifiers([]); void panelWindow.open(); }}><Glyph name="pip" size={18} /></button></Tooltip>}- <button type="button" className="lr-popover-close" aria-label={t("common.close")} onClick={close}><Glyph name="x" size={17} /></button>+ <button type="button" className="lr-btn is-dense is-quiet lr-popover-close" aria-label={t("common.close")} onClick={close}><Glyph name="x" size={17} /></button></>}</div>{panelWindow.failed && <p className="lr-floating-error" role="status">{t("floating.detachFailed")}</p>}@@ -195,7 +196,7 @@ export function RemoteKeyboard({ input, close, mouseControl, touch, platform, ononCompositionEnd={() => { composing.current = false; }}/><div className="lr-remote-text-actions">- <Btn icon="send" cap="remote.typeText" title="remote.sendText" hint="hint-remote-keyboard" tone="primary" type="submit" disabled={!text || textTooLong} />+ <Btn icon="send" cap="remote.typeText" title="remote.sendText" size="compact" hint="hint-remote-keyboard" tone="primary" type="submit" disabled={!text || textTooLong} /></div></div>{textTooLong ? <p id={`${id}-text-help`} role="alert">{t("remote.textTooLong")}</p> : !vis && <p id={`${id}-text-help`}>{t("remote.textHelp")}</p>}diff --git a/src/client/components/living/RoomChatOverlay.tsx b/src/client/components/living/RoomChatOverlay.tsxindex 33f9aaf2..df64ed37 100644--- a/src/client/components/living/RoomChatOverlay.tsx+++ b/src/client/components/living/RoomChatOverlay.tsx@@ -1,4 +1,4 @@-import { useEffect, useId, useSyncExternalStore, type CSSProperties } from "react";+import { useEffect, useId, useSyncExternalStore, type CSSProperties, type ComponentProps } from "react";import { CHAT_OVERLAY_DURATION_MS, RoomInteractionSession } from "../../lib/room-interactions";import { CHAT_OVERLAY_LIMITS } from "../../lib/room-preferences";import { useCopy } from "../../ui/copy";@@ -7,13 +7,15 @@ import { Btn } from "./primitives";import { Tooltip } from "./Tooltip";import "./room-chat-overlay.css";-export function RoomChatToggle({ session }: { session: RoomInteractionSession | null }) {- return session ? <ConnectedToggle key={session.key} session={session} /> : null;+type ToggleProps = { session: RoomInteractionSession | null } & Pick<ComponentProps<typeof Btn>, "size" | "quiet">;++export function RoomChatToggle({ session, ...appearance }: ToggleProps) {+ return session ? <ConnectedToggle key={session.key} session={session} {...appearance} /> : null;}-function ConnectedToggle({ session }: { session: RoomInteractionSession }) {+function ConnectedToggle({ session, ...appearance }: ToggleProps & { session: RoomInteractionSession }) {const { overlayEnabled } = useSyncExternalStore(session.subscribe, session.getSnapshot);- return <span className="lr-chat-overlay-toggle"><Btn icon="danmaku"+ return <span className="lr-chat-overlay-toggle"><Btn icon="danmaku" {...appearance}title={overlayEnabled ? "interaction.overlay.hide" : "interaction.overlay.show"}hint={overlayEnabled ? "hint-chat-overlay-hide" : "hint-chat-overlay-show"}hintText={overlayEnabled ? "interaction.overlay.hideHint" : "interaction.overlay.showHint"}diff --git a/src/client/components/living/RoomInteractions.tsx b/src/client/components/living/RoomInteractions.tsxindex 054141e8..3cdbae60 100644--- a/src/client/components/living/RoomInteractions.tsx+++ b/src/client/components/living/RoomInteractions.tsx@@ -167,7 +167,7 @@ function InteractionPanel({ session, state, ...couch }: ConnectedProps & {title={t(settingsOpen ? "interaction.settings" : "interaction.title")}onOpenChange={(open, owner) => { setChatOpen(open); setChatDocument(owner); }}>{settingsOpen && <>- <div className="lr-interaction-back"><Btn icon="chat" title="interaction.back" cap="interaction.back"+ <div className="lr-interaction-back"><Btn icon="chat" title="interaction.back" cap="interaction.back" size="dense"hint="hint-chat-open" onClick={() => setSettingsOpen(false)} /></div><RoomChatSettings session={session} /></>}@@ -242,21 +242,21 @@ function InteractionPanel({ session, state, ...couch }: ConnectedProps & {aria-label={t("interaction.placeholder")} placeholder={vis ? "···" : t("interaction.placeholder")}name="message" autoComplete="off" onFocus={() => setPanelTarget(null)}onKeyDown={event => { if (event.key === "Enter" && event.nativeEvent.isComposing) event.preventDefault(); }} />- <Btn type="submit" icon="send" title="interaction.send" hint="hint-chat-send" tone="primary" busy={state.pending?.payload.kind === "chat"}+ <Btn type="submit" icon="send" title="interaction.send" hint="hint-chat-send" tone="primary" size="compact" busy={state.pending?.payload.kind === "chat"}disabled={!canSend || !normalizeChatText(draft)} /></div><div className="lr-chat-tools">- <Btn id={`${id}-express`} icon="smile" title="interaction.express" cap="interaction.express"+ <Btn id={`${id}-express`} icon="smile" title="interaction.express" cap="interaction.express" size="dense" quiethint="hint-reaction-picker"expanded={Boolean(panelPerson)} controls={`${id}-reactions`} tone={panelPerson ? "on" : undefined}onClick={() => {if (panelPerson) setPanelTarget(null);else openPanelReactions(state.peerId!, panelArea.current?.ownerDocument.getElementById(`${id}-express`) ?? null);}} />- <RoomChatToggle session={session} />+ <RoomChatToggle session={session} size="dense" quiet /><span className="lr-chat-count" aria-hidden="true" style={{ visibility: draft ? undefined : "hidden" }}>{Array.from(draft).length} / {MAX_CHAT_CODE_POINTS}</span>- <Btn icon="sliders" title="interaction.settings" hint="hint-chat-settings"+ <Btn icon="sliders" title="interaction.settings" hint="hint-chat-settings" size="dense" quietonClick={() => { setPanelTarget(null); setSettingsOpen(true); }} /></div></form>diff --git a/src/client/components/living/ShareFailureHelp.tsx b/src/client/components/living/ShareFailureHelp.tsxindex 54d51945..a4082ea5 100644--- a/src/client/components/living/ShareFailureHelp.tsx+++ b/src/client/components/living/ShareFailureHelp.tsx@@ -30,7 +30,7 @@ export function ShareFailureHelp({ status, label, code, checks }: {<dialog ref={dialog} className="lr-share-help" aria-labelledby={titleId} onClose={() => setOpen(false)}>{open && <><header><h2 id={titleId}>{vis && <Glyph name="alert" size={20} />}<span className={vis ? "visually-hidden" : undefined}>{t("shareHelp.title")}</span></h2>- <button type="button" className="lr-btn" aria-label={t("common.close")} autoFocus onClick={() => dialog.current?.close()}>+ <button type="button" className="lr-btn is-dense is-quiet" aria-label={t("common.close")} autoFocus onClick={() => dialog.current?.close()}><Glyph name="x" size={18} /></button></header>diff --git a/src/client/components/living/button.css b/src/client/components/living/button.cssindex 0d0f9247..3a16d8f1 100644--- a/src/client/components/living/button.css+++ b/src/client/components/living/button.css@@ -1,5 +1,12 @@/* Shared control geometry and motion for the application and static website. */:root {+ --spring: cubic-bezier(.3, 1.45, .45, 1);+ --control-size: 52px;+ --control-compact-size: 44px;+ --control-dense-size: 36px;+ --control-icon-size: 18px;+ --control-label-size: 12.5px;+ --control-border-width: 2px;--control-hover-transform: translateY(-2px);--control-press-transform: translateY(2px);--control-motion: transform 260ms var(--spring);@@ -11,12 +18,14 @@ button { -webkit-user-select: none; user-select: none; -webkit-touch-callout: noalign-items: center;justify-content: center;gap: 8px;- min-width: 52px; height: 52px;- padding: 0 14px;- border: 2px solid var(--control-edge);+ min-width: var(--button-size, var(--control-size)); height: var(--button-size, var(--control-size));+ padding: 0 var(--button-padding, 14px);+ border: var(--control-border-width) solid var(--control-edge);border-radius: 999px;background: var(--paper);color: var(--ink);+ font-size: var(--control-label-size);+ font-weight: 600;white-space: nowrap;text-decoration: none;box-shadow: var(--control-shadow);@@ -31,8 +40,13 @@ button { -webkit-user-select: none; user-select: none; -webkit-touch-callout: no.lr-btn.is-danger:is(:hover, :focus-visible):not(:disabled):not([aria-disabled="true"]) { background: color-mix(in srgb, var(--danger) 10%, var(--paper)); }.lr-btn.is-on { border-color: var(--action); background: var(--control-selected); color: var(--control-selected-ink); box-shadow: inset 0 0 0 1px var(--action), var(--control-shadow); }.lr-btn.is-on:active:not(:disabled):not([aria-disabled="true"]) { box-shadow: inset 0 0 0 1px var(--action); }-.lr-btn .lr-cap { margin-left: 2px; font-size: 12.5px; font-weight: 600; }-.lr-theme-toggle { min-width: 40px; height: 40px; }+.lr-btn .lr-cap { margin-left: 2px; font-size: var(--control-label-size); font-weight: 600; }+.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; }+.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); }@media (prefers-reduced-motion: reduce) {:root { --control-hover-transform: none; --control-press-transform: none; }.lr-btn { transform: none !important; transition: none !important; }diff --git a/src/client/components/living/comic-presentation.ts b/src/client/components/living/comic-presentation.tsindex c376fb5e..ce47a6ea 100644--- a/src/client/components/living/comic-presentation.ts+++ b/src/client/components/living/comic-presentation.ts@@ -81,7 +81,7 @@ export function getComicPresentation(kind?: ComicKind | HintKind): ComicPresentaconst COLOURS: Record<ComicTone, string> = {off: "var(--comic-neutral, var(--ink))",- busy: "var(--action)",+ busy: "var(--busy)",live: "var(--live)",warn: "var(--warn)",bad: "var(--danger)",diff --git a/src/client/components/living/floating-panel.css b/src/client/components/living/floating-panel.cssindex d99f0fce..807feb4c 100644--- a/src/client/components/living/floating-panel.css+++ b/src/client/components/living/floating-panel.css@@ -17,8 +17,7 @@.lr-floating-resize:is(:hover, :focus-visible) { color: var(--action); }.lr-floating-resize:focus-visible { outline: 2px solid var(--action); outline-offset: -4px; border-radius: 10px; }@keyframes lr-floating-enter { from { opacity: 0; transform: translateY(8px) scale(.97); } to { opacity: 1; transform: none; } }-.lr-popover-close { display: grid; place-items: center; width: 36px; height: 36px; flex: none; background: transparent; color: var(--muted); border: 0; border-radius: 12px; cursor: pointer; }-.lr-popover-close:is(:hover, :focus-visible):not(:disabled) { background: var(--control-hover); color: var(--ink); }+.lr-popover-close { flex: none; }.lr-floating-error { padding: 8px 0; color: var(--danger); font-size: 12px; }/* The browser owns the detached frame, movement and resizing. */.lr-panel-window { background: var(--paper); }diff --git a/src/client/components/living/hints/index.tsx b/src/client/components/living/hints/index.tsxindex a4b341f5..c1872653 100644--- a/src/client/components/living/hints/index.tsx+++ b/src/client/components/living/hints/index.tsx@@ -67,6 +67,7 @@ export const HINT_KINDS: readonly HintKind[] = ["hint-topology","hint-close","hint-rename",+ "hint-help","hint-theme-light","hint-theme-dark","hint-collapse",diff --git a/src/client/components/living/hints/set4.tsx b/src/client/components/living/hints/set4.tsxindex df1336d4..18470870 100644--- a/src/client/components/living/hints/set4.tsx+++ b/src/client/components/living/hints/set4.tsx@@ -22,10 +22,30 @@ import {import type { ComicTheme } from "../Comic";import type { HintScene, Set4Kind } from "../../../ui/visual-kinds";import { BrandMark } from "../BrandMark";+import { Glyph } from "../../../ui/icons";const INK = "var(--ink)";const WALL2 = "var(--wall-2)";+/* A question leads to a guide; reading stays neutral, not a success verdict. */+const HintHelp: HintScene = ({ theme }) => (+ <>+ <style>{`+.vls-help-question{animation:vlsHelpQuestion var(--comic-duration,3.2s) ease-in-out var(--comic-repeat,1) both}+.vls-help-reader{animation:vlsHelpRead var(--comic-duration,3.2s) ease-in-out var(--comic-repeat,1) both}+@keyframes vlsHelpQuestion{0%,12%,32%,100%{transform:translateY(0)}22%{transform:translateY(-3px)}}+@keyframes vlsHelpRead{0%,42%,62%,100%{transform:translateY(0)}52%{transform:translateY(-2px)}}+${rmBlock(["vls-help-question", "vls-help-reader"], [[".vls-help-question,.vls-help-reader", "transform:none"]])}+`}</style>+ <Frame x={4} w={152} theme={theme} />+ <Frame x={164} w={152} theme={theme} result />+ <Pawn x={52} yb={78} s={12} eyes />+ <g transform="translate(96 26)" color={INK}><g className="vls-help-question"><Glyph name="help" size={28} /></g></g>+ <Pawn x={202} yb={78} s={12} eyes className="vls-help-reader" />+ <g transform="translate(238 25)" color={INK}><Glyph name="book" size={50} /></g>+ </>+);+/* hint-topology: [one pawn with a Host badge] → [host with two leafpawns on neutral edges]. Demo: leaves hop in turn (8-20%, 26-38%),everyone blinks at 62%; rest >=55%. */@@ -436,6 +456,7 @@ ${rmBlock();export const SET4_SCENES: Record<Set4Kind, HintScene> = {+ "hint-help": HintHelp,"hint-topology": HintTopology,"hint-close": HintClose,"hint-rename": HintRename,diff --git a/src/client/components/living/language-control.css b/src/client/components/living/language-control.cssdeleted file mode 100644index 7f46937b..00000000--- a/src/client/components/living/language-control.css+++ /dev/null@@ -1,55 +0,0 @@-/* Shared by the application and static website. The selected button owns the- thumb position; language choices and persistence belong to each surface. */-.lr-lang {- --lang-count: 3;- position: relative;- display: inline-grid;- grid-auto-flow: column;- grid-auto-columns: 1fr;- padding: 4px;- border: 2.5px solid var(--ink);- border-radius: 999px;- background: var(--paper);-}-.lr-lang:has(.lr-lang-more) { --lang-count: 4; }-.lr-lang::before {- content: "";- position: absolute;- top: 4px; bottom: 4px; left: 4px;- width: calc((100% - 8px) / var(--lang-count));- border-radius: 999px;- background: var(--ink);- box-shadow: inset 0 0 0 2px var(--action);- transition: transform 260ms var(--spring);- pointer-events: none;-}-.lr-lang:has(> :nth-child(2).is-selected)::before { transform: translateX(100%); }-.lr-lang:has(> :nth-child(3).is-selected)::before { transform: translateX(200%); }-.lr-lang:has(> :nth-child(4).is-selected)::before { transform: translateX(300%); }-.lr-lang > button {- position: relative;- display: inline-grid;- min-width: 38px;- height: 34px;- place-items: center;- padding: 0 9px;- border: 0;- border-radius: 999px;- background: transparent;- color: var(--ink);- font-size: 12px;- font-weight: 700;- opacity: .68;- transition: opacity 120ms ease, color 140ms ease, background-color 140ms ease, transform 180ms var(--spring);-}-.lr-lang > button:is(:hover, :focus-visible) { opacity: 1; transform: translateY(-1px); }-.lr-lang > button:is(:hover, :focus-visible):not(.is-selected) { background: var(--wall-2); }-.lr-lang > button:active { transform: var(--control-press-transform); transition-duration: 80ms; }-.lr-lang > .is-selected { color: var(--paper); opacity: 1; }-@media (prefers-reduced-motion: reduce) {- .lr-lang::before, .lr-lang > button { transition: none; }- .lr-lang > button { transform: none !important; }-}-html[data-reduced-motion] .lr-lang::before,-html[data-reduced-motion] .lr-lang > button { transition: none; }-html[data-reduced-motion] .lr-lang > button { transform: none !important; }diff --git a/src/client/components/living/playback-controls.css b/src/client/components/living/playback-controls.cssindex 3a9041c7..74d009f4 100644--- a/src/client/components/living/playback-controls.css+++ b/src/client/components/living/playback-controls.css@@ -47,11 +47,11 @@.lr-tv-screen:has(> .lr-playback):has(> video:focus-visible) { outline: 3px solid var(--action); outline-offset: 2px; }.lr-playback .lr-btn {display: grid; place-items: center; flex: none;- min-width: 0; width: 44px; height: 44px; padding: 0;+ min-width: 0; width: var(--control-compact-size); padding: 0;}.lr-playback-watch { display: flex; align-items: center; flex: 1; gap: 8px; min-width: 0; }.lr-playback-volume { flex: 0 1 144px; min-width: 24px; }-.lr-playback-volume input { width: 100%; min-width: 0; height: 44px; padding: 0; margin: 0; accent-color: var(--action); cursor: pointer; }+.lr-playback-volume input { width: 100%; min-width: 0; height: var(--control-compact-size); padding: 0; margin: 0; accent-color: var(--action); cursor: pointer; }.lr-playback-level { flex: none; width: 4ch; text-align: right; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }.lr-playback-level.is-boosted { color: var(--action-text); }.lr-playback > :is(.lr-remote-controls, .lr-playback-view) { display: inline-flex; align-items: center; flex: none; gap: 4px; }@@ -64,9 +64,9 @@.lr-playback-settings { width: min(560px, calc(100vw - 16px)); padding: 16px; container: playback-settings / inline-size; }.lr-viewer-settings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; width: 100%; }.lr-viewer-settings section { min-width: 0; }-.lr-viewer-settings-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 36px; margin-bottom: 12px; }+.lr-viewer-settings-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: var(--control-dense-size); margin-bottom: 12px; }.lr-viewer-settings h3, .lr-playback-overlay-settings h3 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 12px; font-weight: 650; }-.lr-viewer-settings-heading .lr-btn { display: flex; align-items: center; gap: 5px; width: auto; height: 36px; padding: 0 8px; font-size: 12px; white-space: nowrap; }+.lr-viewer-settings-heading .lr-btn { width: auto; }.lr-viewer-settings .lr-row-group { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }.lr-viewer-settings .lr-row-group > * { min-width: 0; }.lr-viewer-settings .lr-chip { display: flex; align-items: center; justify-content: center; gap: 5px; width: 100%; min-height: 40px; padding: 6px; font-size: 12px; white-space: nowrap; }@@ -90,7 +90,7 @@.lr-tv-overlay > .lr-waiting-caption { min-height: 1.4em; }.lr-tv-overlay > .lr-waiting-caption > span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }.lr-playback.lr-media-controls { gap: 4px; padding: 4px 4px max(4px, env(safe-area-inset-bottom)); }- .lr-playback .lr-btn { width: clamp(24px, 9cqw, 44px); }+ .lr-playback .lr-btn { width: clamp(24px, 9cqw, var(--control-compact-size)); }.lr-playback-menu .lr-btn { width: auto; }.lr-playback-menu-actions .lr-btn, .lr-playback-display-menu .lr-btn { width: 100%; }.lr-playback-watch { gap: 2px; }diff --git a/src/client/components/living/primitives.tsx b/src/client/components/living/primitives.tsxindex 9ce62818..e533d941 100644--- a/src/client/components/living/primitives.tsx+++ b/src/client/components/living/primitives.tsx@@ -40,6 +40,8 @@ export function Btn({icon,cap,tone,+ size,+ quiet = false,title,disabled,busy,@@ -59,6 +61,8 @@ export function Btn({icon: GlyphName;cap?: CopyKey;tone?: "primary" | "danger" | "on";+ size?: "compact" | "dense";+ quiet?: boolean;title: CopyKey;disabled?: boolean;busy?: boolean;@@ -86,7 +90,7 @@ export function Btn({<buttonid={id}type={type}- className={`lr-btn${activeTone ? ` is-${activeTone}` : ""}`}+ className={`lr-btn${size ? ` is-${size}` : ""}${quiet ? " is-quiet" : ""}${activeTone ? ` is-${activeTone}` : ""}`}aria-label={label}disabled={disabled && !softDisabled}aria-disabled={softDisabled || undefined}diff --git a/src/client/components/living/remote-control.css b/src/client/components/living/remote-control.cssindex e3ccab39..3b87a0c1 100644--- a/src/client/components/living/remote-control.css+++ b/src/client/components/living/remote-control.css@@ -17,10 +17,10 @@.lr-remote-field-label { font-size: 12px; font-weight: 650; }.lr-remote-modes.lr-toggle { display: grid; }.lr-remote-modes > .lr-comic-tip-wrap { min-width: 0; }-.lr-remote-modes button { min-width: 0; height: auto; min-height: 40px; padding: 6px 4px; font: 600 12px/1.3 var(--font); white-space: normal; }+.lr-remote-modes button { min-width: 0; padding: 6px 4px; line-height: 1.3; white-space: normal; }.lr-remote-policy-actions { display: flex; align-items: center; gap: 8px; }.lr-remote-settings > .lr-remote-policy-actions > * { flex: 1; }-.lr-remote-settings .lr-remote-policy-actions .lr-btn { width: 100%; height: 42px; }+.lr-remote-settings .lr-remote-policy-actions .lr-btn { width: 100%; }.lr-remote-policy-actions .lr-input { flex: 1; min-width: 0; }.lr-remote-policy-actions .lr-input input { min-width: 0; width: 100%; }.lr-remote-password p { display: flex; align-items: center; gap: 6px; color: var(--warn); margin: 8px auto 0; font-size: 12px; }@@ -49,15 +49,13 @@:is(.lr-remote-keyboard, .lr-remote-password) { grid-area: 3 / 1; z-index: 4; padding: 10px 12px 12px; background: var(--paper); color: var(--ink); border-top: 1px solid var(--control-edge); }:is(.lr-remote-keyboard, .lr-remote-password) .lr-input { padding: 0 10px; }:is(.lr-remote-keyboard, .lr-remote-password) input { font-size: 16px; }-:is(.lr-remote-keyboard, .lr-remote-password) .lr-btn { width: 40px; height: 40px; min-width: 0; padding: 0; }-.lr-remote-game-mouse .lr-btn { width: auto; padding: 0 12px; }.lr-remote-keys { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; margin-bottom: 10px; }.lr-remote-shortcuts:has(> :nth-child(4):last-child) { grid-template-columns: repeat(4, minmax(0, 1fr)); }.lr-remote-keyboard { min-height: 0; max-height: 65dvh; overflow-y: auto; overscroll-behavior: contain; outline: none; }.lr-remote-keyboard > .lr-remote-panel-header { position: sticky; top: -10px; z-index: 1; background: var(--paper); }.lr-remote-keyboard > * { max-width: 640px; margin-inline: auto; }-.lr-remote-keyboard .lr-remote-key-pages { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 12px; }-.lr-remote-keyboard .lr-remote-key-pages button { min-width: 0; height: 36px; padding: 4px 8px; font-size: 12px; letter-spacing: 0; }+.lr-remote-keyboard .lr-remote-key-pages { --selection-item-size: calc(var(--control-compact-size) - 12px); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 12px; }+.lr-remote-keyboard .lr-remote-key-pages button { min-width: 0; padding: 4px 8px; }.lr-remote-key-row { display: flex; justify-content: center; gap: 4px; margin-bottom: 6px; }.lr-remote-key-row .lr-chip { flex: 1; }.lr-remote-key-layout.is-letters .lr-remote-key-row:not(:last-child) .lr-chip { flex: 0 1 calc((100% - 36px) / 10); }@@ -82,7 +80,7 @@.lr-remote-text-field textarea::placeholder { color: var(--muted); font-family: var(--font); opacity: 1; }.lr-remote-text-actions { display: flex; justify-content: end; }.lr-remote-keyboard .lr-remote-text-entry p[role="alert"] { color: var(--danger); }-.lr-remote-text-entry .lr-btn { flex: none; width: auto; gap: 6px; padding-inline: 12px; }+.lr-remote-text-entry .lr-btn { flex: none; }.lr-remote-keyboard .lr-remote-text-entry p { margin: 0; text-align: start; }:is(.lr-remote-keys, .lr-remote-key-row) .lr-chip { justify-content: center; padding: 4px 0; width: 100%; min-width: 0; min-height: 38px; border-width: 1px; border-radius: 9px; font: 600 12px var(--mono); letter-spacing: 0; white-space: nowrap; touch-action: none; }.lr-remote-keyboard p { margin-block: 8px 0; text-align: center; color: var(--muted); font-size: 12px; line-height: 1.5; }diff --git a/src/client/components/living/room-interactions.css b/src/client/components/living/room-interactions.cssindex dbbc71b5..70a2443b 100644--- a/src/client/components/living/room-interactions.css+++ b/src/client/components/living/room-interactions.css@@ -19,7 +19,6 @@.lr-interaction-picker[hidden] { display: none; }.lr-interaction-picker:not([hidden]) { transform-origin: center bottom; animation: lr-floating-enter 150ms var(--spring); }.lr-interaction-back { flex: none; padding: 14px 0 0; }-.lr-interaction-back .lr-btn { min-width: 36px; height: 36px; padding: 0 10px; gap: 4px; }.lr-interaction-activity { position: absolute; z-index: 2; right: 4px; bottom: 8px; max-width: calc(100% - 8px); padding-top: 68px; pointer-events: none; --gift-arc: 30px; --gift-lift: 30px; }.lr-interaction-activity-people, .lr-interaction-activity-people > span { display: flex; align-items: center; gap: 12px; min-width: 0; }.lr-interaction-activity-people { padding: 8px 12px; border: 1px solid var(--control-edge); border-radius: 18px; background: color-mix(in srgb, var(--paper) 96%, transparent); box-shadow: var(--control-shadow); }@@ -59,11 +58,9 @@ button.lr-chat-avatar:focus-visible { outline-offset: -3px; }.lr-chat-compose:has(input:focus-visible) { outline: 3px solid var(--action); outline-offset: 2px; }.lr-chat-input-row { display: flex; align-items: center; gap: 6px; }.lr-chat-input-row > input { min-width: 0; flex: 1; width: 0; height: 44px; border: 0; outline: none; border-radius: 14px; padding: 0 10px; background: transparent; color: var(--ink); font-size: 16px; }-.lr-chat-input-row .lr-btn { flex: none; width: 40px; height: 40px; min-width: 40px; padding: 0; border-radius: 14px; }+.lr-chat-input-row .lr-btn { flex: none; }.lr-chat-tools { display: flex; align-items: center; gap: 2px; padding-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.5; }-.lr-chat-tools .lr-btn { flex: none; min-width: 36px; height: 36px; padding: 0 8px; gap: 6px; border-color: transparent; background: transparent; box-shadow: none; color: var(--muted); }-.lr-chat-tools .lr-btn:is(:hover, :focus-visible) { background: var(--control-hover); color: var(--ink); }-.lr-chat-tools .lr-btn.is-on { background: var(--control-selected); color: var(--control-selected-ink); }+.lr-chat-tools .lr-btn { flex: none; }.lr-chat-tools .lr-chat-count { padding: 0 4px; }.lr-chat-compose[hidden] { display: none; }.lr-chat-settings { flex: 1; padding-block: 18px; }diff --git a/src/client/components/living/segmented-control.css b/src/client/components/living/segmented-control.cssnew file mode 100644index 00000000..b2d3483e--- /dev/null+++ b/src/client/components/living/segmented-control.css@@ -0,0 +1,82 @@+/* One track for language, settings and source tabs, including native radio+ groups. Callers own semantics, selection and content-specific proportions. */+.lr-toggle, .lr-lang {+ --lr-segments: 2;+ --lr-selected-index: 0;+ --selection-item-size: var(--control-compact-size);+ position: relative;+ display: inline-grid;+ grid-auto-flow: column;+ grid-auto-columns: 1fr;+ padding: 4px;+ border: var(--control-border-width) solid var(--control-edge);+ border-radius: 999px;+ background: var(--paper);+ box-shadow: var(--control-shadow);+}+.lr-lang {+ --lr-segments: 3;+ --selection-item-size: calc(var(--control-compact-size) - 12px);+ grid-auto-columns: var(--selection-item-size);+}+.lr-lang:has(.lr-lang-more) { --lr-segments: 4; }+:is(.lr-toggle, .lr-lang)::before {+ content: "";+ position: absolute;+ top: 4px; bottom: 4px; left: 4px;+ width: calc((100% - 8px) / var(--lr-segments));+ border-radius: 999px;+ background: var(--control-selected);+ box-shadow: inset 0 0 0 var(--control-border-width) var(--action);+ transform: translateX(calc(var(--lr-selected-index) * 100%));+ transition: transform 260ms var(--spring);+ pointer-events: none;+}+:is(.lr-toggle, .lr-lang):not(:has(.is-selected, input:checked))::before,+.lr-toggle:disabled::before { opacity: 0; }+:is(.lr-toggle, .lr-lang):has(> :nth-child(2).is-selected, > :nth-child(2) .is-selected, > label:nth-of-type(2) input:checked) { --lr-selected-index: 1; }+:is(.lr-toggle, .lr-lang):has(> :nth-child(3).is-selected, > :nth-child(3) .is-selected, > label:nth-of-type(3) input:checked) { --lr-selected-index: 2; }+:is(.lr-toggle, .lr-lang):has(> :nth-child(4).is-selected, > :nth-child(4) .is-selected, > label:nth-of-type(4) input:checked) { --lr-selected-index: 3; }+.lr-toggle button, .lr-lang > button, .lr-toggle > label > span {+ position: relative;+ z-index: 1;+ display: inline-flex;+ align-items: center;+ justify-content: center;+ gap: 5px;+ min-width: var(--selection-item-size);+ min-height: var(--selection-item-size);+ padding: 0 10px;+ border: 0;+ border-radius: 999px;+ background: transparent;+ color: color-mix(in srgb, var(--ink) 68%, var(--paper));+ font-size: var(--control-label-size);+ font-weight: 600;+ transition: color 140ms ease, background-color 140ms ease, var(--control-motion);+}+.lr-lang > button { min-width: 0; padding: 0; }+.lr-toggle > label { position: relative; min-width: 0; }+.lr-toggle > label > input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }+.lr-toggle > label > input:disabled { cursor: default; }+.lr-toggle > label > span { display: flex; pointer-events: none; }+.lr-toggle input:focus-visible + span { outline: 3px solid var(--action); outline-offset: 3px; }+:is(.lr-toggle, .lr-lang) button.is-selected,+.lr-toggle input:checked + span { color: var(--control-selected-ink); }+:is(.lr-toggle, .lr-lang) button:is(:hover, :focus-visible):not(:disabled),+.lr-toggle input:enabled:is(:hover, :focus-visible) + span { transform: translateY(-1px); }+:is(.lr-toggle, .lr-lang) button:is(:hover, :focus-visible):not(:disabled):not(.is-selected),+.lr-toggle input:enabled:not(:checked):is(:hover, :focus-visible) + span { background: var(--control-hover); color: var(--ink); }+:is(.lr-toggle, .lr-lang) button:active:not(:disabled),+.lr-toggle input:enabled:active + span { transform: var(--control-press-transform); transition-duration: 80ms; }+.lr-toggle > .lr-comic-tip-wrap { min-width: 0; justify-content: center; }+.lr-toggle > .lr-comic-tip-wrap > button { width: 100%; }+@media (prefers-reduced-motion: reduce) {+ :is(.lr-toggle, .lr-lang)::before, :is(.lr-toggle, .lr-lang) button, .lr-toggle > label > span { transition: none; }+ :is(.lr-toggle, .lr-lang) button, .lr-toggle > label > span { transform: none !important; }+}+html[data-reduced-motion] :is(.lr-toggle, .lr-lang)::before,+html[data-reduced-motion] :is(.lr-toggle, .lr-lang) button,+html[data-reduced-motion] .lr-toggle > label > span { transition: none; }+html[data-reduced-motion] :is(.lr-toggle, .lr-lang) button,+html[data-reduced-motion] .lr-toggle > label > span { transform: none !important; }diff --git a/src/client/components/living/share-failure-help.css b/src/client/components/living/share-failure-help.cssindex 088b0042..85b6c543 100644--- a/src/client/components/living/share-failure-help.css+++ b/src/client/components/living/share-failure-help.css@@ -16,7 +16,6 @@.lr-share-help[open] { animation: lr-share-help-enter 180ms var(--spring); }.lr-share-help header { display: flex; gap: 16px; align-items: center; justify-content: space-between; }.lr-share-help h2 { margin: 0; font-size: 18px; }-.lr-share-help header button { min-width: 40px; min-height: 40px; padding: 8px; }.lr-share-help-scene { width: min(260px, 100%); margin: 16px auto; }.lr-share-help-reason { font-weight: 700; line-height: 1.6; margin: 12px 0 6px; }.lr-share-help code { color: var(--muted); font-size: 12px; }diff --git a/src/client/components/living/status-indicator.css b/src/client/components/living/status-indicator.cssindex b1f4a792..03afa0c6 100644--- a/src/client/components/living/status-indicator.css+++ b/src/client/components/living/status-indicator.css@@ -1,5 +1,5 @@.lr-status-indicator {- --status-colour: #8ea3b8;+ --status-colour: var(--idle);display: inline-flex;align-items: center;justify-content: center;@@ -16,7 +16,7 @@ button.lr-status-indicator {cursor: pointer;}.lr-status-indicator[data-tone="live"] { --status-colour: var(--live); }-.lr-status-indicator[data-tone="busy"] { --status-colour: var(--action); }+.lr-status-indicator[data-tone="busy"] { --status-colour: var(--busy); }.lr-status-indicator[data-tone="warn"] { --status-colour: var(--warn); }.lr-status-indicator[data-tone="bad"] { --status-colour: var(--danger); }.lr-status-indicator:focus-visible { outline: 2px solid var(--action); outline-offset: 2px; }diff --git a/src/client/locales/en.ts b/src/client/locales/en.tsindex 7817caba..1788cfde 100644--- a/src/client/locales/en.ts+++ b/src/client/locales/en.ts@@ -12,6 +12,10 @@ export const en: Record<CopyKey, string> = {"remote.keyboardHelp": "Hold a key to keep it pressed; let go to release.","remote.combinationHelp": "Select Ctrl, Shift or Alt, then another key. They release together.","remote.combinationMode": "Key combination mode",+ "remote.key.ShiftLeft": "Shift",+ "remote.key.Windows": "Windows key",+ "remote.key.Command": "Command key",+ "remote.key.Super": "Super key","remote.key.Space": "Space","remote.key.Insert": "Insert","remote.key.Delete": "Delete",@@ -133,6 +137,9 @@ export const en: Record<CopyKey, string> = {"debug.exportHint": "Download browser diagnostics; may include network addresses and device details","debug.exportFailed": "Could not download diagnostics; try again","brand.home": "Piik home",+ "help.title": "Help",+ "help.hint": "Help, diagnostics and version information",+ "help.troubleshooting": "Troubleshooting","common.roomCode": "Room code","host.roomCodePending": "A room code appears when sharing starts",diff --git a/src/client/locales/zh.ts b/src/client/locales/zh.tsindex 57e8bd4a..576c7892 100644--- a/src/client/locales/zh.ts+++ b/src/client/locales/zh.ts@@ -12,6 +12,10 @@ export const zh = {"remote.keyboardHelp": "按住即长按,松手即松开。","remote.combinationHelp": "先选 Ctrl、Shift 等键,再按另一键;完成后自动松开。","remote.combinationMode": "组合键模式",+ "remote.key.ShiftLeft": "Shift 键",+ "remote.key.Windows": "Windows 键",+ "remote.key.Command": "Command 键",+ "remote.key.Super": "Super 键","remote.key.Space": "空格键","remote.key.Insert": "插入键","remote.key.Delete": "删除键",@@ -133,6 +137,9 @@ export const zh = {"debug.exportHint": "下载网页诊断,可能包含网络地址和设备信息","debug.exportFailed": "诊断下载失败,请重试","brand.home": "Piik 首页",+ "help.title": "帮助",+ "help.hint": "帮助、诊断与版本信息",+ "help.troubleshooting": "问题排查","common.roomCode": "房间号","host.roomCodePending": "开始分享后生成房间号",diff --git a/src/client/pages/AppLauncherPage.tsx b/src/client/pages/AppLauncherPage.tsxindex 79b442ad..d2413730 100644--- a/src/client/pages/AppLauncherPage.tsx+++ b/src/client/pages/AppLauncherPage.tsx@@ -256,7 +256,7 @@ export function AppLauncherPage() {return (<div className="lr-app"><AppHeader homeHref="/client" diagnosticControl={appDebug === undefined ? null : (- <Btn icon="cpu" title="client.launch.debugHint" cap="client.launch.debug"+ <Btn icon="cpu" title="client.launch.debugHint" size="compact"pressed={debug} tone={debug ? "on" : undefined} hint="debug-start"disabled={appDebug || debugBusy || loading || starting || !!target || error !== null}onClick={() => void enableDebug()} />@@ -346,7 +346,7 @@ export function AppLauncherPage() {)}</main><footer className="lr-client-footer">- <a className="lr-btn" href="https://github.com/TNTcraftHIM/Piik" target="_blank" rel="noopener noreferrer">GitHub<span aria-hidden="true"> ↗</span></a>+ <a className="lr-btn is-dense is-quiet" href="https://github.com/TNTcraftHIM/Piik" target="_blank" rel="noopener noreferrer">GitHub<span aria-hidden="true"> ↗</span></a>{version && <p className="lr-client-version"><span className={vis ? "visually-hidden" : undefined}>{t("client.launch.version", { version })}</span>{vis && <span aria-hidden="true">{version}</span>}diff --git a/src/client/pages/ControlsPreview.tsx b/src/client/pages/ControlsPreview.tsxindex 1031d925..c68d832f 100644--- a/src/client/pages/ControlsPreview.tsx+++ b/src/client/pages/ControlsPreview.tsx@@ -33,6 +33,7 @@ import { deriveParticipantStatus, STATUS_CATALOG } from "../ui/media-status";import { Glyph } from "../ui/icons";import { useCopy } from "../ui/copy";import { PeoplePreview } from "./PeoplePreview";+import { RemoteControlsPreview } from "./RemoteControlsPreview";import "./controls-preview.css";const POSTER = `data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 360"><rect width="640" height="360" fill="#e8eee6"/><rect x="100" y="60" width="440" height="240" rx="20" fill="#fffdf6"/><path d="M100 100h440" stroke="#c9d7cf" stroke-width="2"/><circle cx="128" cy="81" r="6" fill="#ed9e65"/><circle cx="320" cy="190" r="46" fill="#65b099"/><path d="m310 191 9 9 16-22" fill="none" stroke="#fffdf6" stroke-width="7" stroke-linecap="round" stroke-linejoin="round"/></svg>')}`;@@ -112,6 +113,18 @@ export function ControlsPreview() {<Btn icon="network" title="host.topology" hint="hint-topology" onClick={notify} /><Btn icon="sliders" title="host.advanced" hint="hint-advanced" onClick={notify} /></div>+ <p>{en ? "The same button family has regular, compact and dense sizes. Quiet actions keep a usable target without a visible frame."+ : "同一按钮族提供常规、紧凑和小尺寸;弱化操作保留点击范围,不强调边框。"}</p>+ <div className="cp-tools">+ {([undefined, "compact", "dense"] as const).map((size, index) => <figure className="cp-control-sample" key={size ?? "regular"}>+ <Btn icon="link" title="host.invite.copy" hint="hint-copy-invite" size={size} onClick={notify} />+ <figcaption>{en ? ["Regular", "Compact", "Dense"][index] : ["常规", "紧凑", "小尺寸"][index]}</figcaption>+ </figure>)}+ <figure className="cp-control-sample">+ <Btn icon="help" title="help.title" hint="hint-help" size="compact" quiet onClick={notify} />+ <figcaption>{en ? "Quiet" : "弱化"}</figcaption>+ </figure>+ </div></section><section id="sharing-preview" className="cp-card cp-sharing-preview"><header><h2>{t("host.advanced")}</h2></header>@@ -145,7 +158,7 @@ export function ControlsPreview() {<div className="lr-door-group"><span className="lr-door-glyph"><Glyph name="puzzle" size={19} /><span>{vis ? null : t("host.advanced.codec")}</span></span><div className="lr-row-group" role="group" aria-label={t("host.advanced.codec")}>- {(["vp8", "auto", "h264"] as const).map(mode => <Chip key={mode} selected={mode === "auto"} disabled+ {(["vp8", "auto", "h264"] as const).map(mode => <Chip key={mode} name="videoCodec" value={mode} selected={mode === "auto"} disabledtitle={mode === "auto" ? t("host.advanced.codec.auto") : mode.toUpperCase()} hint="hint-codec">{mode === "auto" && !vis ? t("host.advanced.codec.auto") : mode.toUpperCase()}</Chip>)}@@ -182,7 +195,7 @@ export function ControlsPreview() {<SwitchItem checked disabled locked onChange={() => undefined} label={t("host.advanced.route.sfuOnly")}note={t("host.advanced.route.sfuOnlyHint")} hint="hint-route-sfu" /></div>- <div className="cp-tools">+ <div className="cp-tools" id="admission-preview"><span className="lr-toggle" role="group" aria-label={t("host.policy")}>{(["open", "private"] as const).map(value => <Tooltip key={value} kind={value === "open" ? "hint-admission-code" : "hint-policy-private"}text={vis ? undefined : `${t(`host.policy.${value}`)} · ${t(value === "private" && roomPassword ? "host.policy.privatePasswordHint" : `host.policy.${value}Hint`)}`}>@@ -210,6 +223,13 @@ export function ControlsPreview() {</div>{!includeCredential && policy === "private" && !roomPassword ? <Pill icon="lock" tone="warn"comic="hint-policy-private" label={t("host.invite.credentialRequired")} /> : null}+ <p>{en ? "The website's architecture picker uses the same sliding style with native radio buttons. Arrow keys change the choice."+ : "官网的架构选择也复用滑动样式,使用原生单选项;聚焦后可用方向键切换。"}</p>+ <fieldset className="lr-toggle">+ <legend className="visually-hidden">{en ? "Download architecture" : "下载架构"}</legend>+ <label><input type="radio" name="preview-architecture" value="amd64" defaultChecked /><span>x64</span></label>+ <label><input type="radio" name="preview-architecture" value="arm64" /><span>ARM64</span></label>+ </fieldset></section><section id="input-preview" className="cp-card"><header><span className="cp-number">03</span><h2>{en ? "Names, codes and small details" : "名字、房间号,还有小细节。"}</h2></header>@@ -315,6 +335,7 @@ export function ControlsPreview() {<p>{en ? "Chat and react in one window. Open reactions beside the message input; supported browsers can keep this window on top." : "聊天和表情都在一个窗口里。点输入区的「发表情」选择互动对象;支持的浏览器可以将窗口置顶。"}</p></div></header><InteractionControlsPreview /></section>+ <RemoteControlsPreview /></>;}diff --git a/src/client/pages/HostPage.tsx b/src/client/pages/HostPage.tsxindex cc3d24f5..0834befc 100644--- a/src/client/pages/HostPage.tsx+++ b/src/client/pages/HostPage.tsx@@ -3904,7 +3904,7 @@ export function HostPage({<span className="lr-door-glyph"><Glyph name="puzzle" size={19} /><Cap k="host.advanced.codec" /></span><div className="lr-row-group" role="group" aria-label={t("host.advanced.codec")}>{(["vp8", "auto", "h264"] as const).map(mode => (- <Chip key={mode} selected={displayedVideoCodecMode === mode}+ <Chip key={mode} name="videoCodec" value={mode} selected={displayedVideoCodecMode === mode}disabled={phase === "starting" || phase === "live"}title={mode === "auto"? resolvedVideoCodecdiff --git a/src/client/pages/RemoteControlsPreview.tsx b/src/client/pages/RemoteControlsPreview.tsxnew file mode 100644index 00000000..f574189e--- /dev/null+++ b/src/client/pages/RemoteControlsPreview.tsx@@ -0,0 +1,55 @@+import { useCallback, useState } from "react";+import { HostRemoteControl } from "../components/living/HostRemoteControl";+import { RemoteKeyboard } from "../components/living/RemoteKeyboard";+import { Btn } from "../components/living/primitives";+import type { RemoteControlRequest } from "../native/wire";+import type { RemoteInputEvent } from "../remote-control/input-session";+import type { RemoteControlMode, RemoteInputPlatform } from "../remote-control/protocol";+import { useCopy } from "../ui/copy";++export function RemoteControlsPreview() {+ const { lang, t } = useCopy();+ const en = lang === "en";+ const [platform, setPlatform] = useState<RemoteInputPlatform>("windows");+ const [mode, setMode] = useState<RemoteControlMode>("off");+ const [requests, setRequests] = useState<(RemoteControlRequest & { name: string })[]>([]);+ const [keyboardOpen, setKeyboardOpen] = useState(false);+ const [lastInput, setLastInput] = useState("");+ const input = useCallback((event: RemoteInputEvent) => setLastInput(JSON.stringify(event)), []);+ const closeKeyboard = () => {+ setKeyboardOpen(false);+ document.getElementById("preview-remote-keyboard-toggle")?.focus();+ };++ return <section id="remote-control-preview" className="cp-section">+ <header className="cp-section-head"><div>+ <h2>{t("remote.title")}</h2>+ <p>{en ? "Actual permission panel and keyboard, with local sample state. Key presses only appear below; they are not sent to an App or operating system."+ : "正式的授权浮窗与虚拟键盘,使用本地示例状态。按键只在下方显示,不发送到 App 或操作系统。"}</p>+ </div></header>+ <div className="cp-tools">+ <label className="lr-input"><span>{en ? "Host platform" : "房主平台"}</span>+ <select value={platform} onChange={event => setPlatform(event.target.value as RemoteInputPlatform)}>+ <option value="windows">Windows</option><option value="darwin">macOS</option><option value="linux">Linux</option>+ </select>+ </label>+ <HostRemoteControl mode={mode} platform={platform} requests={requests}+ onPolicy={async value => { setMode(value); setRequests([]); }}+ onDecide={async (id, allow) => setRequests(current => allow+ ? current.map(request => request.id === id ? { ...request, state: "active" } : request)+ : current.filter(request => request.id !== id))} />+ <button type="button" className="lr-btn" onClick={() => {+ setMode("ask");+ setRequests([{ id: "preview-request", peerId: "preview-friend", state: "pending", name: "Piik friend" }]);+ }}>{en ? "Receive a sample request" : "模拟收到控制请求"}</button>+ <Btn id="preview-remote-keyboard-toggle" icon="keyboard" title="remote.keyboard" cap="remote.keyboard" hint="hint-remote-keyboard"+ expanded={keyboardOpen} controls="preview-remote-keyboard" onClick={() => setKeyboardOpen(value => !value)} />+ </div>+ <div id="preview-remote-keyboard" className="cp-keyboard" hidden={!keyboardOpen}>+ {keyboardOpen && <RemoteKeyboard key={platform} platform={platform} touch={false} input={input} close={closeKeyboard} />}+ </div>+ <p className="cp-input-output"><span>{en ? "Latest input" : "最近一次输入"}</span>+ <output>{lastInput || (en ? "Open the keyboard to try it." : "打开键盘即可试用。")}</output>+ </p>+ </section>;+}diff --git a/src/client/pages/TooltipPreviewPage.tsx b/src/client/pages/TooltipPreviewPage.tsxindex 79073948..c351311d 100644--- a/src/client/pages/TooltipPreviewPage.tsx+++ b/src/client/pages/TooltipPreviewPage.tsx@@ -1,5 +1,5 @@import { useState } from "react";-import { AppHeader } from "../components/living/Header";+import { AppHeader, LedStrip } from "../components/living/Header";import { Tooltip } from "../components/living/Tooltip";import { ControlsPreview } from "./ControlsPreview";import { WelcomeLine, WelcomeCipher } from "../components/living/WelcomeLine";@@ -63,7 +63,7 @@ export function TooltipPreviewPage() {const [reducedMotion, setReducedMotion] = useState(false);return (<div className="lr-app" data-comic-reduced-motion={reducedMotion || undefined}>- <AppHeader />+ <AppHeader led={<LedStrip state="live" label={t("state.signal.connected")} comic="signal-connected" />} /><main className="lr-room lr-tooltip-preview"><header className="lr-tooltip-preview-head"><h1>{en ? "Piik · UI catalogue" : "Piik · UI 控件大全"}</h1>@@ -79,13 +79,28 @@ export function TooltipPreviewPage() {<a href="#playback-preview">{en ? "Playback" : "播放栏"}</a><a href="#comic-preview">{en ? "Tooltips & comics" : "提示与漫画"}</a><a href="#launcher-preview">{en ? "App launcher" : "模式选择"}</a><a href="#interaction-preview">{en ? "Chat & reactions" : "聊天与互动"}</a>- <a href="#hint-remote-control">{en ? "Remote control" : "远程控制"}</a>+ <a href="#remote-control-preview">{en ? "Remote control & keyboard" : "远程控制与键盘"}</a>- <a href="#hint-admission-code">{en ? "Room entry" : "房间准入"}</a>+ <a href="#admission-preview">{en ? "Room entry" : "房间准入"}</a><a href="#metrics-preview">{en ? "Metrics" : "连接数据"}</a><a href="#welcome-preview">{en ? "Opening lines" : "开场白"}</a><a href="/__status-preview">{en ? "Status gallery" : "完整状态预览"}</a></nav>+ <details className="cp-catalog-scope">+ <summary>{en ? "Shared controls and surfaces" : "控件与容器的复用范围"}</summary>+ <p>{en ? "These examples render production components with sample data. Page layouts combine them; a different caption or arrangement does not create a new control type."+ : "这里用示例数据渲染正式组件。业务页面组合这些组件;文案或排列不同,不代表另造一种控件。"}</p>+ <ul>+ <li><a href="#button-preview">{en ? "Buttons" : "按钮"}</a> · <code>Btn / button.css</code></li>+ <li><a href="#option-preview">{en ? "Choices and toggles" : "选择与开关"}</a> · <code>Chip / SwitchItem / segmented-control.css</code></li>+ <li><a href="#sharing-preview">{en ? "Numeric settings and inline tabs" : "数值设置与页内选项卡"}</a> · <code>QualityPresets / SharingSettings</code></li>+ <li><a href="#playback-preview">{en ? "Brief attached settings" : "短时附着设置"}</a> · <code>useAnchoredPopover</code></li>+ <li><a href="#interaction-preview">{en ? "Persistent and detachable tools" : "常驻与可独立的工具窗"}</a> · <code>FloatingPanel / usePanelWindow</code></li>+ <li><a href="/__status-preview#sharing-troubleshooting">{en ? "Modal troubleshooting" : "模态故障排查"}</a> · <code>ShareFailureHelp / dialog</code></li>+ </ul>+ <p>{en ? "Source selection stays inside the television. Browser capture permissions, native select menus and operating-system window frames are platform UI, verified in their actual environment. Website and documentation navigation retain their page-specific layouts."+ : "选源界面留在电视内。浏览器采集授权、原生下拉菜单和操作系统窗框属于平台界面,在实际环境验收;官网与文档导航保留各自的页面布局。"}</p>+ </details><ControlsPreview /><MetricPreview /><WelcomeLine still={reducedMotion} />diff --git a/src/client/pages/controls-preview.css b/src/client/pages/controls-preview.cssindex b233b40e..2da19023 100644--- a/src/client/pages/controls-preview.css+++ b/src/client/pages/controls-preview.css@@ -1,5 +1,14 @@.cp-nav { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 20px 0 28px; }.cp-nav a { color: var(--ink); font-size: 13px; text-underline-offset: 5px; }+.cp-catalog-scope { margin-bottom: 24px; color: var(--muted); font-size: 13px; line-height: 1.7; }+.cp-catalog-scope summary { color: var(--ink); cursor: pointer; }+.cp-catalog-scope a { color: var(--ink); text-underline-offset: 3px; }+.cp-catalog-scope code { overflow-wrap: anywhere; }+.cp-control-sample { display: grid; justify-items: center; align-content: start; gap: 10px; margin: 0 6px 0 0; }+.cp-control-sample figcaption { color: var(--muted); font-size: 12px; }+.cp-keyboard { max-width: 780px; margin-inline: auto; }+.cp-input-output { display: grid; gap: 6px; color: var(--muted); font-size: 13px; }+.cp-input-output output { font-family: var(--mono); overflow-wrap: anywhere; }.cp-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }.cp-card { min-width: 0; padding: 24px; border: 1px solid var(--control-edge); border-radius: 24px; background: var(--paper); scroll-margin-top: 24px; }.cp-sharing-preview { grid-column: 1 / -1; }@@ -12,6 +21,7 @@.cp-tools > [role="group"]:not(.lr-lcd, .lr-toggle) { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }.cp-tools .lr-input { max-width: 100%; }.cp-tools .lr-input input { width: 160px; }+.cp-tools .lr-input select { min-width: 0; border: 0; background: var(--paper); color: var(--ink); font: inherit; }.cp-tools .lr-pill { max-width: 100%; }.cp-feedback { min-height: 2em; }.cp-card .cp-input-error { color: var(--danger); }diff --git a/src/client/styles.css b/src/client/styles.cssindex fe20d922..e7ed0e15 100644--- a/src/client/styles.css+++ b/src/client/styles.css@@ -1,8 +1,8 @@@import "./ui/palette.css";@import "./components/living/pawn.css";@import "./components/living/brand-mark.css";-@import "./components/living/language-control.css";@import "./components/living/button.css";+@import "./components/living/segmented-control.css";@import "./ui/glyph.css";/* Piik living-room UI — the production design system.@@ -25,12 +25,9 @@--pawn-5: #e2698f;--pawn-6: #4e9c74;--pawn-7: #a978bd;- --live: #2fa66a;- --warn: #d98e04;- --danger: #d64541;--route-p2p: #1f7a4a;--route-sfu: #53676a;- --route-pending: var(--action);+ --route-pending: var(--busy);--lcd: #1d2b22;--lcd-digits: #9de8bf;--stage: #17191c;@@ -38,7 +35,6 @@--frame-highlight: #3e4b5b;--radius: 16px;--control-radius: 18px;- --spring: cubic-bezier(.3, 1.45, .45, 1);--font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", "PingFang SC","Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;--mono: ui-monospace, "Cascadia Mono", SFMono-Regular, Consolas, monospace;@@ -48,9 +44,6 @@ html[data-theme="dark"] {color-scheme: dark;--frame: #1d2633;--stage: #141517;- --live: #3fb97a;- --warn: #e8a33d;- --danger: #e25a52;--route-p2p: #3fb97a;--route-sfu: #9bb0c5;--lcd: #0d1611;@@ -141,7 +134,7 @@ ul { margin: 0; padding: 0; list-style: none; }}.lr-leds[data-state="live"] i { background: color-mix(in srgb, var(--live) 80%, var(--ink)); opacity: .35; }.lr-leds[data-state="live"] i:first-child { opacity: 1; animation: lr-led-beat 2.8s ease-in-out infinite; }-.lr-leds[data-state="busy"] i { animation: lr-led-chase 1s ease-in-out infinite; background: var(--action); }+.lr-leds[data-state="busy"] i { animation: lr-led-chase 1s ease-in-out infinite; background: var(--busy); }.lr-leds[data-state="busy"] i:nth-child(2) { animation-delay: .15s; }.lr-leds[data-state="busy"] i:nth-child(3) { animation-delay: .3s; }.lr-leds[data-state="warn"] i { background: color-mix(in srgb, var(--warn) 72%, var(--ink)); animation: lr-led-beat 1.1s ease-in-out infinite; }@@ -194,7 +187,7 @@ ul { margin: 0; padding: 0; list-style: none; }transition: background-color 140ms ease, color 140ms ease, transform 180ms var(--spring);}.lr-language-menu button + button { margin-top: 4px; }-.lr-language-menu button:is(:hover, :focus-visible) { background: var(--wall-2); transform: translateY(-1px); }+.lr-language-menu button:is(:hover, :focus-visible) { background: var(--control-hover); transform: translateY(-1px); }.lr-language-menu button:focus-visible { outline-offset: -3px; }.lr-language-menu button:active { transform: var(--control-press-transform); transition-duration: 80ms; }.lr-language-menu button[aria-checked="true"] { background: var(--control-selected); color: var(--control-selected-ink); box-shadow: inset 0 0 0 2px var(--action); }@@ -219,9 +212,6 @@ ul { margin: 0; padding: 0; list-style: none; }overflow-y: visible untouched. Open panels are edge-aligned viais-start/is-end, so nothing visible is cut in practice. */.lr-app { min-height: 100dvh; display: flex; flex-direction: column; overflow-x: clip; }-.lr-app-shell { min-height: 100dvh; display: flex; flex-direction: column; }-.lr-app-shell > .lr-app { flex: 1; min-height: 0; }-.lr-web-version { padding: 8px 16px 16px; color: var(--muted); font-size: 11.5px; text-align: center; }.lr-room {flex: 1;width: min(1180px, 100%);@@ -469,26 +459,9 @@ body.lr-theater-open .lr-top { visibility: hidden; }color: var(--muted);font-size: 11.5px;}-.lr-source-picker-refresh,-.lr-source-picker-close {- display: grid;- width: 38px;- height: 38px;- flex: 0 0 auto;- place-items: center;- border: 2px solid var(--control-edge);- border-radius: 50%;- background: var(--paper);- box-shadow: var(--control-shadow);- color: var(--ink);- transition: var(--control-motion), background 120ms ease;-}+.lr-source-picker-refresh, .lr-source-picker-close { flex: none; }.lr-source-picker-refresh { margin-left: auto; }.lr-source-picker-head > .lr-comic-tip-wrap:has(> .lr-source-picker-refresh) { margin-left: auto; }-.lr-source-picker-refresh:is(:hover, :focus-visible):not(:disabled),-.lr-source-picker-close:is(:hover, :focus-visible):not(:disabled) { background: var(--control-hover); transform: var(--control-hover-transform); }-.lr-source-picker-refresh:active:not(:disabled),-.lr-source-picker-close:active:not(:disabled) { transform: var(--control-press-transform); box-shadow: none; transition-duration: 80ms; }.lr-source-picker-tabs.lr-toggle {display: grid;}@@ -539,7 +512,7 @@ body.lr-theater-open .lr-top { visibility: hidden; }align-items: center;gap: 10px;padding: 9px 12px;- border: 2px solid var(--control-edge);+ border: var(--control-border-width) solid var(--control-edge);border-radius: var(--control-radius);background: var(--surface-glaze) var(--paper);box-shadow: var(--control-shadow);@@ -720,10 +693,10 @@ body.lr-theater-open .lr-top { visibility: hidden; }border-radius: 50%;background: var(--live);}-.lr-pawn-led[data-tone="busy"] { background: var(--action); }+.lr-pawn-led[data-tone="busy"] { background: var(--busy); }.lr-pawn-led[data-tone="warn"] { background: var(--warn); }.lr-pawn-led[data-tone="bad"] { background: var(--danger); }-.lr-pawn-led[data-tone="off"] { background: #8ea3b8; }+.lr-pawn-led[data-tone="off"] { background: var(--idle); }.lr-pawn-led[data-pulse] { animation: lr-blink 1.6s ease-in-out infinite; }.lr-pawn.is-waiting > svg { opacity: .65; animation: lr-pawn-breathe 1.6s ease-in-out infinite; }@keyframes lr-pawn-breathe { 50% { opacity: .35; } }@@ -942,9 +915,8 @@ body.lr-theater-open .lr-top { visibility: hidden; }/* ---------- buttons & chips ---------- */-.lr-app-connect { min-width: 40px; height: 40px; }.lr-app-connect.is-ready > svg { color: var(--live); }-.lr-app-connect-help {+.lr-anchored-card {position: fixed; inset: auto; margin: 0; padding: 16px;width: min(300px, calc(100vw - 16px)); box-sizing: border-box;color: var(--ink); background: var(--paper);@@ -953,38 +925,41 @@ body.lr-theater-open .lr-top { visibility: hidden; }overflow: auto; overscroll-behavior: contain;}.lr-app-connect-help p { margin: 12px 0; font-size: 13px; line-height: 1.6; }-.lr-app-connect-help:is(:popover-open, .\:popover-open) { animation: lr-language-open 180ms var(--spring); }-.lr-app-connect-help.is-above { --language-offset: 5px; }+.lr-anchored-card:is(:popover-open, .\:popover-open) { animation: lr-language-open 180ms var(--spring); }+.lr-anchored-card.is-above { --language-offset: 5px; }.lr-app-connect-head { display: flex; align-items: flex-start; gap: 8px; }-.lr-app-connect-close { flex: 0 0 auto; width: 32px; height: 32px; min-width: 32px; padding: 0; }+.lr-app-connect-close { flex: none; }.lr-app-connect-scene { width: min(220px, 100%); aspect-ratio: 10 / 3; margin-inline: auto; }.lr-app-connect-scene > svg { width: 100% !important; }.lr-app-connect-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }-.lr-app-connect-actions .lr-btn { min-height: 40px; }.lr-app-connect-help .lr-app-connect-optional { color: var(--muted); font-size: 12px; margin-bottom: 0; }-@media (prefers-reduced-motion: reduce) { .lr-app-connect-help:is(:popover-open, .\:popover-open) { animation: none; } }-.lr-cap { font-size: 12.5px; font-weight: 600; color: inherit; white-space: nowrap; }+@media (prefers-reduced-motion: reduce) { .lr-anchored-card:is(:popover-open, .\:popover-open) { animation: none; } }+.lr-help-menu { width: min(260px, calc(100vw - 16px)); }+.lr-help-menu header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 0 2px 14px; }+.lr-help-menu header strong { font-size: 14px; }+.lr-help-menu header :is(a, span) { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }+.lr-help-menu header a { text-underline-offset: 3px; }+.lr-help-menu nav { display: grid; gap: 4px; }+.lr-help-menu nav .lr-btn { width: 100%; justify-content: flex-start; }+.lr-help-menu.is-visual nav { display: flex; justify-content: center; gap: 12px; }+.lr-help-menu.is-visual nav .lr-btn { width: var(--control-compact-size); justify-content: center; }+.lr-cap { font-size: var(--control-label-size); font-weight: 600; color: inherit; white-space: nowrap; }/* Sharing and local playback have distinct owners, but one control grammar. */:where(.lr-media-controls) .lr-btn {- min-width: 44px; height: 44px; padding: 0 12px;+ --button-size: var(--control-compact-size);+ padding: 0 12px;border: 0; border-radius: 12px; box-shadow: none;background: transparent; color: inherit;}.lr-media-controls .lr-btn.is-danger { color: var(--danger); }-/* Diagnostics stay quiet until explicitly enabled; keep the shared input feedback. */-.lr-header-diagnostic { display: inline-flex; }-.lr-header-diagnostic .lr-btn { min-width: 40px; width: 40px; height: 40px; padding: 0; box-shadow: none; }-.lr-header-diagnostic .lr-btn:not(.is-on) { background: transparent; border-color: transparent; color: var(--muted); }-.lr-header-diagnostic .lr-cap { display: none; }-.lr-chip {display: inline-flex;align-items: center;gap: 6px;padding: 9px 14px;- border: 2px solid var(--control-edge);+ border: var(--control-border-width) solid var(--control-edge);border-radius: 999px;background: var(--paper);font-family: var(--mono);@@ -1022,63 +997,12 @@ body.lr-theater-open .lr-top { visibility: hidden; }}@keyframes lr-pop { 50% { transform: scale(1.06); } }-/* Equal segments keep the shared thumb aligned across translated captions. */-.lr-toggle {- --lr-segments: 2;- --lr-selected-index: 0;- position: relative;- display: inline-grid;- grid-auto-flow: column;- grid-auto-columns: 1fr;- padding: 4px;- border-radius: 999px;- background: var(--paper);-}-.lr-toggle { border: 2px solid var(--control-edge); }-.lr-toggle::before {- content: "";- position: absolute;- top: 4px; bottom: 4px; left: 4px;- border-radius: 999px;- background: var(--ink);- box-shadow: inset 0 0 0 2px var(--action);- width: calc((100% - 8px) / var(--lr-segments));- transform: translateX(calc(var(--lr-selected-index) * 100%));- transition: transform 260ms var(--spring);- pointer-events: none;-}-.lr-toggle:not(:has(.is-selected))::before { opacity: 0; }-.lr-toggle:has(> :nth-child(2).is-selected, > :nth-child(2) .is-selected) { --lr-selected-index: 1; }-.lr-toggle button {- position: relative;- z-index: 1;- display: inline-flex;- align-items: center;- justify-content: center;- gap: 5px;- min-width: 44px; height: 44px;- padding: 0 10px;- border: 0;- border-radius: 999px;- background: transparent;- font-weight: 600;- /* Inactive text stays readable; the selected option gains full contrast. */- color: color-mix(in srgb, var(--ink) 68%, var(--paper));- transition: color 180ms ease, transform 180ms var(--spring);-}-.lr-toggle button.is-selected { color: var(--paper); }-.lr-toggle button:is(:hover, :focus-visible):not(:disabled) { transform: translateY(-1px); }-.lr-toggle button:active { transform: var(--control-press-transform); transition-duration: 80ms; }-/* The wrapper owns each half in both language modes. */-.lr-toggle > .lr-comic-tip-wrap { flex: 1; justify-content: center; }-.lr-toggle > .lr-comic-tip-wrap > button { width: 100%; }-/* Sliding switch; its thumb stays inside the track at either end. */.lr-switch {position: relative;display: inline-flex;width: 58px; height: 34px;- border: 2px solid var(--control-edge);+ border: var(--control-border-width) solid var(--control-edge);border-radius: 999px;background: var(--paper);flex: 0 0 auto;@@ -1111,7 +1035,7 @@ body.lr-theater-open .lr-top { visibility: hidden; }gap: 6px;min-width: 76px;padding: 12px 10px 9px;- border: 2px solid var(--control-edge);+ border: var(--control-border-width) solid var(--control-edge);border-radius: var(--control-radius);background: var(--paper);color: var(--ink);@@ -1128,7 +1052,7 @@ body.lr-theater-open .lr-top { visibility: hidden; }min-width: 0;height: 48px;padding: 0 12px;- border: 2px solid var(--control-edge);+ border: var(--control-border-width) solid var(--control-edge);border-radius: var(--control-radius);background: var(--paper);transition: border-color 140ms ease;@@ -1158,8 +1082,6 @@ body.lr-theater-open .lr-top { visibility: hidden; }.lr-quality-range-labels { display: flex; justify-content: space-between; color: var(--muted); font-family: var(--mono); font-size: 10px; }.lr-quality-custom { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 47px; }.lr-quality-custom-label { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }-.lr-quality-custom .lr-btn { min-width: 40px; height: 36px; padding: 0 10px; gap: 5px; border-width: 1px; }-.lr-quality-custom .lr-cap { font-size: 12px; }.lr-input.lr-video-size { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto; gap: 5px; width: 176px; }.lr-resolution-controls { display: flex; flex-direction: column; gap: 8px; min-width: 0; }.lr-resolution-controls > .lr-row-group { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); max-width: 520px; }@@ -1226,31 +1148,24 @@ body.lr-theater-open .lr-top { visibility: hidden; }/* notices */.lr-pill {+ --pill-tone: var(--warn);display: inline-flex;align-items: center;gap: 8px;padding: 9px 14px;border-radius: 999px;- background: #fdf3e0;- border: 2px solid var(--warn);- color: #8a5f04;+ background: color-mix(in srgb, var(--paper) 94%, var(--pill-tone));+ border: 2px solid var(--pill-tone);+ color: var(--ink);font-size: 13px;font-weight: 600;animation: lr-slide-in 240ms var(--spring);}.lr-pill > .lr-glyph { flex-shrink: 0; }-.lr-pill.is-bad { background: rgba(214, 69, 65, .1); border-color: var(--danger); color: #a1332f; }-.lr-pill.is-good { background: #e2f3e9; border-color: var(--live); color: #1f7a4a; }-html[data-theme="dark"] .lr-pill { background: #2e2410; }-html[data-theme="dark"] .lr-pill.is-bad { background: #331c1a; }-html[data-theme="dark"] .lr-pill.is-good { background: #14291d; }-.lr-pill.is-off, html[data-theme="dark"] .lr-pill.is-off {- background: var(--paper); border-color: var(--ink); color: var(--ink);-}-.lr-pill.is-busy, html[data-theme="dark"] .lr-pill.is-busy {- background: color-mix(in srgb, var(--paper) 94%, var(--action));- border-color: var(--action); color: var(--ink);-}+.lr-pill.is-bad { --pill-tone: var(--danger); }+.lr-pill.is-good { --pill-tone: var(--live); }+.lr-pill.is-off { --pill-tone: var(--ink); background: var(--paper); }+.lr-pill.is-busy { --pill-tone: var(--busy); }@keyframes lr-slide-in { from { opacity: 0; transform: translateY(-6px); } }/* metric cells */@@ -1279,7 +1194,7 @@ html[data-theme="dark"] .lr-pill.is-good { background: #14291d; }.lr-meter-text small { font-size: 9.5px; font-weight: 600; color: var(--muted); }.lr-meter-tag { display: inline-flex; align-items: center; padding: 9px 2px 9px 0; color: var(--muted); }.lr-meter-tag .lr-cap { margin-left: 6px; font-size: 12px; }-.lr-metrics-more { min-width: 40px; height: 40px; padding: 0 10px; }+.lr-metrics-more { --button-icon-size: 16px; min-width: 40px; height: 40px; padding: 0 10px; }.lr-metrics-more svg { transition: transform 160ms ease; }.lr-metrics-more.is-open svg { transform: rotate(180deg); }@@ -1296,19 +1211,6 @@ html[data-theme="dark"] .lr-pill.is-good { background: #14291d; }font-weight: 800;}.lr-pawn-detail .lr-meter { flex: 1 1 100%; display: grid; grid-template-columns: repeat(auto-fill, minmax(126px, 1fr)); }-.lr-pawn-detail-close {- display: grid;- width: 40px; height: 40px;- place-items: center;- border: 2.5px solid var(--ink);- border-radius: 12px;- background: var(--paper);- color: var(--ink);- transition: var(--control-motion), background 120ms ease;-}-.lr-pawn-detail-close:is(:hover, :focus-visible) { background: var(--wall-2); transform: var(--control-hover-transform); }-.lr-pawn-detail-close:active { transform: var(--control-press-transform); transition-duration: 80ms; }-/* ---------- topology tree ---------- */.lr-route {@@ -1534,7 +1436,6 @@ html[data-theme="dark"] .lr-pill.is-good { background: #14291d; }.lr-client-approved-site a { display: flex; flex: 1 1 auto; align-items: baseline; gap: 4px; min-width: 0; overflow-wrap: anywhere; color: var(--ink); font: 12px/1.6 var(--mono); text-underline-offset: 3px; }.lr-client-approved-site a > span { flex: none; }.lr-client-site-actions { display: flex; flex: none; align-items: center; gap: 8px; margin-inline-start: auto; }-.lr-client-approved-site .lr-btn { min-width: 32px; width: 32px; height: 32px; padding: 0; }.lr-client-launch-section { justify-self: start; margin: 5px 0 -8px; font-size: 13px; font-weight: 700; color: var(--muted); }.lr-client-approval {display: grid; width: min(480px, 100%); min-width: 0; gap: 20px;@@ -1564,7 +1465,6 @@ html[data-theme="dark"] .lr-pill.is-good { background: #14291d; }.lr-client-approval-actions > .lr-comic-tip-wrap { min-width: 0; }.lr-client-approval-actions .lr-btn { width: 100%; min-width: 0; padding: 0 12px; justify-content: center; }.lr-client-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px clamp(16px, 4vw, 44px) 16px; color: var(--muted); font-size: 11.5px; }-.lr-client-footer .lr-btn { min-width: 44px; height: 36px; padding: 0 10px; border-color: transparent; background: transparent; box-shadow: none; color: inherit; font-size: 12px; text-decoration: none; }.lr-client-version { overflow-wrap: anywhere; text-align: right; }.lr-client-launch-status { color: var(--ink); font-size: 14px; font-weight: 650; }.lr-client-launch-technical { width: 100%; min-width: 0; color: var(--muted); font-size: 13px; text-align: start; }@@ -1829,8 +1729,8 @@ html[data-theme="dark"] .lr-pill.is-good { background: #14291d; }.lr-leds-label { display: none; }.lr-top-right { gap: 8px; }.lr-leds { gap: 4px; padding: 6px; }- .lr-header-controls .lr-btn { width: 40px; min-width: 40px; padding: 0; }- .lr-header-controls .lr-btn .lr-cap { display: none; }+ .lr-top .lr-btn.is-compact { width: var(--control-compact-size); padding: 0; }+ .lr-top .lr-btn.is-compact .lr-cap { display: none; }}.lr-stage-notices {@@ -1980,6 +1880,12 @@ details[open] > summary > .lr-sharing-chevron { transform: rotate(180deg); }.lr-room.is-theater .lr-stage-notices > * { pointer-events: auto; }/* Theatre fills the viewport. On phones, keep notices clear of both rowsof playback controls without coupling their height to a second JS owner. */+@media (max-width: 480px) {+ .lr-top:has(.lr-leds) { display: grid; grid-template-columns: auto minmax(0, 1fr); row-gap: 8px; }+ .lr-top:has(.lr-leds) > .lr-top-right { display: contents; }+ .lr-top:has(.lr-leds) > .lr-top-right > [role="status"] { justify-self: end; }+ .lr-top:has(.lr-leds) .lr-header-controls { grid-column: 1 / -1; justify-self: end; }+}@media (max-width: 440px) {.lr-room.is-theater .lr-stage-notices {top: max(12px, env(safe-area-inset-top));@@ -1988,19 +1894,11 @@ details[open] > summary > .lr-sharing-chevron { transform: rotate(180deg); }}@media (max-width: 360px) {.lr-lcd { gap: 4px; padding-inline: 6px; font-size: 18px; }- .lr-room-chip .lr-btn { min-width: 36px; width: 36px; }- .lr-top { gap: 6px; padding-inline: 10px; }- .lr-top-right { gap: 6px; }+ .lr-top { column-gap: 4px; padding-inline: 10px; }+ .lr-top-right { gap: 4px; }+ .lr-brand { gap: 0; padding-inline: 0; }+ .lr-home-arrow { width: 10px; }.lr-leds i { width: 8px; height: 8px; }- .lr-lang { padding: 2px; border-width: 2px; }- .lr-lang::before { top: 2px; bottom: 2px; left: 2px; width: calc((100% - 4px) / var(--lang-count)); }- .lr-lang > button { min-width: 30px; height: 32px; padding-inline: 5px; }- .lr-header-controls button.lr-btn {- min-width: 36px !important;- width: 36px;- height: 36px !important;- padding: 0;- }.lr-tiles .lr-tile { padding-inline: 4px; }.lr-tiles .lr-tile small { font-size: 10px; letter-spacing: 0; }}@@ -2211,7 +2109,7 @@ svg[data-comic-motion="still"] .lr-person-eyes > ellipse {transition-duration: 0.01ms !important;}.lr-tv-static { animation: none; opacity: .35; }- .lr-chip, .lr-tile, .lr-toggle button, .lr-lang > button, .lr-language-menu button, .lr-source-option, .lr-source-picker-refresh, .lr-source-picker-close { transform: none !important; }+ .lr-chip, .lr-tile, .lr-language-menu button, .lr-source-option { transform: none !important; }.lr-sharing-panel input[type="range"]::-webkit-slider-thumb { transform: none !important; }.lr-sharing-panel input[type="range"]::-moz-range-thumb { transform: none !important; }.lr-route-edge.is-pending { animation: none; }@@ -2222,11 +2120,6 @@ svg[data-comic-motion="still"] .lr-person-eyes > ellipse {/* Revealing a room password must not change its field geometry. */.lr-input.is-password { min-width: min(260px, 100%); }-/* Dark-mode notice pills: pair the dark fills with readable foregrounds. */-html[data-theme="dark"] .lr-pill { color: #e8a33d; }-html[data-theme="dark"] .lr-pill.is-bad { color: #e88a85; }-html[data-theme="dark"] .lr-pill.is-good { color: #63c78a; }-@media (max-width: 640px) {/* Pawn drill-down: the shared .lr-row column stack breaks this card —column + wrap fans the children into off-screen side-by-side columns anddiff --git a/src/client/ui/icons.tsx b/src/client/ui/icons.tsxindex 8c5cbba2..2efb29d0 100644--- a/src/client/ui/icons.tsx+++ b/src/client/ui/icons.tsx@@ -10,6 +10,8 @@ import { useEffect, useRef, type ReactNode } from "react";import { bindSvgReplayOnPointerEnter } from "./animation";const PATHS = {+ book: { body: (<><path pathLength={1} d="M12 5C9 3 5 3 2 4v15c3-1 7-1 10 1 3-2 7-2 10-1V4c-3-1-7-1-10 1Zm0 0v15M5 8h4m-4 4h4m6-4h4m-4 4h4"/></>) },+ help: { body: (<><circle pathLength={1} cx="12" cy="12" r="9"/><path pathLength={1} d="M9.5 8.5a2.5 2.5 0 0 1 5 0c0 2-2.5 2-2.5 4M12 16.5h.01"/></>) },fitContain: { body: (<><rect pathLength={1} x="2" y="3" width="20" height="18" rx="2"/><path pathLength={1} d="M2 7h20M2 17h20m-15-5h10"/></>) },fitCover: { body: (<><rect pathLength={1} x="2" y="3" width="20" height="18" rx="2"/><path pathLength={1} d="M7 3v18M17 3v18m-7-9h4"/></>) },fitStretch: { body: (<><rect pathLength={1} x="2" y="3" width="20" height="18" rx="2"/><path pathLength={1} d="M6 12h12M9 9l-3 3 3 3m6-6 3 3-3 3"/></>) },diff --git a/src/client/ui/palette.css b/src/client/ui/palette.cssindex 3ba9215d..8b71dde4 100644--- a/src/client/ui/palette.css+++ b/src/client/ui/palette.css@@ -1,5 +1,5 @@-/* Shared surfaces for the App, website and documentation. Illustrations and- semantic status colours keep their own roles. Theme selection stays local. */+/* Shared theme for the App, website and documentation. Status and selection+ have separate roles; illustrations keep their own colours. */:root {--wall: #f3f5f8;--wall-2: #e5eaf2;@@ -14,6 +14,11 @@--action-deep: var(--primary);--action-ink: var(--primary-ink);--action-text: #2055b2;+ --idle: #8ea3b8;+ --busy: #3478e5;+ --live: #2fa66a;+ --warn: #d98e04;+ --danger: #d64541;--control-hover: #eef3ff;--control-selected: #e5efff;--control-selected-ink: #214c9b;@@ -39,6 +44,10 @@--wall-2: var(--piik-dark-wall-2);--paper: var(--piik-dark-paper);--ink: var(--piik-dark-ink);+ --busy: #82b1ff;+ --live: #3fb97a;+ --warn: #e8a33d;+ --danger: #e25a52;--action: var(--piik-dark-action);--action-deep: var(--piik-dark-action);--action-ink: var(--piik-dark-action-ink);diff --git a/src/client/ui/theme.ts b/src/client/ui/theme.tsindex e62e2316..9d670feb 100644--- a/src/client/ui/theme.ts+++ b/src/client/ui/theme.ts@@ -3,7 +3,7 @@// chooses explicitly, this module continues following system changes.export type Theme = "light" | "dark";-const THEME_STORAGE_KEY = "piik:ui-theme";+export const THEME_STORAGE_KEY = "piik:ui-theme";const DARK_THEME_QUERY = "(prefers-color-scheme: dark)";function detectTheme(): Theme {diff --git a/src/client/ui/visual-kinds.ts b/src/client/ui/visual-kinds.tsindex 378a1149..cee69ad5 100644--- a/src/client/ui/visual-kinds.ts+++ b/src/client/ui/visual-kinds.ts@@ -89,6 +89,7 @@ export type AdmissionHintKind =| "hint-admission-invite";export type Set4Kind =+ | "hint-help"| "hint-topology"| "hint-close"| "hint-rename"diff --git a/src/client/webrtc/nat-prediction.ts b/src/client/webrtc/nat-prediction.tsindex 8b972588..25a616cf 100644--- a/src/client/webrtc/nat-prediction.ts+++ b/src/client/webrtc/nat-prediction.ts@@ -24,7 +24,7 @@ export function isNativeNatSurveyCandidate(return normalized !== null && natPredictionSurveyUrls(iceServers, auxiliaryStunUrls).has(normalized);}-const BASE_STUN_PORT = 3478;+const DEFAULT_STUN_PORT = 3478;const MIN_PREDICTABLE_PORT = 1;const MAX_PREDICTABLE_PORT = 65_535;@@ -101,7 +101,7 @@ function normalizedStunUrl(url: string): string | null {// The HTTP parser normalizes the host but drops an explicit :80. STUN// defaults to 3478 only when its authority omits the port (RFC 7064).const explicitPort = /:(\d+)$/.exec(authority)?.[1];- const port = explicitPort === undefined ? BASE_STUN_PORT : Number(explicitPort);+ const port = explicitPort === undefined ? DEFAULT_STUN_PORT : Number(explicitPort);return `stun:${hostname}:${port}`;}@@ -119,18 +119,13 @@ export function natPredictionSurveyUrls(if (configuredAuxiliaryUrls.size !== 2) {return new Set();}- for (const server of iceServers ?? []) {- for (const url of urlsOf(server)) {- const baseUrl = normalizedStunUrl(url);- if (baseUrl?.endsWith(`:${BASE_STUN_PORT}`)) {- const surveyUrls = new Set([baseUrl, ...configuredAuxiliaryUrls]);- if (surveyUrls.size === 3) {- return surveyUrls;- }- }- }- }- return new Set();+ const ordinary = (iceServers ?? []).flatMap(urlsOf)+ .map(normalizedStunUrl)+ .filter((url): url is string => url !== null && !configuredAuxiliaryUrls.has(url));+ // Keep the published Hosted base choice, independent of discovery order.+ // Explicit App surveys may also use a non-default port.+ const base = ordinary.find(url => url.endsWith(`:${DEFAULT_STUN_PORT}`)) ?? ordinary[0];+ return base ? new Set([base, ...configuredAuxiliaryUrls]) : new Set();}/**diff --git a/tests/docs-publication.test.ts b/tests/docs-publication.test.tsindex 81f9ddcf..7f6178ae 100644--- a/tests/docs-publication.test.ts+++ b/tests/docs-publication.test.ts@@ -1,8 +1,34 @@import { describe, expect, it } from "vitest";import { documentLink } from "../site/docs/pages.mjs";import { githubSlug } from "../scripts/markdown-slug.mjs";+import { readFileSync } from "node:fs";+import { runInNewContext } from "node:vm";+import { THEME_STORAGE_KEY } from "../src/client/ui/theme";describe("reader documentation publication", () => {+ it("uses the shared appearance key before the native documentation runtime starts", () => {+ const config = readFileSync(new URL("../site/docs/.vitepress/config.mjs", import.meta.url), "utf8");+ const template = config.match(/appearance\[2\] = (`[\s\S]*?`);/)?.[1];+ expect(template).toBeTruthy();+ const script = runInNewContext(template!, { THEME_STORAGE_KEY });+ for (const [preference, systemDark, blocked, expected] of [+ ["light", true, false, false], ["dark", false, false, true],+ [null, true, false, true], ["auto", false, false, false],+ [null, true, true, true],+ ] as const) {+ let dark = false;+ runInNewContext(script, {+ document: { documentElement: { classList: { toggle: (_name: string, value: boolean) => { dark = value; } } } },+ localStorage: { getItem: (key: string) => {+ if (blocked) throw new Error("Storage disabled");+ expect(key).toBe("piik:ui-theme");+ return preference;+ } },+ window: { matchMedia: () => ({ matches: systemDark }) },+ });+ expect(dark).toBe(expected);+ }+ });it("preserves repository anchors for apostrophes, numbered steps and Chinese punctuation", () => {expect(githubSlug("Join a friend's room")).toBe("join-a-friends-room");expect(githubSlug("2. Enable HTTPS")).toBe("2-enable-https");diff --git a/tests/nat-prediction.test.ts b/tests/nat-prediction.test.tsindex 23e9044f..07c4e5ee 100644--- a/tests/nat-prediction.test.ts+++ b/tests/nat-prediction.test.ts@@ -1,4 +1,5 @@import { describe, expect, it, vi } from "vitest";+import { punchIceConfig } from "../src/client/native/native-punch";import {addRemoteIceCandidate,@@ -167,7 +168,10 @@ describe("NAT prediction ICE adapter", () => {natPredictionSurveyUrls([{ urls: "stun:share.example.test:5349" },], auxiliary),- ).toEqual(new Set());+ ).toEqual(new Set([+ "stun:share.example.test:5349",+ ...auxiliary,+ ]));});it("does not invent auxiliary listeners that the server did not enable", () => {@@ -190,17 +194,61 @@ describe("NAT prediction ICE adapter", () => {expect(natPredictionSurveyUrls(servers, auxiliary)).toEqual(new Set(urls));});+ it("keeps auxiliary discovery entries from replacing the ordinary base", () => {+ const auxiliary = ["stun:site.test:3479", "stun:site.test:3480"];+ const urls = [...auxiliary, "stun:site.test:3478"];+ expect(natPredictionSurveyUrls([{ urls }], auxiliary)).toEqual(new Set([+ "stun:site.test:3478", ...auxiliary,+ ]));+ expect(natPredictionSurveyUrls([{ urls: auxiliary }], auxiliary)).toEqual(new Set());+ });++ it.each([+ ["stun:site.test:3479", "stun:site.test:3480"],+ ["stun:survey-a.test:3478", "stun:survey-b.test:3478"],+ ])("preserves the published base choice with non-default discovery first: %s", (...auxiliary) => {+ const servers = [{ urls: ["stun:discovery.test:19302", "stun:site.test:3478"] }];+ expect(natPredictionSurveyUrls(servers, auxiliary)).toEqual(new Set([+ "stun:site.test:3478", ...auxiliary,+ ]));+ });++ it("uses a non-default base when the remaining discovery URLs are the survey pair", () => {+ const urls = ["stun:primary.test:19302", "stun:survey-a.test:3478", "stun:survey-b.test:3478"];+ const servers = [{ urls }];+ const auxiliary = urls.slice(1, 3);+ expect(natPredictionSurveyUrls(servers, auxiliary)).toEqual(new Set(urls.slice(0, 3)));+ expect(punchIceConfig({ iceServers: servers, natPredictionStunUrls: auxiliary })).toEqual({+ iceServers: [{ urls: urls.slice(0, 3) }],+ });++ const send = vi.fn<(candidate: SignalCandidate) => void>();+ const batch = new NatPredictionCandidateBatch(send);+ for (const [index, port] of [[1, 40_000], [2, 40_003], [3, 40_006]]) {+ const observation = candidate(port!)!;+ observation.candidate = observation.candidate.replace("candidate:base", `candidate:ns${index}`);+ const eligible = isNativeNatSurveyCandidate(observation, servers, auxiliary);+ expect(eligible).toBe(true);+ batch.add(observation, eligible);+ }+ batch.complete();+ const emitted = send.mock.calls.map(([value]) => value);+ expect(emitted.filter(value => /^candidate:ns/.test(value?.candidate ?? ""))).toHaveLength(3);+ expect(emitted.filter(value => /^candidate:s[pm]/.test(value?.candidate ?? ""))).toHaveLength(MAX_NAT_PREDICTION_CANDIDATES);+ expect(emitted.at(-1)).toBeNull();+ });+it.each([["stun:Share.TEST", "stun:share.test:3478"],["STUN:Share.TEST:03478", "stun:share.test:3478"],["stun:[2001:DB8::1]:3478", "stun:[2001:db8::1]:3478"],- ["stun:share.test:80", null],- ["stun:share.test:00080", null],- ["stun:share.test:443", null],+ ["stun:share.test:80", "stun:share.test:80"],+ ["stun:share.test:00080", "stun:share.test:80"],+ ["stun:share.test:443", "stun:share.test:443"],] as const)("preserves the STUN port in survey membership for %s", (url, base) => {const auxiliary = ["stun:survey.test:80", "stun:survey.test:443"];expect(natPredictionSurveyUrls([{ urls: url }], auxiliary)).toEqual(- new Set(base ? [base, ...auxiliary] : []),+ new Set([base, ...auxiliary]),);});@@ -409,14 +457,14 @@ describe("NAT prediction ICE adapter", () => {it("retires an unfinished generation without ending the restarted ICE session", () => {const sent: SignalCandidate[] = [];const survey = [- "stun:share.example.test:3478",+ "stun:share.example.test:19302","stun:survey-a.example.test:3478","stun:survey-b.example.test:3478",];const emitter = new NatPredictionCandidateEmitter(true,(value) => sent.push(value),- new Set(survey),+ natPredictionSurveyUrls([{ urls: survey }], survey.slice(1)),);const emit = (port: number, usernameFragment: string, url: string) => {emitter.add({diff --git a/tests/release-automation.test.ts b/tests/release-automation.test.tsindex 08cbf183..214a56ee 100644--- a/tests/release-automation.test.ts+++ b/tests/release-automation.test.ts@@ -6,12 +6,27 @@ import { dirname, join } from "node:path";import { fileURLToPath } from "node:url";import { describe, expect, it } from "vitest";import { pullRequestNotes, releaseNotes } from "../scripts/release-notes.mjs";+import { splitReleaseHeadline } from "../scripts/release-headline.mjs";const planner = fileURLToPath(new URL("../scripts/release-version.mjs", import.meta.url));const publisher = fileURLToPath(new URL("../scripts/publish-release.mjs", import.meta.url));const sha = (value: string) => createHash("sha256").update(value).digest("hex");describe("release automation", () => {+ it("shares only an authored leading bilingual headline with the website", () => {+ const opening = "**Play together. Your turn!**\n\n**远程同乐,轮到你啦!**";+ expect(splitReleaseHeadline(`${opening}\n\n### 中文\n\n修复开播。`)).toEqual({+ headline: { "zh-CN": "远程同乐,轮到你啦!", en: "Play together. Your turn!" },+ notes: "### 中文\n\n修复开播。",+ });+ expect(splitReleaseHeadline(opening.replaceAll("\n\n", "\r\n\r\n\r\n")).headline)+ .toEqual({ "zh-CN": "远程同乐,轮到你啦!", en: "Play together. Your turn!" });+ for (const body of [undefined, "旧版本说明", "**只有一句**", "** **\n\n**English**",+ "**Fixed** **disconnects**\n\n**Details**", `本次更新\n\n${opening}`, `### 中文\n\n${opening}`]) {+ expect(splitReleaseHeadline(body)).toEqual({ headline: null, notes: body ?? "" });+ }+ });+it("validates the PR body against its net product diff before the squash", () => {const root = mkdtempSync(join(tmpdir(), "piik-pr-notes-"));const git = (...args: string[]) => execFileSync("git", args, { cwd: root, encoding: "utf8" }).trim();@@ -87,19 +102,26 @@ describe("release automation", () => {cwd: root, encoding: "utf8", env: { ...process.env, PIIK_BUILD_VERSION: "v1.0.1" },}));expect(candidate).toMatchObject({ version: "v1.0.1", publish: false });- commit("fix: repair playback\n\n## Release notes\n- Playback resumes after reconnecting.");- const next = commit("feat: add a sharing option\n\n## Release notes\n- Choose a window to share.");+ commit("fix: repair playback\n\n## Release notes\n**Earlier theme**\n\n**旧主题**\n\n- Playback resumes after reconnecting.");+ const opening = "**Play together. Your turn!**\n\n**远程同乐,轮到你啦!**";+ const next = commit(`feat: add a sharing option\n\n## Release notes\n${opening}\n\n- Choose a window to share.`);const notes = releaseNotes(root, "v1.1.0", next, "fixture/Piik");+ expect(notes.startsWith(opening)).toBe(true);+ expect(notes).not.toMatch(/旧主题|Earlier theme/);expect(notes).toContain("- Playback resumes after reconnecting.\n\n- Choose a window to share.");expect(notes).toContain(`/compare/v1.0.0...${next}`);expect(notes).not.toContain("开始分享");expect(notes).not.toContain("redesign");- git("tag", "v1.1.0");+ const omitted = commit("fix: reconnect\n\n## Release notes\n- Reconnect reliably.");+ const plain = releaseNotes(root, "v1.1.0", omitted, "fixture/Piik");+ expect(splitReleaseHeadline(plain).headline).toBeNull();+ expect(plain).toContain("- Playback resumes after reconnecting.\n\n- Choose a window to share.\n\n- Reconnect reliably.");+ git("tag", "v1.1.0", next);expect(releaseNotes(root, "v1.1.0", next, "fixture/Piik")).toBe(notes);// A checkout may have advanced; generation still uses the requested SHA.expect(releaseNotes(root, "v1.0.0", launch, "fixture/Piik")).toBe(first);for (const section of ["", "## Release notes", "## Release notes\n<!-- Fill in -->\n### Changes",- "## Release notes\n- One\n## Release notes\n- Two"]) {+ "## Release notes\n- One\n## Release notes\n- Two", `## Release notes\n${opening}`]) {git("checkout", "--quiet", "--detach", next);const invalid = commit(`chore: maintenance\n\n${section}`);expect(() => releaseNotes(root, "v1.1.1", invalid, "fixture/Piik")).toThrow("one nonempty");