# Specification: Advanced Workspace Docking & Layout Profiles

## Overview
Expand the existing GUI window management to support named "Workspace Profiles." This will allow users to save, manage, and instantly switch between complex multi-window, multi-viewport docking arrangements.

## Functional Requirements
- **Comprehensive State Capture:**
  - A Workspace Profile must capture:
    - ImGui layout data (positions, sizes, docking nodes) usually stored in `imgui.ini`.
    - Window visibility toggles (the `show_windows` dict and popout panel booleans).
    - Relevant internal panel state (e.g., active tabs, split sizes if applicable).
- **Storage & Scope:**
  - Profiles follow a **Global + Project** inheritance model (similar to prompt presets). Global profiles are stored in `config.toml`, while project-specific profiles are stored in `manual_slop.toml` and can override global ones.
  - The system starts blank (no pre-loaded templates).
- **Trigger Mechanisms:**
  - **Manual Menu:** A dedicated "Layout Profiles" sub-menu in the main menu bar (under "Windows" or "View") to save, load, and manage profiles.
  - **Contextual Auto-Switch (Experimental):** An opt-in setting that automatically switches to a designated profile based on the active MMA Tier or task context (e.g., switching to a "QA" layout when a Tier 4 worker spawns).

## Non-Functional Requirements
- **ImGui INI Management:** Safely loading and saving raw ImGui INI strings using `imgui.load_ini_settings_from_memory` and `imgui.save_ini_settings_to_memory` without corrupting the active render frame.
- **Graceful Fallback:** If a profile references a window that no longer exists, the layout engine should recover gracefully without crashing.

## Acceptance Criteria
- [ ] A user can arrange windows, dock them, and save the current state as a named Workspace Profile.
- [ ] Selecting a saved profile instantly re-arranges windows, updates visibility toggles, and restores internal tab states.
- [ ] Profiles can be scoped globally or to a specific project.
- [ ] An experimental toggle allows binding profiles to specific MMA Tiers for automatic switching.

## Out of Scope
- Creating default templates (users will build their own).
- Synchronizing layouts across different monitor resolutions (ImGui docking handles this best-effort, but pixel-perfect restoration on different hardware is out of scope).
