Repeater admin lists the neighbours the node hears
The neighbour table says which nodes a repeater receives directly, and how strongly. Until now the only way to it was the Fetch neighbours row of the trace path composer, three steps in, and the table dissolved into the evidence graph with no screen that showed it. The admin page gets a Neighbours row. The session is already open, so the fetch sends no second login. It runs under the spinner dialog with Abort that the reads use, and the answer floats as the Trace-target picker does: the same lane layout, the same Ctrl+arrow sort ring, the same type-to-filter, the same node hues, type marks, and key lane. Enter opens the node page of the highlighted neighbour, and the list stays pushed under it, so Esc comes back to the same row in the same sort. Only the two middle lanes are new, because here the readings belong to the remote node and not to us: SNR is what that node measured, and HEARD is how long ago it received from the neighbour. Both are declarations in the shared lane spec, so the header, the rows, the widths, and the sort metric all read the same tuple. The contact list gains an `snr` lane kind, an `absent` word for an age lane (a neighbour with no age is not "never" heard: the node hears it and did not say when), and an `unknown` flag that draws the `○` mark, because a type mark on a node nobody identified is a claim we cannot make. A neighbour the device holds as a contact carries that contact. One that nothing can name carries a contact of its key prefix alone, so every row opens a page: it shows what the stored history knows about a node our own radio never heard, which is the question the reader has. The snapshot goes to the repository as before, so a fetch from here feeds the mesh walk, the path composer, and the trace scenarios exactly as a fetch from the composer does. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
17912782ee
commit
d2de2caf60
3 files changed
+288
-18
No files matched your search
+29
-1
@@ -102,7 +102,7 @@ from meshterm.ui.path_composer import PathComposerScreen
|
||||
from meshterm.ui.preferences import _menu_items as _preference_items
|
||||
from meshterm.ui.records_screen import RecordScreen, WalkVertex
|
||||
from meshterm.ui.remote_cli import RemoteCliScreen
|
||||
from meshterm.ui.repeater_admin import AdminMenu
|
||||
from meshterm.ui.repeater_admin import AdminMenu, neighbours_picker
|
||||
from meshterm.ui.repeater_admin import _menu_items as _admin_menu_items
|
||||
from meshterm.ui.theme import name_style
|
||||
from meshterm.ui.timemachine_screen import TimeMachineScreen
|
||||
@@ -1862,6 +1862,33 @@ def _repeater_admin(cols: int, rows: int) -> Screen:
|
||||
return AdminMenu(title, items, footer_hint="↑↓ move · type to filter · Enter select · Esc back")
|
||||
|
||||
|
||||
def _repeater_neighbours(cols: int, rows: int) -> Screen:
|
||||
"""The neighbour table of a repeater, floated as the Trace-target picker is.
|
||||
|
||||
It has the widest shapes that the list can draw: a long name, a node that nothing can
|
||||
name (which reads as its grey key prefix, after the unknown type mark), and an entry
|
||||
for which the node gave neither a reading nor an age.
|
||||
"""
|
||||
from datetime import timedelta
|
||||
|
||||
from meshterm.core.models import NeighbourInfo
|
||||
|
||||
hub = Contact(name="Hilltop-Repeater", public_key=_HUB_KEY, key_prefix="3d63c6429436")
|
||||
now = utcnow()
|
||||
entries = [
|
||||
NeighbourInfo("a1b2c3d4", 7.5, now - timedelta(minutes=12)),
|
||||
NeighbourInfo("b7c80912", 2.0, now - timedelta(days=9)),
|
||||
NeighbourInfo("c3d4e5f6", -4.25, now - timedelta(hours=3)),
|
||||
NeighbourInfo("ffee0011", None, None),
|
||||
]
|
||||
contacts = [
|
||||
Contact(name="Mont-Royal", public_key="a1b2c3d4" + "1" * 56, node_type=NODE_TYPE_REPEATER),
|
||||
Contact(name="A Rather Long Node Name", public_key="b7c80912" + "2" * 56),
|
||||
Contact(name="Chalet-Sensor", public_key="c3d4e5f6" + "3" * 56, node_type=NODE_TYPE_SENSOR),
|
||||
]
|
||||
return neighbours_picker(hub, entries, contacts=contacts, prefix_bytes=1)
|
||||
|
||||
|
||||
def _preferences(cols: int, rows: int) -> Screen:
|
||||
"""The Preferences page when it is widest.
|
||||
|
||||
@@ -2205,6 +2232,7 @@ _ENTRIES: list[_Entry] = [
|
||||
_Entry("config_editor_revealed", _config_editor_revealed),
|
||||
_Entry("repeater_admin", _repeater_admin),
|
||||
_Entry("region_editor", _region_editor),
|
||||
_Entry("repeater_neighbours", _repeater_neighbours),
|
||||
_Entry("preferences", _preferences),
|
||||
_Entry("preferences-weekly-advert", _preferences_weekly_advert),
|
||||
_Entry("cooldown_countdown", _cooldown_countdown),
|
||||
|
||||
Reference in new issue
Block a user