diff --git a/changelog.d/fixed-15983.md b/changelog.d/fixed-15983.md new file mode 100644 index 0000000000..adccbfed04 --- /dev/null +++ b/changelog.d/fixed-15983.md @@ -0,0 +1 @@ +- The display-mode 🔗 Copy link control now keeps `density=tv` and `shift=1`, so a wall screen opened with `?display=1&density=tv&shift=1` no longer loses its TV layout and burn-in shift when the link is copied; the flags are rendering-only, so no token or cookie can ride along (#15983). diff --git a/src/docs/streaming-the-activity-monitor.md b/src/docs/streaming-the-activity-monitor.md index 59ad882d19..0b48940003 100644 --- a/src/docs/streaming-the-activity-monitor.md +++ b/src/docs/streaming-the-activity-monitor.md @@ -200,7 +200,7 @@ and acts only when clicked: | Control | What it does | |---|---| | **✕ Exit display** | Leaves display mode, the same as **Esc**. | -| **🔗 Copy link** | Copies a link to this display: `display=1`, the current `am.*` view (or the playlist's `am.view` + `interval`) and `theme`, and nothing else — never a token or cookie. If the clipboard is unavailable or refused, the link is shown in a selectable field instead. | +| **🔗 Copy link** | Copies a link to this display: `display=1`, the current `am.*` view (or the playlist's `am.view` + `interval`), `theme`, and the `density=tv` / `shift=1` display options when set, and nothing else — never a token or cookie. If the clipboard is unavailable or refused, the link is shown in a selectable field instead. | | **⛶ Full screen** | The same full screen as the header's ⛶ button. Disabled with a "not supported" tooltip where the browser has no Fullscreen API. | | **☀ Keep awake** | Asks the browser to keep the screen awake (Screen Wake Lock). Shows *on*, *off*, *denied* (with the browser's reason; it is not retried automatically) or is disabled where unsupported. While on, it is re-requested when the tab becomes visible again; it is released on exit and is not remembered after a reload. | diff --git a/src/pkg/dashboard/stage_tracker_display.test.js b/src/pkg/dashboard/stage_tracker_display.test.js index 91995250d8..5e2ddab045 100644 --- a/src/pkg/dashboard/stage_tracker_display.test.js +++ b/src/pkg/dashboard/stage_tracker_display.test.js @@ -490,6 +490,14 @@ test('Copy display link falls back to a selectable field when the clipboard is m // With no parsed playlist the current view is used, whatever am.view said. assert.deepStrictEqual(new URL(pl.api.stageTrackerDisplayLinkUrl(plHref, pl.api.filter(), 'none', null)).searchParams.getAll('am.view'), []); assert.strictEqual(pl.api.stageTrackerDisplayLinkUrl('nope', {}, 'none', null), ''); + // density=tv and shift=1 are rendering-only flags and ride along; any other value does not. + const flags = new URL(pl.api.stageTrackerDisplayLinkUrl('https://hive.example/?display=1&density=tv&shift=1&token=x', pl.api.filter(), 'none', null)); + assert.strictEqual(flags.searchParams.get('density'), 'tv'); + assert.strictEqual(flags.searchParams.get('shift'), '1'); + assert.strictEqual(flags.searchParams.get('token'), null); + const badFlags = new URL(pl.api.stageTrackerDisplayLinkUrl('https://hive.example/?display=1&density=foo&shift=0', pl.api.filter(), 'none', null)); + assert.strictEqual(badFlags.searchParams.get('density'), null); + assert.strictEqual(badFlags.searchParams.get('shift'), null); }); test('Exit display drops display=1 like Esc and releases a held wake lock', async () => { diff --git a/src/pkg/dashboard/static-src/js/tracker-popout.js b/src/pkg/dashboard/static-src/js/tracker-popout.js index 71b2b00eda..d030c95249 100644 --- a/src/pkg/dashboard/static-src/js/tracker-popout.js +++ b/src/pkg/dashboard/static-src/js/tracker-popout.js @@ -331,7 +331,8 @@ } // Pure: the link Copy display link puts on the clipboard. Only view // parameters ride along — display=1, am.* (or, given a parsed playlist, - // one am.view per accepted view plus interval) and theme — so no token, + // one am.view per accepted view plus interval), theme and the rendering-only + // density=tv / shift=1 flags — so no token, // cookie or other query param can leak. Playlist views are re-serialised // from the parsed { filter, group }, never echoed from the current URL. function stageTrackerDisplayLinkUrl(href, filter, group, playlist) { @@ -349,6 +350,8 @@ } const theme = src.searchParams.get('theme'); if (theme !== null) out.searchParams.set('theme', theme); + if (src.searchParams.get('density') === 'tv') out.searchParams.set('density', 'tv'); + if (src.searchParams.get('shift') === '1') out.searchParams.set('shift', '1'); out.hash = STAGE_TRACKER_POPOUT_HASH; return out.toString(); } diff --git a/src/pkg/dashboard/static/index.html b/src/pkg/dashboard/static/index.html index ca0b0449e9..80f4f3e0bc 100644 --- a/src/pkg/dashboard/static/index.html +++ b/src/pkg/dashboard/static/index.html @@ -25136,7 +25136,8 @@