The live feed never collapses a packet's class name, and the PicoCalc drops its icon

The class name was dropped below the width the whole row needed, leaving only its icon. It is now drawn at every width, like the scope; a row wider than the screen is read by scrolling the highlighted one with ←→. The class icon beside the name is a family cue once the name is always there, so it follows Platform.menu_icons: on the PicoCalc, where it could only be a one-glyph stand-in, the lane is gone.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jean-Pierre MartineauandClaude Opus 5.5 committed 2026-09-25 02:38:41 -04:00
1 parent 01a8f711d6
commit d019c840a8
3 files changed
+76 -78

No files matched your search

+9 -10
View File
@@ -123,16 +123,15 @@ def test_livefeed_rows_leave_the_relay_path_to_the_viewer() -> None:
"""A row says what arrived and how well it was heard; the route is Enter's job.
Whatever the fixed lanes left a route was never enough to draw one in — it arrived
elided to a stub — so the feed carries none: the whole row, scope lane and all, fits a
72-column screen, and a wide one keeps its class label in words too.
elided to a stub — so the feed carries none: the row is its fixed lanes, class name
and all, and a wide terminal holds the whole of it.
"""
screen = _screen()
screen.on_event(MeshEvent.observation_event(_obs(kind="packet", path="3d63,a1b2", snr=1.0)))
row = _rows(screen, 68)[0] # a 72-column terminal's framed body
row = _rows(screen, 100)[0]
assert "via" not in row and "Hub" not in row # no route, not even a stub of one
assert "+1.0 dB" in row and "-90 dBm" in row # …the reception it was heard at reads
assert len(row.rstrip()) <= 68
assert "📦 packet" in _rows(screen, 90)[0] # the class label, where there is room
assert "📦 packet" in row # the class, in words
assert "+1.0 dB" in row and "-90 dBm" in row # …and the reception it was heard at
def test_livefeed_class_lane_names_the_payload_class_once() -> None:
@@ -483,11 +482,11 @@ def test_livefeed_windows_inside_the_fixed_screen() -> None:
_CRAMPED = 44
def test_livefeed_the_whole_row_fits_a_72_column_screen() -> None:
"""No row overflows at 72 — which is why ←→ has nothing to advertise there."""
def test_livefeed_the_whole_row_fits_a_wide_screen() -> None:
"""No row overflows where the lanes fit — which is when ←→ has nothing to advertise."""
screen = _screen(seed=[_obs(node="n0", kind="telemetry")])
for line in _stripped(screen.render_body(72)):
assert len(line.rstrip()) <= 72
for line in _stripped(screen.render_body(100)):
assert len(line.rstrip()) <= 100
assert screen._hmax == 0
assert "←→" not in screen.footer_hint
+27 -17
View File
@@ -180,18 +180,12 @@ def _feed(*raws: dict) -> LiveFeedScreen:
return screen
def test_the_feed_carries_a_scope_lane_on_a_72_column_terminal() -> None:
"""The framed body there is 68 cells: the icon-only row holds the lane, name and all.
The lane sits between the subject and the readings; a plain flood is a muted dash and
a direct frame, which has no scope, leaves the lane blank.
"""
def test_the_feed_scope_lane_sits_between_subject_and_readings() -> None:
"""A plain flood is a muted dash; a direct frame, which has no scope, leaves it blank."""
screen = _feed(_DIRECT, _FLOOD, _scoped("elsewhere"), _scoped("harbour"))
header, *rows = _stripped(screen.render_body(68))
header, *rows = _stripped(screen.render_body(100))
lanes = header.split()
assert lanes.index("SCOPE") == lanes.index("SNR") - 1
for line in (header, *rows):
assert cell_len(line.rstrip()) <= 68
assert lanes.index("SUBJECT") + 1 == lanes.index("SCOPE") == lanes.index("SNR") - 1
col = _col(header, "SCOPE")
assert _col(rows[0], "harbour") == col
assert _col(rows[1], f"? {_code('elsewhere')}") == col
@@ -200,18 +194,34 @@ def test_the_feed_carries_a_scope_lane_on_a_72_column_terminal() -> None:
assert all(row.rstrip().endswith("dBm") for row in rows)
def test_the_feed_never_collapses_the_scope_lane() -> None:
"""The scope is drawn at every width; the class label is what gives way when narrow.
def test_the_feed_never_collapses_a_lane() -> None:
"""The class name and the scope are drawn at every width; a narrow row scrolls instead.
Beside the subject, the lane is on screen even at the PicoCalc's 53, where it is the
readings after it that run off the edge.
Nothing gives way: at 72 columns (a 68-cell body) the readings run past the edge, and
the highlighted row's ←→ is what reaches them.
"""
screen = _feed(_scoped("harbour"))
for width in (53, 68, 72, 80, 100):
for width in (68, 72, 80, 100):
header, row = _stripped(screen.render_body(width))[:2]
assert "CLASS" in header and "channel text" in row, width
assert _col(header, "SCOPE") == _col(row, "harbour"), width
assert "CLASS" not in _stripped(screen.render_body(80))[0]
assert "CLASS" in _stripped(screen.render_body(100))[0]
screen._selected = 0 # noqa: SLF001
screen.render_body(68)
assert screen._hmax > 0 # noqa: SLF001 - the row is wider than the body: ←→ reaches it
def test_the_picocalc_feed_names_the_class_without_an_icon() -> None:
"""On the console the class icon is a one-glyph stand-in; the name alone says it."""
from meshterm.platforms import PICOCALC, REGULAR, set_platform
set_platform(PICOCALC)
try:
screen = _feed(_scoped("harbour"))
header, row = _stripped(screen.render_body(53))[:2]
assert header.split()[:2] == ["TIME", "CLASS"]
assert _col(header, "CLASS") == _col(row, "channel text")
finally:
set_platform(REGULAR)
def test_the_feed_hands_its_scope_reader_to_the_viewer() -> None: