mirror of
https://github.com/layer-systems/website.git
synced 2026-09-12 13:43:01 +02:00
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:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user