Make your computer a home for your AI partner. Avibe is the local-first Agent OS: Vibey, its built-in AI partner, works out of the box, and Claude Code, Codex & OpenCode run unchanged beside it — reach them from your browser, phone, or any chat app.
Apps Layer v2 — Windowing Redesign
Background
The Apps layer v1 (File Browser + Terminal, PR #659) shipped as full-page routes
with an invented sidebar treatment. On review the owner asked for a major UX/UI rework:
apps should behave like a real OS — open in draggable, resizable, multi-instance
windows managed by a Dock. Design was done and LOCKED in design.pen
(canonical frame: Apps · Dock on REAL Workbench, id NbPMq).
Hard rule learned during design: base everything on the REAL current layout
(ui/src/components/AppShell.tsx, workbench/WorkbenchSidebar.tsx, workbench/ChatPage.tsx,
workbench/Composer.tsx) — not an imagined one.
Goal
Turn Files / Terminal / Editor into windowed OS-style apps with a unified Dock, and
upgrade the editor to the Monaco (VS Code) kernel, without regressing the existing
backend (/api/files/*, terminal WS) shipped in #659.
Locked design
- Windowing. A reusable
<AppWindow>(Mac chrome: traffic lights close/min/max, centered title, rounded + drop-shadow) that is draggable (titlebar), resizable (edges/corner), maximizable, focus-to-raise (z-order), minimizable. AWindowManagercontext owns the open-window list, z-order, focus, min/restore, and per-app multi-instance. Windows render in a portal layer above the workbench main area (not over the sidebar). Bounds clamp to the viewport. - Dock = unified launcher + window manager. One surface = pinned app list +
running indicators (dot under icon) + minimized-window thumbnails (right of a
divider, click to restore). Anchored bottom-LEFT, rises ABOVE the bottom-left
"Apps" button (clear of the centered Chat composer). Interaction:
hover Apps = transient preview float; click Apps = pin/unpin toggle. Reuse the
existing hover-popover pattern (
InboxHoverPopover) for the hover/close-delay. - Sidebar bottom (in
AppShell.tsx, real layout): replace the single[AppsLauncher][dot][VersionBadge]row with row 1 = [Apps (LEFT) | 设置 (right)] two buttons, row 2 = [VersionBadge … green run-dot]. Apps stays left (Dock anchor); the oldAppsLauncherpopover is superseded by the Dock. Keep the "Open Control Panel" mode-switch link below. 设置 button = the control-panel / settings entry. - Terminal app (port
AppsTerminalPage/TerminalViewinto a window body): full-width xterm (v1 squished-strip bug is gone once it fills the window), session tabs,tmux·persistentbadge, accessory key bar. Backend unchanged. - File Browser app (port
AppsFileBrowserPage): Finder-like list (type icon + size + modified + selection), favorites/projects rail, toolbar New File + New Folder + breadcrumbs + search + status bar. (New File already added backend-side? verify; v1 had New Folder only.) - Editor = Monaco (VS Code kernel). Replaces the CodeMirror look in
FileEditorPane.- Lazy-load:
React.lazy(() => import(...Monaco...))so Monaco is NOT in the main bundle — it loads only when an Editor window opens. Usevite-plugin-monaco-editorto trim language workers to what we support. Self-host (Avibe serves UI from the user's machine — local transfer, no CDN). - Caching: content-hash immutable chunks (Vite default) + a Service Worker
precache (Workbox
injectManifest,revision:null, cache-first) that warms Monaco in the background after the workbench loads → instant + offline subsequent opens. Optional: prefetch on hover of the Dock's Editor icon.cleanupOutdatedCacheson version bump. - Mobile: Monaco has no official touch support. Add a mobile UI layer = reuse the
Terminal accessory key bar (symbol keys
(){}[];Tab Esc) + explicit Copy-all / Select-all buttons + a touch-selection shim. Gate the heavy editor / show a lighter path on very small screens if needed.
- Lazy-load:
Implementation phases
- P1 — Windowing foundation.
WindowManagercontext +<AppWindow>(drag/resize/ maximize/focus/minimize) + window portal layer. Headless of any specific app (a demo body). Unit/interaction sanity. - P2 — Dock. Dock component (launcher + running + minimized thumbnails), anchored
bottom-left, hover-preview + click-pin, wired to WindowManager. Replace the sidebar
AppsLaunchertrigger; keepAppsLauncherremoval behind the Dock. - P3 — Port apps into windows. Files + Terminal bodies moved into
<AppWindow>(route → window, or keep routes as deep-links that open a window). Multi-instance. - P4 — Monaco editor. Lazy-loaded Monaco in the editor window + VS Code theme; SW
precache; mobile accessory layer. Swap
FileEditorPane's CodeMirror. - P5 — Sidebar bottom + mobile.
[Apps|设置]+[ver·dot]rows inAppShell; mobile Dock-as-bottom-bar + full-screen single app. - P6 — Polish. Minimize→Dock animation, multi-window expose, keyboard (⌘
/⌘W), empty/restore states, i18n (en/zh),npm run build` green.
Evidence layers
UI build (npm run build) per phase; reuse #659 backend tests (file browser / terminal)
unchanged; manual workbench sanity in local Incus regression; visual diff vs design.pen
NbPMq / app-window frames.
Notes
- ~95% frontend (
ui/src/**) → lead-owned per the standing split; backend reuses #659. - design.pen frames:
X7d3EvAppWindow,iwYIXTerminal,nknn2Files,dnYPxEditor,RFMRwDock states,NbPMqDock-on-real-workbench (canonical). Exports in/tmp/avibe-apps-design/.