# Web Desktop Environment Migration Plan (The "Windows" Vibe) ## 1. Project Overview & Vision We are migrating the entire UI suite to a Web Desktop Environment (WDE). The goal is to create a UI that feels like a modern, web-based operating system (inspired by Windows 95's spatial model but with modern Tailwind aesthetics like the `html3.html` prototype). **Key Principles:** - **Vanilla JS + HTMX:** We will build a custom Window Manager in Vanilla JS (`window-manager.js`) rather than relying on outdated libraries like WinBox. HTMX will handle fetching the content *inside* the windows. - **Desktop Metaphor:** A main workspace with shortcut icons (Vibe, Tasks, Chat, Terminal, Explorer, Editor, Browser, Mail, Settings). - **Taskbar:** A bottom bar showing currently open applications, allowing users to switch between them, alongside a system tray and clock. - **Dynamic Windows:** Windows must be draggable, closable, minimizable, and maintain their state. The title bar must dynamically reflect the active view. - **App Renames:** - `Mantis` is now **`Vibe`** - `Terminal` added to suite default features - `Browser` added to suite default features - `Editor` already in suite, add to default features - Note: Keep `Drive` as `Drive` (undo Explorer rename). This document provides a strictly detailed, step-by-step implementation guide so that any LLM or developer can execute it without ambiguity. --- ## 2. Architecture & File Structure ### Frontend Assets to Create: 1. `ui/desktop.html` - The main shell containing the desktop background, desktop icons, and the empty taskbar. 2. `js/window-manager.js` - The core engine. A JavaScript class responsible for DOM manipulation of windows. 3. `css/desktop.css` - Custom styles for the grid background, scrollbars, and window animations (using Tailwind as the base). ### Backend (Botserver) Updates: - **State Management:** The backend needs to track the user's open windows, their positions, and sizes if we want persistence across reloads. Otherwise, local state (localStorage) is fine for V1. - **HTMX Endpoints:** Each app (Explorer, Vibe, Chat, etc.) must expose an endpoint that returns *only* the HTML fragment for the app's body, NOT a full HTML page. - **Theme Manager:** Needs to be updated to support the new desktop color schemes (e.g., brand-500 greens, transparent glass effects). --- ## 3. Step-by-Step Implementation Guide ### PHASE 1: The Shell (Desktop & Taskbar) **Goal:** Create the static HTML structure based on `html3.html`. **Tasks:** 1. Create the main `desktop.html`. 2. Implement the `workspace-bg` and `workspace-grid` using Tailwind and SVG. 3. Add the left-side Desktop Icons. Each icon must have a `data-app-id` and `data-app-title` attribute. - Example: `
...
` 4. Create the Bottom Taskbar `