Desktop Layout

Goal

Use wide desktop screens as a workspace instead of stretching the chat timeline and singleton widgets across the full viewport.

Mobile keeps the current simple layout and widget behavior.

Target Layout

Desktop with a left dock:

┌──────────────────────┬──────────────────────────────────────┐
│ Singleton Widgets    │ Topbar: layout/status/account         │
│                      │                                      │
│ [Todos] [Files] ...  │ Timeline                             │
│                      │                                      │
│ Todo Card            │ Chatbox                              │
│ Files Card           │ Palette                              │
└──────────────────────┴──────────────────────────────────────┘

Desktop with a right dock:

┌──────────────────────────────────────┬──────────────────────┐
│ Topbar: layout/status/account         │ Singleton Widgets    │
│ Timeline                             │                      │
│ Chatbox                              │ [Todos] [Files] ...  │
│ Palette                              │ Opened widget cards  │
└──────────────────────────────────────┴──────────────────────┘

Dock hidden keeps the current main-app-only layout.

Layout Preferences

Persist desktop layout preferences in localStorage.

type DockPosition = 'left' | 'right' | 'hidden';

type LayoutPrefs = {
  dockPosition: DockPosition;
  dockResizable: boolean;
  dockWidthPx: number;
};

Default preferences:

{
  dockPosition: 'left',
  dockResizable: true,
  dockWidthPx: 400,
}

The dock applies only on desktop or wide screens. Below the desktop breakpoint, the app ignores the dock and keeps the existing mobile layout.

Layout Button

Add a desktop-only layout button in the main topbar, near account/status controls.

Clicking it opens a singleton-style layout settings card in the timeline. Changing settings updates the layout live so the user can see the result immediately.

Settings:

Dock position
Left ✓
Right
Hidden

Resizable ✓

Singleton Dock Behavior

The dock has widget buttons at the top. Multiple singleton widgets can be open at the same time.

Widget button behavior:

Widget card behavior:

Header Widget Behavior

Desktop with dock visible:

Desktop with dock hidden:

Mobile:

File Widget

The File widget button should open the singleton file widget in the dock on desktop once dock widget routing is implemented.

The file widget is a natural persistent workspace panel because users often want files visible while chatting with the bot.

Main Content Width

Once the dock exists, the main timeline/composer column can use a readable desktop width around 40rem.

Wide content will need escape hatches later, such as wide cards, full-width cards, or horizontal scrolling for logs, diffs, tables, and file views.

Implementation Phases

Phase 1: Desktop Workspace Shell

Phase 2: Dock Widget Buttons

Phase 3: Docked Singleton Cards

Phase 4: Layout Settings Singleton

Phase 5: File Widget Routing And Polish

Acceptance Criteria