From 809077d054463b21668e453a6bd6c185e95a67b1 Mon Sep 17 00:00:00 2001 From: mroxso <24775431+mroxso@users.noreply.github.com> Date: Sun, 6 Sep 2026 12:09:21 +0200 Subject: [PATCH] fix: open the picked app from the mobile app switcher (#18) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The switcher only focused the window it was given. `FOCUS_WINDOW` raises and focuses but never un-minimizes, while the mobile shell renders a window only when it is focused *and* not minimized — so picking a minimized app updated the URL and the document title (both follow `focusedId`) while the home screen stayed on screen. Restore a minimized window instead of merely focusing it, the same way the menu bar's Window menu and the command palette already do. Fixes #15 Claude-Session: https://claude.ai/code/session_01Trku191Ww2a2YmDWQF3fTS Co-authored-by: Claude Opus 5 --- src/components/os/MobileAppShell.tsx | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/components/os/MobileAppShell.tsx b/src/components/os/MobileAppShell.tsx index ad472ce..ada5899 100644 --- a/src/components/os/MobileAppShell.tsx +++ b/src/components/os/MobileAppShell.tsx @@ -22,8 +22,16 @@ import type { AppParams } from '@/os/types'; * app at a time. */ export function MobileAppShell() { - const { windows, focusedId, openApp, focusWindow, closeWindow, setWindowTitle, setWindowParams } = - useWindowManager(); + const { + windows, + focusedId, + openApp, + focusWindow, + restoreWindow, + closeWindow, + setWindowTitle, + setWindowParams, + } = useWindowManager(); const [switcherOpen, setSwitcherOpen] = useState(false); const active = useMemo( @@ -92,7 +100,11 @@ export function MobileAppShell() { key={win.id} type="button" onClick={() => { - focusWindow(win.id); + // Focusing alone leaves a minimized window minimized, + // and the shell only renders a window that is focused + // *and* not minimized — the home screen would stay up. + if (win.minimized) restoreWindow(win.id); + else focusWindow(win.id); setSwitcherOpen(false); }} className={cn(