piker/ai/prompt-io/opencode/20260903T205404Z_aadfd1cf_p...

2.5 KiB
Raw Blame History

Generated changes

git diff HEAD -- piker/ui/_exec.py piker/ui/_window.py

Extracts nonblocking start_qtractor() from the blocking CLI adapter. The returned QtractorSession exposes the production window and central widget, the Trio token and cancellation scope, readiness and completion Qt signals, the final outcome.Outcome, Qt-loop ownership, and an idempotent structured shutdown request. Caller-owned Qt application state and installed callbacks are restored when the guest completes. MainWindow.closeEvent() retains geometry persistence but delegates runtime teardown through the injected callback instead of sending process-wide SIGINT.

git diff HEAD -- piker/ui/_app.py

Publishes application readiness only after initial symbol loading, order-mode startup, search registration, provider-search task startup, input handler entry, and startup-status removal.

git diff HEAD -- tests/ui/test_qtractor.py

Adds a provider-independent lifecycle regression which runs two real Tractor root runtimes in sequence on pytest’s unique registry. Real window-close events drive structured cancellation while signal, outcome, task-finalization, global-window, runtime, and shared-QApplication assertions prove restartable teardown without an interlayer fake.

Human review then brought the generated Python into project style: boolean connectives use dedicated vertical lines, opaque helper returns and control-flow targets carry local annotations, and Qt disconnect failures are logged instead of silently suppressed.

Verification

  • Ruff passes for all four changed Python files.
  • Python static compilation and git diff --check pass.
  • The first focused run exposed the test widget’s missing production on_win_resize() contract; the narrow test widget was corrected.
  • The focused lifecycle regression passes with two sequential real Tractor sessions.
  • The combined UI harness and lifecycle run passes: 3 tests and two upstream Tractor Registrar.uid deprecation warnings.
  • A post-pass attempt to disconnect a pre-existing Qt signal proxy segfaulted during PyQt teardown and was fully reverted; it is not part of this patch. The restored lifecycle regression passes again.
  • All automated Qt execution used --headless and the offscreen platform.
  • The approved nix develop shell hook unexpectedly provisioned the ignored worktree-local py313/ environment; no tracked dependency or lock files changed.