feat(3-1): stale state detection and dimmed display
When fetch times out or returns empty after prior data, retain last aircraft with is_stale=True and render them as black outlines so the display stays informative rather than blank or crashing. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+2
-2
@@ -31,7 +31,7 @@ def test_run_one_cycle_calls_display_show(renderer: Renderer) -> None:
|
||||
fetcher = FileFixtureFetcher(FIXTURE_DIR / "aircraft_sample.json")
|
||||
display = NullDisplay()
|
||||
display_mock = MagicMock(wraps=display)
|
||||
_run_one_cycle(renderer, fetcher, display_mock)
|
||||
_run_one_cycle(renderer, fetcher, display_mock, [])
|
||||
display_mock.show.assert_called_once()
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ def test_run_one_cycle_logs_warning_when_slow(
|
||||
# Simulate 43s total: t0=0, t1=1, t2=2, t3=43
|
||||
with patch("planemapper.main.time.monotonic", side_effect=[0.0, 1.0, 2.0, 43.0]):
|
||||
with caplog.at_level(logging.WARNING, logger="planemapper.main"):
|
||||
_run_one_cycle(renderer, fetcher, display)
|
||||
_run_one_cycle(renderer, fetcher, display, [])
|
||||
assert any("render slow" in r.message for r in caplog.records)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user