A trophy case record is a page, not a card floating over the list
The reader is in a record — reading its stats, scrolling the route, arming a trace from it — so it fills the frame like the browser under it and Esc reads back. It used to float as a 62-column card, which read as a question over the list rather than as the page it is. RecordDialog is RecordScreen, full-frame, and the reading width it asked for as a dialog goes with the name. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
1 parent
6bdfa26160
commit
07a566d49d
4 files changed
+29
-21
No files matched your search
@@ -111,6 +111,10 @@ opens over the menu, Esc from it lands there; tracing another node is opening th
|
||||
again. The typed fallback floats the same way. `ContactListScreen` stays a full-screen place
|
||||
everywhere else.
|
||||
|
||||
*Same day — a record is a page.* `RecordDialog` floated a 62-column card over the trophy
|
||||
case; the reader is *in* a record (reading, scrolling, arming a trace), so it is
|
||||
`RecordScreen`, full-frame, Esc back onto the browser.
|
||||
|
||||
**I. An entry chain of prompts was not a stack.** Five flows asked two or more things in a
|
||||
row, and Esc on any of them abandoned the whole flow rather than stepping back one — a
|
||||
mistyped 32-hex channel key cost the name typed before it. `menus.run_steps` now runs a
|
||||
|
||||
@@ -13,7 +13,8 @@ opened from the main menu. Every successful trace — a *Trace target* boomerang
|
||||
path widget with both ends bare (every record is a boomerang, so the cells go to the
|
||||
hops). A discipline holding records at more than one hash width tags each row with its
|
||||
width, since the widths are genuinely different games;
|
||||
* opening a record floats :class:`RecordDialog` — every stat the walk was measured by
|
||||
* opening a record pushes :class:`RecordScreen`, a full-screen page — every stat the walk
|
||||
was measured by
|
||||
(the far point named with the node it reached, the longest leg with the link it spanned),
|
||||
the walk drawn two ways: on THE route graph (the Message paths dialog's shape, us at both
|
||||
ends, drawn no taller than one lane
|
||||
@@ -180,8 +181,13 @@ class WalkVertex:
|
||||
is_self: bool
|
||||
|
||||
|
||||
class RecordDialog(Screen):
|
||||
"""One record's full story, floating over the screen beneath.
|
||||
class RecordScreen(Screen):
|
||||
"""One record's full story, a full-screen page pushed over the trophy case.
|
||||
|
||||
A place rather than a popup: the reader is *in* the record — reading, scrolling,
|
||||
arming a trace from it — so it fills the frame like the browser under it, and Esc
|
||||
reads *back*. It used to float as a 62-column card, which read as a question over the
|
||||
list rather than as the page it is.
|
||||
|
||||
Every stat the walk was measured by — a reliability read from the far node's trace
|
||||
history, the far point named with the node it reached, the longest leg drawn as the
|
||||
@@ -198,6 +204,8 @@ class RecordDialog(Screen):
|
||||
removes this one record behind a red Cancel/Delete data-loss confirm.
|
||||
"""
|
||||
|
||||
floating = False
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
record: DiscoveredPath,
|
||||
@@ -255,11 +263,6 @@ class RecordDialog(Screen):
|
||||
# cursor, while PgUp/PgDn/Home/End scroll the body free of it (see cursor_line).
|
||||
self._follow = False
|
||||
|
||||
@property
|
||||
def dialog_width(self) -> int:
|
||||
"""A comfortable reading width; the compositor still caps it to the frame."""
|
||||
return 62
|
||||
|
||||
def handle(self, action: str, data: str = "") -> None:
|
||||
"""Move the action cursor, scroll the card, commit the selection, or dismiss."""
|
||||
if action == "up":
|
||||
@@ -913,10 +916,11 @@ async def open_records(ctx: AppContext) -> dict:
|
||||
# trace screen and used to come up as a content-sized box.
|
||||
browser.floating = False
|
||||
# The browser stays pushed for the whole visit, so every dialog that belongs *over*
|
||||
# the trophy case — the discipline picker, the delete confirms, a record's floating
|
||||
# story — already has it drawn full-frame behind them, and the cursor is still on the
|
||||
# record just read when they close. The loop only leaves (and the list only rebuilds,
|
||||
# losing that place) when the record set itself has changed under it.
|
||||
# the trophy case — the discipline picker, the delete confirms — already has it
|
||||
# drawn full-frame behind them, and a record's page (full-frame itself) pops back
|
||||
# onto it with the cursor still on the record just read. The loop only leaves (and
|
||||
# the list only rebuilds, losing that place) when the record set itself has changed
|
||||
# under it.
|
||||
async with session.stay(browser) as visit:
|
||||
while True:
|
||||
picked = await visit.result()
|
||||
@@ -937,7 +941,7 @@ async def open_records(ctx: AppContext) -> dict:
|
||||
_verb, category, rank, record = picked
|
||||
far_label, far_id, shape = walk_drawing(record)
|
||||
action = await session.run_screen(
|
||||
RecordDialog(
|
||||
RecordScreen(
|
||||
record,
|
||||
category,
|
||||
rank,
|
||||
|
||||
@@ -83,7 +83,7 @@ from meshterm.ui.node_detail_screen import NodeDetailScreen, _Action, _RoutesVie
|
||||
from meshterm.ui.packet_viewer import PacketEntry, PacketViewer
|
||||
from meshterm.ui.path_composer import PathComposerScreen
|
||||
from meshterm.ui.preferences import _menu_items as _preference_items
|
||||
from meshterm.ui.records_screen import RecordDialog
|
||||
from meshterm.ui.records_screen import RecordScreen
|
||||
from meshterm.ui.remote_cli import RemoteCliScreen
|
||||
from meshterm.ui.repeater_admin import AdminMenu
|
||||
from meshterm.ui.repeater_admin import _menu_items as _admin_menu_items
|
||||
@@ -663,7 +663,7 @@ def _record(**over) -> DiscoveredPath:
|
||||
|
||||
def _record_dialog(cols: int, rows: int) -> Screen:
|
||||
record = _record()
|
||||
return RecordDialog(
|
||||
return RecordScreen(
|
||||
record,
|
||||
CATEGORY_BY_ID[record.category],
|
||||
1,
|
||||
|
||||
@@ -24,7 +24,7 @@ from meshterm.core.device_store import DeviceStore
|
||||
from meshterm.persistence.repository import DiscoveredPath, Repository
|
||||
from meshterm.services.records import CATEGORIES, CATEGORY_BY_ID
|
||||
from meshterm.ui.records_screen import (
|
||||
RecordDialog,
|
||||
RecordScreen,
|
||||
WalkVertex,
|
||||
discipline_label,
|
||||
discipline_lane,
|
||||
@@ -83,8 +83,8 @@ def _record(**kw) -> DiscoveredPath:
|
||||
return DiscoveredPath(**defaults)
|
||||
|
||||
|
||||
def _dialog(record: DiscoveredPath, rank: int = 1, **kw) -> RecordDialog:
|
||||
return RecordDialog(
|
||||
def _dialog(record: DiscoveredPath, rank: int = 1, **kw) -> RecordScreen:
|
||||
return RecordScreen(
|
||||
record,
|
||||
CATEGORY_BY_ID[record.category],
|
||||
rank,
|
||||
@@ -104,7 +104,7 @@ def test_record_dialog_shows_stats_route_and_the_trace_action() -> None:
|
||||
assert "Trace this path" in body # the renamed action (was "Walk again")
|
||||
assert "Walk again" not in body
|
||||
assert "Delete record" in body
|
||||
assert "Back" not in body # no exit row: Esc closes the story
|
||||
assert "Back" not in body # no exit row: Esc leaves the page
|
||||
|
||||
|
||||
def test_record_dialog_draws_the_walk_as_a_route_graph() -> None:
|
||||
@@ -642,9 +642,9 @@ async def test_trace_this_path_nests_above_the_browser_and_comes_back_to_it(
|
||||
record = ctx.repo.discoveries("grand_tour")[0]
|
||||
browser.resolve(("open", CATEGORY_BY_ID["grand_tour"], 1, record))
|
||||
dialog = await _step_until(
|
||||
lambda: session._float_layers()[0] if session._has_float() else None
|
||||
lambda: session.top if isinstance(session.top, RecordScreen) else None
|
||||
)
|
||||
assert isinstance(dialog, RecordDialog)
|
||||
assert session._base_screen() is dialog, "the record is a page, full-frame"
|
||||
dialog.resolve("trace") # "Trace this path"
|
||||
# The trace ran and the browser is back on top — the same object, not a rebuild.
|
||||
again = await _step_until(lambda: _trophy_case(session))
|
||||
|
||||
Reference in new issue
Block a user