fix: open the picked app from the mobile app switcher (#18)

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 <noreply@anthropic.com>
This commit is contained in:
mroxso
2026-09-06 12:09:21 +02:00
committed by GitHub
parent dc1701afd9
commit 809077d054

View File

@@ -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(