# Implementation Plan: Advanced Workspace Docking & Layout Profiles

## Phase 1: Data Model & Persistence Engine
- [x] Task: Create a `WorkspaceProfile` dataclass in `src/models.py` to store INI string, `show_windows` dict, and panel states. [9840035]
- [x] Task: Implement `WorkspaceManager` (similar to `PresetManager`) to handle saving/loading profiles from `config.toml` and `project.toml`. [5b3173a]
- [x] Task: Write Tests: Verify the manager correctly merges global and project profiles and serializes the ImGui INI string properly. [b7ba7a1]
- [x] Task: Conductor - User Manual Verification 'Phase 1: Data Model & Persistence Engine' (Protocol in workflow.md)

## Phase 2: ImGui State Extraction & Restoration
- [x] Task: Implement methods in `src/gui_2.py` (or a helper module) to safely capture the current ImGui layout (`imgui.save_ini_settings_to_memory()`). [eab1945]
- [x] Task: Implement methods to safely restore layout (`imgui.load_ini_settings_from_memory()`) and apply the associated `show_windows` state. [eab1945]
- [x] Task: Write Tests: Verify using `live_gui` that saving a layout and loading it back does not cause crashes or assertion failures in the ImGui render loop. [41bc8bb]
- [x] Task: Conductor - User Manual Verification 'Phase 2: ImGui State Extraction & Restoration' (Protocol in workflow.md)

## Phase 3: GUI Menu Integration [checkpoint: f22265b]
- [x] Task: Add a "Layout Profiles" menu under the main "Windows" or "View" menu bar in `src/gui_2.py`. [ded9f38]
- [x] Task: Implement "Save Current Layout" modal (prompting for name and scope: Global/Project). [ded9f38]
- [x] Task: Populate the menu with a dynamically generated list of available profiles to load. [ded9f38]
- [x] Task: Conductor - User Manual Verification 'Phase 3: GUI Menu Integration' (Protocol in workflow.md)

## Phase 4: Contextual Auto-Switch (Experimental) [checkpoint: 470b7b2]
- [x] Task: Add UI in "AI Settings" or "Operations Hub" to enable "Experimental: Auto-switch layout by Tier". [ecc5a66]
- [x] Task: Add UI to bind specific profiles to Tiers 1 through 4. [ecc5a66]
- [x] Task: Implement the event hook in `AppController` so that when the `active_tier` changes, the bound profile is automatically loaded if the feature is enabled. [ecc5a66]
- [x] Task: Conductor - User Manual Verification 'Phase 4: Contextual Auto-Switch (Experimental)' (Protocol in workflow.md) [470b7b2]
