diff --git a/docs/reports/TRACK_COMPLETION_default_layout_install_20260629.md b/docs/reports/TRACK_COMPLETION_default_layout_install_20260629.md index 2e5479c7..b65ab6b4 100644 --- a/docs/reports/TRACK_COMPLETION_default_layout_install_20260629.md +++ b/docs/reports/TRACK_COMPLETION_default_layout_install_20260629.md @@ -226,3 +226,36 @@ Then review with `git log --oneline origin/master..review/default_layout_install - Decide whether to clean up the `mcp_paths.toml` / `opencode.json` drift in the working tree (it's intentional sandbox state; not a leak) **End of track report.** Total commits: 14 (11 source + 3 plan/tracks.md bookkeeping + checkpoint). Final plan + state + tracks.md are in sync with `git HEAD`. + +--- + +## POST-SHIP ERRATA (2026-06-29) + +User empirical verification (`uv run sloppy.py` on current branch, post-shipping) revealed that even with the original install-and-write-to-disk fix, the GUI rendered as: only the menu ribbon bar visible; the entire window body empty. + +### Root cause (post-mortem) + +Two compounding bugs not caught by the original 3-test install suite: + +1. **Stale dockspace IDs in the bundled INI.** `layouts/default.ini` (relocated from `tests/artifacts/manualslop_layout_default.ini` in Phase 1 commit `7577d7d`) had been previously captured against a specific runtime where `HelloImgui`'s dockspace ID was `0xAFBEEF01` and the parent DockNode IDs were `0x10` (left) / `0x11` (right). `HelloImgui` computes dockspace IDs dynamically per session (typically a hash of the dockspace name and creation order). The hardcoded literal in the INI was orphan by the first render of any fresh session: `imgui.load_ini_settings_from_disk/memory` applied the `[Window][X]` positions but the `[Docking][Data]` block referenced a DockSpace that didn't exist. HelloImgui then treated each `[Window]` entry as a *floating* window at its absolute `Pos=` coordinates; the auto-created dockspace captured the full window body and hid them all. **The INI's docking instructions are session-incompatible by construction.** + +2. **Install write ran AFTER HelloImgui's INI load.** `imgui_bundle.hello_imgui` reads `cwd/manualslop_layout.ini` at app startup, BEFORE the `post_init` callback fires. My original `_install_default_layout_if_empty` only wrote the bundled INI to disk; the live session kept its pre-install (empty) state. The bundled INI helped on the SECOND launch but not the first. + +### Fix (commit `e9654518`, post-shipping patch) + +Two-part: + +1. `layouts/default.ini`: stripped the stale `[Docking][Data]` block and all `DockId=` references. Each `[Window]` entry now has only `Pos + Size + Collapsed=0`. HelloImgui's auto-dock layer (in the `imgui_bundle.hello_imgui` module, not a separate package) places the panels as tabs in the central dockspace on first render. The bundled layout strategy is to give each window an explicit absolute position so the user can verify in the INI that all 12 windows are registered; the actual dock topology is session-determined. + +2. `_install_default_layout_if_empty` in `src/gui_2.py`: after writing the bundled INI to disk, also call `imgui.load_ini_settings_from_memory(src_text)` (the `imgui` module from `imgui_bundle`) so the live session applies the new INI. Catches exceptions to drain to stderr but does not abort the install. + +### Tests updated + +- `tests/test_default_layout_install.py`: `_has_window_with_collapsed_zero` replaces `_has_dockid_after_window_header`; new `_has_no_docking_block` asserts no `[Docking] data block` survives in the installed INI; new `_assert_live_session_apply` (called in tests 1 and 2) reads stderr log and confirms the `(and applied to live session)` line is present. +- 17/17 tests still pass after the fix. + +### Verification recompute + +Re-ran the full batch (test_default_layout_install + test_reset_layout + test_gui2_layout + test_gui_diagnostics + test_layout_reorganization + test_commands_no_top_level_command_palette): **17/17 PASSED**. + +Manual user verification (Task 2.9 + 4.2) recompute needed: launch `uv run sloppy.py` on current branch with empty `cwd/manualslop_layout.ini`. The window body should now show all 8 default-true panels (Project Settings, Files & Media, AI Settings, Discussion Hub, Operations Hub, Theme, Log Management, Diagnostics) plus the 4 Tier panels (since the INI registers them and Config.toml defaults are False but the bundled INI lists them with `Collapsed=0` so they're registered). 12 panels total as tabs in the central dockspace.