From 5bc2e830dbe5a60a2b8e60b05cd3276d617c416e Mon Sep 17 00:00:00 2001 From: Tristan Simas Date: Wed, 18 Nov 2026 14:52:53 -0500 Subject: [PATCH 1/3] qt: generic helpers reach the top-level window through QWidget.window QtConversation names its scroll surface `window` (the shared contract Textual answers), so parent.window() on a conversation returned the history list: opening session details raised 'QtHistoryWindow' object is not callable (the APK's shipped-app check). The presented window's host and the floating menu take any widget, so they call QWidget.window(widget). Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01RnH6dT7wdh7i4tjJZQdFu3 --- src/toad/qt/menu.py | 4 ++-- src/toad/qt/presented_window.py | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/toad/qt/menu.py b/src/toad/qt/menu.py index 0b18d826b..9078c0909 100644 --- a/src/toad/qt/menu.py +++ b/src/toad/qt/menu.py @@ -142,12 +142,12 @@ def __init__(self, window: QWidget) -> None: @classmethod def of(cls, widget: QWidget) -> QtMenu: """The pop-up menu of the window `widget` is in: the window's own direct child.""" - return widget.window().findChild(cls, "toad-menu", Qt.FindChildOption.FindDirectChildrenOnly) + return QWidget.window(widget).findChild(cls, "toad-menu", Qt.FindChildOption.FindDirectChildrenOnly) @staticmethod def anchor_of(widget: QWidget) -> QRect: """`widget`'s rectangle in its window, as `show_entries` takes an anchor.""" - return QRect(widget.mapTo(widget.window(), widget.rect().topLeft()), widget.size()) + return QRect(widget.mapTo(QWidget.window(widget), widget.rect().topLeft()), widget.size()) def paint(self, renderer: QtLineRenderer) -> None: """One surface in the renderer's theme: the float tone (a tier above what it floats diff --git a/src/toad/qt/presented_window.py b/src/toad/qt/presented_window.py index 3624ec96e..7ac4766e2 100644 --- a/src/toad/qt/presented_window.py +++ b/src/toad/qt/presented_window.py @@ -127,7 +127,9 @@ def presentation_host(self) -> QWidget: if parent is None: raise TypeError(f"{type(self).__qualname__} is shown without the window it opens over " "as its parent") - return parent.window() + # QWidget.window, not parent.window(): a conversation view names its scroll surface + # `window` (the shared contract Textual also answers), shadowing the Qt method. + return QWidget.window(parent) def page_header(self) -> QWidget: """The ← header a filled window shows above its content, built the first time.""" From e733dbf0f66c630327b61289d8dc2f58425d8ba3 Mon Sep 17 00:00:00 2001 From: Tristan Simas Date: Wed, 18 Nov 2026 14:55:46 -0500 Subject: [PATCH 2/3] shipped_run: save the unoffered theme and read error files where qt_drive keeps them (OUTDIR) Since qt_drive always keeps settings and state under OUTDIR, shipped_run's toad.json in kept/config was never read (the app started on 'wal', failing the theme check) and its error files under kept/state were never found. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01RnH6dT7wdh7i4tjJZQdFu3 --- tools/android/shipped_run.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tools/android/shipped_run.py b/tools/android/shipped_run.py index 5fb635340..d4f0cfbcc 100644 --- a/tools/android/shipped_run.py +++ b/tools/android/shipped_run.py @@ -199,15 +199,17 @@ def main(runtime: Path, app: Path, site_packages: Path) -> int: for candidate in site_packages.glob(f"{name}*"): if not (recipes / candidate.name).exists(): (recipes / candidate.name).symlink_to(candidate) - settings = work / "kept" / "config" / "toad" / "toad.json" + # qt_drive keeps its settings and state under its OUTDIR (`out/config`, `out/state`) + # whatever the environment holds, so the saved theme and the error files live there. + out = work / "out" + settings = out / "config" / "toad" / "toad.json" settings.parent.mkdir(parents=True) settings.write_text(json.dumps({"ui": {"theme": UNOFFERED_THEME}})) trust = work / "trust.pem" trust.write_text((app / "cacert.pem").read_text() + (work / "cert.pem").read_text()) - out = work / "out" result = shipped_qt(shipped, recipes, trust, profile, out) print(result.stdout[-6000:]) - errors = sorted((work / "kept" / "state").rglob("errors/*.txt")) + errors = sorted((out / "state").rglob("errors/*.txt")) failed = (result.returncode != 0 or "ModuleNotFoundError" in result.stdout + result.stderr or errors) if failed: print(result.stderr[-8000:], file=sys.stderr) From 278ad00f8cd5bfa3844d9d964d47d992a467c682 Mon Sep 17 00:00:00 2001 From: Tristan Simas Date: Wed, 18 Nov 2026 14:59:29 -0500 Subject: [PATCH 3/3] shipped_run: read the fault trace from qt_drive's OUTDIR state too Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01RnH6dT7wdh7i4tjJZQdFu3 --- tools/android/shipped_run.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/android/shipped_run.py b/tools/android/shipped_run.py index d4f0cfbcc..3b2b852c6 100644 --- a/tools/android/shipped_run.py +++ b/tools/android/shipped_run.py @@ -219,7 +219,7 @@ def main(runtime: Path, app: Path, site_packages: Path) -> int: f"{len(errors)} error file(s)); TOAD_SHIPPED_KEEP=1 keeps its scratch folder", file=sys.stderr) return 1 print("shipped app ran every view kind and bound key on a scratch bus") - fault = fault_trace_failure(work / "kept" / "state", shipped, recipes) + fault = fault_trace_failure(out / "state", shipped, recipes) if fault: print(f"error: the shipped app's fault trace: {fault}", file=sys.stderr) return 1