# Specification: GUIv2 Feature Parity ## 1. Overview This track aims to bring `gui_2.py` (the `imgui-bundle` based UI) to feature parity with the existing `gui.py` (the `dearpygui` based UI). This involves porting several major systems and features to ensure `gui_2.py` can serve as a viable replacement and support the latest project capabilities like automated testing and advanced diagnostics. ## 2. Functional Requirements ### FR1: Port Core Architectural Systems - **FR1.1: Event-Driven Architecture:** `gui_2.py` MUST be refactored to use the `events.py` module for handling API lifecycle events, decoupling the UI from the AI client. - **FR1.2: MCP File Tools Integration:** `gui_2.py` MUST integrate and use `mcp_client.py` to provide the AI with native, sandboxed file system capabilities (read, list, search). ### FR2: Port Major Features - **FR2.1: API Hooks System:** The full API hooks system, including `api_hooks.py` and `api_hook_client.py`, MUST be integrated into `gui_2.py`. This will enable external test automation and state inspection. - **FR2.2: Performance & Diagnostics:** The performance monitoring capabilities from `performance_monitor.py` MUST be integrated. A new "Diagnostics" panel, mirroring the one in `gui.py`, MUST be created to display real-time metrics (FPS, CPU, Frame Time, etc.). - **FR2.3: Prior Session Viewer:** The functionality to load and view previous session logs (`.log` files from the `/logs` directory) MUST be implemented, including the distinctive "tinted" UI theme when viewing a prior session. ### FR3: UI/UX Alignment - **FR3.1: 'Hub' UI Layout:** The windowing layout of `gui_2.py` MUST be refactored to match the "Hub" paradigm of `gui.py`. This includes creating: - `Context Hub` - `AI Settings Hub` - `Discussion Hub` - `Operations Hub` - **FR3.2: Agent Capability Toggles:** The UI MUST include checkboxes or similar controls to allow the user to enable or disable the AI's agent-level tools (e.g., `run_powershell`, `read_file`). - **FR3.3: Full Theme Integration:** All new UI components, windows, and controls MUST correctly apply and respond to the application's theming system (`theme_2.py`). ## 3. Non-Functional Requirements - **NFR1: Stability:** The application must remain stable and responsive during and after the feature porting. - **NFR2: Maintainability:** The new code should follow existing project conventions and be well-structured to ensure maintainability. ## 4. Acceptance Criteria - **AC1:** `gui_2.py` successfully launches without errors. - **AC2:** The "Hub" layout is present and organizes the UI elements as specified. - **AC3:** The Diagnostics panel is present and displays updating performance metrics. - **AC4:** The API hooks server starts and is reachable when `gui_2.py` is run with the appropriate flag. - **AC5:** The AI can successfully use file system tools provided by `mcp_client.py`. - **AC6:** The "Prior Session Viewer" can successfully load and display a log file. - **AC7:** All new UI elements correctly reflect the selected theme. ## 5. Out of Scope - Deprecating or removing `gui.py`. Both will coexist for now. - Any new features not already present in `gui.py`. This is strictly a porting and alignment task.