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.

feat(desktop): give Finder, Explorer and Settings native platform layouts

Rahman625d290dfa34
diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md
index ec3e83fd..7784c82f 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-09-08
+
+**Added**
+
+- `desktop` give Finder, Explorer and Settings native platform layouts
+
## 2026-09-07
**Added**
diff --git a/docs/PROGRESS.md b/docs/PROGRESS.md
index 938c90a6..0859a5f4 100644
--- a/docs/PROGRESS.md
+++ b/docs/PROGRESS.md
@@ -1,3 +1,9 @@
+## 2026-09-08 — Native desktop Files and Settings
+
+Files now presents Finder and File Explorer names and distinct toolbars, navigation, search, folder colors, selection and status treatments while retaining the shared host API. Windows Settings replaces horizontal tabs with a searchable Fluent sidebar; macOS System Settings gains grouped search and colored categories. App names follow the current shell without changing routes or custom file titles. Running Windows taskbar pins now minimize/restore the front existing window instead of duplicating a multi-window app; New window remains explicit.
+
+Browser checks exposed two underlying issues: home-relative breadcrumbs invented /~ paths, and app sidebars only adapted to the viewport. Home paths now remain home-relative, and the shared sidebar switches to a sheet below 600px of actual window width (including Code's existing sidebar). Windows Enter opens, F2 renames and Backspace navigates back; Finder Enter renames. Settings wallpaper previews now have a real width and resolve Auto to the shell backdrop. Tests cover breadcrumb paths, platform profiles and authenticated/preview browser search, rename, taskbar reuse and narrow-window navigation in scripts/e2e/desktop-native.mjs.
+
## 2026-09-07 — Private named connections for modular project MCPs
A project MCP declaration previously supplied only a URL or raw header values, so Baton discovery through MSO returned 401 despite the generic dispatcher existing. The Project MCP integration now keeps an endpoint-bound downstream bearer in the owner-private connection store; repo manifests carry only a named user/connection reference. Exact optional tool grants apply at discovery and call time, connection changes are rechecked, errors/results redact the selected token, HTTP requests time out, and paginated catalogs fail explicitly when incomplete. Token identity and live downstream RBAC remain authoritative; no impersonation or incoming-token passthrough is added. Shared project metadata types replace a copied auth union. See PROJECT-MCP-CONNECTIONS.md for setup and acceptance. The global tool names remain unchanged; compact discovery copy is shorter to retain scanner headroom after the provider enum grows.
diff --git a/frontend/slices/appshell/components/layout/app-chrome.tsx b/frontend/slices/appshell/components/layout/app-chrome.tsx
index e8a016f2..72c9905a 100644
--- a/frontend/slices/appshell/components/layout/app-chrome.tsx
+++ b/frontend/slices/appshell/components/layout/app-chrome.tsx
@@ -13,6 +13,7 @@
import { type ReactNode } from "react";
import dynamic from "next/dynamic";
+import { useContainer } from "../../responsive/use-container";
import { useIsMobile } from "../../responsive/use-is-mobile";
import { cn } from "@/lib/utils";
@@ -36,6 +37,7 @@ function SideRegion({
onOpenChange,
side,
railOpen,
+ compact,
title,
description,
railBase,
@@ -48,6 +50,7 @@ function SideRegion({
onOpenChange: (open: boolean) => void;
side: "left" | "right";
railOpen: boolean;
+ compact: boolean;
title: string;
description?: string;
railBase: string;
@@ -57,7 +60,7 @@ function SideRegion({
children: ReactNode;
}) {
const isMobile = useIsMobile();
- if (isMobile) {
+ if (isMobile || compact) {
return (
<MobileSideRegion
open={open}
@@ -97,12 +100,16 @@ export function AppSidebar({
sheetClassName?: string;
children: ReactNode;
}) {
+ const [measureRef, pane] = useContainer<HTMLDivElement>();
return (
+ <>
+ <div ref={measureRef} aria-hidden className="pointer-events-none absolute inset-x-0 top-0 h-0" />
<SideRegion
open={open}
onOpenChange={onOpenChange}
side="left"
railOpen={railOpen}
+ compact={pane === "xs" || pane === "sm"}
title={title}
description={description}
railBase="flex w-56 shrink-0 flex-col border-r border-border bg-sidebar"
@@ -112,5 +119,6 @@ export function AppSidebar({
>
{children}
</SideRegion>
+ </>
);
}
diff --git a/frontend/slices/appshell/components/shells/windows/taskbar.tsx b/frontend/slices/appshell/components/shells/windows/taskbar.tsx
index 1b643d92..a964bba0 100644
--- a/frontend/slices/appshell/components/shells/windows/taskbar.tsx
+++ b/frontend/slices/appshell/components/shells/windows/taskbar.tsx
@@ -71,9 +71,10 @@ export function Taskbar({ onTaskView }: { onTaskView?: () => void }) {
</Button>
)}
{pinnedApps.length > 0 && <span className="mx-1 h-6 w-px bg-border" />}
- {pinnedApps.map((app) => (
- <PinnedApp key={app.id} app={app} running={runningApps.has(app.id)} />
- ))}
+ {pinnedApps.map((app) => {
+ const front = Object.values(wins).filter((w) => w.app === app.id).sort((a, b) => b.z - a.z)[0];
+ return front ? <TaskButton key={app.id} id={front.id} compact /> : <PinnedApp key={app.id} app={app} running={runningApps.has(app.id)} />;
+ })}
{order.filter((id) => !pinnedIds.has(wins[id]?.app)).map((id) => (
<TaskButton key={id} id={id} />
))}
@@ -144,7 +145,7 @@ function PinnedApp({ app, running }: { app: AppDescriptor; running: boolean }) {
);
}
-function TaskButton({ id }: { id: string }) {
+function TaskButton({ id, compact = false }: { id: string; compact?: boolean }) {
const win = useWindow(id);
const focused = useFocused() === id;
const apps = useApps();
@@ -163,7 +164,8 @@ function TaskButton({ id }: { id: string }) {
<Button type="button" variant="ghost"
onClick={onClick}
onContextMenu={menu.open}
- title={win.title}
+ title={app?.title ?? win.title}
+ aria-label={app?.title ?? win.title}
className={cn(`h-auto p-0 font-normal hover:bg-transparent relative flex h-10 items-center gap-2 rounded-md px-2 hover:bg-muted ${active ? "bg-muted" : ""}`)}
>
{app && (
@@ -171,7 +173,7 @@ function TaskButton({ id }: { id: string }) {
<AppIcon app={app} />
</span>
)}
- <span className="max-w-[120px] truncate text-xs">{win.title}</span>
+ {!compact && <span className="max-w-[120px] truncate text-xs">{win.title}</span>}
<span
className={cn(`absolute bottom-[1px] left-1/2 h-[2px] -translate-x-1/2 rounded-full bg-primary transition-all ${active ? "w-5" : "w-2 opacity-60"}`)}
/>
@@ -191,6 +193,7 @@ function TaskButton({ id }: { id: string }) {
pos={menu.pos}
onClose={menu.close}
items={[
+ ...(app?.multi ? [{ label: "New window", onClick: () => openWindow(app.id, app.title, app.defaultSize, undefined, { multi: true }) }] : []),
{ label: win.minimized ? "Restore" : "Focus", icon: ArrowUpRight, onClick: () => (win.minimized ? restoreWindow(id) : focusWindow(id)) },
{ label: "Minimize", icon: Minimize2, disabled: win.minimized, onClick: () => minimizeWindow(id) },
{ type: "sep" },
diff --git a/frontend/slices/appshell/components/window.tsx b/frontend/slices/appshell/components/window.tsx
index 31e40583..3a5c7c89 100644
--- a/frontend/slices/appshell/components/window.tsx
+++ b/frontend/slices/appshell/components/window.tsx
@@ -2,6 +2,7 @@
import { memo, useRef, useState } from "react";
import { cn } from "@/lib/utils";
+import { useApp } from "../lib/registry";
import { useWindow, useFocused } from "../hooks/use-shell";
import { useWindowDrag } from "../hooks/use-window-drag";
import {
@@ -29,6 +30,7 @@ import type { WinId } from "../lib/types";
// (drag, 8-way resize, content, snap preview) is shared.
export const Window = memo(function Window({ id, variant = "macos" }: { id: WinId; variant?: "macos" | "windows" }) {
const win = useWindow(id);
+ const app = useApp(win?.app ?? "");
const focused = useFocused() === id;
const activeSpace = useActiveSpace();
const groupTopId = useGroupTop(win?.groupId);
@@ -51,14 +53,16 @@ export const Window = memo(function Window({ id, variant = "macos" }: { id: WinI
if (win.groupId && groupTopId !== id) return null; // a tab behind the group's active frame
const preview = zone ? snapRect(zone) : null;
const isWin = variant === "windows";
+ const title = app && [app.title, ...Object.values(app.shellTitles ?? {})].includes(win.title)
+ ? app.shellTitles?.[variant] ?? app.title : win.title;
// Title-bar right-click menu — the window controls, mirroring the traffic
// lights / caption buttons plus pin.
const menuItems: MenuItem[] = [
{ label: win.maximized ? "Restore" : "Maximize", icon: win.maximized ? Minimize2 : Maximize2, onClick: () => toggleMaximize(id) },
- { label: "Minimize", icon: Minus, onClick: beginMinimize, shortcut: "⌘M" },
+ { label: "Minimize", icon: Minus, onClick: beginMinimize, shortcut: isWin ? "Win+↓" : "⌘M" },
{ label: win.pinned ? "Unpin from Top" : "Keep on Top", icon: win.pinned ? PinOff : Pin, onClick: () => togglePin(id) },
{ type: "sep" },
- { label: "Close", icon: X, onClick: beginClose, shortcut: "⌘W" },
+ { label: "Close", icon: X, onClick: beginClose, shortcut: isWin ? "Ctrl+W" : "⌘W" },
];
const anim =
phase === "closing"
@@ -80,6 +84,7 @@ export const Window = memo(function Window({ id, variant = "macos" }: { id: WinI
<div
ref={ref}
data-window
+ data-app={win.app}
className={cn(
"win-geo absolute flex flex-col overflow-hidden border border-border bg-card shadow-[var(--shadow-win)]",
"rounded-[var(--shell-radius-win)]",
@@ -108,7 +113,7 @@ export const Window = memo(function Window({ id, variant = "macos" }: { id: WinI
onContextMenu={ctx.open}
>
<div className="pointer-events-none flex-1 truncate pl-3 text-[12px] font-medium text-muted-foreground">
- {win.title}
+ {title}
</div>
<WinCaption
id={id}
@@ -132,7 +137,7 @@ export const Window = memo(function Window({ id, variant = "macos" }: { id: WinI
onMaximize={() => toggleMaximize(id)}
/>
<div className="pointer-events-none flex-1 truncate text-center text-[13px] font-semibold text-muted-foreground">
- {win.title}
+ {title}
</div>
<div className="min-w-[54px]" />
</div>
diff --git a/frontend/slices/appshell/design/macos/design.md b/frontend/slices/appshell/design/macos/design.md
index ae9344fd..7df5be2d 100644
--- a/frontend/slices/appshell/design/macos/design.md
+++ b/frontend/slices/appshell/design/macos/design.md
@@ -5,7 +5,8 @@ Source family: the project Apple-platform design reference, 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.
+- System Settings uses a searchable grouped sidebar, colored category icons and a persistent selected detail pane; narrow windows use a side sheet.
+- Finder uses compact navigation/view/action controls, inline folder search, blue folders, an icon-grid default and a compact status bar. Enter renames; Space previews.
- 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.
diff --git a/frontend/slices/appshell/design/profiles.test.ts b/frontend/slices/appshell/design/profiles.test.ts
index 0026112b..16807453 100644
--- a/frontend/slices/appshell/design/profiles.test.ts
+++ b/frontend/slices/appshell/design/profiles.test.ts
@@ -25,7 +25,7 @@ describe("shell design profiles", () => {
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.windows.settingsNavigation).toBe("windows-sidebar");
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
index 49d27ded..b7bb9a72 100644
--- a/frontend/slices/appshell/design/profiles.ts
+++ b/frontend/slices/appshell/design/profiles.ts
@@ -34,7 +34,7 @@ export const SHELL_DESIGN_PROFILES: Record<ShellId, ShellDesignProfile> = {
family: "fluent",
density: "compact",
mobileNavigation: "none",
- settingsNavigation: "windows-tabs",
+ settingsNavigation: "windows-sidebar",
dialog: { mobile: "dialog", drawerHeightClass: "", drawerRadiusClass: "" },
docsPath: "frontend/slices/appshell/design/windows/design.md",
},
diff --git a/frontend/slices/appshell/design/types.ts b/frontend/slices/appshell/design/types.ts
index 99d5e69a..66baaa92 100644
--- a/frontend/slices/appshell/design/types.ts
+++ b/frontend/slices/appshell/design/types.ts
@@ -1,7 +1,7 @@
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 SettingsNavigationStyle = "ios-stack" | "android-stack" | "macos-sidebar" | "windows-sidebar" | "dashboard-tabs";
export type DialogPresentation = "drawer-bottom" | "drawer-right" | "dialog";
/**
diff --git a/frontend/slices/appshell/design/windows/design.md b/frontend/slices/appshell/design/windows/design.md
index f3075426..b99ddf68 100644
--- a/frontend/slices/appshell/design/windows/design.md
+++ b/frontend/slices/appshell/design/windows/design.md
@@ -6,7 +6,9 @@ Design family: Windows 11 / Fluent.
- 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.
+- Settings use a searchable left navigation rail, neutral selected rows with an accent indicator, and a large detail heading; narrow windows switch to a side sheet.
+- File Explorer uses a command bar above navigation/address/search, yellow folder icons, a details-list default and a selection/status strip.
+- Running pinned taskbar apps focus, minimize and restore their existing window; New window is an explicit context-menu action.
- 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/lib/registry.tsx b/frontend/slices/appshell/lib/registry.tsx
index 60f319c6..a708c49b 100644
--- a/frontend/slices/appshell/lib/registry.tsx
+++ b/frontend/slices/appshell/lib/registry.tsx
@@ -1,6 +1,7 @@
"use client";
import { createContext, useContext, useMemo, type ReactNode } from "react";
+import { useActiveShell } from "../registry/shells";
import type { AppDescriptor } from "./types";
// Apps are injected by the app layer, not imported by os-shell (open/closed).
@@ -21,7 +22,8 @@ export function AppRegistryProvider({
export function useApps(): AppDescriptor[] {
const map = useContext(RegistryContext);
- return useMemo(() => Array.from(map.values()), [map]);
+ const { id } = useActiveShell();
+ return useMemo(() => Array.from(map.values(), (app) => ({ ...app, title: (id === "macos" || id === "windows" ? app.shellTitles?.[id] : undefined) ?? app.title })), [map, id]);
}
export function useApp(id: string): AppDescriptor | undefined {
diff --git a/frontend/slices/appshell/lib/types.ts b/frontend/slices/appshell/lib/types.ts
index 4abf8a4a..1936b602 100644
--- a/frontend/slices/appshell/lib/types.ts
+++ b/frontend/slices/appshell/lib/types.ts
@@ -71,6 +71,8 @@ export type AppDescriptor = {
/** URL slug for deep-linking (`/files`); falls back to `id` when unset. */
slug?: string;
title: string;
+ /** Optional native app names; ids, routes and window state remain shared. */
+ shellTitles?: Partial<Record<"macos" | "windows", string>>;
/** Any glyph component taking the props <AppIcon> passes. A LucideIcon satisfies
* it; so does a hand-written mark, which is how apps that wrap a THIRD-PARTY
* product (Hermes, OpenClaw, Camoufox) show that product's own logo instead of
diff --git a/frontend/slices/files-manager/app.tsx b/frontend/slices/files-manager/app.tsx
index 6bc95902..18d8f730 100644
--- a/frontend/slices/files-manager/app.tsx
+++ b/frontend/slices/files-manager/app.tsx
@@ -101,7 +101,8 @@ export default function FilesManager({ payload }: AppProps) {
<AppSidebar
open={sidebarOpen}
onOpenChange={setSidebarOpen}
- title="Files"
+ title={shellId === "macos" ? "Finder" : shellId === "windows" ? "File Explorer" : "Files"}
+ railClassName={shellId === "macos" ? "w-48 bg-sidebar/65" : "w-52 bg-background"}
description="Browse favorites, the file tree, and storage."
>
<FilesSidebar
@@ -163,6 +164,7 @@ export default function FilesManager({ payload }: AppProps) {
) : (
<FileView
ios={shellId === "ios"}
+ emptyMessage={query.trim() ? "No matching files" : undefined}
entries={visible}
view={view}
dir={fs.path}
diff --git a/frontend/slices/files-manager/components/desktop-files-toolbar.tsx b/frontend/slices/files-manager/components/desktop-files-toolbar.tsx
new file mode 100644
index 00000000..bb7d3b76
--- /dev/null
+++ b/frontend/slices/files-manager/components/desktop-files-toolbar.tsx
@@ -0,0 +1,104 @@
+"use client";
+
+import { ArrowLeft, ArrowRight, ArrowUp, RotateCw, PanelLeft, FolderOpen, Plus, ChevronDown, Upload, Download, FolderUp, ClipboardPaste, ArrowUpDown, LayoutGrid, List, MoreHorizontal, Search, X } from "lucide-react";
+import { Button } from "@/components/ui/button";
+import { Input } from "@/components/ui/input";
+import { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator } from "@/components/ui/dropdown-menu";
+import { useActiveShell } from "@/features/appshell";
+import { cn } from "@/lib/utils";
+import { parentPath } from "../lib/format";
+import { FileCrumbs } from "./file-crumbs";
+import type { DragEvent } from "react";
+import type { SortKey, ViewMode } from "../lib/types";
+
+export type FilesToolbarProps = {
+ path: string;
+ query: string;
+ onQuery: (query: string) => void;
+ onRefresh: () => void;
+ canBack: boolean;
+ canForward: boolean;
+ view: ViewMode;
+ sort: SortKey;
+ hasClipboard: boolean;
+ onBack: () => void;
+ onForward: () => void;
+ onNavigate: (path: string) => void;
+ onView: (v: ViewMode) => void;
+ onSort: (s: SortKey) => void;
+ onNewFolder: () => void;
+ onUpload: () => void;
+ onUploadFolder: () => void;
+ onPaste: () => void;
+ onOpenSidebar: () => void;
+ selectedCount: number;
+ onDownload: () => void;
+ dropTarget: string | null;
+ onCrumbDragOver: (e: DragEvent, dest: string) => void;
+ onCrumbDragLeave: (dest: string) => void;
+ onCrumbDrop: (e: DragEvent, dest: string) => void;
+ onToggleSearch: () => void;
+ searchOpen?: boolean;
+ ios?: boolean;
+};
+
+export function DesktopFilesToolbar(p: FilesToolbarProps) {
+ const { id } = useActiveShell();
+ const windows = id === "windows";
+ const folder = p.path === "~" ? "Home" : p.path.split("/").filter(Boolean).pop() || "Filesystem";
+ const navigation = <div className="flex shrink-0 items-center gap-0.5">
+ <Button variant="ghost" size="icon" aria-label="Open sidebar" onClick={p.onOpenSidebar} className="hidden size-8 @max-[600px]:inline-flex"><PanelLeft className="size-4" /></Button>
+ <Button variant="ghost" size="icon" aria-label="Previous folder" disabled={!p.canBack} onClick={p.onBack} className="size-8"><ArrowLeft className="size-4" /></Button>
+ <Button variant="ghost" size="icon" aria-label="Forward" disabled={!p.canForward} onClick={p.onForward} className="size-8"><ArrowRight className="size-4" /></Button>
+ {windows && <Button variant="ghost" size="icon" aria-label="Up one level" disabled={p.path === "/" || p.path === "~"} onClick={() => p.onNavigate(parentPath(p.path))} className="size-8"><ArrowUp className="size-4" /></Button>}
+ {windows && <Button variant="ghost" size="icon" aria-label="Refresh folder" onClick={p.onRefresh} className="size-8"><RotateCw className="size-4" /></Button>}
+ </div>;
+ const search = <div className={cn("relative min-w-0", windows ? "w-52 @max-[760px]:w-36" : "w-40 @max-[760px]:w-28")}>
+ <Search className="pointer-events-none absolute left-2.5 top-2.5 size-3.5 text-muted-foreground" />
+ <Input aria-label="Search this folder" placeholder={windows ? `Search ${folder}` : "Search"} value={p.query} onChange={(e) => p.onQuery(e.target.value)}
+ onKeyDown={(e) => { e.stopPropagation(); if (e.key === "Escape") p.onQuery(""); }}
+ className={cn("h-9 bg-background/70 pl-8 pr-7 text-xs shadow-none", windows ? "rounded-md" : "rounded-lg")} />
+ {p.query && <Button variant="ghost" size="icon" aria-label="Clear search" onClick={() => p.onQuery("")} className="absolute right-1 top-1 size-7"><X className="size-3" /></Button>}
+ </div>;
+ const view = <div role="group" aria-label="Folder view" className={cn("flex shrink-0 items-center", !windows && "rounded-md bg-secondary p-0.5")}>
+ <Button variant="ghost" size="icon" aria-label="Grid view" aria-pressed={p.view === "grid"} onClick={() => p.onView("grid")} className={cn("size-8", p.view === "grid" && "bg-background shadow-sm")}><LayoutGrid className="size-4" /></Button>
+ <Button variant="ghost" size="icon" aria-label="List view" aria-pressed={p.view === "list"} onClick={() => p.onView("list")} className={cn("size-8", p.view === "list" && "bg-background shadow-sm")}><List className="size-4" /></Button>
+ </div>;
+ const sort = <DropdownMenu>
+ <DropdownMenuTrigger asChild><Button variant="ghost" size="sm" aria-label="Sort" className="h-8 gap-1.5 px-2"><ArrowUpDown className="size-4" />{windows && <span className="text-xs">Sort</span>}<ChevronDown className="size-3" /></Button></DropdownMenuTrigger>
+ <DropdownMenuContent align="end">{(["name", "kind", "size"] as const).map((key) => <DropdownMenuItem key={key} onSelect={() => p.onSort(key)} className={cn(p.sort === key && "bg-accent")}>{({ name: "Name", kind: windows ? "Type" : "Kind", size: "Size" })[key]}</DropdownMenuItem>)}</DropdownMenuContent>
+ </DropdownMenu>;
+ const actions = <DropdownMenu>
+ <DropdownMenuTrigger asChild><Button variant="ghost" size={windows ? "sm" : "icon"} aria-label={windows ? "New" : "More actions"} className={cn("h-8 gap-1.5", !windows && "w-8")}>{windows ? <><Plus className="size-4" /><span className="text-xs">New</span><ChevronDown className="size-3" /></> : <MoreHorizontal className="size-5" />}</Button></DropdownMenuTrigger>
+ <DropdownMenuContent align={windows ? "start" : "end"}>
+ <DropdownMenuItem onSelect={p.onNewFolder}><FolderOpen className="size-4" />New Folder</DropdownMenuItem>
+ <DropdownMenuSeparator />
+ <DropdownMenuItem onSelect={p.onUpload}><Upload className="size-4" />Upload Files…</DropdownMenuItem>
+ <DropdownMenuItem onSelect={p.onUploadFolder}><FolderUp className="size-4" />Upload Folder…</DropdownMenuItem>
+ {!windows && <><DropdownMenuSeparator /><DropdownMenuItem disabled={!p.hasClipboard} onSelect={p.onPaste}><ClipboardPaste className="size-4" />Paste</DropdownMenuItem>
+ <DropdownMenuItem disabled={!p.selectedCount} onSelect={p.onDownload}><Download className="size-4" />Download</DropdownMenuItem>
+ <DropdownMenuItem onSelect={p.onRefresh}><RotateCw className="size-4" />Refresh folder</DropdownMenuItem></>}
+ </DropdownMenuContent>
+ </DropdownMenu>;
+ const crumbs = <FileCrumbs path={p.path} dropTarget={p.dropTarget} onNavigate={p.onNavigate} onDragOver={p.onCrumbDragOver} onDragLeave={p.onCrumbDragLeave} onDrop={p.onCrumbDrop} />;
+
+ return <div data-slot={windows ? "explorer-toolbar" : "finder-toolbar"} className={cn("border-b border-border", windows ? "bg-[var(--mica-win,var(--card))]" : "bg-sidebar/40")}>
+ {windows ? <>
+ <div className="flex min-h-12 items-center gap-2 overflow-x-auto border-b border-border px-3">
+ {actions}<span className="h-5 w-px shrink-0 bg-border" />
+ <Button variant="ghost" size="sm" disabled={!p.hasClipboard} onClick={p.onPaste} className="h-8 gap-2 text-xs"><ClipboardPaste className="size-4" />Paste</Button>
+ <Button variant="ghost" size="sm" disabled={!p.selectedCount} onClick={p.onDownload} className="h-8 gap-2 text-xs"><Download className="size-4" />Download</Button>
+ <span className="h-5 w-px shrink-0 bg-border" />{sort}{view}
+ </div>
+ <div className="flex min-h-14 items-center gap-2 px-2">
+ {navigation}<div className="flex h-9 min-w-0 flex-1 items-center gap-2 rounded-md border border-border bg-background/70 px-2"><FolderOpen className="size-4 shrink-0 text-warning" />{crumbs}</div>{search}
+ </div>
+ </> : <>
+ <div className="flex min-h-14 items-center gap-2 px-2">
+ {navigation}<span className="min-w-0 flex-1 truncate text-[13px] font-semibold">{folder}</span>
+ {view}{sort}{actions}{search}
+ </div>
+ <div className="flex min-h-8 items-center gap-2 border-t border-border/60 px-3"><FolderOpen className="size-3.5 shrink-0 text-info" />{crumbs}</div>
+ </>}
+ </div>;
+}
diff --git a/frontend/slices/files-manager/components/file-item.tsx b/frontend/slices/files-manager/components/file-item.tsx
index 4ebb2000..309ce023 100644
--- a/frontend/slices/files-manager/components/file-item.tsx
+++ b/frontend/slices/files-manager/components/file-item.tsx
@@ -3,6 +3,7 @@
import { createElement, type DragEvent, type MouseEvent, useState } from "react";
import { Folder } from "lucide-react";
import { Input } from "@/components/ui/input";
+import { useActiveShell } from "@/features/appshell";
import { useIsMobile } from "@/hooks/use-mobile";
import { cn } from "@/lib/utils";
import { rawUrl, type FsEntry } from "../lib/host";
@@ -76,7 +77,8 @@ export function FileItem({
onDragLeave: () => void;
onDrop: (e: DragEvent) => void;
}) {
- const color = colorFor(entry);
+ const windows = useActiveShell().id === "windows";
+ const color = entry.kind === "dir" ? (windows ? "text-warning" : "text-info") : colorFor(entry);
const isMobile = useIsMobile();
const [thumbFail, setThumbFail] = useState(false);
// Touch has no double-click — on phones a single tap selects AND opens
@@ -104,6 +106,7 @@ export function FileItem({
<button
draggable
data-name={entry.name}
+ aria-pressed={selected}
onDragStart={onDragStart}
{...dropProps}
onClick={onTap}
@@ -112,7 +115,7 @@ export function FileItem({
{...touchProps}
className={cn(
"flex h-auto w-full flex-col items-center gap-1.5 rounded-lg p-3 text-center transition-colors",
- selected ? "bg-primary text-primary-foreground" : "hover:bg-accent",
+ selected ? "bg-primary/10 text-foreground ring-1 ring-inset ring-primary/25" : "hover:bg-accent",
cut && "opacity-50",
dropActive && "ring-2 ring-primary ring-inset",
)}
@@ -140,7 +143,7 @@ export function FileItem({
"size-12 shrink-0 fill-current drop-shadow-[0_2px_4px_rgba(0,0,0,0.2)] transition-transform",
// Folders use the fixed system folder-blue (#57b3ff) on every shell
// (Finder + Files) — a fixed category color, not the user accent.
- selected ? "" : "text-[#57b3ff]",
+ windows ? "text-warning" : "text-info",
dropActive && "scale-110",
)}
/>
@@ -149,7 +152,7 @@ export function FileItem({
createElement(iconFor(entry), {
className: cn(
"size-11 shrink-0 drop-shadow-[0_1px_2px_rgba(0,0,0,0.15)] transition-transform",
- selected ? "" : color,
+ color,
dropActive && "scale-110",
),
})
@@ -157,7 +160,7 @@ export function FileItem({
{renaming ? (
<RenameInput initial={entry.name} onCommit={commit} onCancel={onRenameCancel} centered />
) : (
- <span className="line-clamp-2 w-full text-[11px] font-medium leading-tight break-words whitespace-normal">
+ <span className={cn("line-clamp-2 max-w-full rounded px-1 text-xs leading-snug break-words whitespace-normal", selected && !windows && "bg-primary text-primary-foreground")}>
{entry.name}
</span>
)}
@@ -176,7 +179,7 @@ export function FileItem({
onContextMenu={onContext}
{...touchProps}
className={cn(
- "grid cursor-default grid-cols-[1fr_92px_96px] items-center gap-2 px-3 py-1.5 text-xs transition-colors @max-[430px]:grid-cols-[1fr_72px] [@media(pointer:coarse)]:min-h-[44px]",
+ "grid cursor-default rounded-sm odd:bg-muted/20 grid-cols-[1fr_92px_96px] items-center gap-2 px-3 py-1.5 text-xs transition-colors @max-[430px]:grid-cols-[1fr_72px] [@media(pointer:coarse)]:min-h-[44px]",
selected ? "bg-primary text-primary-foreground" : "hover:bg-accent",
cut && "opacity-50",
dropActive && "ring-2 ring-primary ring-inset",
diff --git a/frontend/slices/files-manager/components/file-view.tsx b/frontend/slices/files-manager/components/file-view.tsx
index 95d8ec2c..1ee73d78 100644
--- a/frontend/slices/files-manager/components/file-view.tsx
+++ b/frontend/slices/files-manager/components/file-view.tsx
@@ -18,6 +18,7 @@ const LIST_ROW_HEIGHT = 28;
export function FileView({
ios,
+ emptyMessage,
entries,
view,
dir,
@@ -32,6 +33,7 @@ export function FileView({
onRenameCancel,
}: {
ios: boolean;
+ emptyMessage?: string;
entries: FsEntry[];
view: ViewMode;
dir: string;
@@ -59,7 +61,7 @@ export function FileView({
{...bgDrop}
className={`flex h-full items-center justify-center p-8 text-center text-muted-foreground ${ios ? "text-[15px]" : "text-xs"} ${bgRing}`}
>
- {ios ? "No Items" : "Drop files or folders here to upload"}
+ {emptyMessage ?? (ios ? "No Items" : "Drop files or folders here to upload")}
</div>
);
}
@@ -141,7 +143,7 @@ function ListBody({
});
const header = (
- <div className="grid grid-cols-[1fr_92px_96px] gap-2 border-b border-border px-3 pb-1.5 text-[10px] font-semibold tracking-wide text-muted-foreground uppercase @max-[430px]:grid-cols-[1fr_72px]">
+ <div className="grid grid-cols-[1fr_92px_96px] gap-2 border-b border-border bg-muted/30 px-3 py-1.5 text-xs font-medium text-muted-foreground @max-[430px]:grid-cols-[1fr_72px]">
<span>Name</span>
<span>Size</span>
<span className="@max-[430px]:hidden">Kind</span>
diff --git a/frontend/slices/files-manager/components/files-chrome.tsx b/frontend/slices/files-manager/components/files-chrome.tsx
index 8a1b2c52..ccbb38af 100644
--- a/frontend/slices/files-manager/components/files-chrome.tsx
+++ b/frontend/slices/files-manager/components/files-chrome.tsx
@@ -1,5 +1,6 @@
"use client";
+import { useActiveShell } from "@/features/appshell";
import { Search, X } from "lucide-react";
import { FilesToolbar } from "./files-toolbar";
import { UploadBar } from "./upload-bar";
@@ -41,6 +42,9 @@ export function FilesHeader({
<FilesToolbar
ios={ios}
path={fs.path}
+ query={query}
+ onQuery={setQuery}
+ onRefresh={fs.refresh}
canBack={fs.canBack}
canForward={fs.canForward}
view={view}
@@ -65,7 +69,7 @@ export function FilesHeader({
searchOpen={searchOpen}
onToggleSearch={onToggleSearch}
/>
- {searchOpen && (
+ {ios && searchOpen && (
<div className="flex items-center gap-2 border-b border-border px-3 py-1.5">
<Search className="size-3.5 shrink-0 text-muted-foreground" />
<input
@@ -110,15 +114,16 @@ export function FilesFooter({
orderedLen: number | null;
selectedCount: number;
}) {
+ const { id: shell } = useActiveShell();
return (
<>
- {!isMobile && <FileDetails entry={selectedEntry} dir={fs.path} />}
+ {!isMobile && selectedEntry && <FileDetails entry={selectedEntry} dir={fs.path} />}
<div className="flex items-center gap-3 px-3 pt-1.5 text-[11px] text-muted-foreground [padding-bottom:calc(0.375rem+var(--sai-bottom))]">
<span>{orderedLen !== null ? `${orderedLen} items` : "—"}</span>
{selectedCount > 0 && <span>{selectedCount} selected</span>}
{fs.clip && (
<span className="ml-auto">
- {fs.clip.names.length} {fs.clip.mode === "cut" ? "cut" : "copied"} — ⌘V to paste
+ {fs.clip.names.length} {fs.clip.mode === "cut" ? "cut" : "copied"} — {shell === "windows" ? "Ctrl" : "⌘"}V to paste
</span>
)}
</div>
diff --git a/frontend/slices/files-manager/components/files-sidebar.tsx b/frontend/slices/files-manager/components/files-sidebar.tsx
index 649fc03c..f1a035ff 100644
--- a/frontend/slices/files-manager/components/files-sidebar.tsx
+++ b/frontend/slices/files-manager/components/files-sidebar.tsx
@@ -1,3 +1,4 @@
+import { useActiveShell } from "@/features/appshell";
import { type DragEvent } from "react";
import {
Home, Star, Image as ImageIcon, FolderOpen, FileText, Download, HardDrive,
@@ -48,13 +49,15 @@ export function FilesSidebar({
}) {
// Favorites come from the host's real roots (Home/Projects/Filesystem live,
// mock shortcuts in mock mode) — never hardcoded mock paths.
+ const { id } = useActiveShell();
+ const windows = id === "windows";
const favorites = roots.length ? roots : [{ label: "Home", path: "~" }];
const ratio = usage && usage.total > 0 ? usage.used / usage.total : 0;
return (
<div className="flex h-full min-h-0 flex-col">
<div className="flex items-center gap-2 px-3 pt-3 pb-1 text-[11px] font-semibold text-muted-foreground">
- <Star className="size-3.5" />
- <span>Favorites</span>
+ {windows && <Star className="size-3.5" />}
+ <span>{windows ? "Quick access" : "Favorites"}</span>
</div>
<nav className="flex flex-col gap-0.5 p-2">
{favorites.map((fav) => {
@@ -71,13 +74,12 @@ export function FilesSidebar({
onDragLeave={() => onDragLeave(fav.path)}
onDrop={(e) => onDrop(e, fav.path)}
className={cn(
- "h-8 justify-start gap-2 px-2 text-xs font-medium [@media(pointer:coarse)]:min-h-[44px]",
- isActive &&
- "bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground",
+ "h-8 justify-start gap-2 rounded-md px-2 text-[13px] font-normal [@media(pointer:coarse)]:min-h-[44px]",
+ isActive && (windows ? "bg-accent text-accent-foreground hover:bg-accent" : "bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground"),
isDrop && "ring-2 ring-primary ring-inset",
)}
>
- <Icon className="size-4 shrink-0" />
+ <Icon className={cn("size-4 shrink-0", !isActive && (windows ? "text-warning" : "text-info"))} />
<span className="truncate">{fav.label}</span>
</Button>
);
@@ -99,7 +101,7 @@ export function FilesSidebar({
)}
>
<Trash2 className="size-4 shrink-0" />
- <span className="truncate">Trash</span>
+ <span className="truncate">{windows ? "Recycle Bin" : "Trash"}</span>
</Button>
<Button
variant="ghost"
@@ -116,11 +118,11 @@ export function FilesSidebar({
<div className="my-1 h-px bg-border" />
<FileTree
rootPath="~"
- rootLabel="Tree"
+ rootLabel={windows ? "Folders" : "Locations"}
activePath={path}
onSelectDir={onNavigate}
onOpenFile={onOpenFile}
- className="min-h-0 flex-1"
+ className="min-h-0 flex-1 px-1"
/>
<div className="space-y-1.5 border-t border-border p-3">
<p className="text-[10px] font-semibold text-muted-foreground">Storage</p>
diff --git a/frontend/slices/files-manager/components/files-toolbar.tsx b/frontend/slices/files-manager/components/files-toolbar.tsx
index b7333002..60268cdf 100644
--- a/frontend/slices/files-manager/components/files-toolbar.tsx
+++ b/frontend/slices/files-manager/components/files-toolbar.tsx
@@ -1,13 +1,12 @@
-import { type DragEvent } from "react";
-import { ChevronRight, PanelLeft, Plus, Upload, Download, FolderUp, FileUp, LayoutGrid, List, ArrowUpDown, ClipboardPaste, Search } from "lucide-react";
+import { ChevronRight, PanelLeft, Plus, Download, FolderUp, FileUp, LayoutGrid, List, ClipboardPaste, Search } from "lucide-react";
import { Button } from "@/components/ui/button";
-import { Separator } from "@/components/ui/separator";
+import { DesktopFilesToolbar, type FilesToolbarProps } from "./desktop-files-toolbar";
import {
DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem,
} from "@/components/ui/dropdown-menu";
import { cn } from "@/lib/utils";
import { FileCrumbs } from "./file-crumbs";
-import type { SortKey, ViewMode } from "../lib/types";
+import type { SortKey } from "../lib/types";
const SORTS: { key: SortKey; label: string }[] = [
{ key: "name", label: "Name" },
@@ -15,33 +14,7 @@ const SORTS: { key: SortKey; label: string }[] = [
{ key: "kind", label: "Kind" },
];
-export function FilesToolbar(props: {
- path: string;
- canBack: boolean;
- canForward: boolean;
- view: ViewMode;
- sort: SortKey;
- hasClipboard: boolean;
- onBack: () => void;
- onForward: () => void;
- onNavigate: (path: string) => void;
- onView: (v: ViewMode) => void;
- onSort: (s: SortKey) => void;
- onNewFolder: () => void;
- onUpload: () => void;
- onUploadFolder: () => void;
- onPaste: () => void;
- onOpenSidebar: () => void;
- selectedCount: number;
- onDownload: () => void;
- dropTarget: string | null;
- onCrumbDragOver: (e: DragEvent, dest: string) => void;
- onCrumbDragLeave: (dest: string) => void;
- onCrumbDrop: (e: DragEvent, dest: string) => void;
- onToggleSearch: () => void;
- searchOpen?: boolean;
- ios?: boolean;
-}) {
+export function FilesToolbar(props: FilesToolbarProps) {
// iOS Files: a slim bar — tint back chevron + path + iOS grid/list segment +
// a single "+" overflow menu (New/Upload/Paste/Download/Sort), instead of the
// dense desktop cluster. Data flow is unchanged; only the chrome is adapted.
@@ -101,98 +74,5 @@ export function FilesToolbar(props: {
</div>
);
}
- return (
- <div className="flex h-11 items-center gap-2 border-b border-border px-2">
- {/* Drawer toggle — only when the inline rail is hidden (narrow). */}
- <Button
- variant="ghost"
- size="icon"
- onClick={props.onOpenSidebar}
- aria-label="Open sidebar"
- className="hidden size-7 shrink-0 @max-[600px]:inline-flex [@media(pointer:coarse)]:size-9"
- >
- <PanelLeft className="size-4" />
- </Button>
- <div className="flex items-center gap-0.5">
- <Button variant="ghost" size="icon" disabled={!props.canBack} onClick={props.onBack} aria-label="Previous folder" className="size-7 [@media(pointer:coarse)]:size-9">
- <ChevronRight className="size-4 rotate-180" />
- </Button>
- <Button variant="ghost" size="icon" disabled={!props.canForward} onClick={props.onForward} aria-label="Forward" className="size-7 [@media(pointer:coarse)]:size-9">
- <ChevronRight className="size-4" />
- </Button>
- </div>
- <Separator orientation="vertical" className="h-5" />
- <FileCrumbs
- path={props.path}
- dropTarget={props.dropTarget}
- onNavigate={props.onNavigate}
- onDragOver={props.onCrumbDragOver}
- onDragLeave={props.onCrumbDragLeave}
- onDrop={props.onCrumbDrop}
- />
- <div className="flex items-center rounded-md bg-secondary p-0.5">
- <Button variant="ghost" size="icon" aria-label="Grid view" onClick={() => props.onView("grid")} className={cn("size-6 [@media(pointer:coarse)]:size-9", props.view === "grid" && "bg-background shadow-sm")}>
- <LayoutGrid className="size-3.5" />
- </Button>
- <Button variant="ghost" size="icon" aria-label="List view" onClick={() => props.onView("list")} className={cn("size-6 [@media(pointer:coarse)]:size-9", props.view === "list" && "bg-background shadow-sm")}>
- <List className="size-3.5" />
- </Button>
- </div>
- <Button variant="ghost" size="icon" aria-label="Search" onClick={props.onToggleSearch} className={cn("size-7 [@media(pointer:coarse)]:size-9", props.searchOpen && "bg-secondary")}>
- <Search className="size-3.5" />
- </Button>
- <DropdownMenu>
- <DropdownMenuTrigger asChild>
- <Button variant="ghost" size="icon" aria-label="Sort" className="size-7 [@media(pointer:coarse)]:size-9">
- <ArrowUpDown className="size-3.5" />
- </Button>
- </DropdownMenuTrigger>
- <DropdownMenuContent align="end">
- {SORTS.map((s) => (
- <DropdownMenuItem key={s.key} onSelect={() => props.onSort(s.key)} className={cn(props.sort === s.key && "text-primary")}>
- {s.label}
- </DropdownMenuItem>
- ))}
- </DropdownMenuContent>
- </DropdownMenu>
- {props.hasClipboard && (
- <Button variant="ghost" size="sm" className="h-7 gap-1.5 px-2 text-xs [@media(pointer:coarse)]:h-9 [@media(pointer:coarse)]:min-w-9" onClick={props.onPaste}>
- <ClipboardPaste className="size-3.5" />
- <span className="@max-[430px]:hidden">Paste</span>
- </Button>
- )}
- <Button variant="outline" size="sm" className="h-7 gap-1.5 px-2 text-xs [@media(pointer:coarse)]:h-9 [@media(pointer:coarse)]:min-w-9" onClick={props.onNewFolder}>
- <Plus className="size-3.5" />
- <span className="@max-[430px]:hidden">New</span>
- </Button>
- {props.selectedCount > 0 && (
- <Button
- variant="ghost"
- size="sm"
- className="h-7 gap-1.5 px-2 text-xs [@media(pointer:coarse)]:h-9 [@media(pointer:coarse)]:min-w-9"
- onClick={props.onDownload}
- aria-label={`Download ${props.selectedCount} selected`}
- >
- <Download className="size-3.5" />
- <span className="@max-[430px]:hidden">Download</span>
- </Button>
- )}
- <DropdownMenu>
- <DropdownMenuTrigger asChild>
- <Button variant="secondary" size="sm" className="h-7 gap-1.5 px-2 text-xs [@media(pointer:coarse)]:h-9 [@media(pointer:coarse)]:min-w-9">
- <Upload className="size-3.5" />
- <span className="@max-[430px]:hidden">Upload</span>
- </Button>
- </DropdownMenuTrigger>
- <DropdownMenuContent align="end">
- <DropdownMenuItem onSelect={props.onUpload}>
- <FileUp className="size-3.5" /> Upload Files…
- </DropdownMenuItem>
- <DropdownMenuItem onSelect={props.onUploadFolder}>
- <FolderUp className="size-3.5" /> Upload Folder…
- </DropdownMenuItem>
- </DropdownMenuContent>
- </DropdownMenu>
- </div>
- );
+ return <DesktopFilesToolbar {...props} />;
}
diff --git a/frontend/slices/files-manager/hooks/use-file-commands.ts b/frontend/slices/files-manager/hooks/use-file-commands.ts
index ce09c09f..bf642d7a 100644
--- a/frontend/slices/files-manager/hooks/use-file-commands.ts
+++ b/frontend/slices/files-manager/hooks/use-file-commands.ts
@@ -1,7 +1,7 @@
"use client";
import { useCallback, useState, type KeyboardEvent, type MouseEvent } from "react";
-import { openWindow, saveAs, toast } from "@/features/appshell";
+import { inEditable, useActiveShell, openWindow, saveAs, toast } from "@/features/appshell";
import { rawUrl, zipUrl, type FsEntry } from "../lib/host";
import { appForFile, mediaKind } from "../lib/icons";
import { joinPath, parentPath } from "../lib/format";
@@ -13,6 +13,7 @@ import type { ContextState } from "../lib/types";
// + selection. Keeps app.tsx focused on layout. `del` moves to Trash from a
// normal dir but hard-deletes (with confirm) when already inside Trash.
export function useFileCommands(fs: UseFiles, sel: UseFileSelection) {
+ const windows = useActiveShell().id === "windows";
const [renaming, setRenaming] = useState<string | null>(null);
const [ctx, setCtx] = useState<ContextState | null>(null);
// Pending zip awaiting the exclude-heavy-dirs dialog (folder/multi-dir only).
@@ -96,13 +97,7 @@ export function useFileCommands(fs: UseFiles, sel: UseFileSelection) {
const cut = useCallback((names: string[]) => fs.setClip({ mode: "cut", names, from: fs.path }), [fs]);
const copy = useCallback((names: string[]) => fs.setClip({ mode: "copy", names, from: fs.path }), [fs]);
- // Download via a hidden <a download> — the browser's native download manager
- // owns the progress (streaming bytes through JS just to draw a bar would buffer
- // it all in RAM). One plain file → its raw bytes; pure multi-file → a streamed
- // zip straight away; anything containing a FOLDER → open the exclude dialog first
- // (heavy dirs like node_modules can dwarf the archive). All routes are cookie-
- // authed same-origin. A toast acknowledges the start (the click is fire-and-forget
- // — no completion event from <a download>).
+ // Native downloads stream directly; folder selections first confirm zip exclusions.
const download = useCallback(
(names: string[]) => {
const items = names.filter(Boolean);
@@ -181,7 +176,7 @@ export function useFileCommands(fs: UseFiles, sel: UseFileSelection) {
const onKey = useCallback(
(e: KeyboardEvent) => {
- if (renaming) return;
+ if (renaming || inEditable(e.target) || (e.target as HTMLElement).closest("button:not([data-name])")) return;
const mod = e.metaKey || e.ctrlKey;
const names = [...sel.selected];
if (mod && e.key === "a") {
@@ -190,7 +185,12 @@ export function useFileCommands(fs: UseFiles, sel: UseFileSelection) {
} else if (mod && e.key === "c" && names.length) copy(names);
else if (mod && e.key === "x" && names.length) cut(names);
else if (mod && e.key === "v") fs.paste();
- else if (e.key === "Enter" && names.length === 1) setRenaming(names[0]);
+ else if ((e.key === "F2" || (!windows && e.key === "Enter")) && names.length === 1) { e.preventDefault(); setRenaming(names[0]); }
+ else if (windows && e.key === "Enter" && names.length === 1) {
+ e.preventDefault();
+ const entry = fs.entries?.find((x) => x.name === names[0]);
+ if (entry) open(entry);
+ }
else if (e.key === " " && names.length === 1) {
// Quick Look, the macOS binding — and the one the context menu advertises.
// preventDefault or the space scrolls the list under the window.
@@ -198,6 +198,7 @@ export function useFileCommands(fs: UseFiles, sel: UseFileSelection) {
const entry = fs.entries?.find((x) => x.name === names[0]);
if (entry) preview(entry);
}
+ else if (windows && e.key === "Backspace") { e.preventDefault(); fs.goBack(); sel.clear(); }
else if ((e.key === "Backspace" || e.key === "Delete") && names.length) {
e.preventDefault();
del(names);
@@ -206,7 +207,7 @@ export function useFileCommands(fs: UseFiles, sel: UseFileSelection) {
fs.setClip(null);
}
},
- [copy, cut, del, fs, preview, renaming, sel],
+ [copy, cut, del, fs, open, preview, renaming, sel, windows],
);
return {
diff --git a/frontend/slices/files-manager/index.ts b/frontend/slices/files-manager/index.ts
index 5b3d5b8c..14dda860 100644
--- a/frontend/slices/files-manager/index.ts
+++ b/frontend/slices/files-manager/index.ts
@@ -6,9 +6,10 @@ import type { AppDescriptor } from "@/features/appshell";
export const filesManagerApp: AppDescriptor = {
id: "files-manager",
title: "Files",
+ shellTitles: { macos: "Finder", windows: "File Explorer" },
icon: FolderOpen,
gradient: "linear-gradient(160deg,#3b9bff,#2f6fe0)",
load: () => import("./app"),
- defaultSize: { w: 760, h: 520 },
+ defaultSize: { w: 960, h: 620 },
multi: true,
};
diff --git a/frontend/slices/files-manager/lib/format.test.ts b/frontend/slices/files-manager/lib/format.test.ts
index 52414ee4..b1eb55f2 100644
--- a/frontend/slices/files-manager/lib/format.test.ts
+++ b/frontend/slices/files-manager/lib/format.test.ts
@@ -98,6 +98,10 @@ describe("parentPath", () => {
});
describe("crumbsFor", () => {
+ it("preserves home-relative navigation instead of inventing /~", () => {
+ expect(crumbsFor("~")).toEqual([{ name: "Home", path: "~" }]);
+ expect(crumbsFor("~/projects/app")).toEqual([{ name: "Home", path: "~" }, { name: "projects", path: "~/projects" }, { name: "app", path: "~/projects/app" }]);
+ });
it("root path → single crumb [root]", () => {
expect(crumbsFor("/")).toEqual([{ name: "mso", path: "/" }]);
});
diff --git a/frontend/slices/files-manager/lib/format.ts b/frontend/slices/files-manager/lib/format.ts
index a4bc38b9..d6875cf8 100644
--- a/frontend/slices/files-manager/lib/format.ts
+++ b/frontend/slices/files-manager/lib/format.ts
@@ -20,6 +20,10 @@ export { joinPath, parentPath, baseName } from "@/lib/path";
// Breadcrumb segments for a path, including the synthetic root.
export function crumbsFor(path: string, root = "mso"): { name: string; path: string }[] {
+ if (path === "~" || path.startsWith("~/")) {
+ const parts = path.slice(2).split("/").filter(Boolean);
+ return [{ name: "Home", path: "~" }, ...parts.map((name, i) => ({ name, path: "~/" + parts.slice(0, i + 1).join("/") }))];
+ }
const head = { name: root, path: "/" };
if (path === "/") return [head];
const parts = path.split("/").filter(Boolean);
diff --git a/frontend/slices/os-settings/components/appearance-section.tsx b/frontend/slices/os-settings/components/appearance-section.tsx
index 6c8667fe..ffc4a5eb 100644
--- a/frontend/slices/os-settings/components/appearance-section.tsx
+++ b/frontend/slices/os-settings/components/appearance-section.tsx
@@ -55,10 +55,12 @@ function ChoiceCard({
}
function WallpaperPreview({ wallpaper, custom }: { wallpaper: Wallpaper; custom: ImageValue | null }) {
+ const { id, surface } = useActiveShell();
+ const preset = wallpaper === "auto" ? shellsForSurface(surface).find((shell) => shell.id === id)?.wallpaper ?? "aurora" : wallpaper;
if (custom) {
- return <span className="block h-16 rounded-xl bg-cover bg-center ring-1 ring-border" style={imageStyle(custom)} />;
+ return <span className="block h-16 w-28 shrink-0 rounded-xl bg-cover bg-center ring-1 ring-border" style={imageStyle(custom)} />;
}
- return <span className={cn("block h-16 rounded-xl ring-1 ring-border", `wp-${wallpaper}`)} />;
+ return <span className={cn("block h-16 w-28 shrink-0 rounded-xl ring-1 ring-border", `wp-${preset}`)} />;
}
export function AppearanceSection() {
diff --git a/frontend/slices/os-settings/components/nav.tsx b/frontend/slices/os-settings/components/nav.tsx
index 31ca82b0..4b43fb0d 100644
--- a/frontend/slices/os-settings/components/nav.tsx
+++ b/frontend/slices/os-settings/components/nav.tsx
@@ -1,7 +1,11 @@
"use client";
+import { useState } from "react";
+import { Search, Monitor } from "lucide-react";
+import { Input } from "@/components/ui/input";
+import { Button } from "@/components/ui/button";
import { cn } from "@/lib/utils";
-import { SECTIONS, type SectionId } from "../lib/sections";
+import { filterSettingsSections, groupSettingsSections, SECTIONS, type SectionId } from "../lib/sections";
export type { SectionId } from "../lib/sections";
@@ -23,22 +27,38 @@ export function SettingsTabs({ active, onSelect }: { active: SectionId; onSelect
);
}
-export function SettingsSidebar({ active, onSelect }: { active: SectionId; onSelect: (id: SectionId) => void }) {
+export function SettingsSidebar({ active, onSelect, windows = false }: { active: SectionId; onSelect: (id: SectionId) => void; windows?: boolean }) {
+ const [query, setQuery] = useState("");
+ const groups = groupSettingsSections(filterSettingsSections(query));
return (
- <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={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 }}>
- <Icon className="size-[15px] text-white" />
- </span>
- <span className="min-w-0 flex-1 truncate">{label}</span>
- </button>
- );
- })}
- </nav>
+ <div className="flex h-full min-h-0 flex-col">
+ <div className={cn("space-y-4 px-3 pb-3 pt-5", windows && "px-4")}>
+ <Button variant="ghost" onClick={() => onSelect("about")} className="h-auto w-full justify-start gap-3 px-1 py-2 text-left">
+ <span className={cn("grid size-11 shrink-0 place-items-center bg-secondary", windows ? "rounded-full" : "rounded-xl")}><Monitor className="size-6 text-muted-foreground" /></span>
+ <span><span className="block text-sm font-semibold">MSO</span><span className="block text-xs font-normal text-muted-foreground">{windows ? "Settings" : "System Settings"}</span></span>
+ </Button>
+ <div className="relative">
+ <Search className="pointer-events-none absolute left-2.5 top-2.5 size-3.5 text-muted-foreground" />
+ <Input aria-label="Find a setting" placeholder={windows ? "Find a setting" : "Search"} value={query} onChange={(e) => setQuery(e.target.value)} className={cn("h-9 bg-background/70 pl-8 text-xs", windows ? "rounded-md border-b-2" : "rounded-lg")} />
+ </div>
+ </div>
+ <nav aria-label="Settings sections" data-slot={windows ? "settings-windows-sidebar" : "settings-macos-sidebar"} className="min-h-0 flex-1 space-y-3 overflow-y-auto px-2 pb-4">
+ {groups.map((group) => <div key={group[0].group} className="space-y-0.5">
+ <p className="px-2 pb-1 text-[11px] font-medium text-muted-foreground">{({ personalization: "Personalization", services: "Apps & connections", system: "System" })[group[0].group]}</p>
+ {group.map(({ id, label, icon: Icon, color, blurb }) => {
+ const on = id === active;
+ return <Button key={id} variant="ghost" aria-current={on ? "page" : undefined} title={blurb} onClick={() => onSelect(id)}
+ className={cn("relative h-auto min-h-9 w-full justify-start gap-2.5 rounded-md px-2 py-1.5 text-left text-[13px] font-normal", on ? windows ? "bg-accent text-accent-foreground hover:bg-accent" : "bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground" : "text-foreground hover:bg-accent")}>
+ {windows && on && <span className="absolute left-0 h-4 w-[3px] rounded-full bg-primary" />}
+ <span className={cn("grid shrink-0 place-items-center", windows ? "size-7" : "size-[25px] rounded-md shadow-sm")} style={windows ? undefined : { background: color }}>
+ <Icon className={cn("size-4", !windows && "text-white")} />
+ </span>
+ <span className="min-w-0 flex-1 truncate">{label}</span>
+ </Button>;
+ })}
+ </div>)}
+ {!groups.length && <p role="status" className="px-2 py-4 text-xs text-muted-foreground">No settings found.</p>}
+ </nav>
+ </div>
);
}
diff --git a/frontend/slices/os-settings/components/sections.tsx b/frontend/slices/os-settings/components/sections.tsx
index 52fbfe10..3bb4ebc0 100644
--- a/frontend/slices/os-settings/components/sections.tsx
+++ b/frontend/slices/os-settings/components/sections.tsx
@@ -112,7 +112,7 @@ export function SectionDetail({
<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"
+ className={cn("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", shellId === "windows" && "sm:px-7 sm:pt-7")}
>
{showHeading && meta && (
<header className="space-y-0.5">
@@ -120,8 +120,8 @@ export function SectionDetail({
className={cn(
"leading-tight",
shellId === "macos"
- ? "text-[22px] font-bold tracking-tight"
- : "text-sm font-semibold",
+ ? "text-xl font-semibold tracking-tight"
+ : shellId === "windows" ? "text-[28px] font-semibold tracking-tight" : "text-sm font-semibold",
)}
>
{meta.label}
diff --git a/frontend/slices/os-settings/components/settings-shell.tsx b/frontend/slices/os-settings/components/settings-shell.tsx
index 5a03c768..4bf258dd 100644
--- a/frontend/slices/os-settings/components/settings-shell.tsx
+++ b/frontend/slices/os-settings/components/settings-shell.tsx
@@ -1,6 +1,9 @@
"use client";
-import { AppFrame, usePublishMobileNavigation, useShellDesign } from "@/features/appshell";
+import { useState } from "react";
+import { PanelLeft } from "lucide-react";
+import { Button } from "@/components/ui/button";
+import { AppSidebar, AppFrame, usePublishMobileNavigation, useShellDesign } from "@/features/appshell";
import type { SectionId } from "../lib/sections";
import { settingsSection } from "../lib/sections";
import { SettingsSidebar, SettingsTabs } from "./nav";
@@ -10,6 +13,7 @@ import { AndroidSettingsIndex } from "./android-settings";
export function SettingsShell({ active, onSelect }: { active: SectionId | null; onSelect: (id: SectionId | null) => void }) {
const design = useShellDesign();
+ const [sidebarOpen, setSidebarOpen] = useState(false);
const detail = active ? settingsSection(active) : null;
const mobile = design.mobileNavigation !== "none";
@@ -36,16 +40,19 @@ export function SettingsShell({ active, onSelect }: { active: SectionId | null;
}
const desktopActive: SectionId = active ?? "appearance";
- if (design.settingsNavigation === "macos-sidebar") {
+ if (design.settingsNavigation === "macos-sidebar" || design.settingsNavigation === "windows-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>
+ <div className="flex h-full min-h-0 bg-muted/30">
+ <AppSidebar open={sidebarOpen} onOpenChange={setSidebarOpen} title="Settings sections"
+ railClassName={design.id === "windows" ? "w-64 border-r-0 bg-[var(--mica-win,var(--sidebar))]" : "w-56 bg-sidebar/70"}>
+ <SettingsSidebar windows={design.id === "windows"} active={desktopActive} onSelect={(id) => { onSelect(id); setSidebarOpen(false); }} />
+ </AppSidebar>
+ <AppFrame className="min-w-0 flex-1" toolbar={<div className="hidden border-b border-border p-1 @max-[600px]:block">
+ <Button variant="ghost" size="sm" onClick={() => setSidebarOpen(true)}><PanelLeft className="size-4" /> Settings sections</Button>
+ </div>}>
+ <SectionDetail id={desktopActive} />
+ </AppFrame>
+ </div>
);
}
diff --git a/frontend/slices/os-settings/index.ts b/frontend/slices/os-settings/index.ts
index f45b6fdb..8beb4428 100644
--- a/frontend/slices/os-settings/index.ts
+++ b/frontend/slices/os-settings/index.ts
@@ -6,8 +6,9 @@ import type { AppDescriptor } from "@/features/appshell";
export const osSettingsApp: AppDescriptor = {
id: "os-settings",
title: "Settings",
+ shellTitles: { macos: "System Settings", windows: "Settings" },
icon: Settings,
gradient: "linear-gradient(160deg,#8a8f99,#5b6068)",
load: () => import("./app"),
- defaultSize: { w: 840, h: 600 },
+ defaultSize: { w: 960, h: 660 },
};
diff --git a/frontend/slices/shell-settings/components/row.tsx b/frontend/slices/shell-settings/components/row.tsx
index 0772e334..4006cc6e 100644
--- a/frontend/slices/shell-settings/components/row.tsx
+++ b/frontend/slices/shell-settings/components/row.tsx
@@ -20,13 +20,13 @@ export function SettingsRow({
<div
data-slot="settings-row"
className={cn(
- "relative flex min-h-[46px] flex-col gap-2 px-4 py-[11px] sm:flex-row sm:items-center sm:justify-between",
+ "relative flex min-h-[46px] flex-col gap-2 px-4 py-[11px] @min-[600px]:flex-row @min-[600px]:items-center @min-[600px]:justify-between",
"after:absolute after:inset-x-0 after:bottom-0 after:left-4 after:h-px after:bg-border/60 last:after:hidden",
className,
)}
>
<span data-slot="settings-row-label" className="text-sm text-foreground">{label}</span>
- <div className="min-w-0 w-full sm:w-auto sm:shrink-0">{children}</div>
+ <div className="min-w-0 w-full @min-[600px]:w-auto @min-[600px]:shrink-0">{children}</div>
</div>
);
}
diff --git a/lib/config/env-example.test.ts b/lib/config/env-example.test.ts
index f1cd829e..0111fbe3 100644
--- a/lib/config/env-example.test.ts
+++ b/lib/config/env-example.test.ts
@@ -43,6 +43,9 @@ const NOT_A_KNOB: Record<string, string> = {
WATCHDOG_USEC: "systemd's",
// Test + tooling only, never part of a deployment.
E2E_BASE_URL: "test harness",
+ MSO_SCREENSHOT_DIR: "injected per-session artifact staging path for browser tooling; never persistent app configuration",
+ E2E_DEMO: "desktop browser harness only: preview has no authentication; never production configuration",
+ E2E_CAPTURE_ONLY: "desktop browser harness only: capture baseline before native behavior assertions",
CHROME_PATH: "MCP Page browser contract harness executable override, not production configuration",
E2E_PASSWORD: "test harness",
E2E_DEVICE: "test harness",
diff --git a/scripts/e2e/desktop-native.mjs b/scripts/e2e/desktop-native.mjs
new file mode 100644
index 00000000..53b134b5
--- /dev/null
+++ b/scripts/e2e/desktop-native.mjs
@@ -0,0 +1,114 @@
+#!/usr/bin/env node
+// Native desktop acceptance: real navigation/search, taskbar reuse, narrow windows.
+// E2E_BASE_URL=http://127.0.0.1:4173 E2E_DEMO=1 node scripts/e2e/desktop-native.mjs
+import assert from "node:assert/strict";
+import { createRequire } from "node:module";
+import { readFileSync, mkdirSync } from "node:fs";
+import os from "node:os";
+import path from "node:path";
+
+const require = createRequire(import.meta.url);
+const { chromium } = require(path.join(process.cwd(), "os-browser/node_modules/playwright"));
+const base = process.env.E2E_BASE_URL ?? "http://127.0.0.1:4005";
+const demo = process.env.E2E_DEMO === "1";
+const captureOnly = process.env.E2E_CAPTURE_ONLY === "1";
+const out = process.env.MSO_SCREENSHOT_DIR ?? path.join(os.tmpdir(), "mso-desktop-native");
+mkdirSync(out, { recursive: true, mode: 0o700 });
+let device, cookie;
+if (!demo) {
+ const env = readFileSync(".env.local", "utf8");
+ const password = /^OS_LOGIN_PASSWORD=(.*)$/m.exec(env)?.[1]?.trim().replace(/^["']|["']$/g, "");
+ const devices = JSON.parse(readFileSync(process.env.OS_DEVICE_STORE ?? path.join(os.homedir(), ".mso/auth-devices.json"), "utf8")).approved;
+ device = Object.keys(devices).find((id) => devices[id].role === "owner") ?? Object.keys(devices)[0];
+ assert(device, "An approved device is required");
+ const r = await fetch(base + "/api/auth/login", { method: "POST", headers: { "content-type": "application/json", origin: base }, body: JSON.stringify({ password, deviceId: device, deviceLabel: "desktop-native-e2e" }) });
+ assert(r.ok, "Authentication failed: " + r.status);
+ cookie = /(?:^|,\s*)session=([^;]+)/.exec(r.headers.get("set-cookie") ?? "")?.[1];
+ assert(cookie, "Missing authenticated session");
+}
+const browser = await chromium.launch({ headless: true, executablePath: "/usr/bin/google-chrome", args: ["--no-sandbox"] });
+try {
+ for (const shell of ["windows", "macos"]) {
+ const ctx = await browser.newContext({ viewport: { width: 1440, height: 1000 } });
+ if (cookie) await ctx.addCookies([{ name: "session", value: cookie, url: base, sameSite: "Strict" }]);
+ await ctx.addInitScript(({ shell, device }) => {
+ localStorage.setItem("sv:shell", JSON.stringify({ desktop: shell, mobile: "ios" }));
+ localStorage.setItem("mso:onboarding:v1", "done");
+ if (device) localStorage.setItem("mso.device.id", device);
+ }, { shell, device });
+ const page = await ctx.newPage();
+ const errors = [];
+ page.on("pageerror", (e) => errors.push(e.message));
+ await page.goto(base + "/files", { waitUntil: "networkidle", timeout: 90000 });
+ await page.waitForSelector('#main-content[data-shell="' + shell + '"]');
+ if (!demo) assert.equal(await page.evaluate(async () => (await (await fetch("/api/auth/me")).json()).authenticated), true);
+ const files = page.locator('[data-window]').last();
+ await files.locator("[data-name]").first().waitFor({ timeout: 30000 });
+ await page.screenshot({ path: path.join(out, shell + "-files-" + (captureOnly ? "before" : "after") + ".png") });
+ if (!captureOnly) {
+ const nativeFiles = page.locator('[data-app="files-manager"]');
+ assert.equal(await nativeFiles.count(), 1);
+ await nativeFiles.getByLabel("Search this folder").fill("___no_matching_files___");
+ await nativeFiles.getByText("No matching files", { exact: true }).waitFor();
+ await nativeFiles.getByLabel("Clear search").click();
+ await nativeFiles.locator("[data-name]").first().waitFor();
+ await nativeFiles.getByRole("button", { name: "List view", exact: true }).click();
+ await nativeFiles.getByRole("button", { name: "Grid view", exact: true }).click();
+ assert.equal(await nativeFiles.getByRole("button", { name: "Grid view", exact: true }).getAttribute("aria-pressed"), "true");
+ const firstItem = nativeFiles.locator("[data-name]").first();
+ await firstItem.click();
+ await page.keyboard.press(shell === "windows" ? "F2" : "Enter");
+ await firstItem.locator("input").waitFor();
+ await page.keyboard.press("Escape");
+ if (shell === "windows") {
+ const pin = page.locator('button[aria-label="File Explorer"]');
+ await pin.click();
+ await nativeFiles.waitFor({ state: "hidden" });
+ await pin.click();
+ await nativeFiles.waitFor({ state: "visible" });
+ assert.equal(await nativeFiles.count(), 1, "Taskbar must restore the same Files window");
+ }
+ // Resizing via the shared window handle must reveal the sidebar drawer affordance.
+ const box = await nativeFiles.boundingBox();
+ await page.mouse.move(box.x + box.width - 10, box.y + box.height - 10);
+ await page.mouse.down();
+ await page.mouse.move(box.x + 520, box.y + box.height - 10, { steps: 12 });
+ await page.mouse.up();
+ await nativeFiles.getByRole("button", { name: "Open sidebar", exact: true }).waitFor();
+ await page.screenshot({ path: path.join(out, shell + "-files-narrow.png") });
+ }
+ await page.goto(base + "/settings", { waitUntil: "networkidle", timeout: 90000 });
+ const settings = page.locator('[data-window]').last();
+ await settings.getByText("Appearance", { exact: true }).last().waitFor();
+ await page.screenshot({ path: path.join(out, shell + "-settings-" + (captureOnly ? "before" : "after") + ".png") });
+ if (!captureOnly) {
+ const nativeSettings = page.locator('[data-app="os-settings"]');
+ const search = nativeSettings.getByRole("textbox", { name: "Find a setting" });
+ await search.fill("theme");
+ await nativeSettings.getByRole("navigation", { name: "Settings sections" }).getByRole("button", { name: "Theme", exact: true }).click();
+ await nativeSettings.getByRole("heading", { name: "Theme", exact: true }).waitFor();
+ await search.fill("___unknown___");
+ await nativeSettings.getByText("No settings found.", { exact: true }).waitFor();
+ await search.fill("");
+ const nav = nativeSettings.getByRole("navigation", { name: "Settings sections" });
+ assert.equal(await nav.getByRole("button").count(), 11);
+ await nav.getByRole("button", { name: "Appearance", exact: true }).click();
+ const b = await nativeSettings.boundingBox();
+ await page.mouse.move(b.x + b.width - 10, b.y + b.height - 10);
+ await page.mouse.down();
+ await page.mouse.move(b.x + 520, b.y + b.height - 10, { steps: 12 });
+ await page.mouse.up();
+ assert((await nativeSettings.boundingBox()).width < 600, "Settings resized below 600px");
+ await page.screenshot({ path: path.join(out, shell + "-settings-narrow.png") });
+ await nativeSettings.getByRole("button", { name: "Settings sections", exact: true }).click();
+ await page.getByRole("dialog").getByRole("textbox", { name: "Find a setting" }).waitFor();
+ await page.keyboard.press("Escape");
+ await page.getByRole("dialog").waitFor({ state: "hidden" });
+ assert(await nativeSettings.locator('[data-slot="settings-row"]').evaluateAll((rows) => rows.every((r) => r.scrollWidth <= r.clientWidth + 1)), "Settings rows must fit the narrow pane");
+ await page.screenshot({ path: path.join(out, shell + "-settings-narrow.png") });
+ }
+ assert.deepEqual(errors, [], shell + " browser errors");
+ console.log("PASS " + shell + ": " + (captureOnly ? "baseline captured" : "Files search/view, taskbar, Settings search/navigation, narrow layouts"));
+ await ctx.close();
+ }
+} finally { await browser.close(); }