diff --git a/CLAUDE.md b/CLAUDE.md index 01bf11c..147c6fb 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -213,8 +213,9 @@ deliberately, one at a time, and say why in the code. with no reverse of its own**, which cycles or it dead-ends — Tab on a button row, and the picocalc F-lane's single-chip advancers (`Sort →`, the node page's tab chip, the Time Machine's window chip). Those state it in the code. -- Grouped-list section headings use `section_heading("Label")` → `── Label ──` accent. - That is also what makes a heading *sticky* (it pins to the top row while its section +- Grouped-list section headings use `section_heading("Label")` → `── Label ──` in the + bold `heading` grey, never the frame's accent: a rule in the border's colour reads as + part of the frame. A chat's day divider wears the same dress. That is also what makes a heading *sticky* (it pins to the top row while its section scrolls, and the ^PgUp/^PgDn jumps step by it), so build them through it — a hand-rolled `Separator` is no landmark. Prose written *directly under* a heading (a description of what the section holds) is its preamble and pins with it, in order, as each row scrolls diff --git a/meshterm/ui/chat.py b/meshterm/ui/chat.py index 7c95bd3..382e514 100644 --- a/meshterm/ui/chat.py +++ b/meshterm/ui/chat.py @@ -483,11 +483,11 @@ class ChatScreen(Screen): lines += render_lines(Text(""), width) # A day divider is this transcript's section heading — it pins to the # top row while its day scrolls under it and ^PgUp/^PgDn step by it — - # so it wears the app's heading dress (``── Label ──`` in accent, see - # menus.section_heading) rather than reading as grey chrome. The rule - # above the compose line stays muted: that one really is chrome. + # so it wears the app's heading dress (``── Label ──`` in the bold + # ``heading`` grey, see menus.section_heading). The rule above the + # compose line is plain ``muted``: that one really is chrome. divider = render_lines( - Text(f"── {stamp:%a} {stamp:%b} {stamp.day} ──", style="accent"), width + Text(f"── {stamp:%a} {stamp:%b} {stamp.day} ──", style="heading"), width ) self._sticky_headers.append((len(lines), [divider[0]])) lines += divider diff --git a/meshterm/ui/menus.py b/meshterm/ui/menus.py index 86d5bee..4456a31 100644 --- a/meshterm/ui/menus.py +++ b/meshterm/ui/menus.py @@ -594,7 +594,7 @@ async def run_wizard( def section_heading(label: str) -> Separator: - """A ``── Label ──`` accent section heading for a grouped select list. + """A ``── Label ──`` section heading for a grouped select list, in the ``heading`` grey. The one form every grouped list's headings take (the main menu's categories, the config editor's setting groups, Watchtower's Alerts/Watched nodes, Courier's @@ -609,8 +609,11 @@ def section_heading(label: str) -> Separator: on a platform that draws no icon lane, exactly as a command row does — a heading is the same kind of label, and a stand-in glyph beside the rule already drawing ``──`` reads as noise (see :func:`command_label`). + + Grey, never the frame's accent: a rule in the border's own colour reads as part of the + frame rather than as a heading inside it. """ - return Separator(f"── {command_label(label)} ──", style="accent", heading=True) + return Separator(f"── {command_label(label)} ──", style="heading", heading=True) def fit_cells(text: str, width: int, *, align: str = "left") -> str: diff --git a/meshterm/ui/theme.py b/meshterm/ui/theme.py index 7f5a24d..c267abc 100644 --- a/meshterm/ui/theme.py +++ b/meshterm/ui/theme.py @@ -120,6 +120,11 @@ MESH_THEME = Theme( # A step darker than ``muted`` for placeholder dashes (a node's missing packet count / # age) that should recede below the real, muted values around them. "faint": "#64748b", + # A section heading's ``── Label ──`` — a grouped list's, a chat's day divider. A + # dark grey, never the frame's accent: in the border's own colour a heading's rule + # read as part of the frame it sits in (JP, 2026-10-02). Bold, so the label still + # reads as a landmark at that shade. + "heading": "bold #64748b", # A further step darker than ``faint``, for a meter's unlit track (the SNR quality # bars): dark enough to read as background, not as a dimmer version of the reading. "track": "#334155", @@ -340,6 +345,8 @@ MESH_THEME_16 = Theme( "hint.ok": "not bold color(2)", "hint.brand": "not bold color(6)", "faint": "color(8)", + # The console's one dark grey; slot 8 is already the bright bank, so bold moves nothing. + "heading": "bold color(8)", "track": "color(8)", "snr.good": "bold color(10)", "snr.ok": "bold color(11)", diff --git a/meshterm/ui/tui/select.py b/meshterm/ui/tui/select.py index 4613159..b246b1b 100644 --- a/meshterm/ui/tui/select.py +++ b/meshterm/ui/tui/select.py @@ -202,8 +202,8 @@ class Separator: — unlike :attr:`Choice.title`'s zero-argument callable — so a column header can size its labels to the terminal it is being drawn on (see :func:`~meshterm.ui.menus.column_header`). - style: Theme style a *string* title is drawn in. Section headings pass ``"accent"`` - so they read as highlighted landmarks; the default ``"muted"`` fits the + style: Theme style a *string* title is drawn in. Section headings pass ``"heading"`` + so they read as landmarks; the default ``"muted"`` fits the structural rows (blank spacers, column-header lines, inline notes). A ``Text`` title styles itself, so this is unused for one. pinned: Whether this row stays on screen for the *whole* list once scrolled past, diff --git a/tests/test_menus.py b/tests/test_menus.py index 7547a35..2f09ae2 100644 --- a/tests/test_menus.py +++ b/tests/test_menus.py @@ -72,11 +72,11 @@ def test_menu_rows_keep_a_styled_label_styled() -> None: assert any(span.style == "err" for span in title.spans) -def test_section_heading_wears_the_dashes_and_accent() -> None: - """Grouped-list headings read ── Label ── in the accent style, everywhere.""" +def test_section_heading_wears_the_dashes_and_the_heading_grey() -> None: + """Grouped-list headings read ── Label ── in the heading grey, never the frame's accent.""" sep = section_heading("Outbox") assert sep.title == "── Outbox ──" - assert sep.style == "accent" + assert sep.style == "heading" def test_changes_phrase_pluralizes() -> None: