mirror of
https://github.com/usestrix/strix.git
synced 2026-10-11 03:37:54 +00:00
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:
parent
4bc1430d23
commit
2f1bb901cc
2 changed files with 1 additions and 3 deletions
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@ def test_notify_scan_error_dispatches_toast() -> None:
|
|||
app.notify,
|
||||
"Scan failed: RuntimeError: something went wrong",
|
||||
severity="error",
|
||||
timeout=0,
|
||||
)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue