Private
Public Access
0
0

fix(gui): wire _install_default_layout_if_empty_result into App._post_init

App._post_init now resolves src = paths.get_layouts_dir()/default.ini
and dst = Path.cwd()/manualslop_layout.ini, then calls the drain-plane
helper before the warmup-complete registration block. Errors drain to
self._startup_timeline_errors per the data-oriented convention, so a
missing bundled layout (e.g. partial wheel install) does not crash the
GUI: panels just stay invisible until the user drops a real INI in.

Test fix: test_default_layout_install._GUI_SCRIPT was a relative path,
but the subprocess Popen runs with cwd = temp_workspace where sloppy.py
does not exist. Switched to an absolute path via _PROJECT_ROOT, the
same pattern conftest.py:648 uses for the live_gui fixture.
This commit is contained in:
2026-06-29 16:35:20 -04:00
parent f3cd7bc2ff
commit 3d87f8e7ed
2 changed files with 7 additions and 1 deletions
+6
View File
@@ -574,6 +574,12 @@ class App:
# _io_pool thread; it only sets primitive state on the App, which # _io_pool thread; it only sets primitive state on the App, which
# is safe. The render_warmup_status_indicator() function reads # is safe. The render_warmup_status_indicator() function reads
# the timestamp to show a brief "ready" tag for 3 seconds. # the timestamp to show a brief "ready" tag for 3 seconds.
src_layout_path: Path = paths.get_layouts_dir() / "default.ini"
dst_layout_path: Path = Path.cwd() / "manualslop_layout.ini"
install_result: Result[bool] = _install_default_layout_if_empty_result(self, src_layout_path, dst_layout_path)
if not install_result.ok:
if not hasattr(self, "_startup_timeline_errors"): self._startup_timeline_errors = []
self._startup_timeline_errors.append(("_install_default_layout", install_result.errors[0]))
if hasattr(self.controller, "on_warmup_complete"): if hasattr(self.controller, "on_warmup_complete"):
cb_result = _post_init_callback_result(self) cb_result = _post_init_callback_result(self)
if not cb_result.ok: if not cb_result.ok:
+1 -1
View File
@@ -13,7 +13,7 @@ import pytest
_PROJECT_ROOT: Path = Path(os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))) _PROJECT_ROOT: Path = Path(os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
_SCRIPTS_DIR: Path = _PROJECT_ROOT / "tests" / "artifacts" / "tier2_state" / "default_layout_install_20260629" _SCRIPTS_DIR: Path = _PROJECT_ROOT / "tests" / "artifacts" / "tier2_state" / "default_layout_install_20260629"
_GUI_SCRIPT: str = "sloppy.py" _GUI_SCRIPT: str = str(_PROJECT_ROOT / "sloppy.py")
_INI_FILENAME: str = "manualslop_layout.ini" _INI_FILENAME: str = "manualslop_layout.ini"