Private
Public Access
0
0
Files
manual_slop/layouts
ed 5ab23f9eea fix(layout): make 2-column dock layout actually auto-apply
The pre-run install wrote the bundled INI to cwd, and the
_install_default_layout_if_empty helper applies it via
imgui.load_ini_settings_from_memory() when cwd is empty. But the
GUI was rendering all panels as floating windows at default position
(60, 60) with no DockId, despite the bundled INI having a full
[Docking][Data] block with DockSpace + DockNodes + per-window DockIds.

Root cause analysis (via imgui.save_ini_settings_to_memory() at runtime):

1. With default_imgui_window_type=provide_full_screen_dock_space:
   HelloImGui creates its own DockSpace at runtime, overriding the INI's
   DockSpace settings. The DockSpace ID matches (0xAFC85805) but the
   Split/X and child DockNodes from the bundled INI are discarded.
   Runtime INI shows: 'DockSpace ID=0xAFC85805 Window=0x079D3A04 Pos=0,28
   Size=1666,1172 CentralNode=1' (no DockNodes, no DockIds honored).

2. The pre-run install writes the INI to disk, but HelloImGui's
   load_user_pref runs BEFORE post_init, so even a perfect on-disk
   INI doesn't get re-applied to the current session's dock state
   unless we call imgui.load_ini_settings_from_memory() after the
   first frame.

Two-part fix:

A. src/gui_2.py line 678: change default_imgui_window_type from
   'provide_full_screen_dock_space' to 'no_default_window'. Without
   the auto-created DockSpace, HelloImGui honors the INI's full
   docking tree structure.

B. src/gui_2.py _post_init (line 575): always call
   imgui.load_ini_settings_from_memory() after _install_default_layout
   runs, regardless of whether the cwd INI was empty. This re-applies
   the bundled INI to the live session after the first frame is
   rendered, so the panels are docked correctly on the current launch.

Layouts/default.ini: replace the simple 'DockSpace + 2 direct
DockNode children' structure (silently ignored by HelloImGui) with
the user's working nested DockNode tree (5-level deep), mapped to:
- LEFT column (DockNode 0x10, CentralNode=1): Theme, Project Settings,
  AI Settings, Files & Media, Operations Hub
- RIGHT column (DockNode 0x01): Discussion Hub, Log Management,
  Diagnostics

Verification (imgui.save_ini_settings_to_memory at runtime after
15s + first frame):
- LEFT column windows: Pos=0,28, Size=881,1697 (5 panels stacked)
- RIGHT column windows: Pos=883,28, Size=1183,1697 (3 panels stacked)
- [Docking][Data] block fully preserved (DockSpace + 8 DockNodes)
- All 8 panels docked (not floating)

Tests:
- tests/test_default_layout_install.py: 3/3 PASS
- tests/test_api_hooks_gui_health_live.py: 1/1 PASS
- tests/test_command_palette_sim.py: 7/7 PASS
- tests/test_saved_presets_sim.py: 2/2 PASS
- tests/test_live_gui_integration_v2.py: 3/3 PASS
2026-06-30 07:30:44 -04:00
..