Mesh walk: just the name
The title is the screen's name now, with no status atoms at all. Everything it used to carry is already on the screen below it: the breadcrumb trail ends on the focus, the line under that names the node in colour with its hash and its ring, and how big the neighbourhood is, is what the canvas and the link list are for. Set once at construction rather than composed per render, so the top row holds still while the walk moves. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
2252f2622e
commit
b6f3218af9
2 files changed
+12
-28
No files matched your search
@@ -261,6 +261,14 @@ class WalkScreen(Screen):
|
||||
prefix_bytes: Path-hash width to light in the hash lane (0 = none).
|
||||
"""
|
||||
super().__init__()
|
||||
# The screen's name, and nothing else (JP, 2026-08-30). It carried the focus and
|
||||
# the graph's size — ``Mesh walk — YUL-Cartierville · 42 nodes · 61 links`` — which
|
||||
# ran past a 53-column title bar, and every atom of it was already on the screen
|
||||
# below: the trail ends on the focus, the line under it names that node in colour
|
||||
# with its hash and its ring, and how big the neighbourhood is, is what the canvas
|
||||
# and the link list are *for*. Set once here rather than composed per render, so
|
||||
# the top row never rewrites itself as the walk moves.
|
||||
self.title = "Mesh walk"
|
||||
self._session = session
|
||||
self._topo = topo
|
||||
self._contacts = contacts
|
||||
@@ -527,7 +535,6 @@ class WalkScreen(Screen):
|
||||
links = self._topo.links()
|
||||
rows = self._rows()
|
||||
self._index = max(0, min(self._index, len(rows) - 1)) if rows else 0
|
||||
self.title = self._compose_title(links)
|
||||
if not links:
|
||||
return self._empty_state(width)
|
||||
|
||||
@@ -575,29 +582,6 @@ class WalkScreen(Screen):
|
||||
height = min(height, viewport - chrome - _LIST_MIN_ROWS)
|
||||
return max(4, height)
|
||||
|
||||
def _compose_title(self, links: list[Link]) -> str:
|
||||
"""``Mesh walk`` plus the graph's status atoms — the size of what is being walked.
|
||||
|
||||
The focus used to lead it (``Mesh walk — YUL-Cartierville · …``) and it was the
|
||||
title's longest atom, its most changeable, and its only redundant one: the
|
||||
breadcrumb trail ends on the focus and the line under it names the same node in
|
||||
colour, with its hash, its ring and when it was last heard. Spending a fifth of a
|
||||
53-column title bar on a third telling — and rewriting the top row at every step of
|
||||
the walk — cost more than it said (JP, 2026-08-30). So the title reads like the
|
||||
map's, the other spatial screen, whose centre is likewise the body's to name:
|
||||
status atoms only.
|
||||
|
||||
The match count **swaps** for the node count rather than joining it, exactly as the
|
||||
map's does, so a narrowed walk says how much of the mesh answered the query without
|
||||
the title growing a fourth atom the bar would have to clip.
|
||||
"""
|
||||
nodes = len(self._all_nodes())
|
||||
if self._filter:
|
||||
count = f"{len(self._matches())} of {nodes} match"
|
||||
else:
|
||||
count = f"{nodes} nodes"
|
||||
return f"Mesh walk · {count} · {len(links)} links"
|
||||
|
||||
def _header_lines(self, width: int, depths: dict[str, int]) -> list[str]:
|
||||
"""The breadcrumb trail and the focus node's identity line.
|
||||
|
||||
|
||||
+4
-4
@@ -69,9 +69,9 @@ def test_walk_opens_focused_on_us_with_the_link_list() -> None:
|
||||
assert "Links" in body and "strongest observed first" in body
|
||||
assert "YUL-Cartierville" in body # our one neighbour, as a selectable row
|
||||
assert "edge = SNR" in body # the canvas legend
|
||||
# Status atoms only, like the map's: the focus is the trail's and the focus line's
|
||||
# to name, and it is named there in colour, with its hash and its ring.
|
||||
assert screen.title == "Mesh walk · 3 nodes · 2 links"
|
||||
# The screen's name, and nothing else: the focus, and how big the neighbourhood is,
|
||||
# are what the body under it is for.
|
||||
assert screen.title == "Mesh walk"
|
||||
|
||||
|
||||
def test_walk_link_rows_carry_snr_evidence_and_onward_count() -> None:
|
||||
@@ -563,7 +563,7 @@ def test_walk_find_lists_matches_and_teleports() -> None:
|
||||
body = _plain(screen.render_body(80))
|
||||
assert "Matches" in body and "Alice" in body
|
||||
assert "2 hops out" in body # the match row says how far away it sits
|
||||
assert screen.title == "Mesh walk · 1 of 3 match · 2 links" # swapped for the count
|
||||
assert screen.title == "Mesh walk" # the title holds still; the list is the answer
|
||||
|
||||
screen.handle("enter")
|
||||
alice = topo.canonical(ALICE.public_key)
|
||||
|
||||
Reference in new issue
Block a user