commit 1249b550ed17baa980be3378ca9025e1f5886deb
parent 8eda2ec4ed6531c39e16e1c624bfbaf7ec98cd5c
Author: Damian Myrda <damian@prime8.dev>
Date: Thu, 22 Oct 2026 00:36:11 +0000
web: refocus the prompt when switching back to about
Diffstat:
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/internal/web/scripts/modules/shell.js b/internal/web/scripts/modules/shell.js
@@ -777,10 +777,12 @@ export function initShell() {
if (!load(LOGIN_KEY)) store(LOGIN_KEY, String(Date.now()));
render();
- // A terminal opens focused. Skip touch screens, where focus pops the
+ // A terminal opens focused, on load and on every switch back to about. Skip touch screens, where focus pops the
// on-screen keyboard, and never steal focus from something else.
const active = document.activeElement;
- const idle = !active || active === document.body || active === document.documentElement;
+ // A clicked tab keeps focus after the swap; coming back to about counts as idle.
+ const idle = !active || active === document.body || active === document.documentElement ||
+ !!active.closest?.("#tabs");
if (!live.hidden && idle && window.matchMedia("(pointer: fine)").matches) {
input.focus({ preventScroll: true });
}