| 1 | # Cascade IDE — main window layout (v1) |
| 2 | |
| 3 | Layout reference for MCP, onboarding, and agents. **Source of truth:** `Views/MainWindow.axaml` and related views (`DocumentsDockView`, `MfdShellView`). |
| 4 | |
| 5 | **UI mode:** the product ships one mode id in **`UiModes/index.toml`** — **Flight** (PFD · Forward · MFD polygon). There is **no** menu switch for legacy **Focus / Balanced / Power** presets. Family **`UiModeFamily.Flight`** and capabilities come from mode TOML; see [ADR 0010](../adr/0010-ui-modes-toml-configuration.md), [ui-modes-overview-v1.md](ui-modes-overview-v1.md), [ADR 0021](../adr/0021-pfd-mfd-cockpit-attention-model.md). |
| 6 | |
| 7 | --- |
| 8 | |
| 9 | ## 1. Overall structure |
| 10 | |
| 11 | Window: root **Grid** → **DockPanel** with **Menu** on top, then **`MainGrid`** (single work-area grid). |
| 12 | |
| 13 | **Default size:** 1000×600. Resize via window edges and **splitters** between PFD / Forward / MFD columns. |
| 14 | |
| 15 | Overlays: **CommandPalette** (`ZIndex` 5000), optional zone geometry / highlight overlays. |
| 16 | |
| 17 | --- |
| 18 | |
| 19 | ## 2. Menu (`Menu`, DockPanel.Top) |
| 20 | |
| 21 | Current items (see code): |
| 22 | |
| 23 | - **File:** open solution / folder / file, export Markdown, exit. |
| 24 | - **Debug:** F5/start, startup project, attach, stop, step over/into/out. |
| 25 | - **View:** command palette; visibility toggles for **PFD** (explorer / map per layout), **build output** (MFD page), **MFD** column, **terminal** (MFD page), **Git** (MFD page), instrumentation dock; **Theme** submenu; UI language; Markdown preview in MFD; preview in separate window. |
| 26 | - **Settings:** AI and chat parameters. |
| 27 | - **Help:** about. |
| 28 | |
| 29 | **MCP banner:** `McpBannerView` in `MainGrid` row 0 (not in the menu) when the IDE runs as an MCP server. |
| 30 | |
| 31 | --- |
| 32 | |
| 33 | ## 3. `MainGrid` grid |
| 34 | |
| 35 | **Rows:** three — `Auto`, `Auto`, `*`. |
| 36 | |
| 37 | | Row | Content | |
| 38 | | --- | --- | |
| 39 | | 0 | `McpBannerView` (when `IsMcpServerMode`) | |
| 40 | | 1 | **`TaskCockpitView`** — task strip, CascadeChord, quick actions (per capabilities) | |
| 41 | | 2 | **Three attention zones:** PFD · Forward · MFD (below) | |
| 42 | |
| 43 | **Columns:** `220, 4, *, 4, 340` (base widths; PFD/MFD may collapse per bindings). |
| 44 | |
| 45 | | Col | Content | |
| 46 | | --- | --- | |
| 47 | | 0 | **PFD** — `AttentionZoneContainer Zone="Pfd"`: solution explorer and/or workspace navigation map, optional tool mount. | |
| 48 | | 1 | `GridSplitter` | |
| 49 | | 2 | **Forward** — `AttentionZoneContainer Zone="Forward"`: **`DocumentsDockView`** (Avalonia Dock — document tabs, editor). | |
| 50 | | 3 | `GridSplitter` | |
| 51 | | 4 | **MFD** — `AttentionZoneContainer Zone="Mfd"`: **`MfdShellView`** (secondary contour: top band + **page stack**). | |
| 52 | |
| 53 | Zone geometry debug overlay: `SkiaZoneGeometryOverlayPfd` / `Forward` / `Mfd`. Agent highlight: `AgentHighlightLayer` over the full `MainGrid`. |
| 54 | |
| 55 | `UiModeBloomOverlay` — decorative bloom from chrome TOML. |
| 56 | |
| 57 | --- |
| 58 | |
| 59 | ## 4. Forward zone (`DocumentsDockView`) |
| 60 | |
| 61 | - **HUD** ([ADR 0021](../../adr/0021-pfd-mfd-cockpit-attention-model.md) §9): banner strip above the dock when non-empty. |
| 62 | - **Dock manager:** `DockControl` — factory/layout from ViewModel. Long logs (build, tests, terminal) use **MFD pages**, not a bottom dock row in the main grid. |
| 63 | |
| 64 | MCP control names should match `Name` in XAML where possible (`DocumentsDockView` and document factory). |
| 65 | |
| 66 | --- |
| 67 | |
| 68 | ## 5. MFD zone (`MfdShellView` + `MfdShellPageStack`) |
| 69 | |
| 70 | Top to bottom inside the MFD column: |
| 71 | |
| 72 | 1. **`WorkspaceChromeBandView`** — EICAS / IDE Health style band (visibility from TOML/VM). |
| 73 | 2. **`MfdContourStackHost`** — hosts **`MfdShellPageStack`**: one **active page** (`CurrentMfdShellPage`), e.g. Workspace Health, explorer in MFD, related files, Markdown preview, chat, AI settings, **terminal**, **build log**, Problems, **Git**, events, tests, hypotheses, debug stack, … |
| 74 | |
| 75 | Page switching is via VM/commands/menu — there is **no** separate full-width bottom tab bar on the main window. |
| 76 | |
| 77 | **Terminal** on the MFD page is a stub (single command → output), not a full integrated shell — see [mfd-terminal-stub-vs-integrated-shell-v1.md](../../ui-ux/mfd-terminal-stub-vs-integrated-shell-v1.md) (Russian body). |
| 78 | |
| 79 | --- |
| 80 | |
| 81 | ## 6. Key controls and MCP |
| 82 | |
| 83 | | Zone / meaning | Name / note | |
| 84 | | --- | --- | |
| 85 | | Window root | `RootWindow` | |
| 86 | | Grid | `MainGrid` | |
| 87 | | Chat (MFD page) | inside `ChatMfdPageView` / stack | |
| 88 | | Chat input | `ChatInputBox` (on chat page) | |
| 89 | | Terminal input | `TerminalView` (`TerminalMfdPageView`, AvaloniaTerminal) | |
| 90 | | Agent highlight | `AgentHighlightOverlay` on `AgentHighlightLayer` | |
| 91 | |
| 92 | `ide_set_panel_size` and similar follow the current MCP contract; geometry uses **three column splitters** and `workspace.toml` / capabilities. |
| 93 | |
| 94 | --- |
| 95 | |
| 96 | ## 7. Highlight overlay |
| 97 | |
| 98 | `AgentHighlightLayer` (Canvas, `ZIndex` 1000) over the grid; `AgentHighlightOverlay` frames a target control (`ide_highlight_control`). `IsHitTestVisible=false` so clicks pass through. |
| 99 | |
| 100 | --- |
| 101 | |
| 102 | ## 8. Historical context (not current layout) |
| 103 | |
| 104 | Older mockups with a **bottom panel** (Terminal / Build tabs in one `BottomPanelView`) and **Focus / Balanced / Power** presets are **legacy**. Current **Flight** is **PFD | Forward | MFD** in one grid; long streams are **MFD pages**. See [concept-to-implementation-map-v1.md](concept-to-implementation-map-v1.md) and `concept-generated/` — concept PNGs are not guaranteed to match code. |
| 105 | |
| 106 | --- |
| 107 | |
| 108 | *Document version: 2.0 (English). Matches `MainWindow.axaml` and `UiModes/index.toml` (**Flight** only). Update this file when layout changes.* |
| 109 | |