fix: remove timeout=0 from scan error toast — was causing instant dismissal

Textual's Notification expires when raised_at + timeout - time() <= 0.
With timeout=0 the toast expired immediately on mount, making the error
notification invisible to users. Drop the timeout argument to use
Textual's default display duration (~5 s).
This commit is contained in:
Mads Hvelplund 2026-06-19 12:22:30 +02:00
parent 4bc1430d23
commit 2f1bb901cc
No known key found for this signature in database
GPG key ID: 08208EA18E154F00
2 changed files with 1 additions and 3 deletions

View file

@ -1403,13 +1403,12 @@ class StrixTUIApp(App): # type: ignore[misc]
self._scan_thread.start()
def _notify_scan_error(self, exc: Exception) -> None:
"""Dispatch a persistent error toast from any thread."""
"""Dispatch an error toast from any thread."""
with contextlib.suppress(Exception):
self.call_from_thread(
self.notify,
f"Scan failed: {type(exc).__name__}: {exc}",
severity="error",
timeout=0,
)
def _capture_sdk_event(self, agent_id: str, event: Any) -> None:

View file

@ -22,7 +22,6 @@ def test_notify_scan_error_dispatches_toast() -> None:
app.notify,
"Scan failed: RuntimeError: something went wrong",
severity="error",
timeout=0,
)