From 79d3be64f0a3e4552b08c80f1678649ccbff2a7c Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Wed, 11 Nov 2026 10:01:11 +0100 Subject: feat(windows): a new window brings the Windows tab forward When a window id appears that the last poll did not list, the tablet shows the Windows tab for [windows] peek seconds (default 8, 0 off) and then goes back to the tab it was on. A touch on the page or a tab change meanwhile keeps it there; another new window restarts the timer. The hook is generic: a panel's peek(state) returns seconds, app.js does the switching. The first poll only learns what is open, and an error state keeps what it knew, so neither triggers it. Co-Authored-By: Claude Opus 5.5 --- static/modules/windows.js | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'static/modules') diff --git a/static/modules/windows.js b/static/modules/windows.js index 7e2a184..d9f388e 100644 --- a/static/modules/windows.js +++ b/static/modules/windows.js @@ -165,6 +165,16 @@ export default { `; }, + // A window that was not there on the last poll brings the tab forward for + // [windows] peek seconds. + peek(st) { + if (!st.windows) return false; + const ids = new Set(st.windows.map((w) => w.id)); + const fresh = this._ids != null && [...ids].some((id) => !this._ids.has(id)); + this._ids = ids; + return fresh ? st.peek ?? 8 : 0; + }, + update(st, el) { // Polled every second: rebuilding unchanged rows reloads every icon // through its fallbacks, which flickers, so only a change re-renders. -- cgit v1.2.3