From 0b444ce1f0368d8ec98f5113f03949becf2c5ffb Mon Sep 17 00:00:00 2001 From: l0ng-ai <24760907+l0ng-ai@users.noreply.github.com> Date: Fri, 2 Oct 2026 22:26:31 +0800 Subject: [PATCH] fix(mobile): with the lock on, the app switcher shows no panes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The phone keeps a picture of an app as it leaves, for its app switcher. With the lock on, that picture showed whatever pane was open. The app is now covered as it goes, and uncovered — or locked — as it comes back. --- mobile/src/main.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/mobile/src/main.ts b/mobile/src/main.ts index e73e5263..1c0413d9 100644 --- a/mobile/src/main.ts +++ b/mobile/src/main.ts @@ -233,11 +233,22 @@ function suggestions(typed: string, limit = 12) { let onResume: (() => void) | null = null; let onLeave: (() => void) | null = null; +// Locked, the app is covered as it goes, so the picture the phone keeps for +// its app switcher shows nothing of the panes. +let shade: HTMLElement | null = null; document.addEventListener("visibilitychange", () => { if (document.visibilityState === "visible") { + shade?.remove(); + shade = null; if (prefs.lock && Date.now() - hiddenAt > LOCK_AFTER_MS) lock(); onResume?.(); - } else hiddenAt = Date.now(); + } else { + hiddenAt = Date.now(); + if (prefs.lock && !shade) { + shade = h("div", { class: "lock-cover" }, h("img", { class: "empty-mark", src: logoUrl, alt: "" })); + document.body.append(shade); + } + } }); // The app lock: a cover over everything until Face ID or the passcode says