diff --git a/docs/guide_app_controller.md b/docs/guide_app_controller.md index c1567f60..f4dbb1c3 100644 --- a/docs/guide_app_controller.md +++ b/docs/guide_app_controller.md @@ -69,14 +69,14 @@ The actual `__init__` (`src/app_controller.py:778-836`) does the following: 5. **Warmup manager** — `WarmupManager(self._io_pool, log_to_stderr=log_to_stderr)` with an on-complete callback to stamp `warmup_done_ts`. `defer_warmup=True` defers the actual `start_warmup()` call until the first frame is painted (the desktop GUI pattern; headless mode starts immediately). 6. **Various flags** — `_warmup_started`, `_pending_fetch_provider`, `_defer_warmup`. -**Manager objects** (`preset_manager`, `persona_manager`, `context_preset_manager`, `tool_preset_manager`, `tool_bias_engine`, `history_manager`, `workspace_manager`, `rag_engine`) are **NOT created in `__init__`**. They are lazy attributes accessed via `__getattr__` and created on first reference (typically from `_load_active_project` at `src/app_controller.py:2150` or from `App._post_init` at `src/gui_2.py:3995`). +**Manager objects** (`preset_manager`, `persona_manager`, `context_preset_manager`, `tool_preset_manager`, `tool_bias_engine`, `history_manager`, `workspace_manager`, `rag_engine`) are **NOT created in `__init__`**. They are lazy attributes accessed via `__getattr__` and created on first reference (typically from `_load_active_project` at `src/app_controller.py:2150` or from `App._post_init` at `src/gui_2.py:492`). **Hook API surface** is NOT populated by a `register_hooks` method. The actual flow: 1. `AppController._init_actions()` (called from `init_state` at `src/app_controller.py:1740`) populates `self._predefined_callbacks` and `self._gettable_fields` registries via module-level handler registration functions. 2. `src/api_hooks.py:HookHandler.do_GET` / `do_POST` reads from these registries to expose App methods as `/api/gui` `custom_callback` actions. 3. The `sloppy.py` CLI parses `--enable-test-hooks` and passes it to `HookServer` (a separate class, not the controller). -For the actual init flow, read `src/app_controller.py:778-836` (`__init__`), `:1606` (`_init_actions`), `:1740` (`init_state`), and `:2150` (`_load_active_project`). +For the actual init flow, read `src/app_controller.py:778-1212` (`__init__`; the long range is mostly `_post_init`-style wiring for the 12 locks, GUI health state, io_pool, warmup manager, and lazy manager defs), `:1606` (`_init_actions`), `:1740` (`init_state`), and `:2150` (`_load_active_project`). This is the **only** bridge between the GUI's app methods and the external Hook API. If a method is not in `_predefined_callbacks`, external callers cannot invoke it. diff --git a/docs/guide_workspace_profiles.md b/docs/guide_workspace_profiles.md index a33ba4d9..74a53335 100644 --- a/docs/guide_workspace_profiles.md +++ b/docs/guide_workspace_profiles.md @@ -139,7 +139,7 @@ def auto_switch(self, context_id: str) -> bool: 1. Read the profile from the loaded dict. 2. Apply `ini_content` via `ImGui.LoadIniSettingsFromMemory(ini_content)`. 3. Apply `show_windows` to the live windows (hide/show as needed). -4. Apply `panel_states` to the per-panel settable fields via `App._apply_panel_states`. +4. Apply `panel_states` to the per-panel settable fields via `App._apply_workspace_profile` (which iterates `profile.panel_states.items()` and `setattr`s on the App — see `src/gui_2.py:844-848`). Activation is immediate; the next frame renders the new layout. Theme is NOT part of the profile (themes are managed by the separate theme system; see [guide_themes.md](guide_themes.md)).