Rework the device-configuration screen from a flat list with an advert-laden "danger zone" into one grouped menu whose every prompt is a real floating modal popup over a persistent backdrop, matching the quit dialog. The main menu now stays pushed on the session stack for the whole editor session, so sub-prompts float over it rather than replacing the screen. Settings are staged and applied together (with a dirty-cancel confirmation); device actions — adverts, reboot, backup/restore, identity key, factory reset — run immediately behind their own dialogs. Adverts get a dedicated menu (zero-hop, flood, or share this node as a QR/URI contact card). Destructive actions gate behind a new TypedConfirmDialog that requires typing RESET / IMPORT. Reboot hands off to the reconnect dialog and waits for the companion to return. Location can be set by pointing at the full-screen map (new LocationPickScreen) or by typing coordinates. Make every dialog consistent: a short title in the border, the instruction as an in-body prompt, and a width sized to its content instead of a fixed wide cap. TextScreen/SelectScreen/AutocompleteScreen gain an optional in-body prompt, and those plus ConfirmScreen gain a dialog_width; the prompt is threaded through the surface and session. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
51 lines
1.4 KiB
Python
51 lines
1.4 KiB
Python
"""A small, centralized, reusable full-screen text-UI library.
|
|
|
|
Built on prompt_toolkit (for the terminal, input, and resize handling) and Rich (for all
|
|
content rendering), this package gives the interactive app a consistent, bounded, layered
|
|
UI: screens never overflow the terminal, long content scrolls, going deeper stacks dialogs
|
|
over a dimmed parent, and Esc always dismisses the current layer.
|
|
|
|
Public API:
|
|
- :class:`~meshterm.ui.tui.session.TuiSession` — the running session and prompt helpers.
|
|
- :class:`~meshterm.ui.tui.select.Choice` / :class:`~meshterm.ui.tui.select.Separator`
|
|
— items for ``session.select``.
|
|
- Screen classes for advanced/custom layers.
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
from .overlay import BusyOverlay
|
|
from .progress import ProgressScreen
|
|
from .prompt import (
|
|
AutocompleteScreen,
|
|
ConfirmScreen,
|
|
ReconnectDialog,
|
|
TextScreen,
|
|
TypedConfirmDialog,
|
|
)
|
|
from .ring import RingSpinner
|
|
from .screen import CANCEL, BusyScreen, Screen, ScrollScreen
|
|
from .select import Choice, SelectScreen, Separator
|
|
from .session import TuiSession
|
|
from .spinner import Spinner
|
|
|
|
__all__ = [
|
|
"TuiSession",
|
|
"Screen",
|
|
"ScrollScreen",
|
|
"BusyScreen",
|
|
"SelectScreen",
|
|
"Choice",
|
|
"Separator",
|
|
"TextScreen",
|
|
"ConfirmScreen",
|
|
"AutocompleteScreen",
|
|
"ReconnectDialog",
|
|
"TypedConfirmDialog",
|
|
"ProgressScreen",
|
|
"Spinner",
|
|
"RingSpinner",
|
|
"BusyOverlay",
|
|
"CANCEL",
|
|
]
|