From f1b8030055da88f2a1c2c4686af7410bedf75552 Mon Sep 17 00:00:00 2001 From: Jean-Pierre Martineau Date: Wed, 29 Jul 2026 23:14:26 -0400 Subject: [PATCH] Record card: one spelling of the 12-cell label lane MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit _lane padded its label inline, the spec row rebuilt the same column as a hand-spaced string with a bare indent=12. _LABEL_W plus a shared _label builder is now the lane's single source; menus.lane_row was considered and declined — its three-lane shape (label pad, value pad, muted help) is not the card's muted-label/value pair (housekeeping H-010). Co-Authored-By: Claude Fable 5 --- meshterm/ui/records_screen.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/meshterm/ui/records_screen.py b/meshterm/ui/records_screen.py index 29f17ff..f72e7a9 100644 --- a/meshterm/ui/records_screen.py +++ b/meshterm/ui/records_screen.py @@ -94,6 +94,11 @@ _POLY_MAX_W = 28 _POLY_EXTRA_ROWS = 2 _SIDE_BY_SIDE_MIN = 44 +#: Cells the record card's label lane spans. Every labelled row on the card — the stat +#: lanes, the spec row's hanging indent, the recorded line — shares this one column, so +#: the values align whatever the label says. +_LABEL_W = 12 + def _drawn_rows(lines: list[str]) -> list[str]: """``lines`` with the rows nothing actually landed on stripped from either end. @@ -244,9 +249,14 @@ class RecordDialog(Screen): """Keep the selected action visible while arrowing; scroll free once paging.""" return self._cursor if self._follow else None + @staticmethod + def _label(label: str) -> Text: + """The card's muted label lane, padded to :data:`_LABEL_W` cells.""" + return Text(f"{label:<{_LABEL_W}}", style="muted") + def _lane(self, label: str, value: Text) -> Text: """One label/value stat lane (label lane fixed so values align).""" - row = Text(f"{label:<12}", style="muted") + row = self._label(label) row.append_text(value) return row @@ -456,8 +466,7 @@ class RecordDialog(Screen): ) spec = Text(record.spec, style="brand") spec.append(f" ({record.width_bytes}-byte hops)", style="muted") - lines.extend(render_hanging(Text("spec ", style="muted"), spec, width, - indent=12)) + lines.extend(render_hanging(self._label("spec"), spec, width, indent=_LABEL_W)) stamp = record.discovered_at.astimezone().strftime("%b %d %Y %H:%M") when = Text(stamp)