From d0fc6c0f72a1b77ef2928438b59a09dad77e5cfc Mon Sep 17 00:00:00 2001 From: GitHub Copilot Date: Thu, 29 Jan 2026 22:51:30 +0000 Subject: [PATCH] fix: restore dashboard focus on tab activation Ensure the dashboard refocuses when the window regains focus or the tab becomes visible so typeahead works immediately after switching tabs. --- src/webterm/local_server.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/webterm/local_server.py b/src/webterm/local_server.py index 5924638..a983bc6 100644 --- a/src/webterm/local_server.py +++ b/src/webterm/local_server.py @@ -1347,6 +1347,16 @@ class LocalServer: document.addEventListener('keydown', handleKeydown); + // Ensure dashboard regains focus when the tab becomes active + window.addEventListener('focus', () => {{ + window.focus(); + }}); + document.addEventListener('visibilitychange', () => {{ + if (!document.hidden) {{ + window.focus(); + }} + }}); + // Refresh a single tile's screenshot function refreshTile(slug) {{ const card = cardsBySlug[slug];