Describe the bug
App.is_mounted is a method taking a widget, not the Widget.is_mounted
property:
# textual/app.py
def is_mounted(self, widget: Widget) -> bool:
return widget in self._registry
StrixTUIApp subclasses App, so a bare self.is_mounted is a bound method
object, always truthy, and not self.is_mounted is always False. All 13 guards
using it never fire: lines 870, 942, 957, 989, 1113, 1470, 1545, 1682, 1702,
1751, 1769, 1785, 1944. (widget.is_mounted at 1931 is on a Widget and is
correct.)
Worst case is app.py:950 — the dead guard lets query_one run against a missing
screen, raise, and get caught by an except that re-schedules via
call_after_refresh, looping instead of returning.
To Reproduce
uv run mypy strix/ → Function "is_mounted" could always be true in boolean context, plus Statement is unreachable after 7.
uv run pyright strix/ → 13 × reportUnnecessaryComparison.
Expected behavior
if not <guard>: return should return when the app isn't up. App.is_running
is the property these guards want.
System Information:
- OS: environment-independent (static logic bug)
- Strix Version or Commit: 1.3.1 / 27f9750
- Python Version: 3.12+
- LLM Used: n/a
- textual: 6.2.1
Describe the bug
App.is_mountedis a method taking a widget, not theWidget.is_mountedproperty:
StrixTUIAppsubclassesApp, so a bareself.is_mountedis a bound methodobject, always truthy, and
not self.is_mountedis always False. All 13 guardsusing it never fire: lines 870, 942, 957, 989, 1113, 1470, 1545, 1682, 1702,
1751, 1769, 1785, 1944. (
widget.is_mountedat 1931 is on a Widget and iscorrect.)
Worst case is app.py:950 — the dead guard lets
query_onerun against a missingscreen, raise, and get caught by an
exceptthat re-schedules viacall_after_refresh, looping instead of returning.To Reproduce
uv run mypy strix/→Function "is_mounted" could always be true in boolean context, plusStatement is unreachableafter 7.uv run pyright strix/→ 13 ×reportUnnecessaryComparison.Expected behavior
if not <guard>: returnshould return when the app isn't up.App.is_runningis the property these guards want.
System Information: