Skip to content

armgit / mso

Public Imported from GitHub
0

Browser-based graphical shell and control plane for a Linux server you own — real terminal, file manager, live metrics and BYOK AI in one mobile-first workspace. Next.js 16 · React 19 · node-pty · Tailwind v4 · shadcn/ui. Public alpha, self-hosted.

refactor(ui): separate shell design systems

Rahmanf2bef4f71bce
diff --git a/app/globals.css b/app/globals.css
index e55613ae..54f39e41 100644
--- a/app/globals.css
+++ b/app/globals.css
@@ -397,11 +397,11 @@ body {
}
-/* ── iOS System Settings app ───────────────────────────────────────────────
- System Settings owns its iOS navigation chrome, matching the native hierarchy:
- large-title/search root → grouped inset lists → blue Settings back on detail.
+/* ── iOS System Settings content ───────────────────────────────────────────
+ The shell owns the single mobile navigation header. Settings contributes only
+ Search/grouped content at root and detail content below the published parent/title.
These selectors are fully iOS + Settings-slot scoped; Android/desktop shells
- keep their existing layouts. */
+ keep their own layouts. */
[data-shell="ios"] [data-slot="ios-settings-root"],
[data-shell="ios"] [data-slot="ios-settings-detail"] {
font-family: var(--shell-font);
@@ -582,3 +582,109 @@ body {
@keyframes wpFloatB { 0%, 100% { transform: translate(8%, 10%) scale(1.1); } 50% { transform: translate(-10%, -8%) scale(0.92); } }
@keyframes bootPulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.06); opacity: 0.85; } }
@keyframes toastIn { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: none; } }
+
+/* ── Shell design-profile surfaces ─────────────────────────────────────────
+ Behavior stays shared; these selectors are the presentation seam. Per-shell
+ design.md files live in frontend/slices/appshell/design/<shell>/design.md. */
+[data-slot="shell-dialog-surface"][data-shell-id="ios"] {
+ font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", var(--font-ui);
+ background: var(--card);
+}
+[data-slot="shell-dialog-surface"][data-shell-id="android"] {
+ font-family: Roboto, "Google Sans Text", system-ui, var(--font-ui);
+ background: var(--card);
+}
+[data-slot="shell-dialog-surface"][data-shell-id="macos"] {
+ border-radius: 12px;
+ background: var(--window-bg);
+}
+[data-slot="shell-dialog-surface"][data-shell-id="windows"] {
+ border-radius: 8px;
+ background: var(--mica-win, var(--window-bg));
+}
+[data-slot="shell-dialog-surface"][data-shell-id="dashboard"] {
+ border-radius: 10px;
+ background: var(--card);
+}
+
+/* macOS Settings: compact sidebar + solid inset content groups. */
+[data-shell="macos"] [data-slot="settings-card"] { border-radius: 10px; }
+[data-shell="macos"] [data-slot="settings-row"] { min-height: 42px; }
+[data-shell="macos"] [data-slot="settings-section-title"] {
+ text-transform: none;
+ letter-spacing: 0;
+ font-size: 12px;
+ font-weight: 600;
+}
+
+/* Material 3 Settings: larger touch rows and tonal rounded containers. */
+[data-shell="android"] [data-slot="settings-pane"] { background: var(--background); }
+[data-shell="android"] [data-slot="settings-card"] {
+ border-color: transparent;
+ border-radius: 24px;
+ background: var(--card);
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
+}
+[data-shell="android"] [data-slot="settings-row"] { min-height: 56px; }
+[data-shell="android"] [data-slot="settings-section-title"] {
+ font-size: 12px;
+ font-weight: 600;
+ letter-spacing: 0.04em;
+}
+[data-shell="android"] [data-slot="settings-footnote"] {
+ font-size: 12px;
+ line-height: 1.45;
+}
+
+/* Windows 11 Settings: compact Fluent geometry, no mobile-style pill cards. */
+[data-shell="windows"] [data-slot="settings-card"] { border-radius: 8px; }
+[data-shell="windows"] [data-slot="settings-row"] { min-height: 44px; }
+[data-shell="windows"] [data-slot="settings-section-title"] {
+ font-size: 12px;
+ text-transform: none;
+ letter-spacing: 0;
+ font-weight: 600;
+}
+[data-shell="windows"] [data-slot="settings-desktop-tabs"] {
+ gap: 2px;
+ padding: 6px;
+ background: var(--mica-win, var(--sidebar));
+}
+
+/* Dashboard: intentionally denser than consumer OS shells. */
+[data-shell="dashboard"] [data-slot="settings-card"] { border-radius: 8px; }
+[data-shell="dashboard"] [data-slot="settings-row"] { min-height: 40px; padding-top: 8px; padding-bottom: 8px; }
+[data-shell="dashboard"] [data-slot="settings-desktop-tabs"] { padding: 4px; gap: 2px; }
+[data-shell="dashboard"] [data-slot="settings-section-title"] { font-size: 10px; }
+/* Native mobile sheet geometry wins over the base Drawer radius. Scoped to the
+ shell + design family so desktop dialogs and the other persona are untouched. */
+[data-slot="shell-dialog-surface"][data-shell-id="ios"][data-shell-mobile="true"] {
+ border-top-left-radius: 24px !important;
+ border-top-right-radius: 24px !important;
+ border-bottom-left-radius: 0 !important;
+ border-bottom-right-radius: 0 !important;
+}
+[data-slot="shell-dialog-surface"][data-shell-id="android"][data-shell-mobile="true"] {
+ border-top-left-radius: 28px !important;
+ border-top-right-radius: 28px !important;
+ border-bottom-left-radius: 0 !important;
+ border-bottom-right-radius: 0 !important;
+}
+
+/* Portaled shell surfaces cannot inherit the active surface's --shell-font because
+ Radix/Vaul mount them under <body>. data-shell-id makes typography self-contained. */
+[data-shell-id="ios"], [data-shell-id="macos"] {
+ font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", var(--font-ui);
+}
+[data-shell-id="android"] {
+ font-family: Roboto, "Google Sans Text", system-ui, var(--font-ui);
+}
+[data-shell-id="windows"] {
+ font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, var(--font-ui);
+}
+[data-shell-id="dashboard"] {
+ font-family: var(--font-ui);
+}
+[data-slot="shell-dialog-surface"][data-shell-id="windows"] {
+ background: color-mix(in srgb, var(--window-bg) 95%, var(--accent) 5%);
+}
diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md
index 66e5db33..c33082b2 100644
--- a/docs/CHANGELOG.md
+++ b/docs/CHANGELOG.md
@@ -4,6 +4,12 @@
Newest first. `docs/PROGRESS.md` is the source of truth for *why* a change was made;
this is the *what*, and it is what Settings → About shows as “What's new”.
+## 2026-08-23
+
+**Changed**
+
+- `ui` separate shell design systems
+
## 2026-08-22
**Fixed**
diff --git a/frontend/slices/app-store/app.tsx b/frontend/slices/app-store/app.tsx
index 725ed26e..50d6602b 100644
--- a/frontend/slices/app-store/app.tsx
+++ b/frontend/slices/app-store/app.tsx
@@ -38,9 +38,11 @@ export default function AppStore() {
// measurement, and the chips live inside the AppFrame's own @container.
const [paneRef, pane] = useContainer<HTMLDivElement>();
const compact = pane === "xs" || pane === "sm";
- // iOS shell nav already shows the app icon + "App Store" → drop the in-content
- // title (double-title fix); the search field becomes a systemFill pill.
- const ios = useActiveShell().id === "ios";
+ // Mobile shell navigation already owns the App Store title on both mobile OSes,
+ // so the in-content title is desktop-only; iOS still gets its systemFill search.
+ const activeShell = useActiveShell();
+ const ios = activeShell.id === "ios";
+ const mobile = activeShell.surface === "mobile";
const rows = useApps();
const disabled = useDisabledIds();
@@ -105,8 +107,8 @@ export default function AppStore() {
header={
<header className="space-y-3 p-4">
<div className="flex items-center gap-2">
- {!ios && <Store className="size-4 text-primary" />}
- {!ios && <h2 className="text-sm font-semibold">App Store</h2>}
+ {!mobile && <Store className="size-4 text-primary" />}
+ {!mobile && <h2 className="text-sm font-semibold">App Store</h2>}
<span className="ml-auto text-[11px] text-muted-foreground">
{count} {count === 1 ? noun : `${noun}s`}
</span>
diff --git a/frontend/slices/appshell/components/app-actions-sheet.tsx b/frontend/slices/appshell/components/app-actions-sheet.tsx
deleted file mode 100644
index 5f262662..00000000
--- a/frontend/slices/appshell/components/app-actions-sheet.tsx
+++ /dev/null
@@ -1,60 +0,0 @@
-"use client";
-
-import { Sheet, SheetContent, SheetTitle, SheetDescription } from "@/components/ui/sheet";
-import { Button } from "@/components/ui/button";
-import { AppIcon } from "./app-icon";
-import type { AppDescriptor } from "../lib/types";
-import type { InspectorAction } from "../lib/inspector";
-
-// Mobile in-app action drawer: the RUNNING app's live inspector actions raised as
-// a bottom sheet from the nav-bar "•••". Same bus that feeds the desktop menu-bar
-// app menu — one source, both surfaces. shadcn Sheet gives the slide-up, scrim,
-// Esc + focus-trap for free (matches the mock's translateY(102%→0) bottom sheet).
-export function AppActionsSheet({
- app,
- actions,
- open,
- onOpenChange,
-}: {
- app: AppDescriptor;
- actions: InspectorAction[];
- open: boolean;
- onOpenChange: (open: boolean) => void;
-}) {
- return (
- <Sheet open={open} onOpenChange={onOpenChange}>
- <SheetContent
- side="bottom"
- className="rounded-t-3xl border-border bg-card p-0 pb-[max(env(safe-area-inset-bottom,0px),1.5rem)]"
- >
- <SheetTitle className="flex items-center gap-2.5 px-4 pt-4 text-[15px]">
- <span className="size-9">
- <AppIcon app={app} />
- </span>
- {app.title}
- </SheetTitle>
- <SheetDescription className="sr-only">Quick actions for {app.title}</SheetDescription>
- <div className="mt-2 max-h-[50vh] overflow-auto">
- {actions.length === 0 ? (
- <p className="px-4 py-6 text-center text-sm text-muted-foreground">No actions</p>
- ) : (
- actions.map((a) => (
- <Button
- key={a.id}
- type="button"
- variant="ghost"
- onClick={() => {
- onOpenChange(false);
- void a.run();
- }}
- className="h-auto block w-full justify-start rounded-none border-t border-border px-4 py-3.5 text-left text-[15px] font-medium"
- >
- {a.label}
- </Button>
- ))
- )}
- </div>
- </SheetContent>
- </Sheet>
- );
-}
diff --git a/frontend/slices/appshell/components/layout/app-chrome-mobile.tsx b/frontend/slices/appshell/components/layout/app-chrome-mobile.tsx
index 786f19a0..dd748119 100644
--- a/frontend/slices/appshell/components/layout/app-chrome-mobile.tsx
+++ b/frontend/slices/appshell/components/layout/app-chrome-mobile.tsx
@@ -14,6 +14,7 @@ import {
SheetDescription,
} from "@/components/ui/sheet";
import { cn } from "@/lib/utils";
+import { useShellDesign } from "../../design/use-shell-design";
export function MobileSideRegion({
open,
@@ -34,9 +35,23 @@ export function MobileSideRegion({
sheetClassName?: string;
children: ReactNode;
}) {
+ const design = useShellDesign();
return (
<Sheet open={open} onOpenChange={onOpenChange}>
- <SheetContent side={side} className={cn(sheetWidth, "p-0", sheetClassName)}>
+ <SheetContent
+ data-slot="shell-side-region"
+ data-shell-id={design.id}
+ data-shell-family={design.family}
+ data-shell-density={design.density}
+ side={side}
+ className={cn(
+ sheetWidth,
+ "p-0",
+ design.family === "apple" && "rounded-r-[22px] border-y border-r",
+ design.family === "material" && "rounded-r-[28px] border-y border-r bg-card",
+ sheetClassName,
+ )}
+ >
<SheetTitle className="sr-only">{title}</SheetTitle>
<SheetDescription className="sr-only">{description ?? title}</SheetDescription>
<div className="flex h-full w-full min-h-0 flex-col overflow-y-auto">{children}</div>
diff --git a/frontend/slices/appshell/components/mobile-feature-header.test.ts b/frontend/slices/appshell/components/mobile-feature-header.test.ts
new file mode 100644
index 00000000..c2f9c2c6
--- /dev/null
+++ b/frontend/slices/appshell/components/mobile-feature-header.test.ts
@@ -0,0 +1,36 @@
+import { readFileSync } from "node:fs";
+import { resolve } from "node:path";
+import { describe, expect, it } from "vitest";
+
+const src = (path: string) => readFileSync(resolve(process.cwd(), path), "utf8");
+
+describe("mobile feature navigation contract", () => {
+ it("has one shell-owned root contract for iOS and Android", () => {
+ for (const path of [
+ "frontend/slices/appshell/components/shells/ios/ios-feature-header.tsx",
+ "frontend/slices/appshell/components/shells/android/android-feature-header.tsx",
+ ]) {
+ const code = src(path);
+ expect(code).toContain('aria-label={`Back to ${backLabel}`}');
+ expect(code).toContain('aria-label="Ask AI"');
+ expect(code).toContain("{title}");
+ expect(code).toContain("{backLabel}");
+ }
+ });
+
+ it("does not allow feature slices to bypass shell mobile navigation", () => {
+ const types = src("frontend/slices/appshell/lib/types.ts");
+ const settings = src("frontend/slices/os-settings/index.ts");
+ expect(types).not.toContain("ownsMobileNavigation");
+ expect(settings).not.toContain("ownsMobileNavigation");
+ });
+
+ it("moves app quick actions into the AI drawer instead of a second top-right action", () => {
+ const ios = src("frontend/slices/appshell/components/mobile-shell.tsx");
+ const android = src("frontend/slices/appshell/components/shells/android/android-shell.tsx");
+ const ai = src("frontend/slices/appshell/features/inspector/components/alfa-sheet.tsx");
+ expect(ios).not.toContain("AppActionsSheet");
+ expect(android).not.toContain("AppActionsSheet");
+ expect(ai).toContain('data-slot="mobile-ai-actions"');
+ });
+});
diff --git a/frontend/slices/appshell/components/mobile-shell.tsx b/frontend/slices/appshell/components/mobile-shell.tsx
index d0382e1f..d1f7f28e 100644
--- a/frontend/slices/appshell/components/mobile-shell.tsx
+++ b/frontend/slices/appshell/components/mobile-shell.tsx
@@ -3,14 +3,9 @@
import { useCallback, useMemo, useState } from "react";
import { useUrlHome } from "../hooks/use-url-home";
import { cn } from "@/lib/utils";
-import { Button } from "@/components/ui/button";
-import { MoreHorizontal, Sparkles } from "lucide-react";
import { useApps } from "../lib/registry";
-import { useInspectorInfo } from "../lib/inspector";
-import { AppActionsSheet } from "./app-actions-sheet";
import { useWindowOrder, useFocused, useWindow } from "../hooks/use-shell";
import { shellStore, openWindow, focusApp, minimizeWindow, restoreWindow, toggleSpotlight, toggleInspector } from "../lib/store";
-import { AppIcon } from "./app-icon";
import { HomeIndicator } from "./home-indicator";
import { WindowContent } from "./window-content";
import { MobileSwitcher } from "./mobile-switcher";
@@ -19,6 +14,8 @@ import { MobileNotifications } from "./mobile-notifications";
import { Slot } from "../registry/feature-registry";
import { useShellConfig } from "../registry/shell-config";
import { ShellUIProvider, type ShellUI } from "../registry/shell-ui";
+import { useMobileNavigationInfo } from "../lib/mobile-navigation";
+import { IosFeatureHeader } from "./shells/ios/ios-feature-header";
// Phones: no floating windows — a paged home + one fullscreen app at a time.
// Reuses the same store (open/minimize/focus) so state matches the desktop.
@@ -31,7 +28,6 @@ export function MobileShell() {
const [nc, setNc] = useState(false); // notification center (pull down, left half)
const [appScrolled, setAppScrolled] = useState(false); // iOS nav-bar frost-on-scroll
const [closing, setClosing] = useState(false); // playing the dismiss-to-home slide
- const [actionsOpen, setActionsOpen] = useState(false); // in-app "•••" action drawer
// Dock = manifest-pinned apps (AppDescriptor.pinned — the generic shell never
// hardcodes project app ids); falls back to the first 4 dockable apps.
@@ -59,9 +55,7 @@ export function MobileShell() {
const top = useWindow(topId ?? "__none__"); // reactive: re-renders on the active window's own payload/title changes
const showApp = !home && top;
const activeApp = top ? apps.find((a) => a.id === top.app) : null;
- // The running app's live inspector actions → the in-app "•••" drawer (same bus
- // as the desktop menu-bar app menu). Empty ⇒ no "•••" button renders.
- const appActions = useInspectorInfo(activeApp?.id)?.actions ?? [];
+ const mobileNav = useMobileNavigationInfo(activeApp?.id);
// SSOT navigation: open / resume bring a window to the front; home minimises.
// Resume-don't-duplicate (real-iOS): a home tap brings the existing window
@@ -200,46 +194,13 @@ export function MobileShell() {
style={{ height: "var(--sai-top)" }}
onPointerDown={onAppTopPointerDown}
/>
- {/* Nav bar: transparent at rest, frosting into a hairline glass bar once
- the app scrolls (onScrollCapture on <main> catches the app's own inner
- scroll container generically). Title stays put — mso apps carry no
- in-content large title to fade in. */}
- {!activeApp.ownsMobileNavigation && (
- <header
- className={cn(
- "shrink-0 border-b transition-[background-color,border-color] duration-200",
- appScrolled ? "glass border-border bg-[var(--glass-bar)]" : "border-transparent bg-transparent",
- )}
- style={{ paddingTop: "var(--sai-top)" }}
- >
- {/* iOS nav bar: 46px band below the notch. Title CENTERED (16/600);
- the leading app-icon (cockpit identity) + trailing Done are absolute
- so they never shift the centered title. */}
- <div className="relative flex h-[46px] items-center px-3.5">
- <span className="absolute left-3.5 top-1/2 size-[30px] -translate-y-1/2">
- <AppIcon app={activeApp} />
- </span>
- <span className="mx-auto max-w-[55%] truncate text-[16px] font-semibold">{activeApp.title}</span>
- {/* Alfa, in every app. The right dock is desktop-only and Control
- Center is a swipe gesture, so on a phone there was no way to reach
- her from inside an app at all — which is most of the time. Same
- shared thread as the dock and the Assistant app. */}
- <Button type="button" variant="ghost" aria-label="Ask Alfa" onClick={toggleInspector} className="absolute right-[54px] top-1/2 grid h-[44px] w-[44px] -translate-y-1/2 place-items-center rounded-md text-primary">
- <Sparkles className="size-5" />
- </Button>
- {/* app-provided actions (inspector bus) → in-app drawer; left of Alfa */}
- {appActions.length > 0 && (
- <Button type="button" variant="ghost" aria-label="Actions" onClick={() => setActionsOpen(true)} className="absolute right-[106px] top-1/2 grid h-[44px] w-[44px] -translate-y-1/2 place-items-center rounded-md text-primary">
- <MoreHorizontal className="size-5" />
- </Button>
- )}
- {/* primary exit control — 44pt HIG touch target */}
- <Button type="button" variant="ghost" onClick={goHome} className="absolute right-2 top-1/2 h-[44px] min-w-[44px] -translate-y-1/2 rounded-md px-3 text-sm font-medium text-primary">
- Done
- </Button>
- </div>
- </header>
- )}
+ <IosFeatureHeader
+ title={mobileNav?.title ?? activeApp.title}
+ backLabel={mobileNav?.backLabel ?? "Home"}
+ onBack={mobileNav?.onBack ?? goHome}
+ onAI={toggleInspector}
+ scrolled={appScrolled}
+ />
{/* The home-indicator overlays the content edge-to-edge (real-iOS), so
--sai-bottom INSIDE the app pane must clear its 34px band — every app
already pads with var(--sai-bottom), so setting the var here clears the
@@ -264,9 +225,6 @@ export function MobileShell() {
{switcher && <MobileSwitcher onPick={resume} onHome={goHome} />}
<MobileNotifications open={nc} onClose={() => setNc(false)} />
- {activeApp && (
- <AppActionsSheet app={activeApp} actions={appActions} open={actionsOpen} onOpenChange={setActionsOpen} />
- )}
<Slot region="controlCenter" />
<Slot region="topPill" />
</div>
diff --git a/frontend/slices/appshell/components/shells/android/android-feature-header.tsx b/frontend/slices/appshell/components/shells/android/android-feature-header.tsx
new file mode 100644
index 00000000..95c06ef2
--- /dev/null
+++ b/frontend/slices/appshell/components/shells/android/android-feature-header.tsx
@@ -0,0 +1,46 @@
+"use client";
+
+import { ChevronLeft, Sparkles } from "lucide-react";
+import { Button } from "@/components/ui/button";
+import { M3_PRESS } from "./android-motion";
+
+export function AndroidFeatureHeader({
+ title,
+ backLabel,
+ onBack,
+ onAI,
+}: {
+ title: string;
+ backLabel: string;
+ onBack: () => void;
+ onAI: () => void;
+}) {
+ return (
+ <header
+ data-slot="mobile-feature-header"
+ className="relative flex shrink-0 items-center border-b border-border bg-card px-1 text-foreground"
+ style={{ height: "calc(3.5rem + var(--sai-top, 0px))", paddingTop: "var(--sai-top, 0px)" }}
+ >
+ <Button
+ type="button"
+ variant="ghost"
+ onClick={onBack}
+ aria-label={`Back to ${backLabel}`}
+ className={`absolute left-1 top-[calc(var(--sai-top,0px)+1.75rem)] h-12 max-w-[34%] -translate-y-1/2 gap-0 overflow-hidden rounded-full px-1.5 text-[15px] font-medium hover:bg-secondary ${M3_PRESS}`}
+ >
+ <ChevronLeft className="size-6 shrink-0" aria-hidden />
+ <span className="truncate">{backLabel}</span>
+ </Button>
+ <span className="mx-auto max-w-[44%] truncate text-center text-[18px] font-medium">{title}</span>
+ <Button
+ type="button"
+ variant="ghost"
+ onClick={onAI}
+ aria-label="Ask AI"
+ className={`absolute right-1 top-[calc(var(--sai-top,0px)+1.75rem)] grid size-12 -translate-y-1/2 place-items-center rounded-full p-0 hover:bg-secondary ${M3_PRESS}`}
+ >
+ <Sparkles className="size-5" aria-hidden />
+ </Button>
+ </header>
+ );
+}
diff --git a/frontend/slices/appshell/components/shells/android/android-shell.tsx b/frontend/slices/appshell/components/shells/android/android-shell.tsx
index 687f9cd2..eb2fff61 100644
--- a/frontend/slices/appshell/components/shells/android/android-shell.tsx
+++ b/frontend/slices/appshell/components/shells/android/android-shell.tsx
@@ -13,7 +13,7 @@
import { Button } from "@/components/ui/button";
import { useCallback, useMemo, useRef, useState, type CSSProperties } from "react";
import { useUrlHome } from "../../../hooks/use-url-home";
-import { Search, MoreHorizontal, Sparkles } from "lucide-react";
+import { Search } from "lucide-react";
import { useApps } from "../../../lib/registry";
import { usePullDown } from "../../../hooks/use-pull-down";
import { useWindowOrder, useFocused, useWindow } from "../../../hooks/use-shell";
@@ -27,9 +27,9 @@ import { AppCell, AppDrawer, NavBar, Recents } from "./android-parts";
import { M3_PRESS } from "./android-motion";
import { ShellContextMenu, useShellContextMenu } from "../context-menu";
import type { AppDescriptor } from "../../../lib/types";
-import { useInspectorInfo } from "../../../lib/inspector";
-import { AppActionsSheet } from "../../app-actions-sheet";
import { AndroidNotifications } from "./android-notifications";
+import { useMobileNavigationInfo } from "../../../lib/mobile-navigation";
+import { AndroidFeatureHeader } from "./android-feature-header";
function AndroidShell() {
const apps = useApps();
@@ -39,7 +39,6 @@ function AndroidShell() {
const [cc, setCc] = useState(false); // control center (pull down on home)
const [notif, setNotif] = useState(false); // notification shade (pull down, left half)
const [recents, setRecents] = useState(false);
- const [actionsOpen, setActionsOpen] = useState(false); // in-app "•••" action drawer
const gridRef = useRef<HTMLDivElement>(null);
// URL → surface (same derivation as the iOS shell): a pathname naming an app slug
@@ -56,9 +55,7 @@ function AndroidShell() {
const top = useWindow(topId ?? "__none__"); // reactive: re-renders on the active window's own payload/title changes
const showApp = !home && !!top;
const activeApp = top ? apps.find((a) => a.id === top.app) : null;
- // Running app's live inspector actions → the M3 top-app-bar "•••" drawer (same
- // bus as iOS + the desktop menu-bar). Empty ⇒ no overflow button renders.
- const appActions = useInspectorInfo(activeApp?.id)?.actions ?? [];
+ const mobileNav = useMobileNavigationInfo(activeApp?.id);
const launch = useCallback(
(app: AppDescriptor) => {
@@ -185,41 +182,21 @@ function AndroidShell() {
would force a single easing on both families. */}
{showApp && activeApp && top && (
<div className="absolute inset-0 z-[20] flex flex-col bg-background [animation:mobileAppOpen_var(--m3-dur-spatial-slow)_var(--m3-spatial)] [transform-origin:center_bottom]">
- {/* M3 top app bar: flat surface (bg-card, hairline divider), Title Large
- regular weight — not a colored brand header. System Back stays in
- the navigation row below, so this bar does not duplicate it. The per-app color still reads on the icon + recents. */}
- <header
- className="flex shrink-0 items-center gap-3 border-b border-border bg-card px-3 text-foreground"
- style={{ height: "calc(3rem + var(--sai-top, 0px))", paddingTop: "var(--sai-top, 0px)" }}
- >
- {/* Top-bar icon buttons get the same spatial-FAST press as the nav row:
- small elements, so "fast" (k=800, ζ=0.6, ~322ms, 9.3% overshoot).
- The overshoot is what makes a press feel like a physical button
- releasing rather than a scale tween returning. */}
- {/* The system navigation bar below already owns Android Back. A second
- shell-level Back here performed the exact same goHome action and
- doubled the affordance in every app. Internal app navigation (for
- example Settings detail → Settings list) renders its own Back. */}
- <span className="flex-1 truncate pl-1 text-[19px] font-normal">{activeApp.title}</span>
- {appActions.length > 0 && (
- <>
- <Button type="button" variant="ghost" aria-label="Ask Alfa" onClick={toggleInspector} className={`h-auto p-0 font-normal hover:bg-transparent grid size-12 place-items-center active:scale-90 ${M3_PRESS}`}><Sparkles className="size-5" /></Button>
- <Button type="button" variant="ghost" aria-label="Actions" onClick={() => setActionsOpen(true)} className={`-mr-2 h-auto p-0 font-normal hover:bg-transparent grid size-12 place-items-center active:scale-90 ${M3_PRESS}`}><MoreHorizontal className="size-5" /></Button>
- </>
- )}
- </header>
+ <AndroidFeatureHeader
+ title={mobileNav?.title ?? activeApp.title}
+ backLabel={mobileNav?.backLabel ?? "Home"}
+ onBack={mobileNav?.onBack ?? goHome}
+ onAI={toggleInspector}
+ />
<main className="relative min-h-0 flex-1 overflow-x-hidden overflow-y-auto [container-type:inline-size]">
<WindowContent app={top.app} payload={top.payload} />
</main>
- <NavBar onBack={goHome} onHome={goHome} onRecents={() => setRecents(true)} />
+ <NavBar onBack={mobileNav?.onBack ?? goHome} onHome={goHome} onRecents={() => setRecents(true)} />
</div>
)}
{drawer && <AppDrawer apps={dockable} onLaunch={launch} onClose={() => setDrawer(false)} />}
{recents && <Recents order={order} apps={apps} onResume={resume} onHome={goHome} />}
- {activeApp && (
- <AppActionsSheet app={activeApp} actions={appActions} open={actionsOpen} onOpenChange={setActionsOpen} />
- )}
{/* live-activity chip (parity with iOS Dynamic Island) — renders only
while an app reports an activity (render/copy…); reads the same store. */}
<Slot region="topPill" />
diff --git a/frontend/slices/appshell/components/shells/ios/ios-feature-header.tsx b/frontend/slices/appshell/components/shells/ios/ios-feature-header.tsx
new file mode 100644
index 00000000..b4cac6ec
--- /dev/null
+++ b/frontend/slices/appshell/components/shells/ios/ios-feature-header.tsx
@@ -0,0 +1,53 @@
+"use client";
+
+import { ChevronLeft, Sparkles } from "lucide-react";
+import { Button } from "@/components/ui/button";
+import { cn } from "@/lib/utils";
+
+export function IosFeatureHeader({
+ title,
+ backLabel,
+ onBack,
+ onAI,
+ scrolled,
+}: {
+ title: string;
+ backLabel: string;
+ onBack: () => void;
+ onAI: () => void;
+ scrolled: boolean;
+}) {
+ return (
+ <header
+ data-slot="mobile-feature-header"
+ className={cn(
+ "shrink-0 border-b transition-[background-color,border-color] duration-200",
+ scrolled ? "glass border-border bg-[var(--glass-bar)]" : "border-transparent bg-transparent",
+ )}
+ style={{ paddingTop: "var(--sai-top)" }}
+ >
+ <div className="relative flex h-[46px] items-center px-1.5">
+ <Button
+ type="button"
+ variant="ghost"
+ onClick={onBack}
+ aria-label={`Back to ${backLabel}`}
+ className="absolute left-1 top-1/2 h-[44px] max-w-[34%] -translate-y-1/2 gap-0 overflow-hidden px-1 text-[17px] font-normal text-info hover:bg-transparent hover:text-info"
+ >
+ <ChevronLeft className="size-[25px] shrink-0" aria-hidden />
+ <span className="truncate">{backLabel}</span>
+ </Button>
+ <span className="mx-auto max-w-[44%] truncate text-[17px] font-semibold tracking-[-0.01em] text-foreground">{title}</span>
+ <Button
+ type="button"
+ variant="ghost"
+ aria-label="Ask AI"
+ onClick={onAI}
+ className="absolute right-1 top-1/2 grid size-[44px] -translate-y-1/2 place-items-center rounded-full p-0 text-info hover:bg-[var(--fill)] hover:text-info"
+ >
+ <Sparkles className="size-5" aria-hidden />
+ </Button>
+ </div>
+ </header>
+ );
+}
diff --git a/frontend/slices/appshell/design/README.md b/frontend/slices/appshell/design/README.md
new file mode 100644
index 00000000..b0b13cc6
--- /dev/null
+++ b/frontend/slices/appshell/design/README.md
@@ -0,0 +1,10 @@
+# Shell UI architecture
+
+MSO has one behavior model and multiple presentation systems.
+
+- **Shared/headless:** API calls, persistence, settings values, function-calling, stores, validators, data loaders, app actions.
+- **Shell-specific:** navigation chrome, typography, spacing, cards/list treatment, dialog/drawer presentation, motion and desktop window chrome.
+- Feature code must not fork business logic by OS. A feature may publish presentation state (for example a mobile detail title/back action), while the shell renders it.
+- Every shell has a local `design.md`. Code that changes a shell-specific visual rule should update/read that document first.
+- Mobile feature navigation is shell-owned. Root contract: **`< Home` | centered feature title | AI**. Drill-down replaces `Home` with the parent label but does not add a second header.
+- Dialogs/forms use `ResponsiveDialog`/`FormDrawer`; the active `ShellDesignProfile` chooses the native mobile presentation unless a feature explicitly overrides it.
diff --git a/frontend/slices/appshell/design/android/design.md b/frontend/slices/appshell/design/android/design.md
new file mode 100644
index 00000000..00af1bc4
--- /dev/null
+++ b/frontend/slices/appshell/design/android/design.md
@@ -0,0 +1,13 @@
+# Android design.md
+
+Design family: Material 3 / Material You.
+
+## Contract
+- Google Sans/Roboto family, dynamic/tonal surfaces, Material elevation and state layers.
+- Root feature header: **`< Home`** left, feature title centered, AI icon right; minimum 48dp touch targets.
+- Drill-down uses one top app bar; parent replaces Home. Never stack an app-owned navigation bar under it.
+- Prefer 16–28dp rounded containers, tonal fills, pill/segmented controls where appropriate.
+- Settings/list surfaces use Material list rows and section spacing, not iOS grouped-list styling.
+- Modal mobile flows use Material bottom sheets/drawers; destructive confirmations remain explicit.
+- Use M3 motion tokens/springs already defined by the Android shell and honor Reduce Motion.
+- Bottom system navigation remains shell-owned; feature navigation must not duplicate Android Back.
diff --git a/frontend/slices/appshell/design/dashboard/design.md b/frontend/slices/appshell/design/dashboard/design.md
new file mode 100644
index 00000000..1bfc9733
--- /dev/null
+++ b/frontend/slices/appshell/design/dashboard/design.md
@@ -0,0 +1,11 @@
+# Dashboard design.md
+
+MSO cockpit design language (not a fake consumer OS).
+
+## Contract
+- Dense operational layout, neutral graphite surfaces, high information density and clear hierarchy.
+- Use 8px rhythm, compact cards/tables, restrained radius and strong status/value alignment.
+- Prefer inline panels and right-side drawers for configuration/secondary detail.
+- Avoid iOS/Material/Fluent signature chrome; Dashboard should read as an operations cockpit.
+- Preserve keyboard/pointer workflows and expose system state without decorative duplication.
+- Shared feature logic remains identical to every other shell; only the renderer/density changes.
diff --git a/frontend/slices/appshell/design/index.ts b/frontend/slices/appshell/design/index.ts
new file mode 100644
index 00000000..57550938
--- /dev/null
+++ b/frontend/slices/appshell/design/index.ts
@@ -0,0 +1,3 @@
+export { SHELL_DESIGN_PROFILES, designProfileFor } from "./profiles";
+export { useShellDesign } from "./use-shell-design";
+export type { ShellDesignProfile, SettingsNavigationStyle, DialogPresentation, MobileNavigationStyle } from "./types";
diff --git a/frontend/slices/appshell/design/ios/design.md b/frontend/slices/appshell/design/ios/design.md
new file mode 100644
index 00000000..fad24bbc
--- /dev/null
+++ b/frontend/slices/appshell/design/ios/design.md
@@ -0,0 +1,14 @@
+# iOS design.md
+
+Source of truth: `rahmanef63/apple-os-shell/uploads/design.md` (Apple HIG/Liquid Glass reference, 2026).
+
+## Contract
+- Clarity, deference, depth. Content is solid; glass belongs to navigation/overlays, never content cards.
+- 16–20pt side margins, 4/8pt rhythm, continuous/concentric corners.
+- SF-style system typography; body 17pt, navigation title 17pt semibold. Large titles are allowed inside feature content only when they do not duplicate the shell-owned centered root title.
+- Root feature header: **`< Home`** left, feature title centered, AI icon right; 44pt minimum targets.
+- Drill-down uses the same single header: parent on the left, detail title centered, AI right. Never render a second navigation header inside content.
+- Settings: the MSO root contract keeps `Settings` in the centered shell bar, so the content begins with Search (no second large “Settings”). Use grouped inset cards, ~16–18pt radius, 50–52pt rows, inset separators, muted section labels, system-green switches.
+- Forms/actions that interrupt flow use a bottom drawer/sheet. Keep destructive actions red and separated.
+- Navigation/overlay materials may use glass; content cards remain solid.
+- Respect safe areas, Reduce Motion, Reduce Transparency and high contrast.
diff --git a/frontend/slices/appshell/design/macos/design.md b/frontend/slices/appshell/design/macos/design.md
new file mode 100644
index 00000000..b4cffd10
--- /dev/null
+++ b/frontend/slices/appshell/design/macos/design.md
@@ -0,0 +1,12 @@
+# macOS design.md
+
+Source family: `rahmanef63/apple-os-shell/uploads/design.md`, macOS sections.
+
+## Contract
+- Desktop-first, compact density, SF typography, translucent navigation/sidebar layers with solid content.
+- Windows use native title-bar semantics, traffic lights, subtle depth and ~10px window radius.
+- Prefer sidebar + detail for System Settings; selection is persistent while content scrolls independently.
+- Toolbars are compact and contextual. Avoid iOS large-title/grouped-page treatment in desktop windows.
+- Modal workflows use centered dialogs; long secondary workflows may use side panels/sheets.
+- Do not stack glass surfaces. Sidebars/toolbars can be glass; tables/cards/content stay solid.
+- Keep keyboard, pointer, focus, hover, resizable-window behavior first-class.
diff --git a/frontend/slices/appshell/design/profiles.test.ts b/frontend/slices/appshell/design/profiles.test.ts
new file mode 100644
index 00000000..0026112b
--- /dev/null
+++ b/frontend/slices/appshell/design/profiles.test.ts
@@ -0,0 +1,31 @@
+import { existsSync, readFileSync } from "node:fs";
+import { resolve } from "node:path";
+import { describe, expect, it } from "vitest";
+import { SHELL_DESIGN_PROFILES } from "./profiles";
+
+describe("shell design profiles", () => {
+ it("defines one explicit design profile and design.md for every shell", () => {
+ expect(Object.keys(SHELL_DESIGN_PROFILES).sort()).toEqual(["android", "dashboard", "ios", "macos", "windows"]);
+ for (const profile of Object.values(SHELL_DESIGN_PROFILES)) {
+ const doc = resolve(process.cwd(), profile.docsPath);
+ expect(existsSync(doc), `${profile.id} is missing ${profile.docsPath}`).toBe(true);
+ expect(readFileSync(doc, "utf8")).toMatch(/^# .+design\.md/m);
+ }
+ });
+
+ it("keeps mobile navigation shell-owned and desktop navigation desktop-only", () => {
+ expect(SHELL_DESIGN_PROFILES.ios.mobileNavigation).toBe("ios");
+ expect(SHELL_DESIGN_PROFILES.android.mobileNavigation).toBe("android");
+ expect(SHELL_DESIGN_PROFILES.macos.mobileNavigation).toBe("none");
+ expect(SHELL_DESIGN_PROFILES.windows.mobileNavigation).toBe("none");
+ expect(SHELL_DESIGN_PROFILES.dashboard.mobileNavigation).toBe("none");
+ });
+
+ it("uses native settings navigation per persona", () => {
+ expect(SHELL_DESIGN_PROFILES.ios.settingsNavigation).toBe("ios-stack");
+ expect(SHELL_DESIGN_PROFILES.android.settingsNavigation).toBe("android-stack");
+ expect(SHELL_DESIGN_PROFILES.macos.settingsNavigation).toBe("macos-sidebar");
+ expect(SHELL_DESIGN_PROFILES.windows.settingsNavigation).toBe("windows-tabs");
+ expect(SHELL_DESIGN_PROFILES.dashboard.settingsNavigation).toBe("dashboard-tabs");
+ });
+});
diff --git a/frontend/slices/appshell/design/profiles.ts b/frontend/slices/appshell/design/profiles.ts
new file mode 100644
index 00000000..49d27ded
--- /dev/null
+++ b/frontend/slices/appshell/design/profiles.ts
@@ -0,0 +1,54 @@
+import type { ShellId } from "../registry/shells";
+import type { ShellDesignProfile } from "./types";
+
+export const SHELL_DESIGN_PROFILES: Record<ShellId, ShellDesignProfile> = {
+ ios: {
+ id: "ios",
+ family: "apple",
+ density: "comfortable",
+ mobileNavigation: "ios",
+ settingsNavigation: "ios-stack",
+ dialog: { mobile: "drawer-bottom", drawerHeightClass: "h-[92dvh] max-h-[92dvh]", drawerRadiusClass: "rounded-t-[24px]" },
+ docsPath: "frontend/slices/appshell/design/ios/design.md",
+ },
+ android: {
+ id: "android",
+ family: "material",
+ density: "comfortable",
+ mobileNavigation: "android",
+ settingsNavigation: "android-stack",
+ dialog: { mobile: "drawer-bottom", drawerHeightClass: "h-[88dvh] max-h-[88dvh]", drawerRadiusClass: "rounded-t-[28px]" },
+ docsPath: "frontend/slices/appshell/design/android/design.md",
+ },
+ macos: {
+ id: "macos",
+ family: "apple",
+ density: "compact",
+ mobileNavigation: "none",
+ settingsNavigation: "macos-sidebar",
+ dialog: { mobile: "dialog", drawerHeightClass: "", drawerRadiusClass: "" },
+ docsPath: "frontend/slices/appshell/design/macos/design.md",
+ },
+ windows: {
+ id: "windows",
+ family: "fluent",
+ density: "compact",
+ mobileNavigation: "none",
+ settingsNavigation: "windows-tabs",
+ dialog: { mobile: "dialog", drawerHeightClass: "", drawerRadiusClass: "" },
+ docsPath: "frontend/slices/appshell/design/windows/design.md",
+ },
+ dashboard: {
+ id: "dashboard",
+ family: "dashboard",
+ density: "dense",
+ mobileNavigation: "none",
+ settingsNavigation: "dashboard-tabs",
+ dialog: { mobile: "dialog", drawerHeightClass: "", drawerRadiusClass: "" },
+ docsPath: "frontend/slices/appshell/design/dashboard/design.md",
+ },
+};
+
+export function designProfileFor(id: ShellId): ShellDesignProfile {
+ return SHELL_DESIGN_PROFILES[id];
+}
diff --git a/frontend/slices/appshell/design/types.ts b/frontend/slices/appshell/design/types.ts
new file mode 100644
index 00000000..99d5e69a
--- /dev/null
+++ b/frontend/slices/appshell/design/types.ts
@@ -0,0 +1,24 @@
+import type { ShellId } from "../registry/shells";
+
+export type MobileNavigationStyle = "ios" | "android" | "none";
+export type SettingsNavigationStyle = "ios-stack" | "android-stack" | "macos-sidebar" | "windows-tabs" | "dashboard-tabs";
+export type DialogPresentation = "drawer-bottom" | "drawer-right" | "dialog";
+
+/**
+ * Presentation-only profile for one shell. No persistence, API, business logic,
+ * or feature state belongs here. Feature slices keep one headless behavior model;
+ * the active shell profile only selects chrome, density, and presentation.
+ */
+export type ShellDesignProfile = {
+ id: ShellId;
+ family: "apple" | "material" | "fluent" | "dashboard";
+ density: "comfortable" | "compact" | "dense";
+ mobileNavigation: MobileNavigationStyle;
+ settingsNavigation: SettingsNavigationStyle;
+ dialog: {
+ mobile: DialogPresentation;
+ drawerHeightClass: string;
+ drawerRadiusClass: string;
+ };
+ docsPath: string;
+};
diff --git a/frontend/slices/appshell/design/use-shell-design.ts b/frontend/slices/appshell/design/use-shell-design.ts
new file mode 100644
index 00000000..bf829726
--- /dev/null
+++ b/frontend/slices/appshell/design/use-shell-design.ts
@@ -0,0 +1,9 @@
+"use client";
+
+import { useActiveShell } from "../registry/shells";
+import { designProfileFor } from "./profiles";
+
+export function useShellDesign() {
+ const { id } = useActiveShell();
+ return designProfileFor(id);
+}
diff --git a/frontend/slices/appshell/design/windows/design.md b/frontend/slices/appshell/design/windows/design.md
new file mode 100644
index 00000000..f3075426
--- /dev/null
+++ b/frontend/slices/appshell/design/windows/design.md
@@ -0,0 +1,12 @@
+# Windows design.md
+
+Design family: Windows 11 / Fluent.
+
+## Contract
+- Segoe UI Variable, compact desktop density, Mica/acrylic only for chrome or transient surfaces.
+- Window content uses restrained 4–8px radii and clear command hierarchy.
+- Prefer command bars, tabs, navigation rails and right-side panels; avoid mobile-style large grouped cards.
+- Settings use a desktop navigation/tab hierarchy with concise labels and values.
+- Modal workflows use centered content dialogs; non-blocking management flows may use side sheets.
+- Preserve keyboard focus, pointer hover, resize and snap behavior.
+- Accent is functional, not decorative; use neutral surfaces for most content.
diff --git a/frontend/slices/appshell/features/control-center/components/control-center.tsx b/frontend/slices/appshell/features/control-center/components/control-center.tsx
index e493754f..7edae125 100644
--- a/frontend/slices/appshell/features/control-center/components/control-center.tsx
+++ b/frontend/slices/appshell/features/control-center/components/control-center.tsx
@@ -1,30 +1,35 @@
"use client";
import { Sheet, SheetContent, SheetTitle, SheetDescription } from "@/components/ui/sheet";
-import { useShellUI } from "@/features/appshell";
+import { cn } from "@/lib/utils";
+import { useShellDesign, useShellUI } from "@/features/appshell";
import { ControlCenterTiles } from "./control-center-tiles";
-// iPhone Control Center — pulls down from the top. Only REAL toggles (this is a
-// web app: no wifi/cellular/battery/brightness to fake). The tile grid is shared
-// with the desktop menu-bar popover (control-center-tiles). Open state is owned by
-// the mobile surface and read via the shell-UI context.
+// One quick-settings behavior model, shell-native presentation. iOS uses a glass
+// pull-down; Android uses a solid/tonal Material sheet. No fake Wi-Fi/cellular
+// controls — only real MSO toggles are shared between the two renderers.
export function ControlCenter() {
- const { controlCenterOpen: open, setControlCenterOpen: onOpenChange, openAppById } = useShellUI();
+ const { controlCenterOpen: open, setControlCenterOpen: onOpenChange } = useShellUI();
+ const design = useShellDesign();
+ const apple = design.family === "apple";
return (
<Sheet open={open} onOpenChange={onOpenChange}>
<SheetContent
+ data-slot="shell-control-center"
+ data-shell-id={design.id}
+ data-shell-family={design.family}
side="top"
- className="glass rounded-b-3xl border-border bg-[var(--glass-menu)] p-4 pt-9"
+ className={cn(
+ "border-border p-4 pt-[max(2.25rem,var(--sai-top,0px))]",
+ apple
+ ? "glass rounded-b-[28px] bg-[var(--glass-menu)]"
+ : "rounded-b-[28px] bg-card shadow-xl",
+ )}
>
<SheetTitle className="sr-only">Control Center</SheetTitle>
<SheetDescription className="sr-only">Quick system toggles</SheetDescription>
<div className="mx-auto w-full max-w-md">
- {/* No onAssistant override: the tile toggles Alfa IN CONTEXT (right dock
- on desktop, bottom sheet on mobile) rather than launching the app.
- Both show the same conversation now, and the full app is already one
- tap away in the dock — this tile is the only way to reach Alfa over
- whatever app you are currently in, which on a phone did not exist. */}
<ControlCenterTiles onClose={() => onOpenChange(false)} />
</div>
</SheetContent>
diff --git a/frontend/slices/appshell/features/desktop-icons/desktop-icons.tsx b/frontend/slices/appshell/features/desktop-icons/desktop-icons.tsx
index c540732f..53852fb7 100644
--- a/frontend/slices/appshell/features/desktop-icons/desktop-icons.tsx
+++ b/frontend/slices/appshell/features/desktop-icons/desktop-icons.tsx
@@ -5,7 +5,7 @@ import { ExternalLink, File as FileIcon, Globe, Trash2 } from "lucide-react";
import { cn } from "@/lib/utils";
import { Button } from "@/components/ui/button";
import { Input } from "@/components/ui/input";
-import { Dialog, DialogContent, DialogHeader, DialogTitle } from "@/components/ui/dialog";
+import { ResponsiveDialog } from "../../primitives/responsive-dialog";
import { openWindow } from "../../lib/store";
import { useApps } from "../../lib/registry";
import { AppIcon } from "../../components/app-icon";
@@ -155,11 +155,11 @@ function AddIconDialog() {
close();
};
return (
- <Dialog open={!!kind} onOpenChange={(o) => !o && close()}>
- <DialogContent className="max-w-sm">
- <DialogHeader>
- <DialogTitle>{kind === "link" ? "Add link" : "Add file"}</DialogTitle>
- </DialogHeader>
+ <ResponsiveDialog open={!!kind} onOpenChange={(o) => !o && close()} size="sm">
+ <ResponsiveDialog.Header>
+ <ResponsiveDialog.Title>{kind === "link" ? "Add link" : "Add file"}</ResponsiveDialog.Title>
+ </ResponsiveDialog.Header>
+ <ResponsiveDialog.Body className="space-y-3">
<Input
autoFocus
value={val}
@@ -173,12 +173,12 @@ function AddIconDialog() {
onKeyDown={(e) => e.key === "Enter" && submit()}
placeholder="Label (optional)"
/>
- <div className="flex justify-end gap-2">
- <Button type="button" variant="outline" onClick={close}>Cancel</Button>
- <Button type="button" onClick={submit} disabled={!val.trim()}>Add</Button>
- </div>
- </DialogContent>
- </Dialog>
+ </ResponsiveDialog.Body>
+ <ResponsiveDialog.Footer>
+ <Button type="button" variant="outline" onClick={close}>Cancel</Button>
+ <Button type="button" onClick={submit} disabled={!val.trim()}>Add</Button>
+ </ResponsiveDialog.Footer>
+ </ResponsiveDialog>
);
}
diff --git a/frontend/slices/appshell/features/inspector/components/alfa-sheet.tsx b/frontend/slices/appshell/features/inspector/components/alfa-sheet.tsx
index a4be6787..5fba8940 100644
--- a/frontend/slices/appshell/features/inspector/components/alfa-sheet.tsx
+++ b/frontend/slices/appshell/features/inspector/components/alfa-sheet.tsx
@@ -58,6 +58,27 @@ export function AlfaSheet() {
<X className="size-4" />
</Button>
</header>
+ {info?.actions?.length ? (
+ <div data-slot="mobile-ai-actions" className="shrink-0 border-b border-border bg-card px-3 py-2">
+ <p className="mb-1.5 text-[10px] font-medium uppercase tracking-wide text-muted-foreground">Quick actions</p>
+ <div className="flex gap-2 overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden">
+ {info.actions.map((action) => (
+ <Button
+ key={action.id}
+ type="button"
+ variant="secondary"
+ className="min-h-11 shrink-0 rounded-full px-4 text-sm"
+ onClick={() => {
+ setInspectorOpen(false);
+ void action.run();
+ }}
+ >
+ {action.label}
+ </Button>
+ ))}
+ </div>
+ </div>
+ ) : null}
<div className="min-h-0 flex-1">
<AlfaThread
ctx={{
diff --git a/frontend/slices/appshell/index.ts b/frontend/slices/appshell/index.ts
index 9f73c089..020272ae 100644
--- a/frontend/slices/appshell/index.ts
+++ b/frontend/slices/appshell/index.ts
@@ -146,6 +146,10 @@ export {
useActiveShell,
} from "./registry/shells";
export type { ShellId, ShellSurface, ShellDescriptor, ShellPrefs, ActiveShell } from "./registry/shells";
+export { SHELL_DESIGN_PROFILES, designProfileFor, useShellDesign } from "./design";
+export type { ShellDesignProfile, SettingsNavigationStyle, DialogPresentation, MobileNavigationStyle } from "./design";
+export { useMobileNavigationInfo, usePublishMobileNavigation, publishMobileNavigation, clearMobileNavigation } from "./lib/mobile-navigation";
+export type { MobileNavigationInfo } from "./lib/mobile-navigation";
// ── Responsive: the single source of truth (provider + hook + container) ─────
export { ResponsiveProvider } from "./responsive/responsive-provider";
diff --git a/frontend/slices/appshell/lib/mobile-navigation.ts b/frontend/slices/appshell/lib/mobile-navigation.ts
new file mode 100644
index 00000000..1a76abce
--- /dev/null
+++ b/frontend/slices/appshell/lib/mobile-navigation.ts
@@ -0,0 +1,62 @@
+"use client";
+
+import { useCallback, useEffect, useSyncExternalStore } from "react";
+
+/**
+ * Headless mobile navigation state published by a feature and rendered by the
+ * active mobile shell. This is deliberately ephemeral: no URL/API/persistence
+ * semantics live here. Root navigation needs no publish — the shell defaults to
+ * < Home | app title | AI. Drill-down publishes only the parent/title/back action.
+ */
+export type MobileNavigationInfo = {
+ title?: string;
+ backLabel?: string;
+ onBack?: () => void;
+};
+
+type Listener = () => void;
+const infos = new Map<string, MobileNavigationInfo>();
+const versions = new Map<string, number>();
+const listeners = new Set<Listener>();
+
+function bump(appId: string) {
+ versions.set(appId, (versions.get(appId) ?? 0) + 1);
+ listeners.forEach((listener) => listener());
+}
+
+export function publishMobileNavigation(appId: string, info: MobileNavigationInfo): void {
+ infos.set(appId, info);
+ bump(appId);
+}
+
+export function clearMobileNavigation(appId: string): void {
+ if (infos.delete(appId)) bump(appId);
+}
+
+const store = {
+ subscribe(listener: Listener) {
+ listeners.add(listener);
+ return () => listeners.delete(listener);
+ },
+ version(appId: string | null | undefined) {
+ return appId ? versions.get(appId) ?? 0 : 0;
+ },
+ get(appId: string | null | undefined) {
+ return appId ? infos.get(appId) : undefined;
+ },
+};
+
+export function useMobileNavigationInfo(appId: string | null | undefined): MobileNavigationInfo | undefined {
+ const getSnapshot = useCallback(() => store.version(appId), [appId]);
+ useSyncExternalStore(store.subscribe, getSnapshot, getSnapshot);
+ return store.get(appId);
+}
+
+export function usePublishMobileNavigation(appId: string, info: MobileNavigationInfo | null, deps: unknown[]): void {
+ useEffect(() => {
+ if (info) publishMobileNavigation(appId, info);
+ else clearMobileNavigation(appId);
+ return () => clearMobileNavigation(appId);
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ }, [appId, ...deps]);
+}
diff --git a/frontend/slices/appshell/lib/types.ts b/frontend/slices/appshell/lib/types.ts
index b5582432..fbc0d264 100644
--- a/frontend/slices/appshell/lib/types.ts
+++ b/frontend/slices/appshell/lib/types.ts
@@ -91,11 +91,6 @@ export type AppDescriptor = {
/** Pinned to the mobile dock / quick-shortcut set (consumer manifest decides
* — the generic shell never hardcodes project app ids). */
pinned?: boolean;
- /** Let the iOS fullscreen app own its navigation bar instead of receiving the
- * shell's generic app-icon/title/Done header. Used by apps whose native UI
- * already has a complete iOS navigation stack (System Settings). Android has
- * separate shell chrome and is intentionally unaffected. */
- ownsMobileNavigation?: boolean;
/** Allow several windows at once (e.g. Files); default = single instance. */
multi?: boolean;
diff --git a/frontend/slices/appshell/primitives/app-frame.tsx b/frontend/slices/appshell/primitives/app-frame.tsx
index 150c5120..88df72de 100644
--- a/frontend/slices/appshell/primitives/app-frame.tsx
+++ b/frontend/slices/appshell/primitives/app-frame.tsx
@@ -2,6 +2,7 @@
import type { ReactNode } from "react";
import { cn } from "@/lib/utils";
+import { useShellDesign } from "../design/use-shell-design";
// Standard app scaffold: optional header/toolbar row + a scrolling body that
// honours safe-area insets. The whole frame is a CSS `@container` so children
@@ -25,15 +26,17 @@ export function AppFrame({
/** Pad the body for notch/home-bar (mobile fullscreen). Default on. */
safeArea?: boolean;
}) {
+ const design = useShellDesign();
return (
- <div className={cn("@container flex h-full min-h-0 flex-col", className)}>
+ <div data-slot="app-frame" data-shell-family={design.family} data-shell-density={design.density} className={cn("@container flex h-full min-h-0 flex-col", className)}>
{header && (
- <div className="flex-none border-b border-border">{header}</div>
+ <div data-slot="app-frame-header" className="flex-none border-b border-border">{header}</div>
)}
{toolbar && (
- <div className="flex-none border-b border-border">{toolbar}</div>
+ <div data-slot="app-frame-toolbar" className="flex-none border-b border-border">{toolbar}</div>
)}
<div
+ data-slot="app-frame-body"
className={cn(
"min-h-0 flex-1 overflow-x-hidden overflow-y-auto",
safeArea && "[padding-bottom:var(--sai-bottom)]",
@@ -43,7 +46,7 @@ export function AppFrame({
{children}
</div>
{footer && (
- <div className="flex-none border-t border-border">{footer}</div>
+ <div data-slot="app-frame-footer" className="flex-none border-t border-border">{footer}</div>
)}
</div>
);
diff --git a/frontend/slices/appshell/primitives/responsive-dialog-parts.tsx b/frontend/slices/appshell/primitives/responsive-dialog-parts.tsx
index 2184d261..ef43ab2f 100644
--- a/frontend/slices/appshell/primitives/responsive-dialog-parts.tsx
+++ b/frontend/slices/appshell/primitives/responsive-dialog-parts.tsx
@@ -14,6 +14,7 @@ import {
import { DialogDescription, DialogTitle } from "@/components/ui/dialog";
import { useResponsiveDialogContext } from "./responsive-dialog-context";
import { cn } from "@/lib/utils";
+import { useShellDesign } from "../design/use-shell-design";
export interface ResponsiveDialogHeaderProps extends React.HTMLAttributes<HTMLDivElement> {
children: React.ReactNode;
@@ -21,11 +22,16 @@ export interface ResponsiveDialogHeaderProps extends React.HTMLAttributes<HTMLDi
export function ResponsiveDialogHeader({ className, children, ...props }: ResponsiveDialogHeaderProps) {
const { variant, isMobile } = useResponsiveDialogContext("Header");
+ const design = useShellDesign();
const baseClasses = "shrink-0 border-b text-left";
if (isMobile) {
return (
- <DrawerHeader className={cn(baseClasses, "gap-1.5 px-5 pb-3 pt-3 md:text-left", className)} {...props}>
+ <DrawerHeader data-shell-family={design.family} className={cn(
+ baseClasses,
+ design.family === "apple" ? "gap-1 px-5 pb-3 pt-4 md:text-left" : "gap-1.5 px-5 pb-3 pt-4 md:text-left",
+ className,
+ )} {...props}>
{children}
</DrawerHeader>
);
@@ -57,7 +63,8 @@ export interface ResponsiveDialogTitleProps extends React.HTMLAttributes<HTMLHea
export function ResponsiveDialogTitle({ className, children, ...props }: ResponsiveDialogTitleProps) {
const { variant, isMobile } = useResponsiveDialogContext("Title");
- if (isMobile) return <DrawerTitle className={className} {...props}>{children}</DrawerTitle>;
+ const design = useShellDesign();
+ if (isMobile) return <DrawerTitle className={cn(design.family === "apple" ? "text-[17px] font-semibold" : "text-[20px] font-medium", className)} {...props}>{children}</DrawerTitle>;
if (variant === "alert") return <AlertDialogTitle className={className} {...props}>{children}</AlertDialogTitle>;
if (variant === "panel") return <SheetTitle className={className} {...props}>{children}</SheetTitle>;
return <DialogTitle className={className} {...props}>{children}</DialogTitle>;
@@ -97,11 +104,16 @@ export interface ResponsiveDialogFooterProps extends React.HTMLAttributes<HTMLDi
export function ResponsiveDialogFooter({ className, children, ...props }: ResponsiveDialogFooterProps) {
const { variant, isMobile } = useResponsiveDialogContext("Footer");
+ const design = useShellDesign();
const baseClasses = "shrink-0 border-t";
if (isMobile) {
return (
- <DrawerFooter className={cn(baseClasses, "flex-col gap-2 px-5 pb-5 pt-3", className)} {...props}>
+ <DrawerFooter data-shell-family={design.family} className={cn(
+ baseClasses,
+ design.family === "apple" ? "flex-col gap-2 px-5 pb-[max(1.25rem,var(--sai-bottom,0px))] pt-3" : "flex-col gap-2 px-5 pb-[max(1rem,var(--sai-bottom,0px))] pt-3",
+ className,
+ )} {...props}>
{children}
</DrawerFooter>
);
diff --git a/frontend/slices/appshell/primitives/responsive-dialog-policy.test.ts b/frontend/slices/appshell/primitives/responsive-dialog-policy.test.ts
new file mode 100644
index 00000000..daf3252c
--- /dev/null
+++ b/frontend/slices/appshell/primitives/responsive-dialog-policy.test.ts
@@ -0,0 +1,27 @@
+import { readdirSync, readFileSync, statSync } from "node:fs";
+import { join, relative } from "node:path";
+import { describe, expect, it } from "vitest";
+
+function walk(dir: string): string[] {
+ return readdirSync(dir).flatMap((name) => {
+ const full = join(dir, name);
+ return statSync(full).isDirectory() ? walk(full) : [full];
+ });
+}
+
+describe("cross-shell modal policy", () => {
+ it("routes feature forms and confirms through ResponsiveDialog/FormDrawer", () => {
+ const root = join(process.cwd(), "frontend", "slices");
+ const allowed = new Set([
+ "appshell/features/force-quit/force-quit.tsx", // macOS-only native Force Quit window
+ "appshell/primitives/responsive-dialog-parts.tsx",
+ "appshell/primitives/responsive-dialog-shell.tsx",
+ ]);
+ const offenders = walk(root)
+ .filter((file) => file.endsWith(".tsx"))
+ .map((file) => [relative(root, file).replaceAll("\\", "/"), readFileSync(file, "utf8")] as const)
+ .filter(([rel, src]) => !allowed.has(rel) && /from ["']@\/components\/ui\/(dialog|alert-dialog)["']/.test(src))
+ .map(([rel]) => rel);
+ expect(offenders).toEqual([]);
+ });
+});
diff --git a/frontend/slices/appshell/primitives/responsive-dialog-shell.tsx b/frontend/slices/appshell/primitives/responsive-dialog-shell.tsx
index 68124cf6..c08abc7f 100644
--- a/frontend/slices/appshell/primitives/responsive-dialog-shell.tsx
+++ b/frontend/slices/appshell/primitives/responsive-dialog-shell.tsx
@@ -14,6 +14,7 @@ import {
type ResponsiveDialogSize,
} from "./responsive-dialog-context";
import type { ResponsiveDialogProps } from "./responsive-dialog";
+import { useShellDesign } from "../design/use-shell-design";
// The HEAVY chunk (radix Dialog/AlertDialog/Sheet + vaul Drawer). Loaded via
// next/dynamic from responsive-dialog.tsx only when a dialog first OPENS, so
@@ -48,7 +49,7 @@ export function ResponsiveDialogShell({
onOpenChange,
variant = "modal",
size = "md",
- mobileVariant = "drawer-bottom",
+ mobileVariant,
sheetSide = "right",
showCloseButton = true,
dismissible = true,
@@ -56,6 +57,7 @@ export function ResponsiveDialogShell({
children,
}: ResponsiveDialogProps) {
const isMobile = useIsMobile();
+ const design = useShellDesign();
const contextValue = React.useMemo<ResponsiveDialogContextValue>(
() => ({ variant, size, isMobile }),
@@ -63,16 +65,22 @@ export function ResponsiveDialogShell({
);
if (isMobile) {
- const direction: "bottom" | "right" = mobileVariant === "drawer-right" ? "right" : "bottom";
- const mobileHeight = direction === "bottom" ? "h-[90dvh] max-h-[90dvh]" : "h-full";
+ const nativeVariant = design.dialog.mobile === "drawer-right" ? "drawer-right" : "drawer-bottom";
+ const resolvedMobileVariant = mobileVariant ?? nativeVariant;
+ const direction: "bottom" | "right" = resolvedMobileVariant === "drawer-right" ? "right" : "bottom";
+ const mobileHeight = direction === "bottom" ? design.dialog.drawerHeightClass : "h-full";
return (
<ResponsiveDialogContext.Provider value={contextValue}>
<Drawer open={open} onOpenChange={onOpenChange} direction={direction} dismissible={dismissible}>
<DrawerContent
+ data-slot="shell-dialog-surface"
+ data-shell-id={design.id}
+ data-shell-family={design.family}
+ data-shell-mobile="true"
className={cn(
"flex flex-col gap-0 p-0",
direction === "bottom"
- ? "rounded-t-[1.25rem] border-x-0 border-b-0"
+ ? cn(design.dialog.drawerRadiusClass, "border-x-0 border-b-0")
: "w-full max-w-[95vw] sm:max-w-md",
mobileHeight,
contentClassName,
@@ -90,6 +98,10 @@ export function ResponsiveDialogShell({
<ResponsiveDialogContext.Provider value={contextValue}>
<AlertDialog open={open} onOpenChange={onOpenChange}>
<AlertDialogContent
+ data-slot="shell-dialog-surface"
+ data-shell-id={design.id}
+ data-shell-family={design.family}
+ data-shell-mobile="false"
className={cn("flex flex-col gap-0 overflow-hidden p-0", SIZE_DESKTOP_WIDTH[size], contentClassName)}
>
{children}
@@ -104,6 +116,10 @@ export function ResponsiveDialogShell({
<ResponsiveDialogContext.Provider value={contextValue}>
<Sheet open={open} onOpenChange={onOpenChange}>
<SheetContent
+ data-slot="shell-dialog-surface"
+ data-shell-id={design.id}
+ data-shell-family={design.family}
+ data-shell-mobile="false"
side={sheetSide}
className={cn(
"flex h-full w-full max-w-full flex-col gap-0 overflow-hidden p-0 sm:max-w-lg",
@@ -121,6 +137,10 @@ export function ResponsiveDialogShell({
<ResponsiveDialogContext.Provider value={contextValue}>
<Dialog open={open} onOpenChange={onOpenChange}>
<DialogContent
+ data-slot="shell-dialog-surface"
+ data-shell-id={design.id}
+ data-shell-family={design.family}
+ data-shell-mobile="false"
showCloseButton={showCloseButton}
className={cn(
"flex flex-col gap-0 overflow-hidden p-0",
diff --git a/frontend/slices/assistant/components/thread-list.tsx b/frontend/slices/assistant/components/thread-list.tsx
index d75658d0..9d29de6d 100644
--- a/frontend/slices/assistant/components/thread-list.tsx
+++ b/frontend/slices/assistant/components/thread-list.tsx
@@ -2,6 +2,8 @@
import { useCallback, useEffect, useState } from "react";
import { Sheet, SheetContent, SheetHeader, SheetTitle } from "@/components/ui/sheet";
+import { useShellDesign } from "@/features/os-shell";
+import { cn } from "@/lib/utils";
import { Button } from "@/components/ui/button";
import { Trash2, Plus } from "lucide-react";
@@ -22,6 +24,7 @@ export function ThreadList({
onNew: () => void;
}) {
const [threads, setThreads] = useState<Summary[]>([]);
+ const design = useShellDesign();
const load = useCallback(() => {
fetch("/api/threads", { cache: "no-store" })
@@ -46,7 +49,17 @@ export function ThreadList({
return (
<Sheet open={open} onOpenChange={onOpenChange}>
- <SheetContent side="left" className="w-80 gap-0 p-0">
+ <SheetContent
+ data-slot="shell-thread-list"
+ data-shell-id={design.id}
+ data-shell-family={design.family}
+ side="left"
+ className={cn(
+ "w-80 gap-0 p-0",
+ design.family === "apple" && "rounded-r-[22px]",
+ design.family === "material" && "rounded-r-[28px]",
+ )}
+ >
<SheetHeader className="flex-row items-center justify-between space-y-0 border-b border-border p-3">
<SheetTitle>Chats</SheetTitle>
<Button
diff --git a/frontend/slices/code-editor/components/close-guard-dialog.tsx b/frontend/slices/code-editor/components/close-guard-dialog.tsx
index 56a7e6c1..ce52abf1 100644
--- a/frontend/slices/code-editor/components/close-guard-dialog.tsx
+++ b/frontend/slices/code-editor/components/close-guard-dialog.tsx
@@ -1,19 +1,12 @@
"use client";
import { Button } from "@/components/ui/button";
-import {
- AlertDialog,
- AlertDialogAction,
- AlertDialogCancel,
- AlertDialogContent,
- AlertDialogDescription,
- AlertDialogFooter,
- AlertDialogHeader,
- AlertDialogTitle,
-} from "@/components/ui/alert-dialog";
+import { FormDrawer } from "@/features/os-shell";
// Unsaved-changes prompt shown when a dirty window is closed: Save (writes then
// closes) / Don't Save (discards + closes) / Cancel (keeps the window open).
+// FormDrawer keeps the behavior shared while the active shell chooses the native
+// presentation: content dialog on desktop, Apple/Material drawer on mobile.
export function CloseGuardDialog({
open,
onOpenChange,
@@ -30,27 +23,18 @@ export function CloseGuardDialog({
onCancel: () => void;
}) {
return (
- <AlertDialog open={open} onOpenChange={onOpenChange}>
- <AlertDialogContent>
- <AlertDialogHeader>
- <AlertDialogTitle>Save changes before closing?</AlertDialogTitle>
- <AlertDialogDescription>
- {fileLabel} has unsaved edits. They&apos;ll be lost if you
- don&apos;t save.
- </AlertDialogDescription>
- </AlertDialogHeader>
- <AlertDialogFooter className="gap-2">
- <AlertDialogCancel onClick={onCancel} className="[@media(pointer:coarse)]:min-h-[44px]">Cancel</AlertDialogCancel>
- <Button
- variant="ghost"
- className="text-destructive [@media(pointer:coarse)]:min-h-[44px]"
- onClick={onDiscard}
- >
- Don&apos;t Save
- </Button>
- <AlertDialogAction onClick={onSave} className="[@media(pointer:coarse)]:min-h-[44px]">Save</AlertDialogAction>
- </AlertDialogFooter>
- </AlertDialogContent>
- </AlertDialog>
+ <FormDrawer open={open} onOpenChange={onOpenChange} variant="alert" size="sm">
+ <FormDrawer.Header>
+ <FormDrawer.Title>Save changes before closing?</FormDrawer.Title>
+ <FormDrawer.Description>
+ {fileLabel} has unsaved edits. They&apos;ll be lost if you don&apos;t save.
+ </FormDrawer.Description>
+ </FormDrawer.Header>
+ <FormDrawer.Footer>
+ <Button variant="ghost" onClick={onCancel}>Cancel</Button>
+ <Button variant="ghost" className="text-destructive" onClick={onDiscard}>Don&apos;t Save</Button>
+ <Button onClick={onSave}>Save</Button>
+ </FormDrawer.Footer>
+ </FormDrawer>
);
}
diff --git a/frontend/slices/media-studio/app.tsx b/frontend/slices/media-studio/app.tsx
index feee2c28..f6ee84e1 100644
--- a/frontend/slices/media-studio/app.tsx
+++ b/frontend/slices/media-studio/app.tsx
@@ -3,18 +3,8 @@
import { useEffect, useRef, useState } from "react";
import { ImageEditor, type EditorApi } from "@/features/image-editor";
import { rawUrl } from "./lib/host";
-import { closeWindow, setCloseGuard, toast, useContainer, useIsMobile } from "@/features/os-shell";
+import { closeWindow, setCloseGuard, toast, useContainer, useIsMobile, FormDrawer } from "@/features/os-shell";
import type { AppProps } from "@/features/os-shell";
-import {
- AlertDialog,
- AlertDialogAction,
- AlertDialogCancel,
- AlertDialogContent,
- AlertDialogDescription,
- AlertDialogFooter,
- AlertDialogHeader,
- AlertDialogTitle,
-} from "@/components/ui/alert-dialog";
import { Button } from "@/components/ui/button";
import { SaveImageDialog } from "./components/save-image-dialog";
import { autoName, loadSavePrefs, saveImageToHost } from "./lib/save-image";
@@ -112,19 +102,17 @@ export default function MediaStudio({ payload, winId }: AppProps) {
onSaved={onDialogSaved}
/>
- <AlertDialog open={confirmClose} onOpenChange={(o) => !o && setConfirmClose(false)}>
- <AlertDialogContent>
- <AlertDialogHeader>
- <AlertDialogTitle>Save changes before closing?</AlertDialogTitle>
- <AlertDialogDescription>Your image has unsaved edits. They’ll be lost if you don’t save.</AlertDialogDescription>
- </AlertDialogHeader>
- <AlertDialogFooter className="gap-2">
- <AlertDialogCancel onClick={() => setConfirmClose(false)}>Cancel</AlertDialogCancel>
- <Button variant="ghost" className="text-destructive" onClick={() => { setConfirmClose(false); forceClose(); }}>Don’t Save</Button>
- <AlertDialogAction onClick={saveThenClose}>Save</AlertDialogAction>
- </AlertDialogFooter>
- </AlertDialogContent>
- </AlertDialog>
+ <FormDrawer open={confirmClose} onOpenChange={(o) => !o && setConfirmClose(false)} variant="alert" size="sm">
+ <FormDrawer.Header>
+ <FormDrawer.Title>Save changes before closing?</FormDrawer.Title>
+ <FormDrawer.Description>Your image has unsaved edits. They’ll be lost if you don’t save.</FormDrawer.Description>
+ </FormDrawer.Header>
+ <FormDrawer.Footer>
+ <Button variant="ghost" onClick={() => setConfirmClose(false)}>Cancel</Button>
+ <Button variant="ghost" className="text-destructive" onClick={() => { setConfirmClose(false); forceClose(); }}>Don’t Save</Button>
+ <Button onClick={saveThenClose}>Save</Button>
+ </FormDrawer.Footer>
+ </FormDrawer>
</>
);
}
diff --git a/frontend/slices/os-settings/app.tsx b/frontend/slices/os-settings/app.tsx
index d9038ce3..7b98e406 100644
--- a/frontend/slices/os-settings/app.tsx
+++ b/frontend/slices/os-settings/app.tsx
@@ -4,22 +4,19 @@ import { useEffect, useState } from "react";
import { useAppearance, effectiveServerTarget } from "@/lib/appearance";
import { IS_DEMO } from "@/lib/demo";
import {
- AppFrame,
- MasterDetail,
useActiveShell,
usePublishInspector,
toast,
} from "@/features/os-shell";
-import { SettingsTabs, SettingsSidebar, type SectionId } from "./components/nav";
-import { SectionDetail, SectionList } from "./components/sections";
-import { IosSettings } from "./components/ios-settings";
+import type { SectionId } from "./lib/sections";
+import { SettingsShell } from "./components/settings-shell";
// Default export so os-shell can lazy-load it as a window app.
export default function OsSettings() {
const { tweaks } = useAppearance();
- // The active shell drives per-shell Settings layout (same sections, different
- // navigation chrome) — the per-shell feature-config seam.
- const { id: shellId, surface } = useActiveShell();
+ // Shared Settings state stays here; SettingsShell selects the presentation profile.
+ // No shell-specific layout/config lives in this headless app controller.
+ const { surface } = useActiveShell();
const [model, setModel] = useState("default");
// On mobile we start on the section list (no selection drilled in); desktop
// always shows a selected pane. `null` = list view, an id = detail view.
@@ -62,68 +59,5 @@ export default function OsSettings() {
[tweaks.theme, tweaks.preset, tweaks.device, tweaks.fontScale, tweaks.wallpaper, tweaks.wallpaperImage, tweaks.server.mode, serverTarget?.label, model],
);
- // Per-shell layout — SAME sections + section bodies, only the navigation chrome
- // differs: iOS/Android push a nav-stack, macOS shows a colored sidebar, Windows
- // a top tab strip. This IS the per-shell feature-config pattern (one component,
- // useActiveShell() picks the config).
- const layout: "stack" | "sidebar" | "tabs" =
- surface === "mobile" ? "stack" : shellId === "macos" ? "sidebar" : "tabs";
-
- // iOS Settings owns its full native navigation stack: the generic iOS app
- // header is disabled by the app descriptor, so the root can use Apple's
- // large-title/search hierarchy and detail pages can own the Settings back row.
- if (surface === "mobile" && shellId === "ios") {
- return (
- <AppFrame safeArea={false} bodyClassName="overflow-hidden">
- <IosSettings active={active} onSelect={setActive} onBack={() => setActive(null)} />
- </AppFrame>
- );
- }
-
- // Android keeps the shared MasterDetail drill-down and Android shell chrome.
- if (layout === "stack") {
- return (
- <AppFrame>
- <MasterDetail
- master={<SectionList active={active} onSelect={setActive} />}
- detail={active ? <SectionDetail id={active} /> : null}
- hasSelection={active !== null}
- onBack={() => setActive(null)}
- backLabel="Settings"
- masterClassName="w-full"
- />
- </AppFrame>
- );
- }
-
- const desktopActive: SectionId = active ?? "appearance";
-
- // macOS: System Settings sidebar + detail (colored category tiles at left).
- if (layout === "sidebar") {
- return (
- <AppFrame>
- <div className="flex h-full min-h-0">
- <aside className="w-56 shrink-0 border-r border-border bg-sidebar/40">
- <SettingsSidebar active={desktopActive} onSelect={setActive} />
- </aside>
- <div className="min-w-0 flex-1">
- <SectionDetail id={desktopActive} />
- </div>
- </div>
- </AppFrame>
- );
- }
-
- // Windows / Dashboard: top tab strip — every section visible at a glance.
- return (
- <AppFrame
- toolbar={
- <div className="bg-sidebar/40">
- <SettingsTabs active={desktopActive} onSelect={setActive} />
- </div>
- }
- >
- <SectionDetail id={desktopActive} />
- </AppFrame>
- );
+ return <SettingsShell active={active} onSelect={setActive} />;
}
diff --git a/frontend/slices/os-settings/components/android-settings.tsx b/frontend/slices/os-settings/components/android-settings.tsx
new file mode 100644
index 00000000..f7e5bce4
--- /dev/null
+++ b/frontend/slices/os-settings/components/android-settings.tsx
@@ -0,0 +1,64 @@
+"use client";
+
+import { useMemo, useState } from "react";
+import { ChevronRight, Search } from "lucide-react";
+import { cn } from "@/lib/utils";
+import { filterSettingsSections, groupSettingsSections, type SectionId } from "../lib/sections";
+
+export function AndroidSettingsIndex({ onSelect }: { onSelect: (id: SectionId) => void }) {
+ const [query, setQuery] = useState("");
+ const filtered = useMemo(() => filterSettingsSections(query), [query]);
+ const groups = useMemo(() => groupSettingsSections(filtered), [filtered]);
+
+ return (
+ <div data-slot="android-settings-root" className="h-full overflow-y-auto bg-background [scrollbar-width:none] [&::-webkit-scrollbar]:hidden">
+ <div className="mx-auto w-full max-w-2xl space-y-5 px-4 pb-[calc(var(--sai-bottom,0px)+1rem)] pt-4">
+ <label className="flex min-h-14 items-center gap-3 rounded-full bg-secondary px-5 text-muted-foreground shadow-sm">
+ <Search className="size-5 shrink-0" aria-hidden />
+ <span className="sr-only">Search settings</span>
+ <input
+ type="search"
+ value={query}
+ onChange={(event) => setQuery(event.target.value)}
+ placeholder="Search settings"
+ autoComplete="off"
+ className="min-w-0 flex-1 border-0 bg-transparent p-0 !text-[16px] text-foreground outline-none placeholder:text-muted-foreground focus-visible:outline-none"
+ />
+ </label>
+
+ <nav aria-label="Settings sections" className="space-y-4">
+ {groups.map((group) => (
+ <div key={group[0]?.group} data-slot="settings-material-group" className="overflow-hidden rounded-[24px] bg-card shadow-sm">
+ {group.map((section) => {
+ const Icon = section.icon;
+ return (
+ <button
+ key={section.id}
+ type="button"
+ data-slot="settings-material-row"
+ onClick={() => onSelect(section.id)}
+ className={cn(
+ "relative flex min-h-14 w-full items-center gap-4 px-4 py-2 text-left transition-colors active:bg-secondary",
+ "after:absolute after:bottom-0 after:left-[68px] after:right-4 after:h-px after:bg-border last:after:hidden",
+ )}
+ >
+ <span className="grid size-9 shrink-0 place-items-center rounded-full text-white shadow-sm" style={{ background: section.color }}>
+ <Icon className="size-5" aria-hidden />
+ </span>
+ <span className="min-w-0 flex-1">
+ <span className="block truncate text-[16px] font-medium text-foreground">{section.label}</span>
+ <span className="mt-0.5 block truncate text-[12px] text-muted-foreground">{section.blurb}</span>
+ </span>
+ <ChevronRight className="size-5 shrink-0 text-muted-foreground" aria-hidden />
+ </button>
+ );
+ })}
+ </div>
+ ))}
+ </nav>
+
+ {filtered.length === 0 ? <p className="py-12 text-center text-sm text-muted-foreground">No settings found.</p> : null}
+ </div>
+ </div>
+ );
+}
diff --git a/frontend/slices/os-settings/components/ios-settings.tsx b/frontend/slices/os-settings/components/ios-settings.tsx
index 26b065f7..1aabfe40 100644
--- a/frontend/slices/os-settings/components/ios-settings.tsx
+++ b/frontend/slices/os-settings/components/ios-settings.tsx
@@ -1,26 +1,23 @@
"use client";
import { useMemo, useState } from "react";
-import { ChevronLeft, ChevronRight, Search } from "lucide-react";
-import { Button } from "@/components/ui/button";
+import { ChevronRight, Search } from "lucide-react";
import { cn } from "@/lib/utils";
-import { SECTIONS, type SectionId } from "./nav";
+import { filterSettingsSections, groupSettingsSections, settingsSection, type SectionId } from "../lib/sections";
import { SettingsSectionBody } from "./sections";
-// iOS System Settings owns its navigation chrome instead of inheriting the
-// generic fullscreen-app header. This keeps the hierarchy native: large title +
-// Search at the root, then a blue "Settings" back affordance on detail pages.
+// iOS System Settings owns only its CONTENT renderer. The mobile shell owns the
+// single navigation bar: < Home | Settings | AI at root, then the published
+// parent/detail state on drill-down. This file supplies Search + grouped content.
export function IosSettings({
active,
onSelect,
- onBack,
}: {
active: SectionId | null;
onSelect: (id: SectionId) => void;
- onBack: () => void;
}) {
return active ? (
- <IosSettingsDetail id={active} onBack={onBack} />
+ <IosSettingsDetail id={active} />
) : (
<IosSettingsIndex onSelect={onSelect} />
);
@@ -28,25 +25,13 @@ export function IosSettings({
function IosSettingsIndex({ onSelect }: { onSelect: (id: SectionId) => void }) {
const [query, setQuery] = useState("");
- const filtered = useMemo(() => {
- const q = query.trim().toLowerCase();
- return q
- ? SECTIONS.filter((s) => `${s.label} ${s.blurb}`.toLowerCase().includes(q))
- : SECTIONS;
- }, [query]);
- const groups = filtered.reduce<(typeof SECTIONS)[number][][]>((acc, section) => {
- const last = acc[acc.length - 1];
- if (last && last[0]?.group === section.group) last.push(section);
- else acc.push([section]);
- return acc;
- }, []);
+ const filtered = useMemo(() => filterSettingsSections(query), [query]);
+ const groups = useMemo(() => groupSettingsSections(filtered), [filtered]);
return (
<div data-slot="ios-settings-root" className="h-full overflow-y-auto bg-[var(--grouped)] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden">
- <div className="mx-auto w-full max-w-2xl px-4 pb-[calc(var(--sai-bottom,0px)+1.5rem)] pt-[calc(var(--sai-top,0px)+2.5rem)]">
- <h1 className="px-0.5 text-[34px] font-bold leading-[1.05] tracking-[-0.025em] text-foreground">Settings</h1>
-
- <label className="mt-5 flex h-[38px] items-center gap-2 rounded-[11px] bg-[var(--fill)] px-3 text-muted-foreground">
+ <div className="mx-auto w-full max-w-2xl px-4 pb-[calc(var(--sai-bottom,0px)+1.5rem)] pt-6">
+ <label className="flex h-[38px] items-center gap-2 rounded-[11px] bg-[var(--fill)] px-3 text-muted-foreground">
<Search className="size-[19px] shrink-0" aria-hidden />
<span className="sr-only">Search settings</span>
<input
@@ -99,50 +84,26 @@ function IosSettingsIndex({ onSelect }: { onSelect: (id: SectionId) => void }) {
);
}
-function IosSettingsDetail({ id, onBack }: { id: SectionId; onBack: () => void }) {
- const meta = SECTIONS.find((s) => s.id === id)!;
- // Appearance/Theme already begin with strong visual controls, matching Apple's
- // Display & Brightness pattern. The other categories use the General/Wi‑Fi
- // style identity card before their grouped controls.
- const showHero = id !== "appearance" && id !== "theme";
+function IosSettingsDetail({ id }: { id: SectionId }) {
+ const meta = settingsSection(id);
+ // Appearance/Theme are control-first. About already has the Manef Shell OS
+ // identity block, so a second category hero would duplicate its header.
+ const showHero = id !== "appearance" && id !== "theme" && id !== "about";
const Icon = meta.icon;
return (
- <div data-slot="ios-settings-detail" className="flex h-full min-h-0 flex-col bg-[var(--grouped)]">
- <header className="shrink-0 bg-[var(--grouped)] pt-[var(--sai-top,0px)]">
- <div className="flex h-[48px] min-w-0 items-center px-1.5">
- <Button
- type="button"
- variant="ghost"
- onClick={onBack}
- className="h-[44px] shrink-0 gap-0 px-1 text-[17px] font-normal text-info hover:bg-transparent hover:text-info"
- >
- <ChevronLeft className="size-[25px]" aria-hidden />
- Settings
- </Button>
- {!showHero && (
- <h1 className="ml-2 min-w-0 truncate text-[17px] font-semibold tracking-[-0.01em] text-foreground">{meta.label}</h1>
- )}
- </div>
- </header>
-
- <div className="min-h-0 flex-1 overflow-y-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden">
- <div className="mx-auto w-full max-w-2xl space-y-6 px-4 pb-[calc(var(--sai-bottom,0px)+1.5rem)] pt-4">
- {showHero && (
- <section data-slot="ios-settings-hero" className="rounded-[18px] bg-card px-5 py-6 text-center">
- <span
- className="mx-auto grid size-[64px] place-items-center rounded-[16px] shadow-[0_2px_5px_rgba(0,0,0,0.22)]"
- style={{ background: meta.color }}
- >
- <Icon className="size-9 text-white" aria-hidden />
- </span>
- <h1 className="mt-3 text-[24px] font-bold leading-tight tracking-[-0.02em] text-foreground">{meta.label}</h1>
- <p className="mx-auto mt-2 max-w-[32rem] text-[16px] leading-[1.35] text-foreground/90">{meta.blurb}</p>
- </section>
- )}
-
- <SettingsSectionBody id={id} />
- </div>
+ <div data-slot="ios-settings-detail" className="h-full overflow-y-auto bg-[var(--grouped)] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden">
+ <div className="mx-auto w-full max-w-2xl space-y-6 px-4 pb-[calc(var(--sai-bottom,0px)+1.5rem)] pt-4">
+ {showHero && (
+ <section data-slot="ios-settings-hero" className="rounded-[18px] bg-card px-5 py-6 text-center">
+ <span className="mx-auto grid size-[64px] place-items-center rounded-[16px] shadow-[0_2px_5px_rgba(0,0,0,0.22)]" style={{ background: meta.color }}>
+ <Icon className="size-9 text-white" aria-hidden />
+ </span>
+ <h1 className="mt-3 text-[24px] font-bold leading-tight tracking-[-0.02em] text-foreground">{meta.label}</h1>
+ <p className="mx-auto mt-2 max-w-[32rem] text-[16px] leading-[1.35] text-foreground/90">{meta.blurb}</p>
+ </section>
+ )}
+ <SettingsSectionBody id={id} />
</div>
</div>
);
diff --git a/frontend/slices/os-settings/components/live-wallpaper-rows.tsx b/frontend/slices/os-settings/components/live-wallpaper-rows.tsx
index 1a54b75c..e4d2a7dd 100644
--- a/frontend/slices/os-settings/components/live-wallpaper-rows.tsx
+++ b/frontend/slices/os-settings/components/live-wallpaper-rows.tsx
@@ -7,13 +7,12 @@
"Receives clicks" makes the empty desktop click-through so the wallpaper
works as an interactive site; windows/dock/menus stay on top and clickable. */
import { useState } from "react";
-import { Sparkles } from "lucide-react";
import { Button } from "@/components/ui/button";
import { Switch } from "@/components/ui/switch";
import { Textarea } from "@/components/ui/textarea";
import { cn } from "@/lib/utils";
import { LIVE_WALLPAPER_HTML_MAX, useAppearance, type LiveWallpaper } from "@/lib/appearance";
-import { useWallpapers } from "@/features/os-shell";
+import { FormDrawer, useWallpapers } from "@/features/os-shell";
import { SettingsRow as Row } from "@/features/shell-settings";
function Chip({ active, label, onClick }: { active: boolean; label: string; onClick: () => void }) {
@@ -56,39 +55,41 @@ export function LiveWallpaperRows() {
</div>
</Row>
- {(editing || lw?.kind === "html") && (
- <div className="rounded-lg bg-muted/40 p-3">
- <p className="mb-2 flex items-center gap-1.5 text-[11px] text-muted-foreground">
- <Sparkles className="size-3.5" />
- Paste a full HTML page (scripts allowed). It runs in a sandboxed frame: no cookies, no OS access.
- </p>
+ <FormDrawer open={editing} onOpenChange={setEditing} size="lg">
+ <FormDrawer.Header>
+ <FormDrawer.Title>Custom HTML wallpaper</FormDrawer.Title>
+ <FormDrawer.Description>
+ Paste a full HTML page. Scripts run in a sandboxed frame with no cookies or OS access.
+ </FormDrawer.Description>
+ </FormDrawer.Header>
+ <FormDrawer.Body className="space-y-2">
<Textarea
value={draft}
onChange={(e) => setDraft(e.target.value)}
spellCheck={false}
placeholder={"<!doctype html>\n<style>body{margin:0;background:#0b0e1a}</style>\n<canvas id=c></canvas>\n<script>…</script>"}
- className="h-32 font-mono text-xs"
+ className="min-h-52 font-mono text-xs"
/>
- <div className="mt-2 flex items-center gap-2">
- <Button
- type="button"
- size="sm"
- disabled={!draft.trim() || tooBig}
- onClick={() => set({ kind: "html", html: draft, interactive: lw?.interactive ?? true })}
- >
- Apply
- </Button>
- {lw?.kind === "html" && (
- <Button type="button" size="sm" variant="ghost" onClick={() => { set(null); setEditing(false); }}>
- Remove
- </Button>
- )}
- <span className={cn("ml-auto text-[10px]", tooBig ? "text-destructive" : "text-muted-foreground")}>
- {Math.ceil(draft.length / 1024)} / {LIVE_WALLPAPER_HTML_MAX / 1024} KB
- </span>
+ <div className={cn("text-right text-[11px]", tooBig ? "text-destructive" : "text-muted-foreground")}>
+ {Math.ceil(draft.length / 1024)} / {LIVE_WALLPAPER_HTML_MAX / 1024} KB
</div>
- </div>
- )}
+ </FormDrawer.Body>
+ <FormDrawer.Footer>
+ {lw?.kind === "html" && (
+ <Button type="button" variant="ghost" className="text-destructive" onClick={() => { set(null); setEditing(false); }}>
+ Remove
+ </Button>
+ )}
+ <Button type="button" variant="ghost" onClick={() => setEditing(false)}>Cancel</Button>
+ <Button
+ type="button"
+ disabled={!draft.trim() || tooBig}
+ onClick={() => { set({ kind: "html", html: draft, interactive: lw?.interactive ?? true }); setEditing(false); }}
+ >
+ Apply
+ </Button>
+ </FormDrawer.Footer>
+ </FormDrawer>
{lw && (
<Row label="Wallpaper receives clicks">
diff --git a/frontend/slices/os-settings/components/nav.tsx b/frontend/slices/os-settings/components/nav.tsx
index 062cbf2f..31ca82b0 100644
--- a/frontend/slices/os-settings/components/nav.tsx
+++ b/frontend/slices/os-settings/components/nav.tsx
@@ -1,84 +1,18 @@
"use client";
-import type { ComponentType } from "react";
-import {
- DatabaseBackup,
- Info,
- Link2,
- Paintbrush,
- Palette,
- Plug,
- Server,
- ShieldCheck,
- Sparkles,
- Trash2,
-} from "lucide-react";
import { cn } from "@/lib/utils";
+import { SECTIONS, type SectionId } from "../lib/sections";
-export type SectionId =
- | "appearance" | "theme" | "ai" | "quicklinks" | "mcp" | "devices" | "server" | "cleanup" | "backup" | "about";
+export type { SectionId } from "../lib/sections";
-// Semantic buckets for the iOS grouped index (mobile). Reorder-safe: the mobile
-// cards derive from this field, not an index slice, so adding/reordering a
-// section can't silently re-bucket it.
-export type SettingsGroup = "personalization" | "services" | "system";
-
-// Per-category tile colors — fixed like macOS System Settings' category glyphs
-// (Bluetooth stays blue in dark mode); intentionally NOT theme tokens, mirroring
-// the raw-value precedent in AppDescriptor.gradient.
-export const SECTIONS: ReadonlyArray<{
- id: SectionId;
- label: string;
- blurb: string;
- icon: ComponentType<{ className?: string }>;
- color: string;
- group: SettingsGroup;
-}> = [
- { id: "appearance", label: "Appearance", blurb: "Style, accent, wallpaper, device", icon: Palette, color: "#0a84ff", group: "personalization" },
- { id: "theme", label: "Theme", blurb: "Mode, presets, font, contrast", icon: Paintbrush, color: "#ff375f", group: "personalization" },
- { id: "ai", label: "AI", blurb: "Model and API key", icon: Sparkles, color: "#bf5af2", group: "services" },
- { id: "quicklinks", label: "Quicklink", blurb: "Website shortcuts with favicons", icon: Link2, color: "#5e5ce6", group: "services" },
- { id: "mcp", label: "MCP", blurb: "Control this VPS from ChatGPT", icon: Plug, color: "#00c7be", group: "services" },
- { id: "devices", label: "Devices", blurb: "Approved browsers and sessions", icon: ShieldCheck, color: "#30d158", group: "system" },
- { id: "server", label: "Server", blurb: "Mock or live host data", icon: Server, color: "#ff9f0a", group: "system" },
- { id: "cleanup", label: "Cleanup", blurb: "Free disk space safely", icon: Trash2, color: "#64d2ff", group: "system" },
- // Sits immediately before About because About owns "Reset MSO", the one
- // button that destroys exactly what Backup exists to save — a user reaching
- // for the reset should have passed the backup row on the way there.
- { id: "backup", label: "Backup", blurb: "Export or restore browser data", icon: DatabaseBackup, color: "#a2845e", group: "system" },
- { id: "about", label: "About", blurb: "System info and reset", icon: Info, color: "#8e8e93", group: "system" },
-];
-
-// System Settings top tab strip: every section visible at a glance, scrolls
-// horizontally when the window is too narrow to fit all tabs. Active tab fills
-// with the accent; icons tint from the theme so presets restyle them too.
-export function SettingsTabs({
- active,
- onSelect,
-}: {
- active: SectionId;
- onSelect: (id: SectionId) => void;
-}) {
+export function SettingsTabs({ active, onSelect }: { active: SectionId; onSelect: (id: SectionId) => void }) {
return (
- <nav
- role="tablist"
- aria-label="Settings"
- className="flex gap-1 overflow-x-auto p-2 [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden"
- >
- {SECTIONS.map(({ id, label, icon: Icon }) => {
+ <nav role="tablist" aria-label="Settings" data-slot="settings-desktop-tabs" className="flex gap-1 overflow-x-auto p-2 [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden">
+ {SECTIONS.map(({ id, label, icon: Icon, blurb }) => {
const on = id === active;
return (
- <button
- key={id}
- type="button"
- role="tab"
- aria-selected={on}
- title={SECTIONS.find((s) => s.id === id)?.blurb}
- onClick={() => onSelect(id)}
- className={cn(
- "flex shrink-0 items-center gap-1.5 rounded-lg px-3 py-1.5 text-[13px] font-medium leading-none transition-colors min-h-9",
- on ? "bg-primary text-primary-foreground shadow-sm" : "text-muted-foreground hover:bg-accent hover:text-foreground",
- )}
+ <button key={id} type="button" role="tab" aria-selected={on} title={blurb} onClick={() => onSelect(id)}
+ className={cn("flex min-h-9 shrink-0 items-center gap-1.5 rounded-lg px-3 py-1.5 text-[13px] font-medium leading-none transition-colors", on ? "bg-primary text-primary-foreground shadow-sm" : "text-muted-foreground hover:bg-accent hover:text-foreground")}
>
<Icon className="size-4 shrink-0" />
<span>{label}</span>
@@ -89,37 +23,16 @@ export function SettingsTabs({
);
}
-// macOS System Settings sidebar: a vertical category list with fixed colored
-// glyph tiles (Apple's category convention). Same SECTIONS, same onSelect — only
-// the presentation differs from the Windows tab strip. Active row fills accent.
-export function SettingsSidebar({
- active,
- onSelect,
-}: {
- active: SectionId;
- onSelect: (id: SectionId) => void;
-}) {
+export function SettingsSidebar({ active, onSelect }: { active: SectionId; onSelect: (id: SectionId) => void }) {
return (
- <nav role="tablist" aria-label="Settings sections" className="flex h-full flex-col gap-0.5 overflow-y-auto p-2">
- {SECTIONS.map(({ id, label, icon: Icon, color }) => {
+ <nav role="tablist" aria-label="Settings sections" data-slot="settings-macos-sidebar" className="flex h-full flex-col gap-0.5 overflow-y-auto p-2">
+ {SECTIONS.map(({ id, label, icon: Icon, color, blurb }) => {
const on = id === active;
return (
- <button
- key={id}
- type="button"
- role="tab"
- aria-selected={on}
- title={SECTIONS.find((s) => s.id === id)?.blurb}
- onClick={() => onSelect(id)}
- className={cn(
- "flex min-h-9 items-center gap-2.5 rounded-lg px-2 py-1.5 text-left text-[13px] font-medium leading-tight transition-colors",
- on ? "bg-primary text-primary-foreground" : "text-foreground hover:bg-accent",
- )}
+ <button key={id} type="button" role="tab" aria-selected={on} title={blurb} onClick={() => onSelect(id)}
+ className={cn("flex min-h-9 items-center gap-2.5 rounded-lg px-2 py-1.5 text-left text-[13px] font-medium leading-tight transition-colors", on ? "bg-primary text-primary-foreground" : "text-foreground hover:bg-accent")}
>
- <span
- className="grid size-[26px] shrink-0 place-items-center rounded-[7px] shadow-[0_1px_2px_rgba(0,0,0,0.25)]"
- style={{ background: color }}
- >
+ <span className="grid size-[26px] shrink-0 place-items-center rounded-[7px] shadow-[0_1px_2px_rgba(0,0,0,0.25)]" style={{ background: color }}>
<Icon className="size-[15px] text-white" />
</span>
<span className="min-w-0 flex-1 truncate">{label}</span>
diff --git a/frontend/slices/os-settings/components/sections.tsx b/frontend/slices/os-settings/components/sections.tsx
index d96fc608..cb8a747c 100644
--- a/frontend/slices/os-settings/components/sections.tsx
+++ b/frontend/slices/os-settings/components/sections.tsx
@@ -1,12 +1,12 @@
"use client";
-import { ChevronRight, Lock, ShieldCheck } from "lucide-react";
+import { Lock, ShieldCheck } from "lucide-react";
import { ScrollArea } from "@/components/ui/scroll-area";
import { cn } from "@/lib/utils";
import { DevicesPanel } from "@/features/auth";
import { useActiveShell } from "@/features/os-shell";
import { SettingsSection } from "@/features/shell-settings";
-import { SECTIONS, type SectionId } from "./nav";
+import { SECTIONS, type SectionId } from "../lib/sections";
import { AutoLockRow } from "./auto-lock-row";
import { AppearanceSection } from "./appearance-section";
import { ThemeSection } from "./theme-section";
@@ -67,97 +67,23 @@ export function SettingsSectionBody({ id }: { id: SectionId }) {
}
}
-// One scrolling section pane with its heading, adapting per shell (the dynamic
-// per-shell seam): on iPhone a bold iOS large title (the section name — distinct
-// from the shell nav bar's "Settings", so no double title); on macOS/Windows a
-// compact title + blurb above the same shared grouped-card body.
-export function SectionDetail({ id }: { id: SectionId }) {
- const { id: shellId, surface } = useActiveShell();
- const isPhone = surface === "mobile";
+// One shared section body. Desktop renderers show a compact heading; mobile
+// renderers normally suppress it because the shell-owned top bar carries the
+// detail title. `showHeading` remains available for embedded/desktop contexts.
+export function SectionDetail({ id, showHeading = true }: { id: SectionId; showHeading?: boolean }) {
+ const { id: shellId } = useActiveShell();
const meta = SECTIONS.find((s) => s.id === id);
return (
<ScrollArea className="h-full">
<div data-slot="settings-pane" className="mx-auto min-w-0 max-w-3xl space-y-4 overflow-x-hidden p-3 pb-[max(1rem,var(--sai-bottom,0px))] sm:space-y-5 sm:p-5">
- {meta &&
- (isPhone ? (
- // iOS large title (32/800, §3.9); Android keeps the 26px title.
- <h1 className={cn("px-1 pt-1 leading-none", shellId === "ios" ? "text-[32px] font-extrabold tracking-[-0.02em] pb-1" : "text-[26px] font-bold tracking-tight")}>{meta.label}</h1>
- ) : (
- <header className="space-y-0.5">
- <h2 className={cn("leading-tight", shellId === "macos" ? "text-[22px] font-bold tracking-tight" : "text-sm font-semibold")}>{meta.label}</h2>
- <p className="text-xs text-muted-foreground">{meta.blurb}</p>
- </header>
- ))}
+ {showHeading && meta && (
+ <header className="space-y-0.5">
+ <h2 className={cn("leading-tight", shellId === "macos" ? "text-[22px] font-bold tracking-tight" : "text-sm font-semibold")}>{meta.label}</h2>
+ <p className="text-xs text-muted-foreground">{meta.blurb}</p>
+ </header>
+ )}
<SettingsSectionBody id={id} />
</div>
</ScrollArea>
);
}
-
-// Shared mobile fallback section index. Android uses this MasterDetail list; iOS
-// owns a richer native root in ios-settings.tsx (large title + functional Search),
-// so this stays deliberately generic rather than duplicating the iOS hierarchy.
-export function SectionList({
- active,
- onSelect,
-}: {
- active: SectionId | null;
- onSelect: (id: SectionId) => void;
-}) {
- const { id: shellId } = useActiveShell();
- const ios = shellId === "ios";
- // Grouped cards echo iOS's visual grouping, bucketed by each section's
- // semantic `group` (personalization / services / system) — reorder-safe,
- // unlike an index slice. Consecutive same-group sections share a card.
- const groups = SECTIONS.reduce<(typeof SECTIONS)[number][][]>((acc, s) => {
- const last = acc[acc.length - 1];
- if (last && last[0].group === s.group) last.push(s);
- else acc.push([s]);
- return acc;
- }, []);
- return (
- <div
- role="tablist"
- aria-label="Settings sections"
- data-slot="settings-pane"
- className={cn(
- "mx-auto min-h-full max-w-2xl bg-muted/25 p-4 pb-[max(1rem,var(--sai-bottom,0px))]",
- ios ? "space-y-[18px]" : "space-y-6",
- )}
- >
- {groups.map((group, gi) => (
- <div key={gi} data-slot="settings-card" className="overflow-hidden rounded-xl border border-border/70 bg-card shadow-sm">
- {group.map((s) => {
- const Icon = s.icon;
- const on = s.id === active;
- return (
- <button
- key={s.id}
- type="button"
- role="tab"
- aria-selected={on}
- data-slot="settings-row"
- onClick={() => onSelect(s.id)}
- className={cn(
- "relative flex w-full items-center gap-3 px-4 text-left transition-colors",
- ios ? "min-h-[46px] py-[11px]" : "py-2.5",
- "after:absolute after:inset-x-0 after:bottom-0 after:left-[3.5rem] after:h-px after:bg-border/60 last:after:hidden",
- on ? "bg-accent" : "hover:bg-accent/60",
- )}
- >
- <span
- className="grid size-[29px] shrink-0 place-items-center rounded-[7px] shadow-[0_1px_2px_rgba(0,0,0,0.25)]"
- style={{ background: s.color }}
- >
- <Icon className="size-[17px] text-white" />
- </span>
- <span className="min-w-0 flex-1 truncate text-[16px] font-medium leading-tight">{s.label}</span>
- <ChevronRight className={cn("shrink-0", ios ? "size-[15px] text-muted-foreground/40" : "size-[18px] text-muted-foreground/45")} />
- </button>
- );
- })}
- </div>
- ))}
- </div>
- );
-}
diff --git a/frontend/slices/os-settings/components/settings-shell.tsx b/frontend/slices/os-settings/components/settings-shell.tsx
new file mode 100644
index 00000000..05c9536a
--- /dev/null
+++ b/frontend/slices/os-settings/components/settings-shell.tsx
@@ -0,0 +1,57 @@
+"use client";
+
+import { AppFrame, usePublishMobileNavigation, useShellDesign } from "@/features/os-shell";
+import type { SectionId } from "../lib/sections";
+import { settingsSection } from "../lib/sections";
+import { SettingsSidebar, SettingsTabs } from "./nav";
+import { IosSettings } from "./ios-settings";
+import { SectionDetail } from "./sections";
+import { AndroidSettingsIndex } from "./android-settings";
+
+export function SettingsShell({ active, onSelect }: { active: SectionId | null; onSelect: (id: SectionId | null) => void }) {
+ const design = useShellDesign();
+ const detail = active ? settingsSection(active) : null;
+ const mobile = design.mobileNavigation !== "none";
+
+ usePublishMobileNavigation(
+ "os-settings",
+ mobile && detail ? { title: detail.label, backLabel: "Settings", onBack: () => onSelect(null) } : null,
+ [mobile, detail?.id, detail?.label, onSelect],
+ );
+
+ if (design.settingsNavigation === "ios-stack") {
+ return (
+ <AppFrame safeArea={false} bodyClassName="overflow-hidden">
+ <IosSettings active={active} onSelect={(id) => onSelect(id)} />
+ </AppFrame>
+ );
+ }
+
+ if (design.settingsNavigation === "android-stack") {
+ return (
+ <AppFrame safeArea={false} bodyClassName="overflow-hidden bg-background">
+ {active ? <SectionDetail id={active} showHeading={false} /> : <AndroidSettingsIndex onSelect={(id) => onSelect(id)} />}
+ </AppFrame>
+ );
+ }
+
+ const desktopActive: SectionId = active ?? "appearance";
+ if (design.settingsNavigation === "macos-sidebar") {
+ return (
+ <AppFrame>
+ <div className="flex h-full min-h-0">
+ <aside className="w-56 shrink-0 border-r border-border bg-sidebar/40">
+ <SettingsSidebar active={desktopActive} onSelect={(id) => onSelect(id)} />
+ </aside>
+ <div className="min-w-0 flex-1"><SectionDetail id={desktopActive} /></div>
+ </div>
+ </AppFrame>
+ );
+ }
+
+ return (
+ <AppFrame toolbar={<div className="bg-sidebar/40"><SettingsTabs active={desktopActive} onSelect={(id) => onSelect(id)} /></div>}>
+ <SectionDetail id={desktopActive} />
+ </AppFrame>
+ );
+}
diff --git a/frontend/slices/os-settings/components/theme-mode-picker.tsx b/frontend/slices/os-settings/components/theme-mode-picker.tsx
new file mode 100644
index 00000000..defd9d52
--- /dev/null
+++ b/frontend/slices/os-settings/components/theme-mode-picker.tsx
@@ -0,0 +1,60 @@
+"use client";
+
+import { Check } from "lucide-react";
+import { cn } from "@/lib/utils";
+import { useShellDesign } from "@/features/os-shell";
+import type { Theme } from "@/lib/appearance";
+
+function PhonePreview({ mode, family }: { mode: Theme; family: "apple" | "material" }) {
+ const dark = mode === "dark";
+ if (family === "apple") {
+ return (
+ <span className={cn("relative mx-auto block h-[132px] w-[74px] overflow-hidden rounded-[14px] border shadow-sm", dark ? "border-white/10 bg-[#111217]" : "border-black/10 bg-[#f4f4f7]") }>
+ <span className={cn("absolute inset-x-2 top-3 h-3 rounded-full", dark ? "bg-white/80" : "bg-black/75")} />
+ <span className={cn("absolute inset-x-2 top-10 h-9 rounded-[8px]", dark ? "bg-[#292a30]" : "bg-white")} />
+ <span className={cn("absolute inset-x-2 top-[82px] h-7 rounded-[8px]", dark ? "bg-[#292a30]" : "bg-white")} />
+ </span>
+ );
+ }
+ return (
+ <span className={cn("relative mx-auto block h-[124px] w-[78px] overflow-hidden rounded-[22px] border shadow-sm", dark ? "border-white/10 bg-[#161217]" : "border-black/10 bg-[#f8f7fb]") }>
+ <span className={cn("absolute left-3 right-3 top-3 h-7 rounded-full", dark ? "bg-[#2d2830]" : "bg-[#e8e1ea]")} />
+ <span className={cn("absolute bottom-3 left-3 h-11 w-11 rounded-[18px]", dark ? "bg-[#322b37]" : "bg-[#e9dff0]")} />
+ <span className={cn("absolute bottom-3 right-3 h-11 w-3 rounded-full", dark ? "bg-[#47364d]" : "bg-[#d8c2e3]")} />
+ </span>
+ );
+}
+
+export function ThemeModePicker({ value, onChange }: { value: Theme; onChange: (theme: Theme) => void }) {
+ const design = useShellDesign();
+ const family = design.family === "material" ? "material" : "apple";
+
+ return (
+ <div data-slot="theme-mode-picker" data-shell-family={design.family} className="grid grid-cols-2 gap-4 px-1 py-1">
+ {(["light", "dark"] as const).map((mode) => {
+ const selected = value === mode;
+ return (
+ <button
+ key={mode}
+ type="button"
+ aria-pressed={selected}
+ onClick={() => onChange(mode)}
+ className={cn(
+ "rounded-[18px] px-2 py-3 text-center transition-colors",
+ design.family === "material" ? "active:bg-secondary" : "active:bg-[var(--fill)]",
+ )}
+ >
+ <PhonePreview mode={mode} family={family} />
+ <span className="mt-2 block text-[16px] font-medium capitalize text-foreground">{mode}</span>
+ <span className={cn(
+ "mx-auto mt-2 grid size-7 place-items-center rounded-full border-2",
+ selected ? "border-info bg-info text-white" : "border-muted-foreground/45 text-transparent",
+ )}>
+ <Check className="size-4" aria-hidden />
+ </span>
+ </button>
+ );
+ })}
+ </div>
+ );
+}
diff --git a/frontend/slices/os-settings/components/theme-section.tsx b/frontend/slices/os-settings/components/theme-section.tsx
index cf00f9e0..00ffeb95 100644
--- a/frontend/slices/os-settings/components/theme-section.tsx
+++ b/frontend/slices/os-settings/components/theme-section.tsx
@@ -22,6 +22,8 @@ import {
SettingsBlock,
} from "@/features/shell-settings";
import { cn } from "@/lib/utils";
+import { useShellDesign } from "@/features/os-shell";
+import { ThemeModePicker } from "./theme-mode-picker";
function PresetChip({ preset, active, onSelect }: { preset: PresetItem; active: boolean; onSelect: () => void }) {
const swatches = presetSwatches(preset);
@@ -74,6 +76,8 @@ function ThemePreview() {
export function ThemeSection() {
const { tweaks, setTweaks } = useAppearance();
+ const design = useShellDesign();
+ const mobile = design.mobileNavigation !== "none";
const [groups, setGroups] = useState<PresetGroup[] | null>(null);
useEffect(() => {
@@ -86,11 +90,17 @@ export function ThemeSection() {
<div className="space-y-4 sm:space-y-5">
<Section icon={<SunMoon />} title="Display">
<SettingsBlock>
- <ThemePreview />
+ {mobile ? (
+ <ThemeModePicker value={tweaks.theme} onChange={(theme) => setTweaks({ theme })} />
+ ) : (
+ <ThemePreview />
+ )}
</SettingsBlock>
- <Row label="Appearance">
- <Segmented options={THEME_MODE_OPTIONS} value={tweaks.theme} onChange={(v) => setTweaks({ theme: v as Theme })} />
- </Row>
+ {!mobile && (
+ <Row label="Appearance">
+ <Segmented options={THEME_MODE_OPTIONS} value={tweaks.theme} onChange={(v) => setTweaks({ theme: v as Theme })} />
+ </Row>
+ )}
<Row label="Text size">
<Segmented options={FONT_SCALE_OPTIONS} value={String(tweaks.fontScale)} onChange={(v) => setTweaks({ fontScale: Number(v) })} />
</Row>
diff --git a/frontend/slices/os-settings/index.ts b/frontend/slices/os-settings/index.ts
index 72fc42be..fb6c345a 100644
--- a/frontend/slices/os-settings/index.ts
+++ b/frontend/slices/os-settings/index.ts
@@ -8,7 +8,6 @@ export const osSettingsApp: AppDescriptor = {
title: "Settings",
icon: Settings,
gradient: "linear-gradient(160deg,#8a8f99,#5b6068)",
- ownsMobileNavigation: true,
load: () => import("./app"),
defaultSize: { w: 840, h: 600 },
};
diff --git a/frontend/slices/os-settings/lib/sections.test.ts b/frontend/slices/os-settings/lib/sections.test.ts
new file mode 100644
index 00000000..bc609145
--- /dev/null
+++ b/frontend/slices/os-settings/lib/sections.test.ts
@@ -0,0 +1,21 @@
+import { describe, expect, it } from "vitest";
+import { filterSettingsSections, groupSettingsSections, settingsSection } from "./sections";
+
+describe("settings section model", () => {
+ it("filters metadata without depending on a renderer", () => {
+ expect(filterSettingsSections("chatgpt").map((x) => x.id)).toEqual(["mcp"]);
+ expect(filterSettingsSections("wallpaper").map((x) => x.id)).toEqual(["appearance"]);
+ });
+
+ it("groups by semantic category instead of array indexes", () => {
+ expect(groupSettingsSections().map((group) => group.map((x) => x.id))).toEqual([
+ ["appearance", "theme"],
+ ["ai", "quicklinks", "mcp"],
+ ["devices", "server", "cleanup", "backup", "about"],
+ ]);
+ });
+
+ it("keeps About content identity separate from the category metadata", () => {
+ expect(settingsSection("about")).toMatchObject({ label: "About", blurb: "System info and reset" });
+ });
+});
diff --git a/frontend/slices/os-settings/lib/sections.ts b/frontend/slices/os-settings/lib/sections.ts
new file mode 100644
index 00000000..d82cbd75
--- /dev/null
+++ b/frontend/slices/os-settings/lib/sections.ts
@@ -0,0 +1,59 @@
+import type { ComponentType } from "react";
+import {
+ DatabaseBackup,
+ Info,
+ Link2,
+ Paintbrush,
+ Palette,
+ Plug,
+ Server,
+ ShieldCheck,
+ Sparkles,
+ Trash2,
+} from "lucide-react";
+
+export type SectionId =
+ | "appearance" | "theme" | "ai" | "quicklinks" | "mcp" | "devices" | "server" | "cleanup" | "backup" | "about";
+export type SettingsGroup = "personalization" | "services" | "system";
+
+export type SettingsSectionMeta = {
+ id: SectionId;
+ label: string;
+ blurb: string;
+ icon: ComponentType<{ className?: string }>;
+ color: string;
+ group: SettingsGroup;
+};
+
+/** Presentation-agnostic Settings navigation model. */
+export const SECTIONS: ReadonlyArray<SettingsSectionMeta> = [
+ { id: "appearance", label: "Appearance", blurb: "Style, accent, wallpaper, device", icon: Palette, color: "#0a84ff", group: "personalization" },
+ { id: "theme", label: "Theme", blurb: "Mode, presets, font, contrast", icon: Paintbrush, color: "#ff375f", group: "personalization" },
+ { id: "ai", label: "AI", blurb: "Model and API key", icon: Sparkles, color: "#bf5af2", group: "services" },
+ { id: "quicklinks", label: "Quicklink", blurb: "Website shortcuts with favicons", icon: Link2, color: "#5e5ce6", group: "services" },
+ { id: "mcp", label: "MCP", blurb: "Control this VPS from ChatGPT", icon: Plug, color: "#00c7be", group: "services" },
+ { id: "devices", label: "Devices", blurb: "Approved browsers and sessions", icon: ShieldCheck, color: "#30d158", group: "system" },
+ { id: "server", label: "Server", blurb: "Mock or live host data", icon: Server, color: "#ff9f0a", group: "system" },
+ { id: "cleanup", label: "Cleanup", blurb: "Free disk space safely", icon: Trash2, color: "#64d2ff", group: "system" },
+ { id: "backup", label: "Backup", blurb: "Export or restore browser data", icon: DatabaseBackup, color: "#a2845e", group: "system" },
+ { id: "about", label: "About", blurb: "System info and reset", icon: Info, color: "#8e8e93", group: "system" },
+];
+
+export function settingsSection(id: SectionId): SettingsSectionMeta {
+ return SECTIONS.find((section) => section.id === id)!;
+}
+
+export function filterSettingsSections(query: string): ReadonlyArray<SettingsSectionMeta> {
+ const q = query.trim().toLowerCase();
+ if (!q) return SECTIONS;
+ return SECTIONS.filter((section) => `${section.label} ${section.blurb}`.toLowerCase().includes(q));
+}
+
+export function groupSettingsSections(sections: ReadonlyArray<SettingsSectionMeta> = SECTIONS): SettingsSectionMeta[][] {
+ return sections.reduce<SettingsSectionMeta[][]>((groups, section) => {
+ const last = groups[groups.length - 1];
+ if (last && last[0]?.group === section.group) last.push(section);
+ else groups.push([section]);
+ return groups;
+ }, []);
+}
diff --git a/frontend/slices/system-monitor/app.tsx b/frontend/slices/system-monitor/app.tsx
index 5ed8a1db..6fcb6ea1 100644
--- a/frontend/slices/system-monitor/app.tsx
+++ b/frontend/slices/system-monitor/app.tsx
@@ -6,7 +6,6 @@ import {
usePublishInspector,
useOsApi,
useResponsive,
- useActiveShell,
ResponsiveToolbar,
type ToolbarItem,
} from "./lib/host";
@@ -23,9 +22,7 @@ import { fmtGiBPair, fmtMBs, fmtPct } from "./lib/format";
export default function SystemMonitor() {
const api = useOsApi();
const { isMobile } = useResponsive();
- // iOS shell nav already paints the app icon + "System Monitor" title → drop the
- // in-content title here to avoid a double title (keep the chip + Refresh).
- const ios = useActiveShell().id === "ios";
+ // Mobile shell navigation owns the feature title on both iOS and Android.
const { stats, procs, cpuSeries, netSeries, gpu, error, refresh } = useStatsHistory();
usePublishInspector(
@@ -88,8 +85,8 @@ export default function SystemMonitor() {
header={
<header className="flex items-center justify-between gap-2 px-3 py-2">
<div className="flex min-w-0 items-center gap-2">
- {!ios && <Activity className="size-4 shrink-0 text-primary" />}
- {!ios && <h2 className="truncate text-sm font-semibold">System Monitor</h2>}
+ {!isMobile && <Activity className="size-4 shrink-0 text-primary" />}
+ {!isMobile && <h2 className="truncate text-sm font-semibold">System Monitor</h2>}
<span className="shrink-0 rounded-full bg-[color:var(--inset)] px-2 py-0.5 font-mono text-[10px] text-[color:var(--text-dim)]">
{chipLabel}
</span>
diff --git a/scripts/e2e/shell.mjs b/scripts/e2e/shell.mjs
index bee3c495..50bd932b 100644
--- a/scripts/e2e/shell.mjs
+++ b/scripts/e2e/shell.mjs
@@ -65,8 +65,10 @@ const check = (cond, m) => (cond ? pass(m) : fail(m));
// Noise we do not control and that does not indicate a broken shell.
// App titles, for the mobile home where tiles are buttons rather than links.
const TITLES = {
- files: "Files", monitor: "System Monitor", settings: "Settings",
- code: "Code", terminal: "Terminal",
+ files: "Files", browser: "Camoufox", code: "Code", terminal: "Terminal", claude: "Claude Code",
+ studio: "Image Editor", reel: "Video Editor", viewer: "Preview", store: "App Store", create: "Create App",
+ monitor: "System Monitor", assistant: "Alfa", links: "Quicklinks", docs: "Docs", settings: "Settings",
+ hermes: "Hermes", openclaw: "OpenClaw",
};
const IGNORE = [
@@ -178,14 +180,23 @@ async function session(browser, { width, height, label, touch = width < 768, exp
// sit in forever when a chunk import rejected.
check((await page.locator(".animate-spin").count()) === 0, `/${slug} rendered without a stuck spinner`);
- // iOS System Settings deliberately owns its own navigation chrome. Guard the
- // Apple-style hierarchy so the generic app header (icon/title/Done) cannot
- // silently reappear and duplicate the in-app Settings navigation.
+ // Mobile navigation is shell-owned for EVERY feature. Root contract:
+ // < Home | centered feature title | AI. Feature slices may publish a parent
+ // + detail title for drill-down, but may never mount a second navigation bar.
+ if (expectedSurface === "mobile") {
+ const header = page.locator('[data-slot="mobile-feature-header"]');
+ check((await header.count()) === 1, `/${slug} has exactly one shell-owned mobile feature header`);
+ check((await header.getByRole("button", { name: "Back to Home" }).count()) === 1, `/${slug} exposes < Home`);
+ check((await header.getByRole("button", { name: "Ask AI" }).count()) === 1, `/${slug} exposes the AI action`);
+ const headerText = (await header.innerText()).replace(/\s+/g, " ").trim();
+ check(headerText.includes(TITLES[slug] ?? slug), `/${slug} centers the feature title`);
+ check((await page.getByRole("button", { name: "Done", exact: true }).count()) === 0, `/${slug} has no legacy Done control`);
+ }
+
if (slug === "settings" && shell === "ios") {
- check((await page.locator('[data-slot="ios-settings-root"]').count()) === 1, "/settings uses the native iOS Settings root");
- check((await page.locator('[data-slot="ios-settings-root"] h1', { hasText: "Settings" }).count()) === 1, "/settings shows the iOS large title");
+ check((await page.locator('[data-slot="ios-settings-root"]').count()) === 1, "/settings uses the native iOS Settings renderer");
+ check((await page.locator('[data-slot="ios-settings-root"] h1', { hasText: "Settings" }).count()) === 0, "/settings does not duplicate the shell title in content");
check((await page.locator('[data-slot="ios-settings-root"] input[type="search"]').count()) === 1, "/settings exposes functional Search");
- check((await page.getByRole("button", { name: "Done", exact: true }).count()) === 0, "/settings does not duplicate the generic iOS Done header");
}
}