Compare commits

..
1 Commits
  • fix(app,ui): polish handoff links and mobile playback controls
    ## Problem and outcome
    
    The App console could show a launch address that still contained private activation data when copied, while the terminal hyperlink opened a cleaned address. On narrow phones, playback controls could wrap into a second row and cover too much of the video. The handoff now presents the same safe, activation-preserving address everywhere, and the playback bar keeps one compact row with a shorter flexible volume control.
    
    ## Changes
    
    - Sanitize the App activation URL before rendering both copyable console output and terminal hyperlinks, preserving App handoff without exposing credentials.
    - Keep the mobile playback bar on one row; let the volume slider shrink with the available width and hide the nonessential percentage readout at the narrowest sizes.
    - Add bilingual macOS browser/App audio-capture troubleshooting guidance and record the physical-device boundary.
    
    ## Verification
    
    - `npm run check`: TypeScript, 73 test files / 1008 tests, and the Web production build passed.
    - `npm run check:go-core`: Go tests, formatting, vet and supported core target builds passed.
    - `node scripts/check-docs.mjs` and `scripts/check-project-state.ps1` passed.
    - Narrow-layout browser checks covered 320px, 360px, 375px, 390px, 430px, 768px and 1280px widths without wrapping or horizontal overflow.
    - The interaction prototype remains local and uncommitted for later acceptance; it is not part of this PR.
    
    ## Release notes
    
    ### 中文
    
    这是一个维护版本,改善 App 启动链接的安全提示和手机上的播放控制体验。
    
    #### 修复
    
    - 修复 App 控制台复制链接时可能带出私有激活参数的问题。复制、终端链接和手动打开地址现在保持一致,并继续支持自动唤起 App。
    - 修复窄屏手机上的播控挤成两行、遮挡画面的问题。控件保持单行,音量滑条会按可用空间缩短,过窄时隐藏非关键的百分比读数。
    - 补充 macOS 浏览器与 App 采集声音选项的排查说明,明确不同浏览器和系统版本的能力边界。
    
    #### 兼容性
    
    本版本不改变通信协议、配置格式或存储格式。App 公网邀请、本地模式和已部署站点按原方式更新即可;已打开的页面刷新后使用新的播控布局。
    
    ### English
    
    This maintenance release improves App launch links and playback controls on phones.
    
    #### Fixes
    
    - Fixed the App console sometimes exposing private activation parameters in a copied launch address. The copied address, terminal hyperlink and manual URL now match while still supporting App handoff.
    - Fixed narrow phone layouts wrapping playback controls into a second row and covering the video. Controls stay on one row, the volume slider shrinks with the available space, and the nonessential percentage readout hides when space is tight.
    - Added macOS troubleshooting guidance for browser and App audio capture, including the current browser and OS support boundaries.
    
    #### Compatibility
    
    This release changes no wire protocol, configuration format or storage format. Update the App for public invitations or Local mode, or update the deployed site as usual; refresh an open page to use the new playback layout.
6 changed files with 90 additions and 17 deletions

No files matched your search

+23
View File
@@ -10,6 +10,7 @@ collect a diagnostic report if the problem persists.
| What you see | Try this |
| --- | --- |
| Picture but no sound | Unmute the video. The host should choose a source with shareable audio; if sound was disabled, stop and start sharing with it enabled. App window/screen capture keeps that setting when switching sources. |
| No audio option on a Mac | Check whether you are using the browser picker or App capture. See [macOS audio options](#no-audio-option-on-macos). |
| No screen picker | Allow the browser or App to record the screen when the OS asks. Browser capture needs HTTPS or `localhost`; try sharing from a desktop computer. |
| No App windows or screens listed | Check the message in the source picker, then follow [App source troubleshooting](#app-windows-or-screens-are-missing). **Browser** → **Browser picker** also offers browser capture. |
| Yellow outline around the shared window or screen | This is Windows' capture indicator. See [capture borders](#yellow-capture-border-on-windows) for Windows 11 controls and an optional Windows 10 workaround. |
@@ -44,6 +45,28 @@ Local-network permission lets the page contact the App. It is separate from
the WebRTC media settings described below. An unreachable App alone does not
prove that permission was denied.
## No audio option on macOS
**Browser capture:** try an up-to-date Chrome, select a **Chrome tab**, and enable
**Share tab audio**. Window and entire-screen audio need newer platform support:
Google documents **macOS 14.2 or later and Chrome 142 or later** for that feature.
Safari and Firefox currently do not provide screen-share audio through the
browser picker. See [Google's requirements](https://workspaceupdates.googleblog.com/2025/12/share-devices-audio-when-presenting.html)
and [browser audio support](https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getDisplayMedia#browser_compatibility).
**App capture:** keep Piik App running and open the site through it. Choose an
application/window or screen in Piik's source picker; **Application sound** or
**System sound** appears below a loaded source list. The **Browser** tab instead
leaves audio selection to the browser's own dialog. For an unavailable App or
empty list, follow [App source troubleshooting](#app-windows-or-screens-are-missing).
The Mac App includes native audio capture, but physical Mac testing is still pending.
In **System Settings → Privacy & Security → Screen & System Audio Recording**,
allow the browser or capture app named by the system prompt. Follow any request
to quit and reopen it, then share again. Older macOS versions may call this
**Screen Recording**. [Apple's permission guide](https://support.apple.com/guide/mac-help/mchld6aa7d23/mac)
explains these settings.
## Yellow capture border on Windows
Windows draws this outline to identify the window or display being captured.
+18
View File
@@ -10,6 +10,7 @@
| 你遇到的情况 | 可以先试什么 |
| --- | --- |
| 有画面,没声音 | 先取消视频静音。房主应选择支持分享声音的来源;如果开始时关闭了声音,请停止后重新开始并打开声音。通过 App 采集窗口或屏幕时,切换来源会保留原来的声音设置。 |
| Mac 上没有声音选项 | 先区分浏览器选择器与 App 采集,查看 [macOS 声音选项](#macos-没有声音选项)。 |
| 没有屏幕选择弹窗 | 按系统提示允许浏览器或 App 录制屏幕。浏览器采集需要 HTTPS 或 `localhost`,请在电脑上尝试分享。 |
| App 的窗口或屏幕列表为空 | 先查看选源器中的提示,再按 [App 来源排查](#app-找不到窗口或屏幕) 操作;也可以选 **浏览器** → **浏览器选择器** 使用浏览器采集。 |
| 分享的窗口或屏幕周围出现黄框 | 这是 Windows 的采集提示。查看[采集边框说明](#windows-分享时出现黄框),了解 Windows 11 的开关和 Windows 10 的可选处理方法。 |
@@ -41,6 +42,23 @@
本地网络权限用于让网页连接 App,与下文的 WebRTC 媒体设置不同。
仅凭 App 未连接,不能确定是权限被拒绝。
## macOS 没有声音选项
**浏览器采集:** 可以先用最新版 Chrome 选择 **Chrome 标签页**,并打开 **分享标签页音频**。
窗口和整个屏幕的声音需要较新的平台支持:Google 公布的条件是 **macOS 14.2 及以上、
Chrome 142 及以上**。Safari 和 Firefox 目前不提供浏览器屏幕共享音频。
详见 [Google 的版本要求](https://workspaceupdates.googleblog.com/2025/12/share-devices-audio-when-presenting.html)
和 [浏览器音频支持情况](https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getDisplayMedia#browser_compatibility)(英文)。
**App 采集:** 保持 Piik App 运行,并通过它打开站点。在 Piik 选源器中选择应用/窗口或屏幕,
来源列表加载后,底部会出现 **应用声音** 或 **系统声音** 开关。选 **浏览器** 分类时,
声音由浏览器自己的弹窗选择。若 App 不可用或列表为空,先按 [App 来源排查](#app-找不到窗口或屏幕) 处理。
Mac App 已有原生音频采集实现,实机测试仍待完成。
在 **系统设置 → 隐私与安全性 → 屏幕与系统音频录制** 中,允许系统提示所指的浏览器或采集程序。
如果系统要求退出并重新打开程序,照提示完成后再分享。旧版 macOS 的选项可能叫 **屏幕录制**。
具体操作见 [Apple 权限说明](https://support.apple.com/zh-cn/guide/mac-help/mchld6aa7d23/mac)。
## Windows 分享时出现黄框
Windows 用黄色边框标出正在采集的窗口或屏幕。在支持的 Windows 版本上,
+3 -2
View File
@@ -110,8 +110,9 @@ no separate remembered playback intent for source changes or reconnects.
Adding, replacing or removing audio on the same video binding updates only its
audio consumer; it preserves current-frame proof and Viewer-local playback.
The bar spans the screen's lower edge. Narrow screens separate audio controls
from window actions into two rows and retain 44px action targets. Playing video hides the bar
The bar spans the screen's lower edge in one row. Narrow screens shorten the
volume slider and compact horizontal spacing and button widths, retaining 44px
control height and all actions; the percentage readout hides on narrow screens. Playing video hides the bar
after two idle seconds, following [Media Chrome's default](https://github.com/muxinc/media-chrome/blob/main/docs/src/pages/docs/en/components/media-controller.md#autohide).
Pause or unavailable playback keeps it visible. Control hover, keyboard focus,
dragging and an open tooltip hold it open; mouse movement reveals it, and a
+4 -5
View File
@@ -382,13 +382,12 @@ func (model consoleModel) content(styled bool) string {
continue
}
address := consoleAddress(item[1])
if item[0] == "entry" {
address = launchURL(address)
}
style := link
if styled {
target := address
if item[0] == "entry" {
target = launchURL(address)
}
style = style.Hyperlink(target)
style = style.Hyperlink(address)
}
if compactDebug {
fmt.Fprintf(&out, "\n%s\n", style.Render(address))
+32
View File
@@ -190,6 +190,38 @@ func TestBrowserOpenFeedbackBelongsToTheCurrentEntry(t *testing.T) {
}
}
func TestConsoleEntryKeepsAppActivationWithoutExposingCredentials(t *testing.T) {
model := consoleModel{width: 80, language: "en", view: consoleView{
mode: "link", state: "ready",
entry: "http://user:private-secret@localhost:8787/?token=private-secret#client-access=private-secret&piik-client=1",
invite: "https://room.example/?token=private-secret#v=private-secret",
}}
want := []string{"http://localhost:8787/#piik-client=1", "https://room.example/"}
for _, styled := range []bool{false, true} {
content := model.content(styled)
var addresses []string
for _, field := range strings.Fields(ansi.Strip(content)) {
if strings.HasPrefix(field, "http") {
addresses = append(addresses, field)
}
}
if len(addresses) != len(want) {
t.Fatalf("styled=%v: copyable addresses = %q", styled, addresses)
}
for i, address := range want {
if addresses[i] != address {
t.Fatalf("styled=%v: copyable address = %q, want %q", styled, addresses[i], address)
}
if styled && !strings.Contains(content, ansi.SetHyperlink(address)) {
t.Fatalf("terminal hyperlink differs from copyable address %q", address)
}
}
if strings.Contains(content, "private-secret") || strings.Contains(content, "client-access") {
t.Fatal("console exposed an entry or invitation credential")
}
}
}
func TestConsolePresentationAndShutdown(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
@@ -27,21 +27,21 @@
.lr-playback .lr-btn:is(:hover, :focus-visible):not(:disabled):not([aria-disabled="true"]) { transform: translateY(-2px); background: var(--wall-2); }
.lr-playback .lr-btn:active:not(:disabled):not([aria-disabled="true"]) { transform: translateY(2px) scale(.95); transition-duration: 80ms; }
.lr-playback .lr-btn[aria-pressed="true"] { background: var(--wall-2); }
.lr-playback-audio { display: flex; align-items: center; gap: 8px; min-width: 0; }
.lr-playback-separator { width: 1px; height: 20px; background: currentColor; opacity: .22; }
.lr-playback-volume { min-width: 0; }
.lr-playback-volume input { width: clamp(64px, 14vw, 144px); min-width: 0; height: 44px; padding: 0; margin: 0; accent-color: var(--action); cursor: pointer; }
.lr-playback-level { width: 4ch; text-align: right; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.lr-playback-audio { display: flex; align-items: center; flex: 1; gap: 8px; min-width: 0; }
.lr-playback-separator { flex: none; width: 1px; height: 20px; background: currentColor; opacity: .22; }
.lr-playback-volume { flex: 0 1 144px; min-width: 32px; }
.lr-playback-volume input { width: 100%; min-width: 0; height: 44px; 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); }
.lr-playback-view { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; border-left: 1px solid var(--wall-2); padding-left: 8px; }
.lr-playback-view { display: inline-flex; align-items: center; flex: none; gap: 4px; margin-left: auto; border-left: 1px solid var(--wall-2); padding-left: 8px; }
.lr-tv-screen:fullscreen { width: 100%; height: 100%; border: 0; border-radius: 0; }
.lr-tv-screen:has(> .lr-playback) { container-type: inline-size; }
@container (max-width: 440px) {
.lr-playback { flex-wrap: wrap; gap: 2px 6px; padding: 4px 8px max(4px, env(safe-area-inset-bottom)); }
.lr-playback-audio { flex-basis: 100%; gap: 6px; }
.lr-playback-separator { display: none; }
.lr-playback { gap: 6px; padding: 4px 8px max(4px, env(safe-area-inset-bottom)); }
.lr-playback .lr-btn { width: clamp(32px, 11cqw, 44px); }
.lr-playback-audio { gap: 4px; }
.lr-playback-separator, .lr-playback-level { display: none; }
.lr-playback-volume { flex: 1; }
.lr-playback-volume input { width: 100%; }
.lr-playback-view { gap: 2px; border: 0; padding: 0; }
}
@media (prefers-reduced-motion: reduce) {