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.
This commit is contained in:
GitHub Copilot
2026-01-29 22:51:30 +00:00
parent 322b82dc79
commit d0fc6c0f72
+10
View File
@@ -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];