From b6e7cd5c16ca3c9be9cb72b08fa1c2ef4db7e3bb Mon Sep 17 00:00:00 2001 From: Jean-Pierre Martineau Date: Sun, 4 Oct 2026 11:52:41 -0400 Subject: [PATCH] The handhelds are named for their variant: picocalc-lyra and cardputer-zero M5Stack makes three Cardputers and only the Zero runs Linux; the PicoCalc takes several cores and only the Luckfox Lyra runs MeshTerm. So the bare names were ambiguous, and every reference to the two devices now carries the variant: the --platform values and MESHTERM_PLATFORM, the Platform constants (PICOCALC_LYRA, CARDPUTER_ZERO), their lane decks and every screen's picocalc_lyra_lane / cardputer_zero_lane, the font inventories, the lane chips' theme styles, the scripts/ folders, the two chrome test files, and the docs and CLAUDE.md that name them. There is no alias: --platform picocalc is refused with the three real choices listed, rather than falling back to the desktop layout. The PicoCalc is auto-detected from its device tree, so it needs nothing. What names hardware or a user's data keeps its name: the PicoCalc keyboard's input-device name, its battery's sysfs supply, and the serial profile the Lyra setup script writes. .gitignore follows the firmware's folder, and the changelog keeps the words each release used. Co-Authored-By: Claude Opus 5.5 (1M context) --- .../profile-picocalc/scripts/bench_ablate.py | 8 +- .../profile-picocalc/scripts/drive_console.py | 2 +- .gitignore | 6 +- CLAUDE.md | 34 ++++---- README.md | 2 +- docs/cli/README.md | 4 +- docs/devices/README.md | 44 +++++----- docs/devices/cardputer-zero.md | 2 +- docs/devices/picocalc-lyra.md | 18 ++--- meshterm/cli.py | 7 +- meshterm/core/preferences.py | 4 +- meshterm/host/__main__.py | 2 +- meshterm/host/font.py | 8 +- meshterm/host/keys.py | 4 +- meshterm/host/run.py | 10 +-- meshterm/platforms.py | 39 ++++----- meshterm/services/consolefont.py | 4 +- meshterm/services/modifier_watch.py | 2 +- meshterm/ui/about.py | 2 +- meshterm/ui/chat.py | 2 +- meshterm/ui/config_editor.py | 4 +- meshterm/ui/contactlist.py | 4 +- meshterm/ui/dashboard_screen.py | 4 +- meshterm/ui/device_info_screen.py | 2 +- meshterm/ui/diagnostics.py | 4 +- meshterm/ui/fontset.py | 12 +-- meshterm/ui/livefeed_screen.py | 2 +- meshterm/ui/map_screen.py | 6 +- meshterm/ui/menu.py | 4 +- meshterm/ui/message_paths_screen.py | 2 +- meshterm/ui/node_detail_screen.py | 2 +- meshterm/ui/packet_viewer.py | 6 +- meshterm/ui/records_screen.py | 5 +- meshterm/ui/region_editor.py | 4 +- meshterm/ui/remote_cli.py | 2 +- meshterm/ui/repeater_admin.py | 4 +- meshterm/ui/theme.py | 12 +-- meshterm/ui/timemachine_screen.py | 2 +- meshterm/ui/trace_screen.py | 2 +- meshterm/ui/tui/fkeys.py | 28 +++---- meshterm/ui/tui/progress.py | 2 +- meshterm/ui/tui/prompt.py | 6 +- meshterm/ui/tui/screen.py | 12 +-- meshterm/ui/tui/select.py | 6 +- meshterm/ui/tui/session.py | 2 +- meshterm/ui/walk_screen.py | 4 +- meshterm/ui/watchtower_screen.py | 2 +- scripts/README.md | 4 +- .../fetch-terminus.py | 4 +- .../LICENSE.GPL-2.0 | 0 .../calculinux-console-font-6x12.sh | 4 +- .../calculinux-console-font-6x8.sh | 2 +- .../calculinux-radio-bridge.sh | 0 .../calculinux-setup.sh | 0 .../calculinux-wifi-set.sh | 0 .../xiao-radio/LICENSE.MeshCore | 0 .../xiao-radio/README.md | 4 +- .../xiao-radio/build-firmware.sh | 0 .../xiao-radio/flash.py | 0 .../xiao-radio/lyra-setup.sh | 0 .../xiao-radio/meshcore-uart1.patch | 0 .../xiao-radio/uart1-mux.py | 0 tests/conftest.py | 2 +- tests/test_about.py | 16 ++-- tests/test_braillechart.py | 4 +- ...hrome.py => test_cardputer_zero_chrome.py} | 28 +++---- tests/test_channels.py | 8 +- tests/test_chat.py | 73 +++++++++-------- tests/test_colsnap.py | 4 +- tests/test_config_editor.py | 22 ++--- tests/test_console_host.py | 14 ++-- tests/test_courier.py | 4 +- tests/test_dashboard.py | 8 +- tests/test_device_config.py | 6 +- tests/test_diagnostics.py | 8 +- tests/test_gallery.py | 34 +++++--- tests/test_lane_decks.py | 80 ++++++++++--------- tests/test_live_screens.py | 6 +- tests/test_map.py | 44 +++++----- tests/test_markdown.py | 10 +-- tests/test_menu_quit_row.py | 12 +-- tests/test_menus.py | 8 +- tests/test_navigation.py | 12 +-- tests/test_node_detail.py | 22 ++--- tests/test_packet_viewer.py | 16 ++-- tests/test_performance.py | 22 ++--- ...chrome.py => test_picocalc_lyra_chrome.py} | 78 +++++++++--------- tests/test_platforms.py | 55 ++++++++----- tests/test_preferences.py | 4 +- tests/test_records_screen.py | 4 +- tests/test_region_admin.py | 4 +- tests/test_repeater_admin.py | 4 +- tests/test_scope_display.py | 4 +- tests/test_selection_colour.py | 14 ++-- tests/test_send_scope.py | 6 +- tests/test_session_color_depth.py | 4 +- tests/test_session_width.py | 10 +-- tests/test_spdx.py | 2 +- tests/test_theme16.py | 44 +++++----- tests/test_timemachine.py | 10 +-- tests/test_tui.py | 16 ++-- tests/test_vt_console_font.py | 10 +-- tests/test_walk.py | 22 ++--- tests/test_watchtower.py | 8 +- 104 files changed, 587 insertions(+), 542 deletions(-) rename scripts/{cardputer => cardputer-zero}/fetch-terminus.py (94%) rename scripts/{picocalc => picocalc-lyra}/LICENSE.GPL-2.0 (100%) rename scripts/{picocalc => picocalc-lyra}/calculinux-console-font-6x12.sh (99%) rename scripts/{picocalc => picocalc-lyra}/calculinux-console-font-6x8.sh (99%) rename scripts/{picocalc => picocalc-lyra}/calculinux-radio-bridge.sh (100%) rename scripts/{picocalc => picocalc-lyra}/calculinux-setup.sh (100%) rename scripts/{picocalc => picocalc-lyra}/calculinux-wifi-set.sh (100%) rename scripts/{picocalc => picocalc-lyra}/xiao-radio/LICENSE.MeshCore (100%) rename scripts/{picocalc => picocalc-lyra}/xiao-radio/README.md (92%) rename scripts/{picocalc => picocalc-lyra}/xiao-radio/build-firmware.sh (100%) rename scripts/{picocalc => picocalc-lyra}/xiao-radio/flash.py (100%) rename scripts/{picocalc => picocalc-lyra}/xiao-radio/lyra-setup.sh (100%) rename scripts/{picocalc => picocalc-lyra}/xiao-radio/meshcore-uart1.patch (100%) rename scripts/{picocalc => picocalc-lyra}/xiao-radio/uart1-mux.py (100%) rename tests/{test_cardputer_chrome.py => test_cardputer_zero_chrome.py} (90%) rename tests/{test_picocalc_chrome.py => test_picocalc_lyra_chrome.py} (89%) diff --git a/.claude/skills/profile-picocalc/scripts/bench_ablate.py b/.claude/skills/profile-picocalc/scripts/bench_ablate.py index 179fd25..8ca5643 100644 --- a/.claude/skills/profile-picocalc/scripts/bench_ablate.py +++ b/.claude/skills/profile-picocalc/scripts/bench_ablate.py @@ -26,7 +26,7 @@ from prompt_toolkit.input.defaults import create_pipe_input from prompt_toolkit.output.vt100 import Vt100_Output from rich.text import Text -from meshterm.platforms import PICOCALC, REGULAR, set_platform +from meshterm.platforms import PICOCALC_LYRA, REGULAR, set_platform from meshterm.ui.tui.session import TuiSession @@ -149,11 +149,11 @@ def main(): ap = argparse.ArgumentParser() ap.add_argument("--only", default="") ap.add_argument("--reps", type=int, default=20) - ap.add_argument("--platform", default="picocalc") + ap.add_argument("--platform", default="picocalc-lyra") args = ap.parse_args() - set_platform(PICOCALC if args.platform == "picocalc" else REGULAR) - cols, rows = (53, 26) if args.platform == "picocalc" else (72, 24) + set_platform(PICOCALC_LYRA if args.platform == "picocalc-lyra" else REGULAR) + cols, rows = (53, 26) if args.platform == "picocalc-lyra" else (72, 24) from tests import test_gallery as g diff --git a/.claude/skills/profile-picocalc/scripts/drive_console.py b/.claude/skills/profile-picocalc/scripts/drive_console.py index 25ea99a..283033d 100644 --- a/.claude/skills/profile-picocalc/scripts/drive_console.py +++ b/.claude/skills/profile-picocalc/scripts/drive_console.py @@ -140,7 +140,7 @@ def main(): if pid == 0: # child: become the app os.environ["TERM"] = "linux" os.environ["MESHTERM_FULL_WIDTH"] = "0" - argv = [args.exe, "--platform", "picocalc"] + argv = [args.exe, "--platform", "picocalc-lyra"] if args.mock: argv.append("--mock") os.execv(argv[0], argv) diff --git a/.gitignore b/.gitignore index 87ab429..f0f5fa3 100644 --- a/.gitignore +++ b/.gitignore @@ -31,6 +31,6 @@ output/ # addresses, logins, the local venv path). .dev.env.example is tracked and shows the shape. .dev.env -# Built radio firmware (scripts/picocalc/xiao-radio/build-firmware.sh writes it here) -scripts/picocalc/xiao-radio/*.uf2 -scripts/picocalc/xiao-radio/_meshcore-build/ +# Built radio firmware (scripts/picocalc-lyra/xiao-radio/build-firmware.sh writes it here) +scripts/picocalc-lyra/xiao-radio/*.uf2 +scripts/picocalc-lyra/xiao-radio/_meshcore-build/ diff --git a/CLAUDE.md b/CLAUDE.md index 4c5a905..40db44d 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -7,7 +7,7 @@ everything heard is recorded to SQLite (`meshterm/persistence/`). Run the tests with `python -m pytest -q`. Screens must stay readable at each platform's `readable_cols` — 72 regular, 53 PicoCalc (see **Platforms** below); the dual-platform -gallery test (`tests/test_gallery.py`) is the enforcement point, and every picocalc case +gallery test (`tests/test_gallery.py`) is the enforcement point, and every picocalc-lyra case is a hard gate. ## Git workflow @@ -28,7 +28,7 @@ never `git push` unless explicitly asked in that moment. frame's, not the drawing's, wherever the frame has one — **regular** sets the credit into the panel's **bottom border rule**, right-justified, one rule cell before the corner, the way a title sits in the top rule (`Screen.bottom_caption` → `frame._panel_box`), so the - map's cells are untouched; **picocalc**, whose frame has no bottom rule at all, stamps it + map's cells are untouched; **picocalc-lyra**, whose frame has no bottom rule at all, stamps it over the right end of the drawing's last row instead, overprinting what it covers. The minimap always stamps. The split is bound once via `platforms.on_platform`, never asked per frame. Never a title atom, never a footer character, never a key. The licence and URL @@ -155,7 +155,7 @@ deliberately, one at a time, and say why in the code. `TuiSession._dispatch`, and neither is advertised — a global verb has no screen to belong to, and the F-key lane has only three free slots per screen — except `^Q quit?` on the main menu's own hint, where Esc is inert and the reader looks for the way out. - On picocalc that atom rides the title bar's tail (`frame._way_out`), and the menu's lane + On picocalc-lyra that atom rides the title bar's tail (`frame._way_out`), and the menu's lane puts the way out on F3: `Quit?` asks, its Shift half F8 `Quit!` leaves without asking (`quit_now`, the one door that skips the confirm, and only on the menu). The confirm keeps the chip that asked: its F3 reads `Quit!` and sends the same `quit`, which with @@ -213,7 +213,7 @@ deliberately, one at a time, and say why in the code. that reads as the screen changing under you rather than as one step, and held-down arrows should settle at an end rather than loop. The exception is a **forward-only key 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 + the picocalc-lyra 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. - **Edge scroll** — what a clamped arrow does instead. With the highlight on the first selectable row, ↑ scrolls the page up a line, and on the last, ↓ scrolls it down, until @@ -335,7 +335,7 @@ as a grouped list does. Filling a page in is editing its `.md`; no Python follow Where the footer is the hint line (regular) it carries the *top* screen's hint, so a floating dialog's border stays silent — the same sentence in the border and at the bottom of the terminal was one of them wasted — and its clip arrows fall back to the - base frame's `↑↓ more`. Where the footer is the F-key lane (picocalc) there is no hint + base frame's `↑↓ more`. Where the footer is the F-key lane (picocalc-lyra) there is no hint line, so the border is the only place Enter/Esc/the arrows can be named and it keeps the hint, less every atom whose keys are all chips on the lane one row below (`fkeys.strip_lane_atoms` via `frame._dialog_hint`, resolved **per paint** — a screen @@ -632,8 +632,8 @@ derived sweep that runs **every** registered command twice, once plain and once ### Platforms One codebase, three flavours: **regular** (desktop/ssh, 72 cols, truecolor, emoji), -**picocalc** (the PicoCalc's 53×26/53×40 framebuffer console, 16 palette slots, a -512-glyph font, no emoji), and **cardputer** (M5Stack's Cardputer Zero, 53×14 in 6×12 +**picocalc-lyra** (the PicoCalc's 53×26/53×40 framebuffer console, 16 palette slots, a +512-glyph font, no emoji), and **cardputer-zero** (M5Stack's Cardputer Zero, 53×14 in 6×12 cells on a 320×170 panel a console host paints itself, truecolor, no emoji — hardware not yet in hand, so it is chosen by flag only). A frozen `Platform` spec (`meshterm/platforms.py`) resolves @@ -655,13 +655,13 @@ branch on the platform per frame, and never `from meshterm.platforms import PLAT draws over the bar (`dialog_row_margin` 1) but never over the lane, which is the dialog's own; the bar's ends either side of the box are blanked (`frame.composite_float`), since a stray `7%` would read as the battery. -- **Never emit a raw emoji or bare hex colour into picocalc output.** Icons go through +- **Never emit a raw emoji or bare hex colour into picocalc-lyra output.** Icons go through `theme.glyph()` (the compact map); everything else is caught by the render-boundary fold (`theme.fold_text`, applied in `tui/render.render_to_ansi` and `MapCanvas.to_ansi_lines`) — but the fold is the safety net, not the design. - The glyph contract is `ui/fontset.py` — the installed console font's exact codepoint inventory, device-verified. A character outside it is a test failure, not a tofu box - found on-device. The font itself is built by `scripts/picocalc/calculinux-console-font-6x12.sh`; + found on-device. The font itself is built by `scripts/picocalc-lyra/calculinux-console-font-6x12.sh`; the two files move in the same commit. - The 16-slot palette is `theme._VT_SLOTS` (programmed via `/etc/vtrgb`; same script). `MESH_THEME_16` speaks `color(0..15)` only; backgrounds stop at slot 7. Both themes @@ -676,7 +676,7 @@ branch on the platform per frame, and never `from meshterm.platforms import PLAT `22;3N`, never a bare `3N`, because `9N` is *how* the console spells bright and adjacent art spans (the wordmark's bevels, a raster's neighbouring cells) reset nothing between them, so a bare one inherits the intensity bit and lands a bank too high mid-row. -- On picocalc, the node hue and the heat gradient **quantize** — same rule, coarser +- On picocalc-lyra, the node hue and the heat gradient **quantize** — same rule, coarser resolution: `node_style` snaps the key's hue to its sixth of the wheel (`theme._NODE_SLOT_HEXES`, the six chromatic bright slots) and heat to the `heat.*` steps. Nothing loses its colour for being on the console. Marks whose hue is *fixed* @@ -707,10 +707,10 @@ branch on the platform per frame, and never `from meshterm.platforms import PLAT jumps, the Time Machine's `w`, the map's `^Y`, a row's `Del`) earns a slot — otherwise it is undiscoverable on the device. - **Each handheld deals its own lane.** Everything about the lane that belongs to one - keyboard is a `LaneDeck` (`fkeys.PICOCALC_DECK`, `fkeys.CARDPUTER_DECK`), named by + keyboard is a `LaneDeck` (`fkeys.PICOCALC_LYRA_DECK`, `fkeys.CARDPUTER_ZERO_DECK`), named by `Platform.lane_deck`: which keycodes drive the slots, where the chips sit on the row, how they are drawn, and which of a screen's definitions it reads. A screen defines - `picocalc_lane`, and `cardputer_lane` follows it until that screen overrides it (JP, + `picocalc_lyra_lane`, and `cardputer_zero_lane` follows it until that screen overrides it (JP, 2026-09-30: same entries for now, Fn+L/M being an awkward reach for paging). Override the per-deck property, never `fkey_lane`, which only resolves the active deck; resolve a key or draw a row through the deck (`deck.action_for`, `deck.lane_text`), never by @@ -730,12 +730,12 @@ branch on the platform per frame, and never `from meshterm.platforms import PLAT front end is the only part that differs: the framebuffer and evdev on the device (`host/device.py`, written ahead of the hardware), a Tk window on the desktop (`host/sim.py`): `python -m meshterm.host --mock`, after - `python scripts/cardputer/fetch-terminus.py` once. Its glyph contract is - `fontset.CARDPUTER_CODEPOINTS`, named by `Platform.font` as the PicoCalc's is; the fold + `python scripts/cardputer-zero/fetch-terminus.py` once. Its glyph contract is + `fontset.CARDPUTER_ZERO_CODEPOINTS`, named by `Platform.font` as the PicoCalc's is; the fold derives everything from the platform's font (accents, emoji, the `?` net) and quantizes colour only where `truecolor` is off. - `meshterm specimen` prints the whole visual language through the real funnels — the - acceptance card on-device, a preview under `--platform picocalc` on the desktop. -- Dev loop: `meshterm --mock --platform picocalc` in a 53×40 window, or - `--platform cardputer` in a 53×14 one; the gallery and `tests/test_theme16.py` carry the + acceptance card on-device, a preview under `--platform picocalc-lyra` on the desktop. +- Dev loop: `meshterm --mock --platform picocalc-lyra` in a 53×40 window, or + `--platform cardputer-zero` in a 53×14 one; the gallery and `tests/test_theme16.py` carry the contracts. diff --git a/README.md b/README.md index d14193e..dd1e6f7 100644 --- a/README.md +++ b/README.md @@ -232,7 +232,7 @@ meshterm --mock # On a ClockworkPi PicoCalc (Luckfox Lyra / Calculinux) the handheld flavour is # auto-detected: a 53-column layout, a 16-slot palette, a compact glyph language on a # custom console font, and an F-key hint lane. Preview it anywhere, or inspect it: -meshterm --mock --platform picocalc +meshterm --mock --platform picocalc-lyra meshterm specimen ``` diff --git a/docs/cli/README.md b/docs/cli/README.md index f919e49..50c79c8 100644 --- a/docs/cli/README.md +++ b/docs/cli/README.md @@ -61,7 +61,7 @@ With no command, MeshTerm launches the interactive menu instead. | `--json` | Print the answer as JSON instead of aligned text. | | `--absolute` | Print times as ISO-8601 instants rather than relative ages, for this run. | | `-q`, `--quiet` | Suppress console logging entirely (the log file still records). | -| `--platform NAME` | Force the UI flavour (`regular`\|`picocalc`) instead of detecting it. | +| `--platform NAME` | Force the UI flavour (`regular`\|`picocalc-lyra`\|`cardputer-zero`) instead of detecting it. | **A global option may be typed anywhere** — before the command or after it. `meshterm --json contacts` and `meshterm contacts --json` are the same run, because `-o json` goes @@ -1730,7 +1730,7 @@ Print the visual-language specimen — every mark, icon, colour scale and fold o **This is the one command that keeps its colour**, and it builds its own themed console to do it. That is deliberate: the colour *is* the output. It is the font-and-palette -acceptance card on the PicoCalc console, and with `--platform picocalc` it previews that +acceptance card on the PicoCalc console, and with `--platform picocalc-lyra` it previews that flavour from a desktop. A monochrome specimen would test nothing. It is also the one command that **refuses `--json`**, as a usage error (exit `2`). There is diff --git a/docs/devices/README.md b/docs/devices/README.md index cb0c897..0bab20a 100644 --- a/docs/devices/README.md +++ b/docs/devices/README.md @@ -26,8 +26,8 @@ script before you run it; most run as root and change the machine they run on. ## The scripts [`scripts/`](../../scripts/) holds the device-side helpers, one folder per manual: -[`picocalc/`](../../scripts/picocalc/) for the PicoCalc — bringing up Calculinux on the Lyra, -building its console font, and (under [`xiao-radio/`](../../scripts/picocalc/xiao-radio/)) +[`picocalc-lyra/`](../../scripts/picocalc-lyra/) for the PicoCalc — bringing up Calculinux on the Lyra, +building its console font, and (under [`xiao-radio/`](../../scripts/picocalc-lyra/xiao-radio/)) giving it a MeshCore radio over UART — and [`uconsole/`](../../scripts/uconsole/) for the always-on bridge that fronts the uConsole's SPI-attached LoRa chip as a companion (MeshTerm can also drive that chip directly, with no script at all — the uConsole manual covers @@ -38,36 +38,40 @@ directly, or a pump in front of it, never both. | File | Runs on | What it does | | --- | --- | --- | -| [`picocalc/calculinux-setup.sh`](../../scripts/picocalc/calculinux-setup.sh) | the Lyra (root) | One-time bring-up: python packages, the Wi-Fi boot-scan kick, a boot clock sync (there is no RTC), the deploy user, the checkout, the venv and `pip install -e .`, the login PATH, and the console font. Idempotent. | -| [`picocalc/calculinux-console-font-6x12.sh`](../../scripts/picocalc/calculinux-console-font-6x12.sh) | the Lyra (root) | Just the console font: builds, installs and persists the 512-glyph **meshterm** PSF (braille, node marks, rounded frame corners, the list cursor) and restores the stock 16-slot palette. Calls the 6×8 build below when it sits alongside. Run it alone after a MeshTerm update, from the pulled checkout (`/home/meshterm/MeshTerm/scripts/picocalc/`) rather than the copy made at install time. | -| [`picocalc/calculinux-console-font-6x8.sh`](../../scripts/picocalc/calculinux-console-font-6x8.sh) | the Lyra (root) | The shorter-cell companion font, **meshterm8** (6×8 → 53×40), for anyone who wants more rows than the 6×12 default gives. Its base bitmap is the kernel's `font_6x8`, so this one file and the PSF it builds are **GPL-2.0-only** ([`LICENSE.GPL-2.0`](../../scripts/picocalc/LICENSE.GPL-2.0) sits beside it); it reads the donor/alias/keeper tables out of the script above rather than keeping a second copy. Pick between the two fonts from MeshTerm's Preferences page. | -| [`picocalc/calculinux-wifi-set.sh`](../../scripts/picocalc/calculinux-wifi-set.sh) | the Lyra (sudo) | Interactive Wi-Fi join: prompts for an SSID and passphrase, writes iwd's credentials, connects now. This is how a network *becomes* known to the boot kick. | -| [`picocalc/calculinux-radio-bridge.sh`](../../scripts/picocalc/calculinux-radio-bridge.sh) | the Lyra (root) | **Unfinished, unsupported.** An early UART-to-TCP pump: it serves `/dev/ttyS1` on TCP port 5000 and writes a `radio` TCP profile. It does not route UART1 to the header pads. Superseded by `xiao-radio/lyra-setup.sh`, which does the routing and points MeshTerm at the serial port directly. | -| [`picocalc/xiao-radio/`](../../scripts/picocalc/xiao-radio/) | see below | Everything for the XIAO nRF52840 + Wio-SX1262 radio wired to the Lyra's UART1; its [bench card](../../scripts/picocalc/xiao-radio/README.md) has the wiring table. The firmware is MeshCore, MIT-licensed — [`LICENSE.MeshCore`](../../scripts/picocalc/xiao-radio/LICENSE.MeshCore) sits beside the patch. | -| [`xiao-radio/build-firmware.sh`](../../scripts/picocalc/xiao-radio/build-firmware.sh) | dev machine | Clones and patches MeshCore, builds the `Xiao_nrf52_companion_radio_serial` environment, emits the `.uf2`. | -| [`xiao-radio/flash.py`](../../scripts/picocalc/xiao-radio/flash.py) | dev machine | Flashes the `.uf2` to the XIAO over its UF2 bootloader, refusing the wrong board or SoftDevice; prints the serial-DFU command when the bootloader offers no drive. | -| [`xiao-radio/meshcore-uart1.patch`](../../scripts/picocalc/xiao-radio/meshcore-uart1.patch) | — | The two firmware hunks: the companion on nRF52 `Serial1`, and I²C moved off the UART pads. Not upstream yet. | -| [`xiao-radio/lyra-setup.sh`](../../scripts/picocalc/xiao-radio/lyra-setup.sh) | the Lyra (root) | Boot-persistent UART1 → GP4/GP5 mux service, `dialout` membership, and a default MeshTerm serial profile for `/dev/ttyS1`. | -| [`xiao-radio/uart1-mux.py`](../../scripts/picocalc/xiao-radio/uart1-mux.py) | the Lyra (root) | The matrix-IO register poke that routes UART1 to the header pads, run once per boot by the service above. | +| [`picocalc-lyra/calculinux-setup.sh`](../../scripts/picocalc-lyra/calculinux-setup.sh) | the Lyra (root) | One-time bring-up: python packages, the Wi-Fi boot-scan kick, a boot clock sync (there is no RTC), the deploy user, the checkout, the venv and `pip install -e .`, the login PATH, and the console font. Idempotent. | +| [`picocalc-lyra/calculinux-console-font-6x12.sh`](../../scripts/picocalc-lyra/calculinux-console-font-6x12.sh) | the Lyra (root) | Just the console font: builds, installs and persists the 512-glyph **meshterm** PSF (braille, node marks, rounded frame corners, the list cursor) and restores the stock 16-slot palette. Calls the 6×8 build below when it sits alongside. Run it alone after a MeshTerm update, from the pulled checkout (`/home/meshterm/MeshTerm/scripts/picocalc-lyra/`) rather than the copy made at install time. | +| [`picocalc-lyra/calculinux-console-font-6x8.sh`](../../scripts/picocalc-lyra/calculinux-console-font-6x8.sh) | the Lyra (root) | The shorter-cell companion font, **meshterm8** (6×8 → 53×40), for anyone who wants more rows than the 6×12 default gives. Its base bitmap is the kernel's `font_6x8`, so this one file and the PSF it builds are **GPL-2.0-only** ([`LICENSE.GPL-2.0`](../../scripts/picocalc-lyra/LICENSE.GPL-2.0) sits beside it); it reads the donor/alias/keeper tables out of the script above rather than keeping a second copy. Pick between the two fonts from MeshTerm's Preferences page. | +| [`picocalc-lyra/calculinux-wifi-set.sh`](../../scripts/picocalc-lyra/calculinux-wifi-set.sh) | the Lyra (sudo) | Interactive Wi-Fi join: prompts for an SSID and passphrase, writes iwd's credentials, connects now. This is how a network *becomes* known to the boot kick. | +| [`picocalc-lyra/calculinux-radio-bridge.sh`](../../scripts/picocalc-lyra/calculinux-radio-bridge.sh) | the Lyra (root) | **Unfinished, unsupported.** An early UART-to-TCP pump: it serves `/dev/ttyS1` on TCP port 5000 and writes a `radio` TCP profile. It does not route UART1 to the header pads. Superseded by `xiao-radio/lyra-setup.sh`, which does the routing and points MeshTerm at the serial port directly. | +| [`picocalc-lyra/xiao-radio/`](../../scripts/picocalc-lyra/xiao-radio/) | see below | Everything for the XIAO nRF52840 + Wio-SX1262 radio wired to the Lyra's UART1; its [bench card](../../scripts/picocalc-lyra/xiao-radio/README.md) has the wiring table. The firmware is MeshCore, MIT-licensed — [`LICENSE.MeshCore`](../../scripts/picocalc-lyra/xiao-radio/LICENSE.MeshCore) sits beside the patch. | +| [`xiao-radio/build-firmware.sh`](../../scripts/picocalc-lyra/xiao-radio/build-firmware.sh) | dev machine | Clones and patches MeshCore, builds the `Xiao_nrf52_companion_radio_serial` environment, emits the `.uf2`. | +| [`xiao-radio/flash.py`](../../scripts/picocalc-lyra/xiao-radio/flash.py) | dev machine | Flashes the `.uf2` to the XIAO over its UF2 bootloader, refusing the wrong board or SoftDevice; prints the serial-DFU command when the bootloader offers no drive. | +| [`xiao-radio/meshcore-uart1.patch`](../../scripts/picocalc-lyra/xiao-radio/meshcore-uart1.patch) | — | The two firmware hunks: the companion on nRF52 `Serial1`, and I²C moved off the UART pads. Not upstream yet. | +| [`xiao-radio/lyra-setup.sh`](../../scripts/picocalc-lyra/xiao-radio/lyra-setup.sh) | the Lyra (root) | Boot-persistent UART1 → GP4/GP5 mux service, `dialout` membership, and a default MeshTerm serial profile for `/dev/ttyS1`. | +| [`xiao-radio/uart1-mux.py`](../../scripts/picocalc-lyra/xiao-radio/uart1-mux.py) | the Lyra (root) | The matrix-IO register poke that routes UART1 to the header pads, run once per boot by the service above. | | [`uconsole/meshterm-spi-bridge`](../../scripts/uconsole/meshterm-spi-bridge) | the radio host (your user) | The **always-on** option: runs a mesh node in software over an SPI-attached SX1262 (uConsole AIO, Waveshare HATs) and serves the companion protocol on `127.0.0.1:5000`, so the node stays on the mesh while MeshTerm is closed. Setup menu, preflight, optional `systemd --user` service. Runs on `openhop_core` (preferred) or its predecessor `pymc_core`; see the manual for the venv it wants on a bookworm uConsole. Most people should reach for `meshterm --spi` instead — no script, no service, MeshTerm drives the chip itself while it runs. | -## The regular and picocalc platforms +## The platforms MeshTerm resolves one frozen **platform** at boot and draws everything through it. The **regular** platform is a desktop or ssh terminal: 72 readable columns, truecolour, emoji, -a footer hint line. The **picocalc** platform is a framebuffer console: 53 columns, no +a footer hint line. The **picocalc-lyra** platform is a framebuffer console: 53 columns, no emoji, an F-key lane instead of a hint line, and sixteen colour slots rather than a colour space. Nothing loses its colour there: the node hue and the recency heat gradient quantise to those slots instead. It is detected from the device tree on the Lyra, and -`--platform picocalc` or `MESHTERM_PLATFORM=picocalc` forces it anywhere, which is how you -preview the handheld layout on a desktop: +`--platform picocalc-lyra` or `MESHTERM_PLATFORM=picocalc-lyra` forces it anywhere, which +is how you preview the handheld layout on a desktop: ```bash -meshterm --mock --platform picocalc # the whole app, simulated radio, handheld layout -meshterm specimen # the visual language on one card -meshterm platform # which platform this terminal resolved to +meshterm --mock --platform picocalc-lyra # the whole app, simulated radio, handheld layout +meshterm specimen # the visual language on one card +meshterm platform # which platform this terminal resolved to ``` +The **cardputer-zero** platform is the Cardputer Zero's 53×14 screen, which MeshTerm draws +itself. It is [not supported yet](cardputer-zero.md), so it is never detected: only +`--platform cardputer-zero` chooses it. + What that platform needs from the console — a font with the glyphs the interface draws, and the stock sixteen-slot palette — is installed by the PicoCalc manual's setup script; the details are in that manual and in the scripts' own headers. diff --git a/docs/devices/cardputer-zero.md b/docs/devices/cardputer-zero.md index 88086f1..fbbda5c 100644 --- a/docs/devices/cardputer-zero.md +++ b/docs/devices/cardputer-zero.md @@ -68,7 +68,7 @@ You need a copy of MeshTerm's source code (see the screen is drawn in: ```bash -python scripts/cardputer/fetch-terminus.py +python scripts/cardputer-zero/fetch-terminus.py ``` and start the simulator: diff --git a/docs/devices/picocalc-lyra.md b/docs/devices/picocalc-lyra.md index e05c258..aa6b765 100644 --- a/docs/devices/picocalc-lyra.md +++ b/docs/devices/picocalc-lyra.md @@ -422,7 +422,7 @@ the network, so this is a one-time step; to change networks later, run `uwific` ### Step 8 — Copy the setup scripts to the device -You need this repository's `scripts/` directory on the Lyra — its `picocalc/` folder is the +You need this repository's `scripts/` directory on the Lyra — its `picocalc-lyra/` folder is the part the Lyra runs. Two ways to get it there, once Wi-Fi is up: - **`scp` from your PC**. Find the Lyra's IP address with `ip addr show wlan0` on the @@ -453,7 +453,7 @@ part the Lyra runs. Two ways to get it there, once Wi-Fi is up: ```bash # on the PicoCalc, as root, with scripts/ copied over -cd scripts/picocalc +cd scripts/picocalc-lyra sh calculinux-setup.sh ``` @@ -574,21 +574,21 @@ this somewhere with a decent connection. ```bash # on the PC (Git Bash or WSL on Windows) -cd scripts/picocalc/xiao-radio +cd scripts/picocalc-lyra/xiao-radio sh build-firmware.sh ``` You should see it clone MeshCore, apply a patch, build, and finish with: ``` -DONE. Firmware: /path/to/scripts/picocalc/xiao-radio/meshcore-xiao-radio.uf2 +DONE. Firmware: /path/to/scripts/picocalc-lyra/xiao-radio/meshcore-xiao-radio.uf2 Next: put the XIAO in bootloader (double-tap reset) and run: python flash.py ``` Here's what it did, so you could do it by hand if you needed to: 1. Cloned [MeshCore](https://github.com/meshcore-dev/MeshCore) into - `scripts/picocalc/xiao-radio/_meshcore-build`. + `scripts/picocalc-lyra/xiao-radio/_meshcore-build`. 2. Checked out the pinned commit `e9edfc8e` on the `dev` branch — the commit this patch is known to apply cleanly to and build against. 3. Applied `meshcore-uart1.patch`. @@ -635,7 +635,7 @@ If you want to track newer MeshCore instead of the pinned commit: git clone https://github.com/meshcore-dev/MeshCore.git cd MeshCore git checkout dev # or MESHCORE_COMMIT=dev sh build-firmware.sh -git apply /path/to/scripts/picocalc/xiao-radio/meshcore-uart1.patch +git apply /path/to/scripts/picocalc-lyra/xiao-radio/meshcore-uart1.patch pio run -e Xiao_nrf52_companion_radio_serial python bin/uf2conv/uf2conv.py .pio/build/Xiao_nrf52_companion_radio_serial/firmware.hex \ -c -f 0xADA52840 -o meshcore-xiao-radio.uf2 @@ -766,7 +766,7 @@ haven't already (Step 8), then: ```bash # on the PicoCalc, as root -sh scripts/picocalc/xiao-radio/lyra-setup.sh # MT_USER=meshterm by default +sh scripts/picocalc-lyra/xiao-radio/lyra-setup.sh # MT_USER=meshterm by default ``` It does three idempotent things: @@ -840,7 +840,7 @@ re-run the setup script from root (it reinstalls and rebuilds the console font): ```bash # on the PicoCalc, as root su - meshterm -c 'git -C ~/MeshTerm pull' -sh /home/meshterm/MeshTerm/scripts/picocalc/calculinux-setup.sh +sh /home/meshterm/MeshTerm/scripts/picocalc-lyra/calculinux-setup.sh ``` or, as the `meshterm` user, do just the update: @@ -854,7 +854,7 @@ If an update adds new glyphs to the console font, rebuild it on its own afterwar ```bash # on the PicoCalc, as root -sh /home/meshterm/MeshTerm/scripts/picocalc/calculinux-console-font-6x12.sh +sh /home/meshterm/MeshTerm/scripts/picocalc-lyra/calculinux-console-font-6x12.sh ``` **Changing Wi-Fi.** Run `uwific` as root, as in [Step 7](#step-7--join-wi-fi). The boot-time diff --git a/meshterm/cli.py b/meshterm/cli.py index 91f0c67..53efa4e 100644 --- a/meshterm/cli.py +++ b/meshterm/cli.py @@ -196,7 +196,10 @@ def main_callback( platform: str | None = typer.Option( None, "--platform", - help="Force the UI platform (regular|picocalc) instead of auto-detecting it", + help=( + "Force the UI platform (regular|picocalc-lyra|cardputer-zero) " + "instead of auto-detecting it" + ), ), ) -> None: """Build the application context and dispatch to the menu or a subcommand. @@ -664,7 +667,7 @@ def specimen_command() -> None: Every mark, icon funnel, colour scale and fold on one card, drawn through the same theme and glyph machinery the TUI uses — so on the PicoCalc console it is the - font/palette acceptance screen, and with ``--platform picocalc`` on a desktop it + font/palette acceptance screen, and with ``--platform picocalc-lyra`` on a desktop it previews that flavour. See :mod:`meshterm.ui.specimen`. The one command that keeps its colour, and it builds its own themed console to do it diff --git a/meshterm/core/preferences.py b/meshterm/core/preferences.py index c1be005..dc244fc 100644 --- a/meshterm/core/preferences.py +++ b/meshterm/core/preferences.py @@ -185,7 +185,7 @@ _CONSOLE_SETUP_CHOICES: dict[str, str] = { "off": "Leave it alone", } -#: The two console fonts ``scripts/picocalc/calculinux-console-font-6x12.sh`` (and its 6x8 +#: The two console fonts ``scripts/picocalc-lyra/calculinux-console-font-6x12.sh`` (and its 6x8 #: companion) build for the PicoCalc's framebuffer panel. Each is named by its cell and by the #: screen that cell buys, because choosing a font here is choosing how much fits — not a bitmap. #: Plain ASCII ``x`` and not ``×``: the multiplication sign is not one of the 512 glyphs @@ -455,7 +455,7 @@ PREFERENCES: tuple[PrefSpec, ...] = ( # for anyone who would rather see more of a list than read it comfortably. default="6x12", choices=_CONSOLE_FONT_CHOICES, - platforms=frozenset({"picocalc"}), + platforms=frozenset({"picocalc-lyra"}), ), # --- Diagnostics --------------------------------------------------------------- PrefSpec( diff --git a/meshterm/host/__main__.py b/meshterm/host/__main__.py index d72ebd4..8c75ac7 100644 --- a/meshterm/host/__main__.py +++ b/meshterm/host/__main__.py @@ -7,7 +7,7 @@ the framebuffer and reads the keyboard, and is the default wherever the launcher has named a framebuffer (``APPLAUNCH_LINUX_FBDEV_DEVICE``). Everything else is passed to MeshTerm as it would be on a command line — ``--mock`` for the simulated mesh, ``--ble``/``--port``/ -``--tcp`` for a companion — with ``--platform cardputer`` supplied by the host. +``--tcp`` for a companion — with ``--platform cardputer-zero`` supplied by the host. """ from __future__ import annotations diff --git a/meshterm/host/font.py b/meshterm/host/font.py index 73c97bb..520583e 100644 --- a/meshterm/host/font.py +++ b/meshterm/host/font.py @@ -11,7 +11,7 @@ solid tiles where Terminus draws the dots apart. Terminus is licensed under the SIL Open Font License, so it is never shipped inside MeshTerm: the host loads it from a BDF file on the machine (:func:`find_font`). On the -desktop, ``scripts/cardputer/fetch-terminus.py`` puts the two 12-pixel BDFs, with their +desktop, ``scripts/cardputer-zero/fetch-terminus.py`` puts the two 12-pixel BDFs, with their licence, where :func:`find_font` looks. """ @@ -41,7 +41,7 @@ def _art(rows: list[str]) -> bytes: #: MeshTerm's own marks, drawn over the base font. The same pixel art as the PicoCalc's -#: font build (``scripts/picocalc/calculinux-console-font-6x12.sh``, ``MARKS``), so a mark +#: font build (``scripts/picocalc-lyra/calculinux-console-font-6x12.sh``, ``MARKS``), so a mark #: means one picture on every handheld. # fmt: off MARKS: dict[int, bytes] = { @@ -124,7 +124,7 @@ def _braille(value: int) -> bytes: #: Every braille cell, drawn over the base font as solid tiles with no gap between dots or #: between neighbouring cells — the same tiles as the PicoCalc's font build -#: (``scripts/picocalc/calculinux-console-font-6x12.sh``, ``BANDS12``). MeshTerm never sets +#: (``scripts/picocalc-lyra/calculinux-console-font-6x12.sh``, ``BANDS12``). MeshTerm never sets #: braille to be read: every braille cell is pixels, a chart, the map, a QR code, and a #: dotted one breaks every line it draws into beads. BRAILLE: dict[int, bytes] = {0x2800 + value: _braille(value) for value in range(256)} @@ -257,7 +257,7 @@ def find_font() -> Font: if not regular_path.is_file(): raise FileNotFoundError( f"no {REGULAR_BDF} in {directory} -- fetch Terminus with " - "`python scripts/cardputer/fetch-terminus.py` (or set " + "`python scripts/cardputer-zero/fetch-terminus.py` (or set " f"{FONT_ENV} to a directory holding it)" ) bold_path = directory / BOLD_BDF diff --git a/meshterm/host/keys.py b/meshterm/host/keys.py index 452df13..f14ac87 100644 --- a/meshterm/host/keys.py +++ b/meshterm/host/keys.py @@ -5,11 +5,11 @@ Both ends of the host meet here: the device reads key codes off the keyboard's e device, the simulator reads them off a desktop window, and each turns its own events into a :class:`Key` for :func:`encode` to spell the way xterm does. xterm's spelling is the contract because it is what prompt_toolkit parses, and what a desktop terminal running -``--platform cardputer`` sends too, so the TUI cannot tell the three apart: +``--platform cardputer-zero`` sends too, so the TUI cannot tell the three apart: * Shift with F4–F8 is xterm's ``CSI 1;2 S`` / ``CSI 15;2 ~`` …, which prompt_toolkit reads as F16–F20 — the Cardputer deck's Shift bank - (:data:`~meshterm.ui.tui.fkeys.CARDPUTER_DECK`). + (:data:`~meshterm.ui.tui.fkeys.CARDPUTER_ZERO_DECK`). * A modified arrow, Home, End, Page key or F-key carries xterm's modifier parameter (``1 + Shift + 2·Alt + 4·Ctrl``), so Ctrl+PgUp is ``CSI 5;5 ~``, the section jump. * Ctrl with a letter is its C0 control; Alt with anything is ESC then the key. diff --git a/meshterm/host/run.py b/meshterm/host/run.py index 211a3e3..3da7c03 100644 --- a/meshterm/host/run.py +++ b/meshterm/host/run.py @@ -4,7 +4,7 @@ :func:`run` builds the three pieces every host shares — the :class:`~.vt.Terminal` the TUI's bytes land in, a :class:`HostOutput` prompt_toolkit writes to, and a pipe input the host's keys go into — sets them as prompt_toolkit's app session, and calls the ordinary -CLI with ``--platform cardputer`` exactly as a shell would. A *front end* is the part that +CLI with ``--platform cardputer-zero`` exactly as a shell would. A *front end* is the part that differs: where the pixels go and where the keys come from. It is handed the terminal, the lock that guards it and a way to type, starts whatever threads it needs, and is told each time a frame is complete. @@ -22,7 +22,7 @@ from prompt_toolkit.input import create_pipe_input from prompt_toolkit.output.color_depth import ColorDepth from prompt_toolkit.output.vt100 import Vt100_Output -from ..platforms import CARDPUTER +from ..platforms import CARDPUTER_ZERO from .vt import RGB, Terminal @@ -115,8 +115,8 @@ def run(argv: Sequence[str], front_end: FrontEndFactory) -> int: lock = threading.Lock() with create_pipe_input() as pipe: terminal = Terminal( - CARDPUTER.readable_cols, - CARDPUTER.readable_rows, + CARDPUTER_ZERO.readable_cols, + CARDPUTER_ZERO.readable_rows, palette=_palette(), reply=pipe.send_text, ) @@ -126,7 +126,7 @@ def run(argv: Sequence[str], front_end: FrontEndFactory) -> int: with create_app_session(input=pipe, output=output): # Standalone, as a shell would run it: the CLI reports its own errors and # ends by raising SystemExit with the status. - cli.app(args=["--platform", "cardputer", *argv], windows_expand_args=False) + cli.app(args=["--platform", "cardputer-zero", *argv], windows_expand_args=False) return 0 except SystemExit as done: return done.code if isinstance(done.code, int) else (0 if done.code is None else 1) diff --git a/meshterm/platforms.py b/meshterm/platforms.py index a0ba2e1..8454d7f 100644 --- a/meshterm/platforms.py +++ b/meshterm/platforms.py @@ -34,13 +34,16 @@ class Platform: outside this module and the small set of binding points documented at each field. Attributes: - name: Stable identifier — ``"regular"``, ``"picocalc"`` or ``"cardputer"`` — used for - ``--platform``/``MESHTERM_PLATFORM`` matching and diagnostics. + name: Stable identifier — ``"regular"``, ``"picocalc-lyra"`` or ``"cardputer-zero"`` + — used for ``--platform``/``MESHTERM_PLATFORM`` matching and diagnostics. A + handheld's is its product and the variant that sets it apart from its siblings: + M5Stack makes three Cardputers and only the Zero runs Linux, and the PicoCalc + takes several cores and only the Luckfox Lyra runs MeshTerm. readable_cols: The readability standard (CLAUDE.md's "screens stay readable at N columns") and the dual-platform gallery's test width. readable_rows: The row *floor* a screen designs to. PicoCalc's live console is 53×26 (custom 6×12 font); a 6×8 font rebuild (P5) gives 53×40. Screens design - to this floor and exploit extra rows fluidly; the gallery renders picocalc at + to this floor and exploit extra rows fluidly; the gallery renders picocalc-lyra at both 26 and 40 rows. frame_border: Whether the base screen draws inside a bordered ``Panel``. ``False`` swaps it for a title-bar row instead (+4 cols, +1 row reclaimed) — a PicoCalc @@ -89,7 +92,7 @@ class Platform: screen's own ``footer_hint`` string instead. A deck is everything about the lane that belongs to one keyboard: which keycodes drive its slots, where its chips sit on the row, how they are drawn, and which of a screen's lane definitions it reads - (``Screen.picocalc_lane``, ``Screen.cardputer_lane``). Each handheld names its + (``Screen.picocalc_lyra_lane``, ``Screen.cardputer_zero_lane``). Each handheld names its own, so one can change without the other following. :attr:`footer_fkeys` is the yes/no reading of it. width_reclaim: Whether the session may report one extra terminal column (see @@ -117,7 +120,7 @@ class Platform: (:func:`~meshterm.ui.widgets._recency_style`). Wired in P3. solid_braille: Whether the console font draws a braille cell's eight dots as solid tiles with no gap between them or between neighbouring cells — the PicoCalc's - built fonts (``scripts/picocalc``) do — so braille is a true 2×4 pixel grid, + built fonts (``scripts/picocalc-lyra``) do — so braille is a true 2×4 pixel grid, fine enough for what must stay contiguous. It is what lets every QR code be drawn in braille, one module a dot (:mod:`~meshterm.ui.qr`). A desktop font's braille is dotted, and a code drawn in it scans as nothing. @@ -221,8 +224,8 @@ REGULAR = Platform( #: binding point (header_atoms, font, truecolor, effects beyond the #: two P1 bindings, tick_s, battery, modifier_watch) are P2–P5's targets, recorded here #: now so the seam exists before the flavour work lands. -PICOCALC = Platform( - name="picocalc", +PICOCALC_LYRA = Platform( + name="picocalc-lyra", readable_cols=53, readable_rows=26, frame_border=False, @@ -234,10 +237,10 @@ PICOCALC = Platform( # never changes), and the activity pulse takes whatever room remains. header_atoms=("version", "badges", "pulse", "battery"), header_row=True, - lane_deck="picocalc", + lane_deck="picocalc-lyra", width_reclaim=False, emoji=False, - font="picocalc", + font="picocalc-lyra", truecolor=False, solid_braille=True, url_codes=True, @@ -251,7 +254,7 @@ PICOCALC = Platform( #: M5Stack's Cardputer Zero: a 320×170 panel drawn in 6×12 cells (53×14), under a #: 46-key keyboard whose number keys 4–8 sit right below the display. Hardware not yet in -#: hand (2026-10-04), so this is chosen by ``--platform cardputer`` / ``MESHTERM_PLATFORM`` +#: hand (2026-10-04), so this is chosen by ``--platform cardputer-zero`` / ``MESHTERM_PLATFORM`` #: only — no device-tree auto-detection until the device reports its own model string. #: #: The same 53 columns as the PicoCalc, which is why most of its flavour carries over; the @@ -261,8 +264,8 @@ PICOCALC = Platform( #: (``truecolor``). Provisional until measured on the device: the cadences, taken from the #: PicoCalc; ``effects`` off; and the battery, read from the companion until the host's #: gauge (a BQ27220) has a known ``power_supply`` name. -CARDPUTER = Platform( - name="cardputer", +CARDPUTER_ZERO = Platform( + name="cardputer-zero", readable_cols=53, readable_rows=14, frame_border=False, @@ -274,10 +277,10 @@ CARDPUTER = Platform( # header's leftover cells, goes — the dashboard draws the mesh's activity in full. header_atoms=("badges", "battery"), header_row=False, - lane_deck="cardputer", + lane_deck="cardputer-zero", width_reclaim=False, emoji=False, - font="cardputer", + font="cardputer-zero", truecolor=True, # The console host draws its own braille, as the PicoCalc's built fonts do: solid # tiles, no gap between dots (meshterm/host/font.py, BRAILLE). @@ -291,7 +294,7 @@ CARDPUTER = Platform( modifier_watch="tca8418c", ) -_BY_NAME = {p.name: p for p in (REGULAR, PICOCALC, CARDPUTER)} +_BY_NAME = {p.name: p for p in (REGULAR, PICOCALC_LYRA, CARDPUTER_ZERO)} #: The active platform. Do not import this name directly (see the module docstring) — #: read it through :func:`get_platform`, and change it only through :func:`set_platform`. @@ -448,7 +451,7 @@ def resolve(flag: str | None = None) -> Resolution: _lookup(env, source="MESHTERM_PLATFORM"), ) if model == _LYRA_MODEL: - return Resolution(flag, env, model, "auto-detect", PICOCALC) + return Resolution(flag, env, model, "auto-detect", PICOCALC_LYRA) return Resolution(flag, env, model, "default", REGULAR) @@ -474,8 +477,8 @@ def without_emoji(platform: Platform) -> Platform: __all__ = [ "Platform", "REGULAR", - "PICOCALC", - "CARDPUTER", + "PICOCALC_LYRA", + "CARDPUTER_ZERO", "without_emoji", "PLATFORM", "get_platform", diff --git a/meshterm/services/consolefont.py b/meshterm/services/consolefont.py index 290139c..f977b56 100644 --- a/meshterm/services/consolefont.py +++ b/meshterm/services/consolefont.py @@ -39,7 +39,7 @@ from ..core.config import default_config_dir from ..persistence.logging import get_logger from ..platforms import get_platform -#: Where ``scripts/picocalc/calculinux-console-font-6x12.sh`` and its 6x8 companion install +#: Where ``scripts/picocalc-lyra/calculinux-console-font-6x12.sh`` and its 6x8 companion install #: the fonts. FONT_DIR = Path("/usr/share/consolefonts") @@ -92,7 +92,7 @@ def applies() -> bool: which one did not — the log is where a font that "did nothing" gets explained. """ platform = get_platform() - if platform.name != "picocalc": + if platform.name != "picocalc-lyra": get_logger().debug("console font: leaving it alone — platform is %s", platform.name) return False if _controlling_vt() is None: diff --git a/meshterm/services/modifier_watch.py b/meshterm/services/modifier_watch.py index ef0c05e..6b6181d 100644 --- a/meshterm/services/modifier_watch.py +++ b/meshterm/services/modifier_watch.py @@ -15,7 +15,7 @@ bridges that: the session calls it whenever an F6–F10 press actually resolves, :func:`shift_down` latches ``True`` for a short grace window after, so a momentary dip in the raw signal can't flip the display mid-keystroke. The window is generous enough to outlast the flicker without noticeably outlasting the actual key release — the lane still -self-corrects within one idle repaint (the 2 s picocalc tick) either way. +self-corrects within one idle repaint (the 2 s picocalc-lyra tick) either way. Strictly an experiment layered over a working static lane, and built to disappear: it only ever engages when the platform asks for it (``Platform.modifier_watch``), the input diff --git a/meshterm/ui/about.py b/meshterm/ui/about.py index 7db3ef6..e43819c 100644 --- a/meshterm/ui/about.py +++ b/meshterm/ui/about.py @@ -121,7 +121,7 @@ class AboutPage(ScrollScreen): self._doc = doc @property - def picocalc_lane(self): + def picocalc_lyra_lane(self): """The shared pager lane, plus the section step on a page that has sections. A left-hand pair rises toward F1, so ``Sect ↑`` sits outside ``Sect ↓`` — the diff --git a/meshterm/ui/chat.py b/meshterm/ui/chat.py index 2af8655..c48c315 100644 --- a/meshterm/ui/chat.py +++ b/meshterm/ui/chat.py @@ -99,7 +99,7 @@ class ChatScreen(Screen): home_end_jumps = False @property - def picocalc_lane(self): + def picocalc_lyra_lane(self): """The PicoCalc lane in the transcript's own words: Latest/Oldest, Paths, Retry. The shared lane's Shift bank dispatches the plain ``end``/``home`` actions, but diff --git a/meshterm/ui/config_editor.py b/meshterm/ui/config_editor.py index 89f4dbe..e28eb2c 100644 --- a/meshterm/ui/config_editor.py +++ b/meshterm/ui/config_editor.py @@ -532,7 +532,7 @@ class _ConfigMenu(SelectScreen): return splice_hint(base, f"{REVEAL_KEY} {verb} PIN") @property - def picocalc_lane(self): + def picocalc_lyra_lane(self): """The list's lane with the reveal on F3 — the slot a delete-less list leaves free. F1/F2 are this grouped list's section jumps, F4/F5 the pager; F3 is what a select @@ -542,7 +542,7 @@ class _ConfigMenu(SelectScreen): """ from .tui.fkeys import FPair - lane = list(super().picocalc_lane) + lane = list(super().picocalc_lyra_lane) if self._conceals: lane[2] = FPair("Hide" if self._revealed else "Reveal", "reveal") return lane diff --git a/meshterm/ui/contactlist.py b/meshterm/ui/contactlist.py index e3fb3d0..f669d2d 100644 --- a/meshterm/ui/contactlist.py +++ b/meshterm/ui/contactlist.py @@ -491,7 +491,7 @@ class ContactListScreen(SelectScreen): floating = False @property - def picocalc_lane(self): + def picocalc_lyra_lane(self): """The select list's lane, with the whole sort added on F3/F8. Four columns is a short ring — walking it backwards saves at most two presses, so @@ -510,7 +510,7 @@ class ContactListScreen(SelectScreen): """ from .tui.fkeys import FPair - lane = list(super().picocalc_lane) + lane = list(super().picocalc_lyra_lane) descend = self._sort.ascending # ascending now, so the flip lands descending lane[2] = FPair( "Sort →", diff --git a/meshterm/ui/dashboard_screen.py b/meshterm/ui/dashboard_screen.py index a932c1a..84c3fe3 100644 --- a/meshterm/ui/dashboard_screen.py +++ b/meshterm/ui/dashboard_screen.py @@ -109,7 +109,7 @@ def _is_frame_bucket(bucket: str) -> bool: def _traffic_chrome(bucket: str) -> tuple[str, str]: """One traffic bucket's ``(icon, label)`` — the live feed's, from the same function. - Icons are mapped to single glyphs on PICOCALC via :func:`~meshterm.ui.theme.glyph`. + Icons are mapped to single glyphs on PICOCALC_LYRA via :func:`~meshterm.ui.theme.glyph`. """ typename = bucket.split(":", 1)[1] if ":" in bucket else None return payload_marks(typename) @@ -190,7 +190,7 @@ class DashboardScreen(Screen): return " · ".join([*atoms, "Esc back"]) @property - def picocalc_lane(self): + def picocalc_lyra_lane(self): """The shared lane, dimmed on the same gate the hint above uses, plus the scope cycle. The PicoCalc draws no hint line at all — the lane *is* the footer — so the rule diff --git a/meshterm/ui/device_info_screen.py b/meshterm/ui/device_info_screen.py index d612036..56ec73f 100644 --- a/meshterm/ui/device_info_screen.py +++ b/meshterm/ui/device_info_screen.py @@ -86,7 +86,7 @@ class DeviceInfoScreen(ScrollScreen): return " · ".join(atoms) @property - def picocalc_lane(self): + def picocalc_lyra_lane(self): """The shared pager, plus the reveal on F3 — this screen's own verb slot. The chip is the only place the PicoCalc can learn the key exists, and it names the diff --git a/meshterm/ui/diagnostics.py b/meshterm/ui/diagnostics.py index 8369f8d..b04ffe3 100644 --- a/meshterm/ui/diagnostics.py +++ b/meshterm/ui/diagnostics.py @@ -79,7 +79,7 @@ class DiagnosticsPage(AboutPage): return f"{scroll}{SAVE_KEY} save · Esc back" @property - def picocalc_lane(self): + def picocalc_lyra_lane(self): """The About page's lane, with ``Save`` on the slot it leaves free. F1/F2 are the section pair and F4/F5 the pager, so F3 is the one free primary slot @@ -88,7 +88,7 @@ class DiagnosticsPage(AboutPage): """ from .tui.fkeys import FPair - lane = list(super().picocalc_lane) + lane = list(super().picocalc_lyra_lane) lane[2] = FPair("Save", SAVE_ACTION) return lane diff --git a/meshterm/ui/fontset.py b/meshterm/ui/fontset.py index ef23e5e..3762c7f 100644 --- a/meshterm/ui/fontset.py +++ b/meshterm/ui/fontset.py @@ -2,11 +2,11 @@ """The handhelds' glyph inventories — the glyph contract. The PicoCalc panel draws through the kernel console with one 512-glyph PSF font -(``meshterm.psf.gz``, built by ``scripts/picocalc/calculinux-console-font-6x12.sh``): the stock +(``meshterm.psf.gz``, built by ``scripts/picocalc-lyra/calculinux-console-font-6x12.sh``): the stock Terminus 6×12 base (a Cyrillic-coverage table — note there are **no accented Latin letters**), the full braille block, MeshTerm's own marks drawn into donor slots, and a few aliases. A character outside this set renders as a blank on the panel, so *nothing -outside it may ever be emitted* on the picocalc platform — the render boundary folds +outside it may ever be emitted* on the picocalc-lyra platform — the render boundary folds text down to it (:func:`meshterm.ui.theme.fold_text`), and the dual-platform gallery asserts the fold held. @@ -17,7 +17,7 @@ codepoints the build script now repurposes, plus the marks it draws in their pla If the build script's ``MARKS``/``DONORS``/``ALIASES`` change, this table must move in the same commit — and vice versa. -The Cardputer Zero has a contract of its own, :data:`CARDPUTER_CODEPOINTS`: what its console +The Cardputer Zero has a contract of its own, :data:`CARDPUTER_ZERO_CODEPOINTS`: what its console host draws, which no kernel caps. :data:`FONTS` names both, for ``Platform.font``. """ @@ -118,12 +118,12 @@ CARDPUTER_RANGES: tuple[tuple[int, int], ...] = ( # fmt: on #: The Cardputer's inventory as one frozen set. -CARDPUTER_CODEPOINTS: frozenset[int] = frozenset( +CARDPUTER_ZERO_CODEPOINTS: frozenset[int] = frozenset( cp for first, last in CARDPUTER_RANGES for cp in range(first, last + 1) ) #: Every handheld's glyph inventory, by the name ``Platform.font`` gives it. FONTS: dict[str, frozenset[int]] = { - "picocalc": FONT_CODEPOINTS, - "cardputer": CARDPUTER_CODEPOINTS, + "picocalc-lyra": FONT_CODEPOINTS, + "cardputer-zero": CARDPUTER_ZERO_CODEPOINTS, } diff --git a/meshterm/ui/livefeed_screen.py b/meshterm/ui/livefeed_screen.py index b39fcf4..fb28cb8 100644 --- a/meshterm/ui/livefeed_screen.py +++ b/meshterm/ui/livefeed_screen.py @@ -265,7 +265,7 @@ class LiveFeedScreen(Screen): floating = False @property - def picocalc_lane(self): + def picocalc_lyra_lane(self): """The shared lane, gated on there being packets to walk. Every nav key here moves the *cursor* over the feed rather than a scroll offset, diff --git a/meshterm/ui/map_screen.py b/meshterm/ui/map_screen.py index 15810dd..d82061d 100644 --- a/meshterm/ui/map_screen.py +++ b/meshterm/ui/map_screen.py @@ -140,7 +140,7 @@ class MapScreen(Screen): find_enabled = True @property - def picocalc_lane(self): + def picocalc_lyra_lane(self): r"""The PicoCalc lane: three ways to frame the view, then the zoom rocker. The map is the one screen that repurposes the nav actions wholesale: PgUp/PgDn @@ -1036,7 +1036,7 @@ class MapScreen(Screen): """Our own node among the markers, or ``None`` when the map can't place us. A device with no location fix of its own is simply absent from the marker list, so - ``You`` has nowhere to go and its chip dims (see :attr:`picocalc_lane`). + ``You`` has nowhere to go and its chip dims (see :attr:`picocalc_lyra_lane`). """ return next((m for m in self._markers if m.is_self), None) @@ -1134,7 +1134,7 @@ class LocationPickScreen(MapScreen): find_enabled = False @property - def picocalc_lane(self): # type: ignore[override] + def picocalc_lyra_lane(self): # type: ignore[override] """The map's lane minus the two verbs a picker has no use for. ``Frame`` goes because find is off here — nothing can ever be typed to frame, so diff --git a/meshterm/ui/menu.py b/meshterm/ui/menu.py index 9c9ddc7..6a3f76c 100644 --- a/meshterm/ui/menu.py +++ b/meshterm/ui/menu.py @@ -596,7 +596,7 @@ class _MainMenu(SelectScreen): return mark if title == mark.plain else super().bar_title(title, style) @property - def picocalc_lane(self): + def picocalc_lyra_lane(self): """The list's own lane, with the way out on F3: ``Quit?`` asks, ``Quit!`` doesn't. The PicoCalc has no hint line, so the lane is where the menu's way out has to be @@ -605,7 +605,7 @@ class _MainMenu(SelectScreen): half, F8, leaves without asking — a two-key reach on the menu alone, for the reader who already decided (JP, 2026-09-29). """ - lane = list(super().picocalc_lane) + lane = list(super().picocalc_lyra_lane) lane[2] = FPair("Quit?", "quit", "Quit!", "quit_now") return lane diff --git a/meshterm/ui/message_paths_screen.py b/meshterm/ui/message_paths_screen.py index 8b87e09..d2de670 100644 --- a/meshterm/ui/message_paths_screen.py +++ b/meshterm/ui/message_paths_screen.py @@ -217,7 +217,7 @@ class MessagePathsScreen(Screen): return " · ".join(parts) @property - def picocalc_lane(self): + def picocalc_lyra_lane(self): """The shared pager, dimmed while every arrival is already on screen. Both banks move the *selection* here — the pager by a windowful, the jumps to the diff --git a/meshterm/ui/node_detail_screen.py b/meshterm/ui/node_detail_screen.py index d7f9fbc..4b684e6 100644 --- a/meshterm/ui/node_detail_screen.py +++ b/meshterm/ui/node_detail_screen.py @@ -382,7 +382,7 @@ class NodeDetailScreen(Screen): floating = False @property - def picocalc_lane(self): + def picocalc_lyra_lane(self): """The shared pager over the route list, plus the tab switch on F3. The strip shows *that* there are two views; nothing on screen says the key that diff --git a/meshterm/ui/packet_viewer.py b/meshterm/ui/packet_viewer.py index 366031a..bc542ee 100644 --- a/meshterm/ui/packet_viewer.py +++ b/meshterm/ui/packet_viewer.py @@ -245,7 +245,7 @@ class PacketEntry: def kind_icon(kind: str) -> str: """The icon for a packet class (a fallback for unknown classes). - Returns the emoji on REGULAR; on PICOCALC, the emoji is mapped to a single-cell + Returns the emoji on REGULAR; on PICOCALC_LYRA, the emoji is mapped to a single-cell glyph from the 512-glyph font via :func:`~meshterm.ui.theme.glyph`. """ emoji = KIND_ICONS.get(kind, DEFAULT_ICON) @@ -278,7 +278,7 @@ def class_marks(entry: PacketEntry) -> tuple[str, str]: frame arrived in, not the thing it carries; a typename this table has never heard of keeps the fallback mark and shows the raw typename; a class-less frame stays a plain ``packet``. Every other kind is its own class (``advert``, ``message``, …) under the - shared :data:`KIND_ICONS` glyph. The emoji are mapped to single glyphs on PICOCALC. + shared :data:`KIND_ICONS` glyph. The emoji are mapped to single glyphs on PICOCALC_LYRA. """ if entry.kind == "packet": raw = entry.raw if isinstance(entry.raw, dict) else {} @@ -405,7 +405,7 @@ class PacketViewer(Screen): grow_only = True @property - def picocalc_lane(self): + def picocalc_lyra_lane(self): """The shared pager over the body, with the jumps renamed for what they land on. Home and End here don't reach the ends of a *body* — they reach the ends of the diff --git a/meshterm/ui/records_screen.py b/meshterm/ui/records_screen.py index 2354d0d..6187039 100644 --- a/meshterm/ui/records_screen.py +++ b/meshterm/ui/records_screen.py @@ -333,11 +333,12 @@ class RecordScreen(Screen): return () @property - def picocalc_lane(self): + def picocalc_lyra_lane(self): """The shared pager, dimmed where nothing scrolls, plus the tab switch on F3. The chip names the tab it would take you *to*, never the one you are on — the node - page's rule (see :attr:`~meshterm.ui.node_detail_screen.NodeDetailScreen.picocalc_lane`). + page's rule (see + :attr:`~meshterm.ui.node_detail_screen.NodeDetailScreen.picocalc_lyra_lane`). The Area tab is a picture sized to the viewport, so the pager is dim there. """ from .tui.fkeys import FPair, default_lane diff --git a/meshterm/ui/region_editor.py b/meshterm/ui/region_editor.py index 63d2b7b..31f8244 100644 --- a/meshterm/ui/region_editor.py +++ b/meshterm/ui/region_editor.py @@ -145,11 +145,11 @@ class RegionMenu(SelectScreen): return current is not None and current.deletable @property - def picocalc_lane(self): + def picocalc_lyra_lane(self): """The list's lane with ``Read`` on F3 and ``Remove`` behind it.""" from .tui.fkeys import FPair - lane = list(super().picocalc_lane) + lane = list(super().picocalc_lyra_lane) lane[2] = FPair( "Read", "retry", diff --git a/meshterm/ui/remote_cli.py b/meshterm/ui/remote_cli.py index c1d33e6..93e543c 100644 --- a/meshterm/ui/remote_cli.py +++ b/meshterm/ui/remote_cli.py @@ -47,7 +47,7 @@ class RemoteCliScreen(Screen): floating = False @property - def picocalc_lane(self): + def picocalc_lyra_lane(self): """The pager over the transcript, with no jumps behind it. Home and End never reach the transcript here: they fall through to the compose diff --git a/meshterm/ui/repeater_admin.py b/meshterm/ui/repeater_admin.py index c1c8233..0ccc9ea 100644 --- a/meshterm/ui/repeater_admin.py +++ b/meshterm/ui/repeater_admin.py @@ -229,7 +229,7 @@ class AdminMenu(SelectScreen): return splice_hint(base, READ_ONE_HINT) if self._readable_key() else base @property - def picocalc_lane(self): + def picocalc_lyra_lane(self): """The list's lane with ``Read`` on F3 and ``Forget`` behind it — dim where inert. F1/F2 are this grouped list's section jumps and F4/F5 the pager; F3 is the slot a @@ -241,7 +241,7 @@ class AdminMenu(SelectScreen): """ from .tui.fkeys import FPair - lane = list(super().picocalc_lane) + lane = list(super().picocalc_lyra_lane) lane[2] = FPair( "Read", "retry", diff --git a/meshterm/ui/theme.py b/meshterm/ui/theme.py index c267abc..41983dd 100644 --- a/meshterm/ui/theme.py +++ b/meshterm/ui/theme.py @@ -196,8 +196,8 @@ MESH_THEME = Theme( # #ff6633 holds white text at only 2.9:1, so the chip is that colour a step darker # in OKLab at the same hue and chroma (L 0.70 → 0.62, h 38°): 4.0:1, still a # vermilion — chroma is in gamut all the way down, so nothing greys it to brown. - "fkey.chip.cardputer": "bold #ffffff on #e34b0f", - "fkey.chip.cardputer.shift": "bold #ffffff on #0f72bd", + "fkey.chip.cardputer_zero": "bold #ffffff on #e34b0f", + "fkey.chip.cardputer_zero.shift": "bold #ffffff on #0f72bd", # The prose voices — what a markdown page's inline marks are drawn in (see # ui.markdown). Headings borrow the styles the rest of the app already heads # sections with (``brand``, ``accent``), so only the *body* marks need names of @@ -256,8 +256,8 @@ _VT_SLOTS: tuple[tuple[int, str, str], ...] = ( #: The custom 16-slot remap P3 originally shipped (tailwind-family RGBs programmed via #: ``setvtrgb``) — **archived, not installed**: JP chose the standard palette but asked #: to keep this in case he changes his mind. Reinstall with -#: ``MESHTERM_CUSTOM_PALETTE=1 sh scripts/picocalc/calculinux-console-font-6x12.sh`` (whose opt-in -#: block a test keeps byte-identical to :func:`vtrgb_lines`); MESH_THEME_16 would then +#: ``MESHTERM_CUSTOM_PALETTE=1 sh scripts/picocalc-lyra/calculinux-console-font-6x12.sh`` +#: (whose opt-in block a test keeps byte-identical to :func:`vtrgb_lines`); MESH_THEME_16 would then #: want re-tuning against it (see git history at c6485c6 for the matching theme). _VT_SLOTS_CUSTOM: tuple[tuple[int, str, str], ...] = ( (0, "background slate", "#0f172a"), @@ -396,8 +396,8 @@ MESH_THEME_16 = Theme( # The Cardputer deck's fills, for name parity: that panel is truecolor, so these # are only its colours' nearest slots — red for the fn key's orange, blue for the # Shift blue. - "fkey.chip.cardputer": "bold color(15) on color(1)", - "fkey.chip.cardputer.shift": "bold color(15) on color(4)", + "fkey.chip.cardputer_zero": "bold color(15) on color(1)", + "fkey.chip.cardputer_zero.shift": "bold color(15) on color(4)", # Prose on the console. The page's body text is the default light grey (slot 7), # so emphasis is the one place the VT's bold-is-brightness rule *is* the design: # ``md.strong`` says bold on purpose and lands on white, exactly the step up the diff --git a/meshterm/ui/timemachine_screen.py b/meshterm/ui/timemachine_screen.py index 8bf36e2..d9033f4 100644 --- a/meshterm/ui/timemachine_screen.py +++ b/meshterm/ui/timemachine_screen.py @@ -249,7 +249,7 @@ class TimeMachineScreen(Screen): return f"↑↓ PgUp/PgDn scroll · w window{scope} · Esc back" @property - def picocalc_lane(self): + def picocalc_lyra_lane(self): """The shared pager, plus the window cycle on F3. ``w`` is the whole point of this screen — the same history at several spans — and diff --git a/meshterm/ui/trace_screen.py b/meshterm/ui/trace_screen.py index 2b77eb4..160f1ed 100644 --- a/meshterm/ui/trace_screen.py +++ b/meshterm/ui/trace_screen.py @@ -265,7 +265,7 @@ class TracingDialog(Screen): footer_hint = "Enter/Esc abort" @property - def picocalc_lane(self): + def picocalc_lyra_lane(self): """No lane: the dialog's only verb is abort, and it already answers to Enter and Esc.""" from .tui.fkeys import EMPTY_LANE diff --git a/meshterm/ui/tui/fkeys.py b/meshterm/ui/tui/fkeys.py index 8be71ab..b38cd4e 100644 --- a/meshterm/ui/tui/fkeys.py +++ b/meshterm/ui/tui/fkeys.py @@ -6,7 +6,7 @@ belongs to one keyboard is a :class:`LaneDeck`, named by ``Platform.lane_deck``: which keycodes drive the slots, where the chips sit on the row, how they are drawn, and which of a screen's lane definitions it reads. A screen states its lane per deck — -``Screen.picocalc_lane``, ``Screen.cardputer_lane`` — and the Cardputer's follows the +``Screen.picocalc_lyra_lane``, ``Screen.cardputer_zero_lane`` — and the Cardputer's follows the PicoCalc's until a screen says otherwise. Both decks having five slots is a coincidence of two keyboards, not a rule, and nothing here assumes it: a deck's slot count is its keys. @@ -270,8 +270,8 @@ class LaneDeck: #: plain F6-F10, so the Shift bank is keys of its own. Every chip is a 2-cell key caption, #: a space and a 6-cell label; five chips and four 2-cell gaps sum to exactly 53, the #: console's width, with nothing left over. -PICOCALC_DECK = LaneDeck( - name="picocalc", +PICOCALC_LYRA_DECK = LaneDeck( + name="picocalc-lyra", keys=(1, 2, 3, 4, 5), shift_keys=(6, 7, 8, 9, 10), captions=("F1", "F2", "F3", "F4", "F5"), @@ -281,35 +281,35 @@ PICOCALC_DECK = LaneDeck( captioned=True, fill="fkey.chip", shift_fill="fkey.chip.shift", - read_lane=attrgetter("picocalc_lane"), + read_lane=attrgetter("picocalc_lyra_lane"), ) #: The Cardputer Zero's number keys 4-8, which sit right under the display: Fn+4..8 are #: F4-F8, never the bare digits, since a digit must stay a digit on a screen that takes #: typing (JP, 2026-09-30). The keyboard driver sends Shift as a key of its own, and the #: console host encodes Shift+Fn+4..8 the way xterm encodes Shift+F4..F8, which -#: prompt_toolkit reads as F16-F20 — so a desktop terminal with ``--platform cardputer`` +#: prompt_toolkit reads as F16-F20 — so a desktop terminal with ``--platform cardputer-zero`` #: drives the same bank. The chips are laid out exactly as the PicoCalc's — the key's #: caption leading a 6-cell label, nine cells a chip, two between (JP, 2026-09-30) — and #: the Shift bank keeps the same captions, since it is the same keys with Shift held; its #: blue fill is what says so. It reads the PicoCalc's lanes for now (see -#: :meth:`~meshterm.ui.tui.screen.Screen.cardputer_lane`). -CARDPUTER_DECK = LaneDeck( - name="cardputer", +#: :meth:`~meshterm.ui.tui.screen.Screen.cardputer_zero_lane`). +CARDPUTER_ZERO_DECK = LaneDeck( + name="cardputer-zero", keys=(4, 5, 6, 7, 8), shift_keys=(16, 17, 18, 19, 20), captions=("F4", "F5", "F6", "F7", "F8"), shift_captions=("F4", "F5", "F6", "F7", "F8"), - columns=PICOCALC_DECK.columns, - chip_width=PICOCALC_DECK.chip_width, + columns=PICOCALC_LYRA_DECK.columns, + chip_width=PICOCALC_LYRA_DECK.chip_width, captioned=True, - fill="fkey.chip.cardputer", - shift_fill="fkey.chip.cardputer.shift", - read_lane=attrgetter("cardputer_lane"), + fill="fkey.chip.cardputer_zero", + shift_fill="fkey.chip.cardputer_zero.shift", + read_lane=attrgetter("cardputer_zero_lane"), ) #: Every deck, by the name ``Platform.lane_deck`` gives it. -DECKS: dict[str, LaneDeck] = {deck.name: deck for deck in (PICOCALC_DECK, CARDPUTER_DECK)} +DECKS: dict[str, LaneDeck] = {deck.name: deck for deck in (PICOCALC_LYRA_DECK, CARDPUTER_ZERO_DECK)} _DECK: LaneDeck | None = None diff --git a/meshterm/ui/tui/progress.py b/meshterm/ui/tui/progress.py index 56fb0c1..e41fe67 100644 --- a/meshterm/ui/tui/progress.py +++ b/meshterm/ui/tui/progress.py @@ -43,7 +43,7 @@ class ProgressScreen(Screen): modal = True # work in flight owns the keyboard; ^W must not unwind out from under it @property - def picocalc_lane(self): + def picocalc_lyra_lane(self): """No lane: the dialog is non-interactive, so no key does anything to it.""" from .fkeys import EMPTY_LANE diff --git a/meshterm/ui/tui/prompt.py b/meshterm/ui/tui/prompt.py index 1407a2e..1f0e5e4 100644 --- a/meshterm/ui/tui/prompt.py +++ b/meshterm/ui/tui/prompt.py @@ -248,7 +248,7 @@ class _KeylessDialog(Screen): modal = True @property - def picocalc_lane(self): + def picocalc_lyra_lane(self): """No slots: nothing on a prompt pages, jumps, or needs promoting off a chord.""" from .fkeys import EMPTY_LANE @@ -560,12 +560,12 @@ class ButtonDialog(_KeylessDialog): return [Text(self._prompt, style=self._prompt_style)] @property - def picocalc_lane(self): + def picocalc_lyra_lane(self): """The caller's lane where one was given, else a prompt's empty one. The per-deck definition, as every screen's is; the Cardputer's deck follows it. """ - return self._lane if self._lane is not None else super().picocalc_lane + return self._lane if self._lane is not None else super().picocalc_lyra_lane @property def _button_row_width(self) -> int: diff --git a/meshterm/ui/tui/screen.py b/meshterm/ui/tui/screen.py index 91cc442..6a4ea87 100644 --- a/meshterm/ui/tui/screen.py +++ b/meshterm/ui/tui/screen.py @@ -143,7 +143,7 @@ class Screen: """The screen's F-key lane on the active platform (see :mod:`~meshterm.ui.tui.fkeys`). Each handheld deals its own: this reads whichever of the screen's lane definitions - the platform's deck names (:attr:`picocalc_lane`, :attr:`cardputer_lane`). A + the platform's deck names (:attr:`picocalc_lyra_lane`, :attr:`cardputer_zero_lane`). A platform with no lane — the desktop, whose footer is the hint line — gets an empty one. Override the per-deck definitions, never this. """ @@ -153,7 +153,7 @@ class Screen: return EMPTY_LANE if deck is None else deck.read_lane(self) @property - def cardputer_lane(self): + def cardputer_zero_lane(self): """The screen's lane on the Cardputer Zero: the PicoCalc's, for now. JP, 2026-09-30: the Cardputer deals the same entries as the PicoCalc until decided @@ -161,10 +161,10 @@ class Screen: having five slots is a coincidence of two keyboards, so this is the one place the two are tied; a screen whose Cardputer lane should differ overrides this. """ - return self.picocalc_lane + return self.picocalc_lyra_lane @property - def picocalc_lane(self): + def picocalc_lyra_lane(self): """The screen's lane on the PicoCalc (see :mod:`~meshterm.ui.tui.fkeys`). Five slots, F1–F5, each with an optional F6–F10 Shift-bank companion. A slot is @@ -744,7 +744,7 @@ class ScrollScreen(Screen): """ @property - def picocalc_lane(self): + def picocalc_lyra_lane(self): """The shared lane, its nav slots dimmed when the content already fits. Every nav key here scrolls and nothing else, so a result window short enough to @@ -850,7 +850,7 @@ class BusyScreen(Screen): modal = True # work in flight owns the keyboard; ^W must not unwind out from under it @property - def picocalc_lane(self): + def picocalc_lyra_lane(self): """No lane at all: this screen swallows every key, so none of them do anything.""" from .fkeys import EMPTY_LANE diff --git a/meshterm/ui/tui/select.py b/meshterm/ui/tui/select.py index f1c7209..2d80e50 100644 --- a/meshterm/ui/tui/select.py +++ b/meshterm/ui/tui/select.py @@ -288,7 +288,7 @@ class SelectScreen(Screen): _HSCROLL_STEP = 8 @property - def picocalc_lane(self): + def picocalc_lyra_lane(self): """The shared pager, the section jumps on F1/F2, and row deletion on F3. Ctrl+PageUp/PageDown step the highlight heading by heading — and on the PicoCalc @@ -562,7 +562,7 @@ class SelectScreen(Screen): def _all_section_starts(self) -> list[int]: """The section starts of the *unfiltered* list — whether this list has sections at all. - The F-key lane needs both questions answered separately (see :attr:`picocalc_lane`): + The F-key lane needs both questions answered separately (see :attr:`picocalc_lyra_lane`): a flat list never offers a section jump, while a grouped one whose filter has collapsed it to one section offers it again the moment the filter is edited. """ @@ -1012,7 +1012,7 @@ class ReorderScreen(Screen): _HINT_GRABBED = "↑↓ move row · Enter drop · Esc cancel" @property - def picocalc_lane(self): + def picocalc_lyra_lane(self): """No lane: the whole screen is ↑↓ and Enter, three keys already on the keyboard.""" from .fkeys import EMPTY_LANE diff --git a/meshterm/ui/tui/session.py b/meshterm/ui/tui/session.py index 85d46ac..ec77280 100644 --- a/meshterm/ui/tui/session.py +++ b/meshterm/ui/tui/session.py @@ -238,7 +238,7 @@ def _reclaim_last_column() -> bool: This is a gate, not a certainty: it is *correct* only when the probe under-reports. On a terminal whose width probe is already right, the extra column falls off the real screen and the frame would wrap and tear — which is exactly PicoCalc's exact-width console, so - :data:`~meshterm.platforms.PICOCALC` defaults this off. + :data:`~meshterm.platforms.PICOCALC_LYRA` defaults this off. Three sources, in confidence order, because the person at the keyboard can see the column and the platform can only guess at it: ``MESHTERM_FULL_WIDTH=0``/``=1`` for a diff --git a/meshterm/ui/walk_screen.py b/meshterm/ui/walk_screen.py index 8f20660..5d80a65 100644 --- a/meshterm/ui/walk_screen.py +++ b/meshterm/ui/walk_screen.py @@ -231,7 +231,7 @@ class WalkScreen(Screen): floating = False @property - def picocalc_lane(self): + def picocalc_lyra_lane(self): """``You`` on the screen's own F3, the shared pager and its two ends on F4/F5. ``You`` is not an end of the link list — it drops the whole trail and puts the @@ -442,7 +442,7 @@ class WalkScreen(Screen): Home/End are the list's own ends here, as on every other scrolling screen; the jump back to our own node is ``locate`` (^Y, and the lane's F3), which is not a place in - this list at all — see :attr:`picocalc_lane`. + this list at all — see :attr:`picocalc_lyra_lane`. """ rows = self._rows() if action == "escape": diff --git a/meshterm/ui/watchtower_screen.py b/meshterm/ui/watchtower_screen.py index 47f753e..2324a80 100644 --- a/meshterm/ui/watchtower_screen.py +++ b/meshterm/ui/watchtower_screen.py @@ -130,7 +130,7 @@ async def open_watchtower(ctx: AppContext) -> dict[str, Any] | None: # alert actually overflows the width (see SelectScreen.hscroll_hint) — and it # slides the *message* alone: each row pins its own lanes (see _alert_lanes). # The two section headings below earn the list its ^PgUp/^PgDn jumps and their - # F1/F2 chips for free (SelectScreen.picocalc_lane); the hint has no room to name + # F1/F2 chips for free (SelectScreen.picocalc_lyra_lane); the hint has no room to name # them beside the ←→ atom, and no other grouped list spells them out either. footer_hint="↑↓ move · Enter select/acknowledge · Esc back", ) diff --git a/scripts/README.md b/scripts/README.md index 6b9956f..7d9e89c 100644 --- a/scripts/README.md +++ b/scripts/README.md @@ -5,9 +5,9 @@ Repo-side tools. None of these ship in the wheel. | Script | What it is for | |---|---| | `basemap-doctor.py` | Why a user's map has no basemap — certificates, DNS, proxy, or colour depth | -| `picocalc/` | Calculinux device setup: console font, palette, Wi-Fi; `xiao-radio/` is the XIAO radio kit (firmware build, flashing, UART setup) | +| `picocalc-lyra/` | Calculinux device setup: console font, palette, Wi-Fi; `xiao-radio/` is the XIAO radio kit (firmware build, flashing, UART setup) | | `uconsole/` | The uConsole's always-on SPI bridge service (MeshTerm can also drive that radio directly, with no script at all — see `docs/devices/uconsole.md`) | -| `cardputer/` | The Cardputer Zero's console host: `fetch-terminus.py` installs the 12-pixel Terminus fonts it draws in (OFL, so never shipped with MeshTerm) | +| `cardputer-zero/` | The Cardputer Zero's console host: `fetch-terminus.py` installs the 12-pixel Terminus fonts it draws in (OFL, so never shipped with MeshTerm) | ## basemap-doctor.py diff --git a/scripts/cardputer/fetch-terminus.py b/scripts/cardputer-zero/fetch-terminus.py similarity index 94% rename from scripts/cardputer/fetch-terminus.py rename to scripts/cardputer-zero/fetch-terminus.py index fe5bd96..346b632 100644 --- a/scripts/cardputer/fetch-terminus.py +++ b/scripts/cardputer-zero/fetch-terminus.py @@ -9,12 +9,12 @@ reads (``$MESHTERM_HOST_FONTS``, else ``fonts`` under the MeshTerm config direct Run it once on a machine that will run the host or its desktop simulator: - python scripts/cardputer/fetch-terminus.py + python scripts/cardputer-zero/fetch-terminus.py Where Python can't fetch it (a certificate store that rejects the mirror), download the archive any other way and hand it over; it is checked against the same digest: - python scripts/cardputer/fetch-terminus.py --archive terminus-font-4.49.1.tar.gz + python scripts/cardputer-zero/fetch-terminus.py --archive terminus-font-4.49.1.tar.gz """ from __future__ import annotations diff --git a/scripts/picocalc/LICENSE.GPL-2.0 b/scripts/picocalc-lyra/LICENSE.GPL-2.0 similarity index 100% rename from scripts/picocalc/LICENSE.GPL-2.0 rename to scripts/picocalc-lyra/LICENSE.GPL-2.0 diff --git a/scripts/picocalc/calculinux-console-font-6x12.sh b/scripts/picocalc-lyra/calculinux-console-font-6x12.sh similarity index 99% rename from scripts/picocalc/calculinux-console-font-6x12.sh rename to scripts/picocalc-lyra/calculinux-console-font-6x12.sh index c9578dc..9274103 100644 --- a/scripts/picocalc/calculinux-console-font-6x12.sh +++ b/scripts/picocalc-lyra/calculinux-console-font-6x12.sh @@ -262,7 +262,7 @@ PYEOF # --- the 6x8 companion, out of its own (GPL-2.0) file ----------------------------------- # Kept separate because its base bitmap is the kernel's font_6x8 and the produced PSF is -# therefore GPL-2.0 -- see scripts/picocalc/calculinux-console-font-6x8.sh and scripts/picocalc/LICENSE.GPL-2.0. +# therefore GPL-2.0 -- see scripts/picocalc-lyra/calculinux-console-font-6x8.sh and scripts/picocalc-lyra/LICENSE.GPL-2.0. # It re-uses the shared generator block above rather than carrying a second copy of the # donor/alias/keeper tables, so a run here still produces both fonts, as it always did. # A failure there is not a failure here: the 6x12 default is the font the device boots in. @@ -271,7 +271,7 @@ if [ "${SKIP_6X8:-0}" = 1 ]; then elif [ -f "$BUILD8" ]; then sh "$BUILD8" || echo "warning: the 6x8 build failed; $OUT is installed either way" >&2 else - echo "note: $BUILD8 not found -- only $OUT was built (copy the whole scripts/picocalc/ dir)" >&2 + echo "note: $BUILD8 not found -- only $OUT was built (copy the whole scripts/picocalc-lyra/ dir)" >&2 fi # --- apply live: setfont re-renders the whole console immediately ----------------------- diff --git a/scripts/picocalc/calculinux-console-font-6x8.sh b/scripts/picocalc-lyra/calculinux-console-font-6x8.sh similarity index 99% rename from scripts/picocalc/calculinux-console-font-6x8.sh rename to scripts/picocalc-lyra/calculinux-console-font-6x8.sh index 3bea360..791d33f 100644 --- a/scripts/picocalc/calculinux-console-font-6x8.sh +++ b/scripts/picocalc-lyra/calculinux-console-font-6x8.sh @@ -6,7 +6,7 @@ # LICENCE -- READ THIS FIRST. The base bitmap embedded below is the Linux kernel's own # font_6x8 (lib/fonts/font_6x8.c), which is GPL-2.0. This script is therefore GPL-2.0-only # and so is the PSF it produces; the full licence text sits beside it as -# scripts/picocalc/LICENSE.GPL-2.0. The rest of MeshTerm is Apache-2.0 and stays that way: the +# scripts/picocalc-lyra/LICENSE.GPL-2.0. The rest of MeshTerm is Apache-2.0 and stays that way: the # produced meshterm8.psf.gz is a DATA FILE the Linux kernel console reads with setfont, on # the device, at run time. MeshTerm never links it, never bundles it, and never # redistributes it -- it is built on the machine it runs on, from this script, and the diff --git a/scripts/picocalc/calculinux-radio-bridge.sh b/scripts/picocalc-lyra/calculinux-radio-bridge.sh similarity index 100% rename from scripts/picocalc/calculinux-radio-bridge.sh rename to scripts/picocalc-lyra/calculinux-radio-bridge.sh diff --git a/scripts/picocalc/calculinux-setup.sh b/scripts/picocalc-lyra/calculinux-setup.sh similarity index 100% rename from scripts/picocalc/calculinux-setup.sh rename to scripts/picocalc-lyra/calculinux-setup.sh diff --git a/scripts/picocalc/calculinux-wifi-set.sh b/scripts/picocalc-lyra/calculinux-wifi-set.sh similarity index 100% rename from scripts/picocalc/calculinux-wifi-set.sh rename to scripts/picocalc-lyra/calculinux-wifi-set.sh diff --git a/scripts/picocalc/xiao-radio/LICENSE.MeshCore b/scripts/picocalc-lyra/xiao-radio/LICENSE.MeshCore similarity index 100% rename from scripts/picocalc/xiao-radio/LICENSE.MeshCore rename to scripts/picocalc-lyra/xiao-radio/LICENSE.MeshCore diff --git a/scripts/picocalc/xiao-radio/README.md b/scripts/picocalc-lyra/xiao-radio/README.md similarity index 92% rename from scripts/picocalc/xiao-radio/README.md rename to scripts/picocalc-lyra/xiao-radio/README.md index 52fe188..429d4a2 100644 --- a/scripts/picocalc/xiao-radio/README.md +++ b/scripts/picocalc-lyra/xiao-radio/README.md @@ -17,13 +17,13 @@ Three steps on two machines: ```bash # 1. dev machine: build (needs git + PlatformIO) -cd scripts/picocalc/xiao-radio && sh build-firmware.sh +cd scripts/picocalc-lyra/xiao-radio && sh build-firmware.sh # 2. dev machine: flash, with the XIAO's own USB-C plugged in python flash.py # double-tap reset if the touch doesn't take # 3. the Lyra, as root -sh scripts/picocalc/xiao-radio/lyra-setup.sh # MT_USER=meshterm by default +sh scripts/picocalc-lyra/xiao-radio/lyra-setup.sh # MT_USER=meshterm by default # then, as that user meshterm diff --git a/scripts/picocalc/xiao-radio/build-firmware.sh b/scripts/picocalc-lyra/xiao-radio/build-firmware.sh similarity index 100% rename from scripts/picocalc/xiao-radio/build-firmware.sh rename to scripts/picocalc-lyra/xiao-radio/build-firmware.sh diff --git a/scripts/picocalc/xiao-radio/flash.py b/scripts/picocalc-lyra/xiao-radio/flash.py similarity index 100% rename from scripts/picocalc/xiao-radio/flash.py rename to scripts/picocalc-lyra/xiao-radio/flash.py diff --git a/scripts/picocalc/xiao-radio/lyra-setup.sh b/scripts/picocalc-lyra/xiao-radio/lyra-setup.sh similarity index 100% rename from scripts/picocalc/xiao-radio/lyra-setup.sh rename to scripts/picocalc-lyra/xiao-radio/lyra-setup.sh diff --git a/scripts/picocalc/xiao-radio/meshcore-uart1.patch b/scripts/picocalc-lyra/xiao-radio/meshcore-uart1.patch similarity index 100% rename from scripts/picocalc/xiao-radio/meshcore-uart1.patch rename to scripts/picocalc-lyra/xiao-radio/meshcore-uart1.patch diff --git a/scripts/picocalc/xiao-radio/uart1-mux.py b/scripts/picocalc-lyra/xiao-radio/uart1-mux.py similarity index 100% rename from scripts/picocalc/xiao-radio/uart1-mux.py rename to scripts/picocalc-lyra/xiao-radio/uart1-mux.py diff --git a/tests/conftest.py b/tests/conftest.py index 7c48bc3..a9ffe16 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -120,7 +120,7 @@ def _isolate_config_dir(tmp_path_factory: pytest.TempPathFactory) -> Iterator[No def _reset_platform() -> Iterator[None]: """Every test starts and ends on :data:`~meshterm.platforms.REGULAR`. - A test that calls ``set_platform(PICOCALC)`` (directly, or via the gallery harness) + A test that calls ``set_platform(PICOCALC_LYRA)`` (directly, or via the gallery harness) can't leak that choice into whatever runs next — regular is the suite's baseline, the same way it is the default for a process that never passes ``--platform``/ ``MESHTERM_PLATFORM`` (see :mod:`meshterm.platforms`). diff --git a/tests/test_about.py b/tests/test_about.py index b46913e..7bfb008 100644 --- a/tests/test_about.py +++ b/tests/test_about.py @@ -195,18 +195,18 @@ def test_the_console_lane_claims_the_section_step_only_while_the_page_scrolls() never advertises a key that would do nothing (``CLAUDE.md``) — and a page you can see whole has no section to step to. """ - from meshterm.platforms import PICOCALC, REGULAR, set_platform + from meshterm.platforms import PICOCALC_LYRA, REGULAR, set_platform - set_platform(PICOCALC) + set_platform(PICOCALC_LYRA) try: screen = AboutPage("About MeshTerm", about_meshterm()) screen.note_metrics(12, 40) # the whole page fits - assert [pair.label for pair in screen.picocalc_lane[:2]] == ["Sect ↑", "Sect ↓"] - assert not any(pair.enabled for pair in screen.picocalc_lane[:2]) + assert [pair.label for pair in screen.picocalc_lyra_lane[:2]] == ["Sect ↑", "Sect ↓"] + assert not any(pair.enabled for pair in screen.picocalc_lyra_lane[:2]) screen.note_metrics(60, 20) # taller than the viewport - assert all(pair.enabled for pair in screen.picocalc_lane[:2]) - assert [pair.action for pair in screen.picocalc_lane[:2]] == [ + assert all(pair.enabled for pair in screen.picocalc_lyra_lane[:2]) + assert [pair.action for pair in screen.picocalc_lyra_lane[:2]] == [ "ctrl_pageup", "ctrl_pagedown", ] @@ -228,12 +228,12 @@ def test_menu_rows_carry_the_icon_and_the_titles_do_not() -> None: def test_every_page_icon_has_a_picocalc_glyph() -> None: """No emoji reaches the console: each icon folds to a font character (CLAUDE.md).""" - from meshterm.platforms import PICOCALC, REGULAR, set_platform + from meshterm.platforms import PICOCALC_LYRA, REGULAR, set_platform from meshterm.tools import get_tool from meshterm.ui.fontset import FONT_CODEPOINTS from meshterm.ui.theme import glyph - set_platform(PICOCALC) + set_platform(PICOCALC_LYRA) try: for name in ("about", "about-author", "discord", "support"): tool = get_tool(name) diff --git a/tests/test_braillechart.py b/tests/test_braillechart.py index 6c3c7b0..fde59ef 100644 --- a/tests/test_braillechart.py +++ b/tests/test_braillechart.py @@ -264,7 +264,7 @@ def test_axis_chart_mirrors_marks_where_the_platform_affords_them() -> None: The desktop frames a chart with marks on both gutters; the console keeps the right ``├`` tick but spends the mirrored label's cells on the chart instead. """ - from meshterm.platforms import PICOCALC, set_platform + from meshterm.platforms import PICOCALC_LYRA, set_platform from meshterm.ui.braillechart import axis_chrome rows = timeline_rows([9] * 8, rows=2) @@ -275,7 +275,7 @@ def test_axis_chart_mirrors_marks_where_the_platform_affords_them() -> None: assert out[2].plain.startswith(" └") and out[2].plain.endswith("┘") assert axis_chrome(1) == 2 * (1 + 2) # what a caller must budget beside the cells - set_platform(PICOCALC) + set_platform(PICOCALC_LYRA) tight = axis_chart(timeline_rows([9] * 8, rows=2), 9, 4, lambda f: "x") assert tight[0].plain == " 8 ┤⣿⣿⣿⣿├" # the tick survives; the label's cells don't assert tight[1].plain == " 3 ┤⣿⣿⣿⣿├" diff --git a/tests/test_cardputer_chrome.py b/tests/test_cardputer_zero_chrome.py similarity index 90% rename from tests/test_cardputer_chrome.py rename to tests/test_cardputer_zero_chrome.py index b2e2229..fd626c2 100644 --- a/tests/test_cardputer_chrome.py +++ b/tests/test_cardputer_zero_chrome.py @@ -9,14 +9,14 @@ from rich.cells import cell_len from rich.text import Text from meshterm import __version__ -from meshterm.platforms import CARDPUTER, PICOCALC, set_platform +from meshterm.platforms import CARDPUTER_ZERO, PICOCALC_LYRA, set_platform from meshterm.ui import menu from meshterm.ui.tui import frame from meshterm.ui.tui.screen import ScrollScreen from meshterm.ui.widgets import battery_cell from tests.conftest import plain as _plain -ROWS, COLS = CARDPUTER.readable_rows, CARDPUTER.readable_cols +ROWS, COLS = CARDPUTER_ZERO.readable_rows, CARDPUTER_ZERO.readable_cols def _status() -> Text: @@ -41,8 +41,8 @@ def _rows(header: Text, cols: int = COLS, rows: int = ROWS, **lane) -> list[str] def test_the_cardputer_has_no_header_row() -> None: """The title bar is the top row, and every screen gets the header's row for its body.""" - set_platform(CARDPUTER) - assert not CARDPUTER.header_row + set_platform(CARDPUTER_ZERO) + assert not CARDPUTER_ZERO.header_row assert frame.header_lines(_status(), COLS) == [] composed = [_plain(line) for line in _rows(_status())] assert len(composed) == ROWS @@ -54,7 +54,7 @@ def test_the_cardputer_has_no_header_row() -> None: def test_a_platform_with_a_header_row_keeps_it() -> None: """The PicoCalc is unchanged: header on top, the bar under it, no status on the bar.""" - set_platform(PICOCALC) + set_platform(PICOCALC_LYRA) composed = [_plain(line) for line in _rows(Text("hdr"), 53, 26)] assert composed[0].startswith("hdr") assert composed[1].startswith("↑↓ ") and "hdr" not in composed[1] @@ -62,7 +62,7 @@ def test_a_platform_with_a_header_row_keeps_it() -> None: def test_the_status_sits_in_the_corner_after_the_way_out() -> None: """``↑↓ ── Title ──── Esc back ● 3 ⣷ 87%``: the badges and battery keep their corner.""" - set_platform(CARDPUTER) + set_platform(CARDPUTER_ZERO) bar = frame._title_bar(_screen(), COLS, False, True, _status()).plain assert cell_len(bar) == COLS assert bar.endswith("Esc back " + _status().plain) @@ -71,14 +71,14 @@ def test_the_status_sits_in_the_corner_after_the_way_out() -> None: def test_an_empty_status_draws_the_bar_as_it_always_was() -> None: """Nothing unread and no pack: the bar is exactly the one a header row would sit over.""" - set_platform(CARDPUTER) + set_platform(CARDPUTER_ZERO) plain_bar = frame._title_bar(_screen(), COLS, False, True).plain assert frame._title_bar(_screen(), COLS, False, True, Text()).plain == plain_bar def test_a_long_title_gives_way_before_the_status_does() -> None: """The way out sheds first, then the title is cut short; the status is never pushed off.""" - set_platform(CARDPUTER) + set_platform(CARDPUTER_ZERO) status = _status() long_title = "Trace — Hilltop-Repeater over a much longer spec than fits" bar = frame._title_bar(_screen(long_title), COLS, False, True, status).plain @@ -90,7 +90,7 @@ def test_a_long_title_gives_way_before_the_status_does() -> None: def test_the_header_is_its_atoms_alone_without_a_row() -> None: """No version, no pulse, no padding: the badges and the battery, a space apart.""" - set_platform(CARDPUTER) + set_platform(CARDPUTER_ZERO) ctx = SimpleNamespace( mock=False, chat=SimpleNamespace(unread_total=lambda: 3), @@ -108,7 +108,7 @@ def test_the_header_is_its_atoms_alone_without_a_row() -> None: def test_the_main_menu_wears_the_wordmark_where_no_header_row_does() -> None: """The root screen's title is ``MeshTerm vX`` in the header's colours, or else the question.""" - set_platform(CARDPUTER) + set_platform(CARDPUTER_ZERO) assert menu._menu_title() == f"MeshTerm v{__version__}" screen = menu._MainMenu(menu._menu_title(), [], footer_hint="↑↓ move · ^Q quit?") bar = frame._title_bar(screen, COLS, False, False, _status()) @@ -116,7 +116,7 @@ def test_the_main_menu_wears_the_wordmark_where_no_header_row_does() -> None: styles = {str(span.style) for span in bar.spans if span.start <= start < span.end} assert "brand" in styles - set_platform(PICOCALC) + set_platform(PICOCALC_LYRA) assert menu._menu_title() == "What would you like to do?" @@ -127,8 +127,8 @@ def test_a_tall_dialog_covers_the_bar_and_blanks_its_ends() -> None: short of it. On the bar, the cells either side of the box are blanked: there, a stray ``7%`` would read as the battery. """ - set_platform(CARDPUTER) - assert ROWS - 2 - CARDPUTER.dialog_row_margin == 11 # the dialog's budget + set_platform(CARDPUTER_ZERO) + assert ROWS - 2 - CARDPUTER_ZERO.dialog_row_margin == 11 # the dialog's budget base = _rows(_status(), footer_lane=lambda: Text("LANE")) box = "\n".join("|" + "x" * 45 + "|" for _ in range(ROWS - 1)) rows = [_plain(row) for row in frame.composite_float(base, box, COLS, ROWS)] @@ -139,7 +139,7 @@ def test_a_tall_dialog_covers_the_bar_and_blanks_its_ends() -> None: def test_a_short_dialog_leaves_the_bar_whole() -> None: """A box that doesn't reach the top row leaves the bar, and its status, in view.""" - set_platform(CARDPUTER) + set_platform(CARDPUTER_ZERO) base = _rows(_status()) rows = frame.composite_float(base, "\n".join(["[box]"] * 5), COLS, ROWS) assert rows[0] == base[0] diff --git a/tests/test_channels.py b/tests/test_channels.py index 5595afc..56d02f7 100644 --- a/tests/test_channels.py +++ b/tests/test_channels.py @@ -316,7 +316,7 @@ def test_where_braille_is_solid_every_code_is_drawn_in_it() -> None: """ import segno - from meshterm.platforms import PICOCALC, set_platform + from meshterm.platforms import PICOCALC_LYRA, set_platform def is_braille(text: str) -> bool: return any("⠀" <= ch <= "⣿" for ch in text) @@ -325,7 +325,7 @@ def test_where_braille_is_solid_every_code_is_drawn_in_it() -> None: channel = "meshcore://channel/add?name=Test&secret=" + "ab" * 16 assert not is_braille(fit_qr(url, 53, 22).plain) and not is_braille(qr_text(channel).plain) - set_platform(PICOCALC) + set_platform(PICOCALC_LYRA) assert is_braille(qr_text(channel).plain) and "█" not in qr_text(channel).plain screen = QrScreen(url, title="Share YUL-Cartierville") screen.note_viewport(26) @@ -844,7 +844,7 @@ async def test_the_detail_summary_sheds_atoms_rather_than_wrapping(ctx: AppConte this screen from — never the channel's own identity. """ from meshterm.core.models import ChatMessage - from meshterm.platforms import PICOCALC, REGULAR, set_platform + from meshterm.platforms import PICOCALC_LYRA, REGULAR, set_platform from meshterm.ui.channels import _detail_summary, _LiveStats device = await ctx.device() @@ -857,7 +857,7 @@ async def test_the_detail_summary_sheds_atoms_rather_than_wrapping(ctx: AppConte ctx.chat._unread[slot.conversation.key] = 2 try: - for platform in (REGULAR, PICOCALC): + for platform in (REGULAR, PICOCALC_LYRA): set_platform(platform) line = _detail_summary(ctx, slot, _LiveStats(ctx)) assert cell_len(line) <= platform.readable_cols, (platform.name, line) diff --git a/tests/test_chat.py b/tests/test_chat.py index 457b5f0..5c079e6 100644 --- a/tests/test_chat.py +++ b/tests/test_chat.py @@ -1073,18 +1073,20 @@ async def test_chat_fkey_lane_dims_retry_and_the_nav_slots() -> None: return message empty = _screen(_StubSession(), send=None, resend=resend) - assert not any(pair.enabled for pair in empty.picocalc_lane if pair) # nothing to walk + assert not any(pair.enabled for pair in empty.picocalc_lyra_lane if pair) # nothing to walk failed = ChatMessage(text="oops", outbound=True, peer="d4e5f6a7", acked=False) screen = _screen(_StubSession(), send=None, messages=[failed], resend=resend) - assert all(pair.enabled for pair in screen.picocalc_lane[3:]) # the pager walks the pick - assert screen.picocalc_lane[2].opp_enabled is True # F8 Retry: the message never acked + assert all(pair.enabled for pair in screen.picocalc_lyra_lane[3:]) # the pager walks the pick + assert screen.picocalc_lyra_lane[2].opp_enabled is True # F8 Retry: the message never acked screen.handle("retry") await asyncio.sleep(0) assert failed.acked is True - assert screen.picocalc_lane[2].opp_enabled is False # acknowledged — nothing left to retry - assert screen.picocalc_lane[2].opp_label == "Retry" # dim, not gone: it belongs on this screen + assert screen.picocalc_lyra_lane[2].opp_enabled is False # acknowledged — nothing left to retry + assert ( + screen.picocalc_lyra_lane[2].opp_label == "Retry" + ) # dim, not gone: it belongs on this screen def test_chat_fkey_lane_speaks_the_transcript_and_drops_channel_retry() -> None: @@ -1095,10 +1097,10 @@ def test_chat_fkey_lane_speaks_the_transcript_and_drops_channel_retry() -> None: # Not "Bottom"/"Top": what the Shift bank does to a conversation is come back to the # latest message and the compose line, or reach back to its oldest one. Relabelled in # place, so each jump still rides the pager heading for it. - assert [pair.opp_label for pair in direct.picocalc_lane[3:]] == ["Latest", "Oldest"] - assert [pair.opp_action for pair in direct.picocalc_lane[3:]] == ["ctrl_end", "ctrl_home"] - assert [pair.label for pair in direct.picocalc_lane[3:]] == ["Page ↓", "Page ↑"] - assert direct.picocalc_lane[2].opp_label == "Retry" + assert [pair.opp_label for pair in direct.picocalc_lyra_lane[3:]] == ["Latest", "Oldest"] + assert [pair.opp_action for pair in direct.picocalc_lyra_lane[3:]] == ["ctrl_end", "ctrl_home"] + assert [pair.label for pair in direct.picocalc_lyra_lane[3:]] == ["Page ↓", "Page ↑"] + assert direct.picocalc_lyra_lane[2].opp_label == "Retry" channel = ChatScreen( Conversation(label="#general", is_channel=True, channel_id="1"), @@ -1109,8 +1111,8 @@ def test_chat_fkey_lane_speaks_the_transcript_and_drops_channel_retry() -> None: ) # A channel message is never acknowledged, so retrying one isn't a thing here: the # slot is empty rather than dimmed, and its key resolves to nothing. - assert channel.picocalc_lane[2].opp_label == "" - assert fkeys.PICOCALC_DECK.action_for(channel.picocalc_lane, 8) is None + assert channel.picocalc_lyra_lane[2].opp_label == "" + assert fkeys.PICOCALC_LYRA_DECK.action_for(channel.picocalc_lyra_lane, 8) is None def test_chat_screen_up_picks_and_ctrl_end_returns_to_compose() -> None: @@ -1311,7 +1313,7 @@ async def test_chat_paths_key_needs_a_picked_message() -> None: await asyncio.sleep(0) assert shown == [] assert "^P" not in screen.footer_hint - assert screen.picocalc_lane[2].enabled is False + assert screen.picocalc_lyra_lane[2].enabled is False screen.handle("up") screen.handle("up") # pick the older message @@ -1321,7 +1323,7 @@ async def test_chat_paths_key_needs_a_picked_message() -> None: # With a pick, paths are on offer — here on Enter, since a direct chat has no reply # to prime (a channel's hint keeps the ^P atom beside its Enter reply). assert "Enter paths" in screen.footer_hint - assert screen.picocalc_lane[2].enabled is True + assert screen.picocalc_lyra_lane[2].enabled is True async def test_chat_direct_enter_on_a_pick_opens_paths() -> None: @@ -1870,7 +1872,7 @@ def test_picker_marker_lane_lines_the_two_groups_up(repo: Repository) -> None: padded to whatever it actually measures rather than to a written-down width: a hard-coded pad left every channel row a cell adrift of every direct row on the PicoCalc. """ - from meshterm.platforms import PICOCALC, REGULAR, set_platform + from meshterm.platforms import PICOCALC_LYRA, REGULAR, set_platform from meshterm.tools.chat import _lanes channel = Conversation(label="Public", is_channel=True, channel_idx=0, channel_id="c0") @@ -1879,7 +1881,7 @@ def test_picker_marker_lane_lines_the_two_groups_up(repo: Repository) -> None: ) ctx = _RowCtx(repo) try: - for platform in (REGULAR, PICOCALC): + for platform in (REGULAR, PICOCALC_LYRA): set_platform(platform) lanes = _lanes([channel, contact]) rows = [_title(ctx, c, {}, _NO_KEYS, lanes).plain for c in (channel, contact)] @@ -2293,9 +2295,14 @@ def test_chat_fkey_lane_steps_by_day_on_the_free_left_pair() -> None: now = utcnow() one_day = [ChatMessage(text="hi", peer="d4e5f6a7", created_at=now)] single = _screen(_StubSession(), send=None, messages=one_day) - assert [pair.label for pair in single.picocalc_lane[:2]] == ["Day ↑", "Day ↓"] - assert [pair.action for pair in single.picocalc_lane[:2]] == ["ctrl_pageup", "ctrl_pagedown"] - assert not any(pair.enabled for pair in single.picocalc_lane[:2]) # one day: nowhere to step + assert [pair.label for pair in single.picocalc_lyra_lane[:2]] == ["Day ↑", "Day ↓"] + assert [pair.action for pair in single.picocalc_lyra_lane[:2]] == [ + "ctrl_pageup", + "ctrl_pagedown", + ] + assert not any( + pair.enabled for pair in single.picocalc_lyra_lane[:2] + ) # one day: nowhere to step spread = _screen( _StubSession(), @@ -2305,11 +2312,11 @@ def test_chat_fkey_lane_steps_by_day_on_the_free_left_pair() -> None: ChatMessage(text="now", peer="d4e5f6a7", created_at=now), ], ) - assert all(pair.enabled for pair in spread.picocalc_lane[:2]) + assert all(pair.enabled for pair in spread.picocalc_lyra_lane[:2]) # A left-hand pair rises toward F1, so stepping *back* through the transcript is the # outer key — the same handedness as the pager's on the right. - assert fkeys.PICOCALC_DECK.action_for(spread.picocalc_lane, 1) == "ctrl_pageup" - spread.handle(fkeys.PICOCALC_DECK.action_for(spread.picocalc_lane, 1)) + assert fkeys.PICOCALC_LYRA_DECK.action_for(spread.picocalc_lyra_lane, 1) == "ctrl_pageup" + spread.handle(fkeys.PICOCALC_LYRA_DECK.action_for(spread.picocalc_lyra_lane, 1)) assert spread._selected == 0 # jumped to the first message of the older day @@ -2341,9 +2348,9 @@ def test_on_the_picocalc_each_url_hangs_a_code_under_its_message_side_by_side() """ import segno - from meshterm.platforms import PICOCALC, set_platform + from meshterm.platforms import PICOCALC_LYRA, set_platform - set_platform(PICOCALC) + set_platform(PICOCALC_LYRA) first, second = "https://meshterm.net", "https://github.com/jpmartineau/MeshTerm" conv = Conversation(label="#ops", is_channel=True, channel_idx=1) message = ChatMessage(text=f"Alice: map at {first}, code at {second}!", is_channel=True) @@ -2379,10 +2386,10 @@ def test_codes_that_outrun_the_line_start_a_new_band() -> None: """Two short links fit beside each other in the 44 cells after the indent; a third wraps.""" import segno - from meshterm.platforms import PICOCALC, set_platform + from meshterm.platforms import PICOCALC_LYRA, set_platform from meshterm.ui.qr import qr_strip - set_platform(PICOCALC) + set_platform(PICOCALC_LYRA) urls = [f"https://meshterm.net/{c}" for c in "abc"] size = segno.make(urls[0], error="m").symbol_size(border=4)[0] cols, height = -(-size // 2), -(-size // 4) @@ -2395,10 +2402,10 @@ def test_codes_that_outrun_the_line_start_a_new_band() -> None: def test_a_picked_message_keeps_its_codes_in_view() -> None: """Walking the pick down onto a link shows its code, not just the message's first row.""" - from meshterm.platforms import PICOCALC, set_platform + from meshterm.platforms import PICOCALC_LYRA, set_platform from meshterm.ui.tui import frame - set_platform(PICOCALC) + set_platform(PICOCALC_LYRA) conv = Conversation(label="#ops", is_channel=True, channel_idx=1) messages = [ChatMessage(text=f"Alice: line {i}", is_channel=True) for i in range(12)] messages.insert(6, ChatMessage(text="Bob: map at https://meshterm.net", is_channel=True)) @@ -2497,8 +2504,10 @@ def test_ctrl_u_is_named_only_on_a_picked_message_with_a_link() -> None: linked.handle("up") plain.handle("up") assert "^U QR" in linked.footer_hint and "^U" not in plain.footer_hint - assert fkeys.PICOCALC_DECK.action_for(linked.picocalc_lane, 7) == "url_code" # Shift+F2 - assert linked.picocalc_lane[1].opp_enabled and not plain.picocalc_lane[1].opp_enabled + assert ( + fkeys.PICOCALC_LYRA_DECK.action_for(linked.picocalc_lyra_lane, 7) == "url_code" + ) # Shift+F2 + assert linked.picocalc_lyra_lane[1].opp_enabled and not plain.picocalc_lyra_lane[1].opp_enabled # Every pick state's hint, with a link in it, inside the 72-cell budget. direct = _screen( @@ -2523,15 +2532,15 @@ def test_on_the_cardputer_a_link_takes_the_share_screen_as_on_the_desktop() -> N and the share screen draws the code in braille — small enough that a link and its code share the 53x14 panel, URL under the code, nothing a page down. """ - from meshterm.platforms import CARDPUTER, set_platform + from meshterm.platforms import CARDPUTER_ZERO, set_platform from meshterm.ui.qr import QrScreen - set_platform(CARDPUTER) + set_platform(CARDPUTER_ZERO) url = "https://github.com/jpmartineau/MeshTerm" screen = _url_chat(f"the road list is at {url}") assert not _code_rows(_strip_ansi(screen._render_grouped(53)).splitlines()) screen.handle("up") - assert fkeys.CARDPUTER_DECK.action_for(screen.cardputer_lane, 17) == "url_code" + assert fkeys.CARDPUTER_ZERO_DECK.action_for(screen.cardputer_zero_lane, 17) == "url_code" share = QrScreen(url, title="Links") share.note_viewport(14) diff --git a/tests/test_colsnap.py b/tests/test_colsnap.py index 4f370c1..0526f8b 100644 --- a/tests/test_colsnap.py +++ b/tests/test_colsnap.py @@ -251,10 +251,10 @@ def test_the_row_writer_pins_what_it_writes(monkeypatch) -> None: # noqa: ANN00 def test_a_platform_that_draws_no_emoji_pins_nothing() -> None: """The PicoCalc draws only glyphs its own font has verified, so there is nothing to pin.""" - from meshterm.platforms import PICOCALC, set_platform + from meshterm.platforms import PICOCALC_LYRA, set_platform assert colsnap.enabled() - set_platform(PICOCALC) + set_platform(PICOCALC_LYRA) assert not colsnap.enabled() diff --git a/tests/test_config_editor.py b/tests/test_config_editor.py index dad30ad..148d321 100644 --- a/tests/test_config_editor.py +++ b/tests/test_config_editor.py @@ -23,7 +23,7 @@ from meshterm.core.admin_store import AdminStore from meshterm.core.config import Settings from meshterm.core.device_store import DeviceStore from meshterm.persistence.repository import Repository -from meshterm.platforms import PICOCALC, REGULAR, set_platform +from meshterm.platforms import PICOCALC_LYRA, REGULAR, set_platform from meshterm.ui.config_editor import ( _ConfigMenu, _menu_items, @@ -134,15 +134,15 @@ def test_config_table_drops_the_description_lane_where_it_cannot_fit() -> None: The setting and its value are all that fit, and with nothing competing for the cells the labels keep their natural width. """ - set_platform(PICOCALC) + set_platform(PICOCALC_LYRA) try: - lines = _table_lines(PICOCALC.readable_cols) + lines = _table_lines(PICOCALC_LYRA.readable_cols) finally: set_platform(REGULAR) header = next(line for line in lines if line.lstrip().startswith("SETTING")) assert "DESCRIPTION" not in header assert any("Telemetry mode (environment)" in line for line in lines) - assert max(len(line.rstrip()) for line in lines) <= PICOCALC.readable_cols + assert max(len(line.rstrip()) for line in lines) <= PICOCALC_LYRA.readable_cols def test_config_table_drops_the_description_lane_beside_a_staged_column() -> None: @@ -234,11 +234,11 @@ def test_the_lane_chip_and_the_key_are_one_behaviour() -> None: One behaviour reached two ways, not a second copy of it. """ screen = _info_screen(_SNAPSHOT) - assert screen.picocalc_lane[2].label == "Reveal" + assert screen.picocalc_lyra_lane[2].label == "Reveal" screen.handle("reveal") assert "123456" in _pin_row(screen.render_body(72)) - assert screen.picocalc_lane[2].label == "Hide" + assert screen.picocalc_lyra_lane[2].label == "Hide" def test_the_footer_names_what_the_press_would_do_now() -> None: @@ -257,9 +257,9 @@ def test_a_page_with_no_pin_advertises_no_key_for_it() -> None: """ screen = _info_screen({k: v for k, v in _SNAPSHOT.items() if k != "ble_pin"}) assert "PIN" not in screen.footer_hint - assert screen.picocalc_lane[2] is None + assert screen.picocalc_lyra_lane[2] is None screen.handle("reveal") - assert screen.picocalc_lane[2] is None + assert screen.picocalc_lyra_lane[2] is None def test_uncovering_the_pin_keeps_the_reader_where_they_were() -> None: @@ -321,12 +321,12 @@ def test_the_editor_reveals_on_the_same_chord_as_the_info_page() -> None: """ menu = _editor(_SNAPSHOT) assert f"{REVEAL_KEY} show PIN" in menu.footer_hint - assert menu.picocalc_lane[2].label == "Reveal" + assert menu.picocalc_lyra_lane[2].label == "Reveal" menu.handle("reveal") assert "123456" in _pin_row(menu.render_body(72)) assert f"{REVEAL_KEY} hide PIN" in menu.footer_hint - assert menu.picocalc_lane[2].label == "Hide" + assert menu.picocalc_lyra_lane[2].label == "Hide" def test_revealing_keeps_the_filter_and_the_row_the_reader_was_on() -> None: @@ -350,7 +350,7 @@ def test_an_editor_over_a_device_with_no_pin_offers_no_reveal() -> None: """An editor over a device with no PIN offers no reveal either, footer or lane.""" menu = _editor({k: v for k, v in _SNAPSHOT.items() if k != "ble_pin"}) assert "PIN" not in menu.footer_hint - assert menu.picocalc_lane[2] is None + assert menu.picocalc_lyra_lane[2] is None # -- contact share URL ---------------------------------------------------------- diff --git a/tests/test_console_host.py b/tests/test_console_host.py index 3d51783..912156e 100644 --- a/tests/test_console_host.py +++ b/tests/test_console_host.py @@ -16,7 +16,7 @@ from meshterm.host.raster import PANEL_H, PANEL_W, Raster, rgb565 from meshterm.host.run import host_output, run from meshterm.host.sim import key_from_tk from meshterm.host.vt import BOLD, REVERSE, UNDERLINE, Terminal -from meshterm.ui.tui.fkeys import CARDPUTER_DECK +from meshterm.ui.tui.fkeys import CARDPUTER_ZERO_DECK _BDF = """STARTFONT 2.1 FONT test @@ -127,8 +127,8 @@ def test_the_lane_keys_reach_prompt_toolkit_as_the_deck_expects() -> None: """Fn+4..8 parse as F4-F8 and Shift with them as F16-F20, the Cardputer deck's banks.""" plain = [_parsed(encode(Key(name=f"f{n}")))[0] for n in range(4, 9)] shifted = [_parsed(encode(Key(name=f"f{n}", shift=True)))[0] for n in range(4, 9)] - assert [k.value for k in plain] == [f"f{n}" for n in CARDPUTER_DECK.keys] - assert [k.value for k in shifted] == [f"f{n}" for n in CARDPUTER_DECK.shift_keys] + assert [k.value for k in plain] == [f"f{n}" for n in CARDPUTER_ZERO_DECK.keys] + assert [k.value for k in shifted] == [f"f{n}" for n in CARDPUTER_ZERO_DECK.shift_keys] def test_modified_navigation_and_control_letters() -> None: @@ -268,14 +268,14 @@ def test_meshterm_runs_inside_the_host(monkeypatch) -> None: def test_the_cardputer_inventory_is_what_the_host_draws() -> None: - """``fontset.CARDPUTER_CODEPOINTS`` holds every mark, and the installed font exactly.""" + """``fontset.CARDPUTER_ZERO_CODEPOINTS`` holds every mark, and the installed font exactly.""" from meshterm.host.font import ALIASES, BRAILLE, font_dir, load_bdf - from meshterm.ui.fontset import CARDPUTER_CODEPOINTS + from meshterm.ui.fontset import CARDPUTER_ZERO_CODEPOINTS ours = set(MARKS) | set(ALIASES) | set(BRAILLE) - assert ours <= CARDPUTER_CODEPOINTS + assert ours <= CARDPUTER_ZERO_CODEPOINTS installed = font_dir() / "ter-u12n.bdf" if not installed.is_file(): return # no Terminus on this machine (CI): the marks are the part that is ours drawn = {cp for cp in load_bdf(installed) if cp >= 0x20} | ours - assert drawn == CARDPUTER_CODEPOINTS + assert drawn == CARDPUTER_ZERO_CODEPOINTS diff --git a/tests/test_courier.py b/tests/test_courier.py index a912832..7eea41f 100644 --- a/tests/test_courier.py +++ b/tests/test_courier.py @@ -564,9 +564,9 @@ async def test_courier_command_rows_go_bare_where_the_platform_draws_no_icons( those rows aligned with one another — while the queue, clear, send and cancel rows lose their icons exactly as every other command row does there. """ - from meshterm.platforms import PICOCALC, REGULAR, set_platform + from meshterm.platforms import PICOCALC_LYRA, REGULAR, set_platform - set_platform(PICOCALC) + set_platform(PICOCALC_LYRA) try: rows = _outbox_titles(tmp_path / "outbox") assert "Queue a message…" in rows and "Clear finished" in rows diff --git a/tests/test_dashboard.py b/tests/test_dashboard.py index 307006f..ae2ae65 100644 --- a/tests/test_dashboard.py +++ b/tests/test_dashboard.py @@ -95,13 +95,13 @@ def test_the_activity_aside_names_dot_columns_only_where_braille_has_dots() -> N There are no dots there to count, and on 53 columns the words cost the heading its line. The desktop keeps them; both keep what the chart counts. """ - from meshterm.platforms import PICOCALC, REGULAR, set_platform + from meshterm.platforms import PICOCALC_LYRA, REGULAR, set_platform def heading(width: int) -> str: body = _plain(_screen(histogram=[1] * ACTIVITY_BUCKETS).render_body(width)) return next(line for line in body.splitlines() if "Activity" in line) - set_platform(PICOCALC) + set_platform(PICOCALC_LYRA) assert heading(53).strip() == "Activity · every packet heard" set_platform(REGULAR) assert heading(72).strip() == "Activity · every packet heard · one minute per dot column" @@ -534,6 +534,8 @@ def test_no_scope_view_is_offered_without_a_flood_to_narrow_to() -> None: """A window of direct frames only offers nothing to cycle: no hint atom, no chip.""" screen = _scoped_screen([_flood(None, "TEXT_MSG")]) assert "scope" not in screen.footer_hint - assert screen.picocalc_lane[2] is None or not getattr(screen.picocalc_lane[2], "label", "") + assert screen.picocalc_lyra_lane[2] is None or not getattr( + screen.picocalc_lyra_lane[2], "label", "" + ) screen.handle("text", "s") assert screen.title == "Dashboard — mesh overview" diff --git a/tests/test_device_config.py b/tests/test_device_config.py index 61b314e..64e65d7 100644 --- a/tests/test_device_config.py +++ b/tests/test_device_config.py @@ -673,7 +673,7 @@ async def test_sparing_every_row_leaves_the_sweep_with_nothing_to_do() -> None: assert victims == [] -@pytest.mark.parametrize("platform_name", ["regular", "picocalc"]) +@pytest.mark.parametrize("platform_name", ["regular", "picocalc-lyra"]) def test_the_archive_preview_keeps_its_cursor_in_its_box_walking_both_ways( platform_name: str, ) -> None: @@ -689,11 +689,11 @@ def test_the_archive_preview_keeps_its_cursor_in_its_box_walking_both_ways( from meshterm.core.contact_score import ContactSignals, ScoredContact from meshterm.core.models import Contact - from meshterm.platforms import PICOCALC, REGULAR, set_platform + from meshterm.platforms import PICOCALC_LYRA, REGULAR, set_platform from meshterm.ui.sweep_screen import _preview_screen from meshterm.ui.tui.frame import compose_dialog - platform = {"regular": REGULAR, "picocalc": PICOCALC}[platform_name] + platform = {"regular": REGULAR, "picocalc-lyra": PICOCALC_LYRA}[platform_name] set_platform(platform) def scored(index: int) -> ScoredContact: diff --git a/tests/test_diagnostics.py b/tests/test_diagnostics.py index cdfcff3..c39b55a 100644 --- a/tests/test_diagnostics.py +++ b/tests/test_diagnostics.py @@ -149,7 +149,7 @@ def test_states_the_facts_a_bug_report_opens_with(ctx: AppContext) -> None: assert values["install"] in {"frozen", "source", "package"} assert values["os"] and values["python"] and values["arch"] assert "x" in values["terminal_size"] - assert values["platform"] in {"regular", "picocalc"} + assert values["platform"] in {"regular", "picocalc-lyra"} # The simulator answers like a radio, so the device half is populated rather than # skipped: this is the shape a real connected run produces. assert values["connected"] is True @@ -231,9 +231,9 @@ def test_the_save_is_advertised_on_both_platforms(ctx: AppContext) -> None: page = _page(ctx) assert f"{SAVE_KEY} save" in page.footer_hint assert page.footer_hint.endswith("Esc back") - assert page.picocalc_lane[2] is not None - assert page.picocalc_lane[2].label == "Save" - assert page.picocalc_lane[2].action == SAVE_ACTION + assert page.picocalc_lyra_lane[2] is not None + assert page.picocalc_lyra_lane[2].label == "Save" + assert page.picocalc_lyra_lane[2].action == SAVE_ACTION # --- saving it ------------------------------------------------------------------------ diff --git a/tests/test_gallery.py b/tests/test_gallery.py index 0a9116b..9fcc970 100644 --- a/tests/test_gallery.py +++ b/tests/test_gallery.py @@ -8,8 +8,8 @@ Each entry below builds one full-screen :class:`~meshterm.ui.tui.screen.Screen` hand-built (simulator-shaped) data — the same "fake session, real screen" approach every individual screen's own test file already uses — then renders it, both directly (``render_body``) and through the real frame compositor (``compose_base``), at REGULAR's -72x24, at PICOCALC's two live/lux row counts (53x26, the actual on-device floor; 53x40, -the boot-font/6x8-font-B case), and at the CARDPUTER's 53x14. No rendered line may exceed +72x24, at PICOCALC_LYRA's two live/lux row counts (53x26, the actual on-device floor; 53x40, +the boot-font/6x8-font-B case), and at the CARDPUTER_ZERO's 53x14. No rendered line may exceed its terminal's width. This is the platform-parity harness the PicoCalc work was built around: a @@ -58,7 +58,14 @@ from meshterm.core.regions import frame_scope, region_key, scope_body, transport from meshterm.core.remote_store import CachedValue from meshterm.core.watch_store import WatchStore from meshterm.persistence.repository import DiscoveredPath -from meshterm.platforms import CARDPUTER, PICOCALC, REGULAR, Platform, get_platform, set_platform +from meshterm.platforms import ( + CARDPUTER_ZERO, + PICOCALC_LYRA, + REGULAR, + Platform, + get_platform, + set_platform, +) from meshterm.services.courier import CourierService from meshterm.services.message_paths import Arrival from meshterm.services.monitor_service import ACTIVITY_BUCKETS @@ -1518,16 +1525,16 @@ _ENTRIES: list[_Entry] = [ #: judged worklist, not an xfail list (see the port's logbook). _COMBOS: list[tuple[Platform, int, int]] = [ (REGULAR, REGULAR.readable_cols, REGULAR.readable_rows), - (PICOCALC, PICOCALC.readable_cols, PICOCALC.readable_rows), - (PICOCALC, PICOCALC.readable_cols, 40), - (CARDPUTER, CARDPUTER.readable_cols, CARDPUTER.readable_rows), + (PICOCALC_LYRA, PICOCALC_LYRA.readable_cols, PICOCALC_LYRA.readable_rows), + (PICOCALC_LYRA, PICOCALC_LYRA.readable_cols, 40), + (CARDPUTER_ZERO, CARDPUTER_ZERO.readable_cols, CARDPUTER_ZERO.readable_rows), ] -#: Entries that overflow PICOCALC's 53 columns today (a width overflow doesn't depend on -#: row count, so one entry here covers both picocalc combos). P6 emptied it — the whole +#: Entries that overflow PICOCALC_LYRA's 53 columns today (a width overflow doesn't depend on +#: row count, so one entry here covers both picocalc-lyra combos). P6 emptied it — the whole #: P1 worklist graduated once the F-key lane replaced the per-screen hint strings and the #: path composer's wrapped empty-state note stopped smuggling a newline into one row — -#: so every picocalc case is now a hard gate. A new screen that can't fit 53 goes here +#: so every picocalc-lyra case is now a hard gate. A new screen that can't fit 53 goes here #: only with a ticket, never to stay. _KNOWN_WIDE: set[str] = set() @@ -1549,12 +1556,13 @@ def _cases(): for platform, cols, rows in _COMBOS: case_id = f"{entry.name}-{platform.name}-{cols}x{rows}" marks = [] - if platform.name == "picocalc" and entry.name in _KNOWN_WIDE: + if platform.name == "picocalc-lyra" and entry.name in _KNOWN_WIDE: marks.append( pytest.mark.xfail( reason=( - f"{entry.name} overflows picocalc's {PICOCALC.readable_cols} cols " - "today -- see _KNOWN_WIDE, the width-reduction worklist" + f"{entry.name} overflows picocalc-lyra's " + f"{PICOCALC_LYRA.readable_cols} cols today -- see _KNOWN_WIDE, " + "the width-reduction worklist" ), strict=False, ) @@ -1624,7 +1632,7 @@ def test_gallery_screen_fits_its_platform( assert line.strip() != "Back", f"{entry.name}: an exit row came back: {line!r}" # P3 assertions, on the *rendered ANSI* (the theme/fold contracts, not the config): - # picocalc output may carry no truecolor or 256-colour SGR (the console has 16 slots, + # picocalc-lyra output may carry no truecolor or 256-colour SGR (the console has 16 slots, # addressed as plain 30-37/90-97/40-47 codes), and no character outside the 512-glyph # console font. Together these are the parity gate that catches a stray emoji or hex # colour the moment a screen grows one, instead of as tofu found on-device. diff --git a/tests/test_lane_decks.py b/tests/test_lane_decks.py index 4d84fc9..2f65748 100644 --- a/tests/test_lane_decks.py +++ b/tests/test_lane_decks.py @@ -6,15 +6,15 @@ from __future__ import annotations from prompt_toolkit.keys import Keys from rich.cells import cell_len -from meshterm.platforms import CARDPUTER, PICOCALC, REGULAR, resolve, set_platform +from meshterm.platforms import CARDPUTER_ZERO, PICOCALC_LYRA, REGULAR, resolve, set_platform from meshterm.services import modifier_watch from meshterm.ui.tui import session from meshterm.ui.tui.fkeys import ( - CARDPUTER_DECK, + CARDPUTER_ZERO_DECK, DECKS, DEFAULT_LANE, EMPTY_LANE, - PICOCALC_DECK, + PICOCALC_LYRA_DECK, FPair, active_deck, ) @@ -25,37 +25,39 @@ class _OwnCardputerLane(ScrollScreen): """A screen that has decided its Cardputer lane for itself.""" @property - def cardputer_lane(self): + def cardputer_zero_lane(self): return (FPair("Mine", "mine"), None, None, None, None) def test_every_handheld_names_a_deck_of_its_own() -> None: """A platform with a lane names a deck that exists; the desktop names none.""" - assert PICOCALC.lane_deck == "picocalc" and CARDPUTER.lane_deck == "cardputer" - assert all(DECKS[p.lane_deck].name == p.lane_deck for p in (PICOCALC, CARDPUTER)) + assert ( + PICOCALC_LYRA.lane_deck == "picocalc-lyra" and CARDPUTER_ZERO.lane_deck == "cardputer-zero" + ) + assert all(DECKS[p.lane_deck].name == p.lane_deck for p in (PICOCALC_LYRA, CARDPUTER_ZERO)) assert REGULAR.lane_deck == "" and not REGULAR.footer_fkeys - assert PICOCALC.footer_fkeys and CARDPUTER.footer_fkeys + assert PICOCALC_LYRA.footer_fkeys and CARDPUTER_ZERO.footer_fkeys def test_the_active_deck_follows_the_platform() -> None: """The deck is bound at platform-switch time, never looked up per frame.""" assert active_deck() is None - set_platform(PICOCALC) - assert active_deck() is PICOCALC_DECK - set_platform(CARDPUTER) - assert active_deck() is CARDPUTER_DECK + set_platform(PICOCALC_LYRA) + assert active_deck() is PICOCALC_LYRA_DECK + set_platform(CARDPUTER_ZERO) + assert active_deck() is CARDPUTER_ZERO_DECK def test_the_cardputer_deals_the_picocalc_lanes_until_a_screen_says_otherwise() -> None: """JP, 2026-09-30: same entries for now, and each platform reads its own definition.""" screen = ScrollScreen("body") - assert screen.cardputer_lane == screen.picocalc_lane + assert screen.cardputer_zero_lane == screen.picocalc_lyra_lane own = _OwnCardputerLane("body") - set_platform(CARDPUTER) + set_platform(CARDPUTER_ZERO) assert own.fkey_lane[0].label == "Mine" - set_platform(PICOCALC) - assert own.fkey_lane == own.picocalc_lane # the PicoCalc never sees the Cardputer's choice + set_platform(PICOCALC_LYRA) + assert own.fkey_lane == own.picocalc_lyra_lane # the PicoCalc never sees the Cardputer's choice set_platform(REGULAR) assert own.fkey_lane == EMPTY_LANE # no lane on the desktop @@ -63,16 +65,16 @@ def test_the_cardputer_deals_the_picocalc_lanes_until_a_screen_says_otherwise() def test_cardputer_keys_are_fn_4_to_8_with_their_shift_bank() -> None: """Fn+4..8 arrive as F4-F8, Shift with them as F16-F20; nothing else is the lane's.""" lane = DEFAULT_LANE - assert CARDPUTER_DECK.action_for(lane, 7) == "pagedown" - assert CARDPUTER_DECK.action_for(lane, 8) == "pageup" - assert CARDPUTER_DECK.action_for(lane, 19) == "end" - assert CARDPUTER_DECK.action_for(lane, 20) == "home" - assert all(CARDPUTER_DECK.action_for(lane, n) is None for n in (1, 2, 3, 9, 10, 11, 12)) - assert CARDPUTER_DECK.is_shift_key(16) and not CARDPUTER_DECK.is_shift_key(6) + assert CARDPUTER_ZERO_DECK.action_for(lane, 7) == "pagedown" + assert CARDPUTER_ZERO_DECK.action_for(lane, 8) == "pageup" + assert CARDPUTER_ZERO_DECK.action_for(lane, 19) == "end" + assert CARDPUTER_ZERO_DECK.action_for(lane, 20) == "home" + assert all(CARDPUTER_ZERO_DECK.action_for(lane, n) is None for n in (1, 2, 3, 9, 10, 11, 12)) + assert CARDPUTER_ZERO_DECK.is_shift_key(16) and not CARDPUTER_ZERO_DECK.is_shift_key(6) # The same lane on the PicoCalc's own keys, untouched by the Cardputer's. - assert PICOCALC_DECK.action_for(lane, 4) == "pagedown" - assert PICOCALC_DECK.action_for(lane, 10) == "home" - assert PICOCALC_DECK.action_for(lane, 16) is None + assert PICOCALC_LYRA_DECK.action_for(lane, 4) == "pagedown" + assert PICOCALC_LYRA_DECK.action_for(lane, 10) == "home" + assert PICOCALC_LYRA_DECK.action_for(lane, 16) is None def test_the_session_binds_every_key_a_deck_can_use() -> None: @@ -84,39 +86,39 @@ def test_the_session_binds_every_key_a_deck_can_use() -> None: def test_cardputer_chips_are_laid_out_as_the_picocalcs() -> None: """The PicoCalc's chips — caption, 9-cell width, 2-cell gaps — under the Cardputer's keys.""" - assert CARDPUTER_DECK.columns == PICOCALC_DECK.columns - assert CARDPUTER_DECK.chip_width == PICOCALC_DECK.chip_width + assert CARDPUTER_ZERO_DECK.columns == PICOCALC_LYRA_DECK.columns + assert CARDPUTER_ZERO_DECK.chip_width == PICOCALC_LYRA_DECK.chip_width lane = (FPair("Region", "home"), FPair("You", "locate", enabled=False), None, *DEFAULT_LANE[3:]) - row = CARDPUTER_DECK.lane_text(lane) - assert cell_len(row.plain) == CARDPUTER.readable_cols - chips = [row.plain[c : c + CARDPUTER_DECK.chip_width] for c in CARDPUTER_DECK.columns] + row = CARDPUTER_ZERO_DECK.lane_text(lane) + assert cell_len(row.plain) == CARDPUTER_ZERO.readable_cols + chips = [row.plain[c : c + CARDPUTER_ZERO_DECK.chip_width] for c in CARDPUTER_ZERO_DECK.columns] assert chips == ["F4 Region", "F5 You ", "F6 ", "F7 Page ↓", "F8 Page ↑"] styles = {row.plain[s.start : s.end].strip(): str(s.style) for s in row.spans} - assert styles["F4 Region"] == "fkey.chip.cardputer" + assert styles["F4 Region"] == "fkey.chip.cardputer_zero" assert styles["F5 You"] == "muted" and styles["F6"] == "muted" def test_cardputer_shift_bank_draws_in_its_own_fill() -> None: """Shifted, the companions show in the Shift fill under the same keys' captions.""" - row = CARDPUTER_DECK.lane_text(DEFAULT_LANE, shifted=True) + row = CARDPUTER_ZERO_DECK.lane_text(DEFAULT_LANE, shifted=True) styles = {row.plain[s.start : s.end].strip(): str(s.style) for s in row.spans} - assert styles["F7 Bottom"] == "fkey.chip.cardputer.shift" - assert styles["F8 Top"] == "fkey.chip.cardputer.shift" + assert styles["F7 Bottom"] == "fkey.chip.cardputer_zero.shift" + assert styles["F8 Top"] == "fkey.chip.cardputer_zero.shift" assert styles["F4"] == "muted" def test_the_picocalc_row_is_unchanged() -> None: """Five captioned 9-cell chips with 2-cell gaps: exactly the console's 53 columns.""" - row = PICOCALC_DECK.lane_text(DEFAULT_LANE) - assert cell_len(row.plain) == PICOCALC.readable_cols + row = PICOCALC_LYRA_DECK.lane_text(DEFAULT_LANE) + assert cell_len(row.plain) == PICOCALC_LYRA.readable_cols assert row.plain.startswith("F1 ") assert row.plain.endswith("F5 Page ↑") def test_the_platform_resolves_by_name() -> None: """Chosen by flag or environment only: no device-tree model is known for it yet.""" - assert resolve("cardputer").platform is CARDPUTER - assert CARDPUTER.readable_cols == 53 and CARDPUTER.readable_rows == 14 + assert resolve("cardputer-zero").platform is CARDPUTER_ZERO + assert CARDPUTER_ZERO.readable_cols == 53 and CARDPUTER_ZERO.readable_rows == 14 def test_the_shift_watcher_looks_for_the_platforms_keyboard(tmp_path, monkeypatch) -> None: @@ -126,5 +128,5 @@ def test_the_shift_watcher_looks_for_the_platforms_keyboard(tmp_path, monkeypatc device.mkdir(parents=True) (device / "name").write_text(f"{name}\n") monkeypatch.setattr(modifier_watch, "_SYS_INPUT", tmp_path) - assert modifier_watch._find_keyboard(CARDPUTER.modifier_watch).name == "event1" - assert modifier_watch._find_keyboard(PICOCALC.modifier_watch) is None + assert modifier_watch._find_keyboard(CARDPUTER_ZERO.modifier_watch).name == "event1" + assert modifier_watch._find_keyboard(PICOCALC_LYRA.modifier_watch) is None diff --git a/tests/test_live_screens.py b/tests/test_live_screens.py index 56eadba..2b5c4b6 100644 --- a/tests/test_live_screens.py +++ b/tests/test_live_screens.py @@ -473,7 +473,7 @@ def _words_start(row: str) -> int: return cell_len(row[: next(i for i, ch in enumerate(row) if ch.isalnum())]) -@pytest.mark.parametrize("platform_name", ["regular", "picocalc"]) +@pytest.mark.parametrize("platform_name", ["regular", "picocalc-lyra"]) def test_every_action_row_starts_its_words_in_one_cell_in_both_modes(platform_name: str) -> None: """Every action the screen can draw, in either mode, lit or not, shares one word column. @@ -489,10 +489,10 @@ def test_every_action_row_starts_its_words_in_one_cell_in_both_modes(platform_na how a two-cell icon lands in a one-cell column. On the PicoCalc the lane is dropped whole, so every word starts straight after the pointer. """ - from meshterm.platforms import PICOCALC, REGULAR, set_platform + from meshterm.platforms import PICOCALC_LYRA, REGULAR, set_platform from meshterm.ui.trace_screen import _ACTION_ICONS - platform = {"regular": REGULAR, "picocalc": PICOCALC}[platform_name] + platform = {"regular": REGULAR, "picocalc-lyra": PICOCALC_LYRA}[platform_name] set_platform(platform) starts: set[int] = set() marks: set[str] = set() diff --git a/tests/test_map.py b/tests/test_map.py index e6502ab..d34beba 100644 --- a/tests/test_map.py +++ b/tests/test_map.py @@ -1554,10 +1554,10 @@ def test_map_fkey_lane_names_its_three_destinations_and_the_zoom() -> None: """The map repurposes the nav keys, so its lane labels them — and offers no dead key.""" from meshterm.ui.map_render import MapMarker from meshterm.ui.map_screen import MapScreen - from meshterm.ui.tui.fkeys import PICOCALC_DECK + from meshterm.ui.tui.fkeys import PICOCALC_LYRA_DECK screen = MapScreen(_StubSession(80, 24), [MapMarker("A", 45.5, -73.6)], _StubSource(), 14) - lane = screen.picocalc_lane + lane = screen.picocalc_lyra_lane # PgUp/PgDn zoom here and Home reframes — the shared paging labels would all be lies, # and "end" is bound to nothing at all, so no jump rides the zoom rocker's Shift bank. @@ -1570,20 +1570,20 @@ def test_map_fkey_lane_names_its_three_destinations_and_the_zoom() -> None: "Zoom +", ] assert ( - PICOCALC_DECK.action_for(lane, 1) == "home" - and PICOCALC_DECK.action_for(lane, 5) == "pageup" + PICOCALC_LYRA_DECK.action_for(lane, 1) == "home" + and PICOCALC_LYRA_DECK.action_for(lane, 5) == "pageup" ) assert ( - PICOCALC_DECK.action_for(lane, 2) == "locate" - and PICOCALC_DECK.action_for(lane, 3) == "frame" + PICOCALC_LYRA_DECK.action_for(lane, 2) == "locate" + and PICOCALC_LYRA_DECK.action_for(lane, 3) == "frame" ) # Two slots carry a Shift half along their own axis: You + homes in on us zoomed, # Clear drops the find query. The other three Shift keys stay unbound. assert ( - PICOCALC_DECK.action_for(lane, 7) == "locate_zoom" - and PICOCALC_DECK.action_for(lane, 8) == "clear_find" + PICOCALC_LYRA_DECK.action_for(lane, 7) == "locate_zoom" + and PICOCALC_LYRA_DECK.action_for(lane, 8) == "clear_find" ) - assert all(PICOCALC_DECK.action_for(lane, n) is None for n in (6, 9, 10)) + assert all(PICOCALC_LYRA_DECK.action_for(lane, n) is None for n in (6, 9, 10)) # Region and the zoom always act; the other two only where they'd land somewhere — # and each Shift half gates with its own axis (no self marker, no query typed). assert [pair.enabled for pair in lane] == [True, False, False, True, True] @@ -1605,7 +1605,7 @@ def test_map_locate_recenters_on_our_own_node_at_the_current_zoom() -> None: zoom = screen._viewport.zoom screen.handle("left") # and pan away from wherever we are - assert screen.picocalc_lane[1].enabled is True # we're on the map, so You can act + assert screen.picocalc_lyra_lane[1].enabled is True # we're on the map, so You can act screen.handle("locate") assert screen._viewport.center_lat == pytest.approx(45.40) assert screen._viewport.center_lon == pytest.approx(-73.50) @@ -1616,12 +1616,12 @@ def test_map_locate_recenters_on_our_own_node_at_the_current_zoom() -> None: away.render_body(80) before = away._viewport away.handle("locate") - assert away.picocalc_lane[1].enabled is False and away._viewport is before + assert away.picocalc_lyra_lane[1].enabled is False and away._viewport is before def test_map_echoes_the_find_query_in_the_body_only_where_the_footer_is_gone() -> None: """The PicoCalc draws no hint line, so the query it carries moves into the body.""" - from meshterm.platforms import PICOCALC, REGULAR, set_platform + from meshterm.platforms import PICOCALC_LYRA, REGULAR, set_platform from meshterm.ui.attribution import CREDIT_SHORT from meshterm.ui.map_render import MapMarker from meshterm.ui.map_screen import MapScreen @@ -1639,7 +1639,7 @@ def test_map_echoes_the_find_query_in_the_body_only_where_the_footer_is_gone() - assert len(desktop.render_body(72)) == 20 assert "find: hil" in desktop.footer_hint - set_platform(PICOCALC) + set_platform(PICOCALC_LYRA) device = MapScreen(_StubSession(53, 23), markers, _StubSource(), 14) assert len(device.render_body(53)) == 23 for ch in "hil": @@ -1700,18 +1700,18 @@ def test_map_frame_chip_lights_only_with_matches_to_frame() -> None: screen.render_body(80) before = screen._viewport screen.handle("frame") # no query typed: nothing to frame, so nothing moves - assert screen.picocalc_lane[2].enabled is False and screen._viewport is before + assert screen.picocalc_lyra_lane[2].enabled is False and screen._viewport is before for ch in "ali": screen.handle("text", ch) - assert screen.picocalc_lane[2].enabled is True + assert screen.picocalc_lyra_lane[2].enabled is True screen.handle("frame") assert screen._viewport.center_lat == pytest.approx(45.40) # A query nothing matches has no extent either — the chip goes back to dim. for ch in "zzz": screen.handle("text", ch) - assert screen._matches() == [] and screen.picocalc_lane[2].enabled is False + assert screen._matches() == [] and screen.picocalc_lyra_lane[2].enabled is False def test_map_screen_find_filters_frames_and_clears() -> None: @@ -2704,10 +2704,10 @@ def _mark(screen: MapScreen, cols: int = 80) -> str: def _both_platforms(): """The two platforms, restoring REGULAR afterwards — the credit differs across them.""" - from meshterm.platforms import PICOCALC, REGULAR, set_platform + from meshterm.platforms import PICOCALC_LYRA, REGULAR, set_platform try: - for platform in (REGULAR, PICOCALC): + for platform in (REGULAR, PICOCALC_LYRA): set_platform(platform) yield platform finally: @@ -2757,11 +2757,11 @@ def test_a_bordered_frame_sets_the_credit_in_its_bottom_rule_and_spares_the_draw def test_a_frame_with_no_bottom_rule_stamps_the_drawing_instead() -> None: """The PicoCalc has a title bar and an F-key lane, and no rule to set a caption into.""" - from meshterm.platforms import PICOCALC, REGULAR, set_platform + from meshterm.platforms import PICOCALC_LYRA, REGULAR, set_platform from meshterm.ui import attribution try: - set_platform(PICOCALC) + set_platform(PICOCALC_LYRA) screen = _credited_map(53) assert screen.bottom_caption == "" # nowhere to put it but the map assert _last_row(screen, 53).endswith(attribution.CREDIT_FULL) @@ -2823,11 +2823,11 @@ def test_the_bottom_rule_keeps_its_clip_arrows_when_a_caption_shares_it() -> Non def test_the_find_query_and_the_credit_share_the_row_with_the_credit_kept_whole() -> None: """Where the F-key lane replaces the hint, the echo yields its right end to the credit.""" - from meshterm.platforms import PICOCALC, REGULAR, set_platform + from meshterm.platforms import PICOCALC_LYRA, REGULAR, set_platform from meshterm.ui import attribution try: - set_platform(PICOCALC) + set_platform(PICOCALC_LYRA) screen = _credited_map(53) screen.render_body(53) # keys do nothing until the map has a viewport to move screen.handle("right") diff --git a/tests/test_markdown.py b/tests/test_markdown.py index 3ee3240..44cbbe9 100644 --- a/tests/test_markdown.py +++ b/tests/test_markdown.py @@ -16,7 +16,7 @@ from rich.cells import cell_len from rich.padding import Padding from rich.text import Text -from meshterm.platforms import PICOCALC, REGULAR, set_platform +from meshterm.platforms import PICOCALC_LYRA, REGULAR, set_platform from meshterm.ui.fontset import FONT_CODEPOINTS from meshterm.ui.markdown import MarkdownDoc, render_markdown from meshterm.ui.tui.render import render_lines @@ -45,7 +45,7 @@ maps and a ~~telepathic~~ courier queue over the top. > Nothing here transmits without being asked. ``` -meshterm --mock --platform picocalc +meshterm --mock --platform picocalc-lyra ``` | Platform | Cols | Colours | @@ -300,14 +300,14 @@ def test_every_construct_survives_the_picocalc() -> None: every construct a page *could* grow, so a table or a code fence added to one of them is a known quantity rather than tofu found on-device. """ - set_platform(PICOCALC) + set_platform(PICOCALC_LYRA) try: - rendered = render_lines(render_markdown(KITCHEN_SINK), PICOCALC.readable_cols) + rendered = render_lines(render_markdown(KITCHEN_SINK), PICOCALC_LYRA.readable_cols) finally: set_platform(REGULAR) for index, line in enumerate(rendered): - assert cell_len(plain(line)) <= PICOCALC.readable_cols, (index, line) + assert cell_len(plain(line)) <= PICOCALC_LYRA.readable_cols, (index, line) assert "[38;2;" not in line and "[38;5;" not in line, (index, line) strays = {ch for ch in plain(line) if ord(ch) >= 0x20 and ord(ch) not in FONT_CODEPOINTS} assert not strays, (index, sorted(strays), line) diff --git a/tests/test_menu_quit_row.py b/tests/test_menu_quit_row.py index de58cab..7417d9b 100644 --- a/tests/test_menu_quit_row.py +++ b/tests/test_menu_quit_row.py @@ -17,7 +17,7 @@ from types import SimpleNamespace import pytest from rich.cells import cell_len -from meshterm.platforms import PICOCALC, REGULAR, set_platform +from meshterm.platforms import PICOCALC_LYRA, REGULAR, set_platform from meshterm.tools import all_tools, load_all_tools from meshterm.ui import menu from meshterm.ui.tui import Choice @@ -38,9 +38,9 @@ def tools() -> list: @pytest.fixture -def picocalc() -> Iterator[None]: +def picocalc_lyra() -> Iterator[None]: """Run a test on the PicoCalc platform, restoring the regular one afterwards.""" - set_platform(PICOCALC) + set_platform(PICOCALC_LYRA) try: yield finally: @@ -114,7 +114,7 @@ def test_the_quit_mark_is_measured_into_the_column(monkeypatch: pytest.MonkeyPat assert set(starts.values()) == {cell_len(_WIDE) + 1} -@pytest.mark.usefixtures("picocalc") +@pytest.mark.usefixtures("picocalc_lyra") def test_no_icon_lane_leaves_the_bare_word_flush_with_the_titles(tools: list) -> None: """No icon lane on the PicoCalc: the row is just *Quit*, with no padding left behind.""" items = menu._menu_items(tools) @@ -144,6 +144,6 @@ def test_the_quit_confirm_keeps_the_chip_that_asked(monkeypatch: pytest.MonkeyPa monkeypatch.setattr(menu, "_can_unpair", no_bond) assert asyncio.run(menu._confirm_quit(SimpleNamespace(), Session())) is False assert asked["lane"][2].label == "Quit!" - assert fkeys.PICOCALC_DECK.action_for(asked["lane"], 3) == "quit" # F3 - assert fkeys.CARDPUTER_DECK.action_for(asked["lane"], 6) == "quit" # Fn+6, its middle chip + assert fkeys.PICOCALC_LYRA_DECK.action_for(asked["lane"], 3) == "quit" # F3 + assert fkeys.CARDPUTER_ZERO_DECK.action_for(asked["lane"], 6) == "quit" # Fn+6, its middle chip assert [slot for i, slot in enumerate(asked["lane"]) if i != 2] == [None] * 4 diff --git a/tests/test_menus.py b/tests/test_menus.py index 2f09ae2..c69670f 100644 --- a/tests/test_menus.py +++ b/tests/test_menus.py @@ -344,9 +344,9 @@ def test_menu_rows_line_up_mixed_icon_widths_without_being_told() -> None: def test_align_icons_pads_nothing_where_the_platform_draws_no_icons() -> None: """No icon lane: the icons go, and no padding is left standing in their place.""" - from meshterm.platforms import PICOCALC, REGULAR, set_platform + from meshterm.platforms import PICOCALC_LYRA, REGULAR, set_platform - set_platform(PICOCALC) + set_platform(PICOCALC_LYRA) try: labels = align_icons([f"{_NARROW} Archive contacts…", f"{_WIDE} View archived"]) assert [_plain(label) for label in labels] == ["Archive contacts…", "View archived"] @@ -390,9 +390,9 @@ def test_an_iconless_platform_collapses_the_column_and_keeps_the_tint( A destructive row announces itself by its red mark; drop the mark and the claim has to land somewhere, or a delete reads like any other action. """ - from meshterm.platforms import PICOCALC, REGULAR, set_platform + from meshterm.platforms import PICOCALC_LYRA, REGULAR, set_platform - set_platform(PICOCALC) + set_platform(PICOCALC_LYRA) try: assert icon_lane((_NARROW, _WIDE)) == 0 assert icon_mark(_NARROW, "err", 0).plain == "" diff --git a/tests/test_navigation.py b/tests/test_navigation.py index b470b02..6e446b0 100644 --- a/tests/test_navigation.py +++ b/tests/test_navigation.py @@ -974,16 +974,16 @@ def test_the_main_menu_lane_puts_the_way_out_on_f3() -> None: """``Quit?`` on F3 asks; its Shift half, F8, is ``Quit!``, which doesn't.""" from meshterm.ui.menu import _MainMenu from meshterm.ui.menus import section_heading - from meshterm.ui.tui.fkeys import PICOCALC_DECK + from meshterm.ui.tui.fkeys import PICOCALC_LYRA_DECK menu = _MainMenu( "menu", [section_heading("A"), Choice("alpha", 1), section_heading("B"), Choice("beta", 2)], ) - lane = menu.picocalc_lane + lane = menu.picocalc_lyra_lane assert (lane[2].label, lane[2].opp_label) == ("Quit?", "Quit!") - assert PICOCALC_DECK.action_for(lane, 3) == "quit" - assert PICOCALC_DECK.action_for(lane, 8) == "quit_now" + assert PICOCALC_LYRA_DECK.action_for(lane, 3) == "quit" + assert PICOCALC_LYRA_DECK.action_for(lane, 8) == "quit_now" assert lane[0].label == "Sect ↑", "the section jumps keep F1/F2" @@ -1250,10 +1250,10 @@ async def test_the_chip_that_asked_to_quit_leaves_when_pressed_again() -> None: The confirm's lane carries ``Quit!`` on the slot the menu's ``Quit?`` sat on, sending the same ``quit`` — which, with the question up, is the leaving, as a second ^Q is. """ - from meshterm.platforms import PICOCALC, set_platform + from meshterm.platforms import PICOCALC_LYRA, set_platform from meshterm.ui.tui.fkeys import EMPTY_LANE, FPair - set_platform(PICOCALC) + set_platform(PICOCALC_LYRA) lane = list(EMPTY_LANE) lane[2] = FPair("Quit!", "quit") with create_pipe_input() as inp: diff --git a/tests/test_node_detail.py b/tests/test_node_detail.py index a3b12db..fb9feb2 100644 --- a/tests/test_node_detail.py +++ b/tests/test_node_detail.py @@ -675,7 +675,7 @@ def test_the_remove_row_is_tinted_and_keeps_its_tint_where_the_icon_lane_goes() """ import re - from meshterm.platforms import PICOCALC, set_platform + from meshterm.platforms import PICOCALC_LYRA, set_platform remove = _Action("remove", "🗑", "err", "Remove contact…") screen = _screen(info_actions=[remove]) @@ -683,7 +683,7 @@ def test_the_remove_row_is_tinted_and_keeps_its_tint_where_the_icon_lane_goes() line = screen._action_line(remove, selected=False, width=40) assert "🗑" in line and "Remove contact…" in _plain([line]) - set_platform(PICOCALC) + set_platform(PICOCALC_LYRA) screen = _screen(info_actions=[remove]) screen.note_viewport(30) folded = screen._action_line(remove, selected=False, width=40) @@ -820,7 +820,7 @@ def test_node_detail_routes_stage_spends_the_caption_and_top_air_on_the_fan() -> The graph's own end padding leaves a whole empty canvas row above its topmost label; the stage draws one row over its ceiling and peels that row off, so the peel pays for itself. """ - from meshterm.platforms import PICOCALC, REGULAR, set_platform + from meshterm.platforms import PICOCALC_LYRA, REGULAR, set_platform # A fan busy enough that the row ceiling — not its own ideal height — is what sizes it, # so the reclaimed rows show up as lanes rather than as slack. @@ -849,7 +849,7 @@ def test_node_detail_routes_stage_spends_the_caption_and_top_air_on_the_fan() -> ) return [_plain([ln]) for ln in lines[strip_idx + 2 : rule_idx]] # past the strip's own rule - set_platform(PICOCALC) + set_platform(PICOCALC_LYRA) pico = _stage(22) assert pico[0].strip(), "no blank row between the tab strip and the fan" assert not any("selected route" in line for line in pico), "the caption is dropped" @@ -895,10 +895,10 @@ def test_a_short_frame_wears_the_identity_in_the_title_bar() -> None: under the bar that said the same would only say it twice (JP, 2026-10-04). A tall frame keeps both as they were. """ - from meshterm.platforms import CARDPUTER, set_platform + from meshterm.platforms import CARDPUTER_ZERO, set_platform from meshterm.ui.tui import frame - set_platform(CARDPUTER) + set_platform(CARDPUTER_ZERO) screen = _screen(mark=_mark()) screen.note_viewport(12) # the Cardputer's body, under the bar and over the lane body = _plain(screen.render_body(53)) @@ -928,9 +928,9 @@ def test_a_short_frame_gives_the_route_graph_the_rows_it_freed() -> None: Between the tab strip and the route list there is nothing but the fan, which takes every row the list's guaranteed window leaves it. """ - from meshterm.platforms import CARDPUTER, set_platform + from meshterm.platforms import CARDPUTER_ZERO, set_platform - set_platform(CARDPUTER) + set_platform(CARDPUTER_ZERO) screen = _screen(mark=_mark(), routes=_busy_routes()) screen.handle("tab") # onto Routes screen.note_viewport(12) @@ -1344,12 +1344,12 @@ def test_node_detail_screen_tabs_switch_the_stage() -> None: assert screen.consume_edge_scrub() == 2 # The F-key chip names where the switch would take you, so it flips with the stage. - assert screen.picocalc_lane[2].label == "Routes" + assert screen.picocalc_lyra_lane[2].label == "Routes" screen.handle("tab") # switch to the Routes tab body = _plain(screen.render_body(72)) assert "│ Routes │" in body and "no route observed yet" in body assert screen.consume_edge_scrub() == 0 # the braille preview isn't showing now - assert screen.picocalc_lane[2].label == "Info" + assert screen.picocalc_lyra_lane[2].label == "Info" def test_node_detail_single_tab_hides_the_switch_hint() -> None: @@ -1358,7 +1358,7 @@ def test_node_detail_single_tab_hides_the_switch_hint() -> None: assert "←→ tab" not in screen.footer_hint assert "↑↓ move" in screen.footer_hint and screen.footer_hint.endswith("Esc back") # Nothing to switch to, so the lane leaves the slot empty rather than dimming it. - assert screen.picocalc_lane[2] is None + assert screen.picocalc_lyra_lane[2] is None def test_toggling_the_lock_rewrites_the_rows_and_keeps_the_cursor_on_it() -> None: diff --git a/tests/test_packet_viewer.py b/tests/test_packet_viewer.py index 5b50b20..768c17e 100644 --- a/tests/test_packet_viewer.py +++ b/tests/test_packet_viewer.py @@ -128,16 +128,16 @@ def test_packet_viewer_lane_names_the_ends_of_the_list_not_the_body() -> None: lone = PacketViewer([old], 0, resolve=lambda h: "") lone.note_metrics(4, 20) # a short body in a roomy box: nothing to page either - assert [pair.opp_label for pair in lone.picocalc_lane[3:]] == ["Oldest", "Newest"] - assert not any(pair.enabled or pair.opp_enabled for pair in lone.picocalc_lane[3:]) + assert [pair.opp_label for pair in lone.picocalc_lyra_lane[3:]] == ["Oldest", "Newest"] + assert not any(pair.enabled or pair.opp_enabled for pair in lone.picocalc_lyra_lane[3:]) # A second packet lights the jumps on their own — the pager still needs a tall body. pair_view = PacketViewer([newer, old], 0, resolve=lambda h: "") pair_view.note_metrics(4, 20) - assert [pair.opp_enabled for pair in pair_view.picocalc_lane[3:]] == [True, True] - assert [pair.enabled for pair in pair_view.picocalc_lane[3:]] == [False, False] + assert [pair.opp_enabled for pair in pair_view.picocalc_lyra_lane[3:]] == [True, True] + assert [pair.enabled for pair in pair_view.picocalc_lyra_lane[3:]] == [False, False] pair_view.note_metrics(80, 20) - assert [pair.enabled for pair in pair_view.picocalc_lane[3:]] == [True, True] + assert [pair.enabled for pair in pair_view.picocalc_lyra_lane[3:]] == [True, True] def test_packet_viewer_follows_the_stream_off_the_top_of_a_live_list() -> None: @@ -203,7 +203,7 @@ def test_packet_viewer_home_resumes_the_stream() -> None: lone = PacketViewer(feed[:1], 0, resolve=lambda h: "", source=lambda: feed[:1]) lone.note_metrics(4, 20) # a short body in a roomy box: nothing to page - assert [pair.opp_enabled for pair in lone.picocalc_lane[3:]] == [True, True] + assert [pair.opp_enabled for pair in lone.picocalc_lyra_lane[3:]] == [True, True] def test_packet_viewer_without_a_source_stays_a_snapshot() -> None: @@ -456,11 +456,11 @@ def test_packet_viewer_reception_row_keeps_rssi_on_one_line() -> None: misses the roomy `` · `` by exactly its padding — and folding puts the bare word ``rssi`` on a line of its own. """ - from meshterm.platforms import PICOCALC, REGULAR + from meshterm.platforms import PICOCALC_LYRA, REGULAR from meshterm.ui.tui.frame import _dialog_layout entry = PacketEntry(when=utcnow(), kind="advert", node="3d63", snr=-13.5, rssi=-101.0) - for platform, cols in ((REGULAR, 72), (PICOCALC, PICOCALC.readable_cols)): + for platform, cols in ((REGULAR, 72), (PICOCALC_LYRA, PICOCALC_LYRA.readable_cols)): set_platform(platform) viewer = _viewer(entry) _, _, _, body = _dialog_layout(viewer, cols, 26) diff --git a/tests/test_performance.py b/tests/test_performance.py index 109c319..8d49423 100644 --- a/tests/test_performance.py +++ b/tests/test_performance.py @@ -23,7 +23,7 @@ from prompt_toolkit.data_structures import Size from prompt_toolkit.output import DummyOutput from meshterm.persistence import db -from meshterm.platforms import PICOCALC, REGULAR, set_platform +from meshterm.platforms import PICOCALC_LYRA, REGULAR, set_platform from meshterm.ui.tui.session import _has_wide_glyph from meshterm.ui.tui.spinner import Spinner @@ -139,20 +139,20 @@ def test_wide_glyph_scan_short_circuits_without_emoji() -> None: """A no-emoji console font has no wide glyph, so the per-frame scan can be skipped.""" waving = "hi \U0001f44b" assert _has_wide_glyph(waving) is True - set_platform(PICOCALC) + set_platform(PICOCALC_LYRA) assert _has_wide_glyph(waving) is False def test_spinner_cycle_follows_the_platform() -> None: """Braille where effects are on, the plain LINE cycle where they aren't.""" assert Spinner().frames == Spinner.BRAILLE - set_platform(PICOCALC) + set_platform(PICOCALC_LYRA) assert Spinner().frames == Spinner.LINE def test_an_explicit_spinner_cycle_still_wins() -> None: """The platform supplies a *default*; a caller that names its frames keeps them.""" - set_platform(PICOCALC) + set_platform(PICOCALC_LYRA) assert Spinner("ab").frames == "ab" @@ -181,10 +181,10 @@ def test_battery_gauge_steps_the_sweep_at_the_platforms_own_cadence(monkeypatch) out.append(_battery_segment(ctx).plain[0]) # type: ignore[arg-type] return out - set_platform(PICOCALC) + set_platform(PICOCALC_LYRA) # A step per 2 s idle repaint: the sweep climbs, and does not alias across skipped frames. - assert len(set(_sweep(PICOCALC.tick_s))) == 5 - assert len(set(_sweep(PICOCALC.tick_s / 2))) < 5 # half a tick apart, some frames repeat + assert len(set(_sweep(PICOCALC_LYRA.tick_s))) == 5 + assert len(set(_sweep(PICOCALC_LYRA.tick_s / 2))) < 5 # half a tick apart, some frames repeat set_platform(REGULAR) assert len(set(_sweep(REGULAR.tick_s))) == 5 assert _battery_segment(ctx).plain.endswith("5%") # type: ignore[arg-type] @@ -200,10 +200,10 @@ def test_idle_and_spin_cadences_are_slower_where_a_frame_is_dear() -> None: """ assert REGULAR.tick_s == 1.0 assert REGULAR.spinner_tick_s == 0.12 - assert PICOCALC.tick_s > REGULAR.tick_s + assert PICOCALC_LYRA.tick_s > REGULAR.tick_s # A frame costs ~110 ms at the taller 53x40 geometry; a spin cadence under that would # queue repaints faster than they can finish. - assert PICOCALC.spinner_tick_s > 0.12 + assert PICOCALC_LYRA.spinner_tick_s > 0.12 def test_spinner_interval_reads_the_active_platform() -> None: @@ -211,8 +211,8 @@ def test_spinner_interval_reads_the_active_platform() -> None: from meshterm.ui.tui.spinner import spinner_interval assert spinner_interval() == REGULAR.spinner_tick_s - set_platform(PICOCALC) - assert spinner_interval() == PICOCALC.spinner_tick_s + set_platform(PICOCALC_LYRA) + assert spinner_interval() == PICOCALC_LYRA.spinner_tick_s # --- the direct row-diff renderer --------------------------------------------------- diff --git a/tests/test_picocalc_chrome.py b/tests/test_picocalc_lyra_chrome.py similarity index 89% rename from tests/test_picocalc_chrome.py rename to tests/test_picocalc_lyra_chrome.py index ff67191..e4ea295 100644 --- a/tests/test_picocalc_chrome.py +++ b/tests/test_picocalc_lyra_chrome.py @@ -6,11 +6,11 @@ from __future__ import annotations from rich.cells import cell_len from rich.text import Text -from meshterm.platforms import PICOCALC, REGULAR, set_platform +from meshterm.platforms import PICOCALC_LYRA, REGULAR, set_platform from meshterm.ui.tui import frame from meshterm.ui.tui.fkeys import ( DEFAULT_LANE, - PICOCALC_DECK, + PICOCALC_LYRA_DECK, FPair, default_lane, strip_lane_atoms, @@ -37,7 +37,7 @@ def test_borderless_frame_swaps_the_panel_for_a_title_bar() -> None: It carries the rule, the title, and the clip arrow. No border column is spent, so the body starts at column 0 and owns all 53 cells. """ - set_platform(PICOCALC) + set_platform(PICOCALC_LYRA) composed = frame.compose_base(Text("hdr"), _screen(), "hint", 53, 26).split("\n") assert len(composed) == 26 plain = [_plain(line) for line in composed] @@ -180,7 +180,7 @@ def test_bordered_frame_is_unchanged_on_regular() -> None: def test_picocalc_header_brands_the_app_not_the_device() -> None: """The PicoCalc header brands the app, not the device. - Per JP's spec for the ``header_atoms`` wiring: picocalc shows ``MeshTerm vX``, + Per JP's spec for the ``header_atoms`` wiring: picocalc-lyra shows ``MeshTerm vX``, because a soldered radio's port never changes and so the device segment earns nothing. Regular keeps both. """ @@ -198,11 +198,11 @@ def test_picocalc_header_brands_the_app_not_the_device() -> None: chat = _Badges() watchtower = _Badges() - set_platform(PICOCALC) + set_platform(PICOCALC_LYRA) text = "".join(seg.plain for seg in _header_segments(_Ctx(), {})) assert "MeshTerm" in text assert "simulator" not in text # the device atom is composed out - assert "pulse" in PICOCALC.header_atoms # the sparkline takes the remaining room + assert "pulse" in PICOCALC_LYRA.header_atoms # the sparkline takes the remaining room set_platform(REGULAR) text = "".join(seg.plain for seg in _header_segments(_Ctx(), {})) assert "MeshTerm" in text and "simulator" in text @@ -218,19 +218,19 @@ def test_fkey_lane_resolution_and_banks() -> None: # F4/F5 (paging — no physical key at all) carry the pager, and each jump rides the # Shift half of the very pager heading for it: Home behind Page ↑, End behind Page ↓. assert ( - PICOCALC_DECK.action_for(lane, 4) == "pagedown" - and PICOCALC_DECK.action_for(lane, 9) == "end" + PICOCALC_LYRA_DECK.action_for(lane, 4) == "pagedown" + and PICOCALC_LYRA_DECK.action_for(lane, 9) == "end" ) assert ( - PICOCALC_DECK.action_for(lane, 5) == "pageup" - and PICOCALC_DECK.action_for(lane, 10) == "home" + PICOCALC_LYRA_DECK.action_for(lane, 5) == "pageup" + and PICOCALC_LYRA_DECK.action_for(lane, 10) == "home" ) # F1-F3 are free on every screen — the shared lane claims none of them. for number in (1, 2, 3, 6, 7, 8): - assert PICOCALC_DECK.action_for(lane, number) is None + assert PICOCALC_LYRA_DECK.action_for(lane, number) is None # Enter/Esc never occupy a slot — both keys are already close at hand. - assert "enter" not in {PICOCALC_DECK.action_for(lane, n) for n in range(1, 11)} - assert "escape" not in {PICOCALC_DECK.action_for(lane, n) for n in range(1, 11)} + assert "enter" not in {PICOCALC_LYRA_DECK.action_for(lane, n) for n in range(1, 11)} + assert "escape" not in {PICOCALC_LYRA_DECK.action_for(lane, n) for n in range(1, 11)} def test_fkey_lane_text_fits_and_flips() -> None: @@ -239,8 +239,8 @@ def test_fkey_lane_text_fits_and_flips() -> None: The directional pair rises toward its outer key, and a free slot draws as a bare key number rather than an empty gap. """ - primary = PICOCALC_DECK.lane_text(DEFAULT_LANE) - shifted = PICOCALC_DECK.lane_text(DEFAULT_LANE, shifted=True) + primary = PICOCALC_LYRA_DECK.lane_text(DEFAULT_LANE) + shifted = PICOCALC_LYRA_DECK.lane_text(DEFAULT_LANE, shifted=True) assert cell_len(primary.plain) == 53 and cell_len(shifted.plain) == 53 # A directional pair rises to the right: down/out left, up/in right — and each # companion keeps its slot's end of that axis. @@ -251,15 +251,15 @@ def test_fkey_lane_text_fits_and_flips() -> None: assert f"F{number} " in primary.plain assert f"F{number + 5} " in shifted.plain wide = [FPair("Muchtoolonglabel", "a", "Muchtoolonglabel", "b")] * 5 - assert cell_len(PICOCALC_DECK.lane_text(wide).plain) == 53 # clipped to the slot budget - assert cell_len(PICOCALC_DECK.lane_text(wide, shifted=True).plain) == 53 + assert cell_len(PICOCALC_LYRA_DECK.lane_text(wide).plain) == 53 # clipped to the slot budget + assert cell_len(PICOCALC_LYRA_DECK.lane_text(wide, shifted=True).plain) == 53 def test_fkey_slot_dims_when_its_action_is_unavailable() -> None: """An unavailable slot keeps its label and drops its fill — it never offers a dead key.""" lane = [FPair("Paths", "paths", "Retry", "retry", enabled=False)] + [None] * 4 - primary = PICOCALC_DECK.lane_text(lane) - shifted = PICOCALC_DECK.lane_text(lane, shifted=True) + primary = PICOCALC_LYRA_DECK.lane_text(lane) + shifted = PICOCALC_LYRA_DECK.lane_text(lane, shifted=True) # The label survives: the lane still says what F1 is for, just not that it acts now. assert "F1 Paths" in primary.plain and _slot_style(primary, 0) == "muted" @@ -268,7 +268,7 @@ def test_fkey_slot_dims_when_its_action_is_unavailable() -> None: # The row is still exactly the lane's width, dim chips and all. assert cell_len(primary.plain) == 53 and cell_len(shifted.plain) == 53 # Dimming is presentational: the key still resolves, and the screen's handler no-ops. - assert PICOCALC_DECK.action_for(lane, 1) == "paths" + assert PICOCALC_LYRA_DECK.action_for(lane, 1) == "paths" def test_default_lane_dims_every_nav_slot_when_nothing_moves() -> None: @@ -278,24 +278,24 @@ def test_default_lane_dims_every_nav_slot_when_nothing_moves() -> None: assert [pair.label for pair in dim if pair] == ["Page ↓", "Page ↑"] assert not any(pair.enabled or pair.opp_enabled for pair in dim if pair) - row = PICOCALC_DECK.lane_text(dim) + row = PICOCALC_LYRA_DECK.lane_text(dim) assert cell_len(row.plain) == 53 and "F4 Page ↓" in row.plain and "F5 Page ↑" in row.plain assert {str(span.style) for span in row.spans} == {"muted"} # Both banks dim together: the jump behind a dead pager is just as dead. - assert {str(span.style) for span in PICOCALC_DECK.lane_text(dim, shifted=True).spans} == { + assert {str(span.style) for span in PICOCALC_LYRA_DECK.lane_text(dim, shifted=True).spans} == { "muted" } def test_lane_is_built_after_the_body_renders() -> None: """The frame defers the lane, so its gates read this paint's metrics, not the last one's.""" - set_platform(PICOCALC) + set_platform(PICOCALC_LYRA) screen = _screen() # 40 body rows into a 23-row viewport: it overflows seen: dict[str, bool] = {} def build() -> Text: - seen["nav"] = all(pair.enabled for pair in screen.picocalc_lane if pair) - return PICOCALC_DECK.lane_text(screen.picocalc_lane) + seen["nav"] = all(pair.enabled for pair in screen.picocalc_lyra_lane if pair) + return PICOCALC_LYRA_DECK.lane_text(screen.picocalc_lyra_lane) composed = frame.compose_base(Text("hdr"), screen, "hint", 53, 26, footer_lane=build) @@ -307,9 +307,9 @@ def test_scroll_screen_lane_tracks_whether_its_body_overflows() -> None: """The result window's nav slots light only once there is something to scroll to.""" screen = _screen() screen.note_metrics(4, 20) # the whole body fits the viewport - assert not any(pair.enabled for pair in screen.picocalc_lane if pair) + assert not any(pair.enabled for pair in screen.picocalc_lyra_lane if pair) screen.note_metrics(80, 20) # taller than the viewport - assert all(pair.enabled for pair in screen.picocalc_lane if pair) + assert all(pair.enabled for pair in screen.picocalc_lyra_lane if pair) def test_select_lane_promotes_the_section_jumps_only_where_there_are_sections() -> None: @@ -319,8 +319,8 @@ def test_select_lane_promotes_the_section_jumps_only_where_there_are_sections() flat = SelectScreen("Flat", [Choice("one", 1), Choice("two", 2)]) # No headings anywhere: sections are not a thing on this list, so the slots are empty # rather than dim — and F1/F2 resolve to nothing at all. - assert flat.picocalc_lane[0] is None and flat.picocalc_lane[1] is None - assert PICOCALC_DECK.action_for(flat.picocalc_lane, 1) is None + assert flat.picocalc_lyra_lane[0] is None and flat.picocalc_lyra_lane[1] is None + assert PICOCALC_LYRA_DECK.action_for(flat.picocalc_lyra_lane, 1) is None grouped = SelectScreen( "Grouped", @@ -332,12 +332,12 @@ def test_select_lane_promotes_the_section_jumps_only_where_there_are_sections() Choice("gamma", 3), ], ) - lane = grouped.picocalc_lane + lane = grouped.picocalc_lyra_lane assert [pair.label for pair in lane[:2]] == ["Sect ↑", "Sect ↓"] # A pair rises toward its outer key: on this left-edge pair, up takes F1. assert ( - PICOCALC_DECK.action_for(lane, 1) == "ctrl_pageup" - and PICOCALC_DECK.action_for(lane, 2) == "ctrl_pagedown" + PICOCALC_LYRA_DECK.action_for(lane, 1) == "ctrl_pageup" + and PICOCALC_LYRA_DECK.action_for(lane, 2) == "ctrl_pagedown" ) assert all(pair.enabled for pair in lane[:2]) @@ -345,7 +345,7 @@ def test_select_lane_promotes_the_section_jumps_only_where_there_are_sections() # the sections are still a thing here, they just have nowhere to jump right now. for ch in "gam": grouped.handle("text", ch) - dim = grouped.picocalc_lane + dim = grouped.picocalc_lyra_lane assert [pair.label for pair in dim[:2]] == ["Sect ↑", "Sect ↓"] assert not any(pair.enabled for pair in dim[:2]) @@ -360,8 +360,8 @@ def test_dialogs_draw_no_lane_at_all() -> None: ConfirmScreen("Sure?"), ButtonDialog("Reboot the node?", ["Cancel", "Reboot"]), ): - assert list(screen.picocalc_lane) == list(EMPTY_LANE) - row = PICOCALC_DECK.lane_text(screen.picocalc_lane) + assert list(screen.picocalc_lyra_lane) == list(EMPTY_LANE) + row = PICOCALC_LYRA_DECK.lane_text(screen.picocalc_lyra_lane) assert cell_len(row.plain) == 53 assert {str(span.style) for span in row.spans} == {"muted"} @@ -407,7 +407,7 @@ def test_dialog_wrap_shrinks_on_picocalc() -> None: """A dialog message wraps to fewer cells on the PicoCalc, the screen being narrower.""" from meshterm.ui.surface import _dialog_wrap_cells - set_platform(PICOCALC) + set_platform(PICOCALC_LYRA) assert _dialog_wrap_cells() == 37 # 53 readable - 4 margin - 12 chrome set_platform(REGULAR) assert _dialog_wrap_cells() == 54 # 72 readable - 6 margin - 12 chrome @@ -433,13 +433,13 @@ def test_a_dialog_keeps_its_hint_where_the_lane_is_the_footer() -> None: screen = _dialog("↑↓ move · Enter select · Esc back") set_platform(REGULAR) assert frame._dialog_hint(screen) == "" - set_platform(PICOCALC) + set_platform(PICOCALC_LYRA) assert "Esc back" in _plain(frame.compose_dialog(screen, 53, 26)) def test_the_dialog_hint_drops_what_the_lane_already_says() -> None: """An atom whose every key is a chip on the very next row is the same claim twice.""" - set_platform(PICOCALC) + set_platform(PICOCALC_LYRA) screen = _dialog("↑↓ move · PgUp/PgDn scroll · Home/End ends · Enter select · Esc back") # The shared lane pages on F4/F5 and jumps to either end behind their Shift halves. assert frame._dialog_hint(screen) == "↑↓ move · Enter select · Esc back" @@ -452,7 +452,7 @@ def test_the_dialog_hint_is_resolved_on_every_paint() -> None: The packet viewer rewrites its own hint as the list it pages through grows past one entry (JP, 2026-08-31), and every screen reads its lane fresh each frame. """ - set_platform(PICOCALC) + set_platform(PICOCALC_LYRA) screen = _dialog("Esc close") assert frame._dialog_hint(screen) == "Esc close" screen._footer_hint = "↑↓ newer/older · PgUp/PgDn scroll · Home/End ends · Esc close" diff --git a/tests/test_platforms.py b/tests/test_platforms.py index f1ef186..178d7ce 100644 --- a/tests/test_platforms.py +++ b/tests/test_platforms.py @@ -14,7 +14,7 @@ import pytest import meshterm.platforms as platforms_mod from meshterm.platforms import ( - PICOCALC, + PICOCALC_LYRA, REGULAR, get_platform, resolve, @@ -34,12 +34,12 @@ def test_regular_is_todays_behaviour() -> None: def test_picocalc_is_the_narrower_plainer_flavour() -> None: - """PICOCALC never claims a capability the console can't back up.""" - assert PICOCALC.name == "picocalc" - assert PICOCALC.readable_cols < REGULAR.readable_cols - assert PICOCALC.width_reclaim is False # a phantom column would tear the exact-width frame - assert PICOCALC.emoji is False - assert PICOCALC.truecolor is False + """PICOCALC_LYRA never claims a capability the console can't back up.""" + assert PICOCALC_LYRA.name == "picocalc-lyra" + assert PICOCALC_LYRA.readable_cols < REGULAR.readable_cols + assert PICOCALC_LYRA.width_reclaim is False # a phantom column would tear the exact-width frame + assert PICOCALC_LYRA.emoji is False + assert PICOCALC_LYRA.truecolor is False def test_get_platform_defaults_to_regular() -> None: @@ -49,8 +49,8 @@ def test_get_platform_defaults_to_regular() -> None: def test_set_platform_is_visible_through_get_platform() -> None: """set_platform takes effect immediately for any caller reading via get_platform().""" - set_platform(PICOCALC) - assert get_platform() is PICOCALC + set_platform(PICOCALC_LYRA) + assert get_platform() is PICOCALC_LYRA set_platform(REGULAR) assert get_platform() is REGULAR @@ -63,8 +63,8 @@ def test_set_platform_reaches_a_dotted_import_too() -> None: access (``platforms_mod.PLATFORM``) — and every real binding point in this codebase, which reads through :func:`get_platform` — does. """ - set_platform(PICOCALC) - assert platforms_mod.PLATFORM is PICOCALC + set_platform(PICOCALC_LYRA) + assert platforms_mod.PLATFORM is PICOCALC_LYRA def test_resolve_defaults_to_regular_off_device(monkeypatch: pytest.MonkeyPatch) -> None: @@ -79,29 +79,42 @@ def test_resolve_defaults_to_regular_off_device(monkeypatch: pytest.MonkeyPatch) def test_resolve_flag_wins_over_everything(monkeypatch: pytest.MonkeyPatch) -> None: """An explicit --platform overrides both the env var and auto-detection.""" - monkeypatch.setenv("MESHTERM_PLATFORM", "picocalc") + monkeypatch.setenv("MESHTERM_PLATFORM", "picocalc-lyra") monkeypatch.setattr(platforms_mod, "_DEVICE_TREE_MODEL_PATH", Path("/nonexistent/model")) r = resolve("regular") assert r.platform is REGULAR assert r.source == "--platform flag" - assert r.env == "picocalc" # recorded even though it didn't decide the outcome + assert r.env == "picocalc-lyra" # recorded even though it didn't decide the outcome def test_resolve_env_wins_when_no_flag(monkeypatch: pytest.MonkeyPatch) -> None: """MESHTERM_PLATFORM decides when --platform wasn't passed.""" - monkeypatch.setenv("MESHTERM_PLATFORM", "picocalc") + monkeypatch.setenv("MESHTERM_PLATFORM", "picocalc-lyra") monkeypatch.setattr(platforms_mod, "_DEVICE_TREE_MODEL_PATH", Path("/nonexistent/model")) r = resolve(None) - assert r.platform is PICOCALC + assert r.platform is PICOCALC_LYRA assert r.source == "MESHTERM_PLATFORM env var" def test_resolve_matching_is_case_insensitive_and_trims_space() -> None: """A flag/env value matches regardless of case or stray whitespace.""" - assert resolve(" PicoCalc ").platform is PICOCALC + assert resolve(" PicoCalc-Lyra ").platform is PICOCALC_LYRA assert resolve("REGULAR").platform is REGULAR +@pytest.mark.parametrize("old", ["picocalc", "cardputer"]) +def test_the_old_device_names_are_refused_with_the_new_ones_listed(old: str) -> None: + """``picocalc`` and ``cardputer`` were renamed for the device variant, with no alias. + + M5Stack makes three Cardputers and the PicoCalc takes several cores, so the bare names + were ambiguous. A launcher still passing one fails loudly, naming the real choices, + rather than quietly falling back to the desktop layout. + """ + with pytest.raises(ValueError) as exc: + resolve(old) + assert "picocalc-lyra" in str(exc.value) and "cardputer-zero" in str(exc.value) + + def test_resolve_unknown_flag_raises_with_the_choices(monkeypatch: pytest.MonkeyPatch) -> None: """A typo'd --platform is a clear ValueError, not a silent fallback to REGULAR.""" monkeypatch.delenv("MESHTERM_PLATFORM", raising=False) @@ -109,7 +122,7 @@ def test_resolve_unknown_flag_raises_with_the_choices(monkeypatch: pytest.Monkey resolve("laptop") message = str(exc.value) assert "laptop" in message and "--platform" in message - assert "picocalc" in message and "regular" in message + assert "picocalc-lyra" in message and "regular" in message def test_resolve_unknown_env_raises_only_when_it_would_decide( @@ -134,13 +147,13 @@ def test_resolve_auto_detects_the_lyra_model(monkeypatch: pytest.MonkeyPatch) -> monkeypatch.setattr(platforms_mod, "_DEVICE_TREE_MODEL_PATH", _FakePath()) r = resolve() - assert r.platform is PICOCALC + assert r.platform is PICOCALC_LYRA assert r.source == "auto-detect" assert r.detected_model == "Luckfox Lyra" # trailing space/NUL stripped def test_resolve_auto_detect_is_conservative(monkeypatch: pytest.MonkeyPatch) -> None: - """A device tree that exists but names different hardware never guesses picocalc.""" + """A device tree that exists but names different hardware never guesses picocalc-lyra.""" monkeypatch.delenv("MESHTERM_PLATFORM", raising=False) class _FakePath: @@ -183,9 +196,9 @@ def test_without_emoji_leaves_an_already_compact_platform_alone() -> None: """A platform whose icons are already compact comes back untouched. The same object, not a copy that would compare equal but break every ``is`` check - the suite makes against PICOCALC. + the suite makes against PICOCALC_LYRA. """ - assert without_emoji(PICOCALC) is PICOCALC + assert without_emoji(PICOCALC_LYRA) is PICOCALC_LYRA def test_the_emoji_less_variant_still_drives_the_theme() -> None: diff --git a/tests/test_preferences.py b/tests/test_preferences.py index 3f623af..09f0ec3 100644 --- a/tests/test_preferences.py +++ b/tests/test_preferences.py @@ -681,10 +681,10 @@ def test_a_newly_watched_node_takes_the_preferred_silence_rule(tmp_path: Path) - def test_the_last_column_preference_overrules_the_platform() -> None: """``full_width`` steps aside on ``auto`` and decides otherwise (env still wins over both).""" - from meshterm.platforms import PICOCALC, set_platform + from meshterm.platforms import PICOCALC_LYRA, set_platform from meshterm.ui.tui.session import _reclaim_last_column - set_platform(PICOCALC) # a platform that defaults the reclaim off + set_platform(PICOCALC_LYRA) # a platform that defaults the reclaim off prefs = Preferences() install(prefs) try: diff --git a/tests/test_records_screen.py b/tests/test_records_screen.py index 22bcaf5..c434402 100644 --- a/tests/test_records_screen.py +++ b/tests/test_records_screen.py @@ -267,7 +267,7 @@ def test_record_dialog_actions_start_both_labels_in_the_same_cell() -> None: it is the cell the words land in that the eye compares. Where the platform draws no icon lane the marks go, and so must their padding: both labels open right after the pointer. """ - from meshterm.platforms import PICOCALC, set_platform + from meshterm.platforms import PICOCALC_LYRA, set_platform def starts() -> set[int]: lines = _plain(_dialog(_record()).render_body(60)).splitlines() @@ -284,7 +284,7 @@ def test_record_dialog_actions_start_both_labels_in_the_same_cell() -> None: assert len(regular) == 1 # one column for both words… assert regular == {2 + 2 + 1} # …after the pointer, the two-cell lane, and its space - set_platform(PICOCALC) + set_platform(PICOCALC_LYRA) assert starts() == {2} # no lane, no leftover padding: the words follow the pointer diff --git a/tests/test_region_admin.py b/tests/test_region_admin.py index c54b9f4..21d4da5 100644 --- a/tests/test_region_admin.py +++ b/tests/test_region_admin.py @@ -664,13 +664,13 @@ async def test_ctrl_r_reads_again_and_f3_is_read_over_remove() -> None: menu = RegionMenu(title, items) menu.future = asyncio.get_running_loop().create_future() assert not menu.floating - lane = menu.picocalc_lane + lane = menu.picocalc_lyra_lane assert (lane[2].label, lane[2].opp_label) == ("Read", "Remove") assert not lane[2].opp_enabled # the wildcard row is highlighted first assert "Del remove" not in menu.footer_hint menu.handle("down") menu.handle("down") # lakeside-north - assert menu.picocalc_lane[2].opp_enabled + assert menu.picocalc_lyra_lane[2].opp_enabled assert "Del remove" in menu.footer_hint menu.handle("retry") assert menu.future.result() == region_editor._READ diff --git a/tests/test_repeater_admin.py b/tests/test_repeater_admin.py index 87787f4..9db431c 100644 --- a/tests/test_repeater_admin.py +++ b/tests/test_repeater_admin.py @@ -582,14 +582,14 @@ async def test_ctrl_r_reads_only_a_highlighted_setting() -> None: menu.future = loop.create_future() assert menu._current_choice().value == "name" assert menu.footer_hint.endswith("Enter select · ^R read · Esc back") - assert menu.picocalc_lane[2].label == "Read" and menu.picocalc_lane[2].enabled + assert menu.picocalc_lyra_lane[2].label == "Read" and menu.picocalc_lyra_lane[2].enabled menu.handle("retry") assert menu.future.result() == ReadOne("name") menu.future = loop.create_future() menu.handle("end") # the last action row: nothing there to read assert "^R" not in menu.footer_hint - assert not menu.picocalc_lane[2].enabled + assert not menu.picocalc_lyra_lane[2].enabled menu.handle("retry") assert not menu.future.done() diff --git a/tests/test_scope_display.py b/tests/test_scope_display.py index 09c46e5..fadfebb 100644 --- a/tests/test_scope_display.py +++ b/tests/test_scope_display.py @@ -212,9 +212,9 @@ def test_the_feed_never_collapses_a_lane() -> None: def test_the_picocalc_feed_names_the_class_without_an_icon() -> None: """On the console the class icon is a one-glyph stand-in; the name alone says it.""" - from meshterm.platforms import PICOCALC, REGULAR, set_platform + from meshterm.platforms import PICOCALC_LYRA, REGULAR, set_platform - set_platform(PICOCALC) + set_platform(PICOCALC_LYRA) try: screen = _feed(_scoped("harbour")) header, row = _stripped(screen.render_body(53))[:2] diff --git a/tests/test_selection_colour.py b/tests/test_selection_colour.py index 4540182..423d198 100644 --- a/tests/test_selection_colour.py +++ b/tests/test_selection_colour.py @@ -20,7 +20,7 @@ import re import pytest from rich.text import Text -from meshterm.platforms import PICOCALC, REGULAR, set_platform +from meshterm.platforms import PICOCALC_LYRA, REGULAR, set_platform from meshterm.ui.contactlist import _SORT_ACTIVE from meshterm.ui.pathline import PathHop, PathLine from meshterm.ui.theme import ( @@ -181,7 +181,7 @@ def test_a_name_beside_a_path_line_still_folds() -> None: assert node_style("77").removeprefix("bold ") in hues # …the route did not -@pytest.mark.parametrize("platform", [REGULAR, PICOCALC]) +@pytest.mark.parametrize("platform", [REGULAR, PICOCALC_LYRA]) def test_the_message_paths_dialog_colours_its_picked_route_like_its_graph(platform) -> None: # noqa: ANN001 """The end JP asked for: the picked row and the graph above it agree on each node. @@ -244,7 +244,7 @@ def test_the_ansi_cache_tells_a_highlighted_row_from_the_same_row_unhighlighted( assert render_to_ansi(_row(selected=False), 60) == plain_ansi # not clobbered -@pytest.mark.parametrize("platform", [REGULAR, PICOCALC]) +@pytest.mark.parametrize("platform", [REGULAR, PICOCALC_LYRA]) def test_the_fold_speaks_whichever_hue_vocabulary_is_bound(platform) -> None: # noqa: ANN001 """PicoCalc quantizes the hue to a palette slot; the rule above it is the same rule.""" set_platform(platform) @@ -257,7 +257,7 @@ def test_the_fold_speaks_whichever_hue_vocabulary_is_bound(platform) -> None: # assert lit != unlit assert "Lakeside" in re.sub(r"\x1b\[[\d;]*m", "", lit) - if platform is PICOCALC: + if platform is PICOCALC_LYRA: assert "\x1b[1;97mLakeside" in lit, lit # slot 15, the console's white else: assert "38;2;255;255;255mLakeside" in lit, lit @@ -266,7 +266,7 @@ def test_the_fold_speaks_whichever_hue_vocabulary_is_bound(platform) -> None: # # -- the vocabulary itself ------------------------------------------------------------ -@pytest.mark.parametrize("platform", [REGULAR, PICOCALC]) +@pytest.mark.parametrize("platform", [REGULAR, PICOCALC_LYRA]) def test_every_hue_a_key_can_mint_is_recognised_as_one(platform) -> None: # noqa: ANN001 """:func:`node_style` read backwards has to answer for all 256 first bytes. @@ -307,7 +307,7 @@ def test_the_two_platforms_hue_vocabularies_cannot_be_confused() -> None: """ set_platform(REGULAR) spectrum = {node_style(f"{byte:02x}") for byte in range(256)} - set_platform(PICOCALC) + set_platform(PICOCALC_LYRA) slots = {node_style(f"{byte:02x}") for byte in range(256)} assert not (spectrum & slots) @@ -376,7 +376,7 @@ def test_the_active_sort_column_is_lit_in_the_cursor_white() -> None: def test_the_sort_cue_survives_the_console_s_sixteen_slots() -> None: """A bare hex would have been quantized at the fold; a theme name is chosen deliberately.""" - set_platform(PICOCALC) + set_platform(PICOCALC_LYRA) header = Text("NAME ▲", style=_SORT_ACTIVE) assert "\x1b[1;97m" in render_to_ansi(header, 20) # slot 15, not the brand's 14 diff --git a/tests/test_send_scope.py b/tests/test_send_scope.py index 8969d2e..c6bc1d3 100644 --- a/tests/test_send_scope.py +++ b/tests/test_send_scope.py @@ -389,7 +389,7 @@ async def test_resend_unscoped_targets_only_a_newest_scoped_message() -> None: screen = _channel_chat(_Session(), [scoped], resend=resend) assert screen._retry_target() is scoped assert "^R resend unscoped" in screen.footer_hint - lane = screen.picocalc_lane + lane = screen.picocalc_lyra_lane assert lane[2].opp_label == "Resend" and lane[2].opp_enabled screen.handle("retry") @@ -455,9 +455,9 @@ def test_a_channel_with_nothing_to_resend_dims_the_chip() -> None: return message screen = _channel_chat(_Session(), [unscoped], resend=resend) - lane = screen.picocalc_lane + lane = screen.picocalc_lyra_lane assert lane[2].opp_label == "Resend" and not lane[2].opp_enabled - assert fkeys.PICOCALC_DECK.lane_text(lane, shifted=True).plain + assert fkeys.PICOCALC_LYRA_DECK.lane_text(lane, shifted=True).plain def _plain_lines(screen: ChatScreen) -> str: diff --git a/tests/test_session_color_depth.py b/tests/test_session_color_depth.py index 59b36f8..70c32b7 100644 --- a/tests/test_session_color_depth.py +++ b/tests/test_session_color_depth.py @@ -15,7 +15,7 @@ from __future__ import annotations from prompt_toolkit.output.color_depth import ColorDepth -from meshterm.platforms import PICOCALC, REGULAR, set_platform +from meshterm.platforms import PICOCALC_LYRA, REGULAR, set_platform from meshterm.ui.tui.session import _color_depth @@ -61,7 +61,7 @@ def test_picocalc_is_never_promoted(monkeypatch) -> None: """A 16-slot console addresses its palette by index; RGB has nowhere to land there.""" _auto(monkeypatch) monkeypatch.setenv("COLORTERM", "truecolor") - set_platform(PICOCALC) + set_platform(PICOCALC_LYRA) assert _color_depth() is None diff --git a/tests/test_session_width.py b/tests/test_session_width.py index d3a0327..0c2da51 100644 --- a/tests/test_session_width.py +++ b/tests/test_session_width.py @@ -17,7 +17,7 @@ from types import SimpleNamespace from prompt_toolkit.data_structures import Size -from meshterm.platforms import PICOCALC, REGULAR, set_platform +from meshterm.platforms import PICOCALC_LYRA, REGULAR, set_platform from meshterm.ui.tui.session import TuiSession, _WidthExtendedOutput @@ -71,18 +71,18 @@ def test_session_pins_the_real_terminal_inside_the_width_extension(monkeypatch) def test_session_leaves_the_bare_terminal_on_picocalc(monkeypatch) -> None: - """PICOCALC's exact-width console → no reclaim: a phantom column would tear the frame.""" + """PICOCALC_LYRA's exact-width console → no reclaim: a phantom column would tear the frame.""" monkeypatch.delenv("MESHTERM_FULL_WIDTH", raising=False) - set_platform(PICOCALC) + set_platform(PICOCALC_LYRA) assert TuiSession()._resolve_output() is None def test_env_override_forces_reclaim_on_despite_picocalc(monkeypatch) -> None: - """``MESHTERM_FULL_WIDTH=1`` wins over PICOCALC's off-by-default.""" + """``MESHTERM_FULL_WIDTH=1`` wins over PICOCALC_LYRA's off-by-default.""" fake = SimpleNamespace(get_size=lambda: Size(rows=30, columns=100)) monkeypatch.setattr("prompt_toolkit.output.defaults.create_output", lambda: fake) monkeypatch.setenv("MESHTERM_FULL_WIDTH", "1") - set_platform(PICOCALC) + set_platform(PICOCALC_LYRA) assert isinstance(TuiSession()._resolve_output(), _WidthExtendedOutput) diff --git a/tests/test_spdx.py b/tests/test_spdx.py index 4781c09..e634ef6 100644 --- a/tests/test_spdx.py +++ b/tests/test_spdx.py @@ -17,7 +17,7 @@ def test_spdx_headers(): python_files = [] # Collect all Python files from the required directories - for directory in ["meshterm", "tests", "packaging", "scripts/picocalc/xiao-radio"]: + for directory in ["meshterm", "tests", "packaging", "scripts/picocalc-lyra/xiao-radio"]: dir_path = repo_root / directory if dir_path.exists(): if directory == "packaging": diff --git a/tests/test_theme16.py b/tests/test_theme16.py index 5a2d53a..4254b25 100644 --- a/tests/test_theme16.py +++ b/tests/test_theme16.py @@ -17,7 +17,7 @@ from pathlib import Path from rich.cells import cell_len from rich.default_styles import DEFAULT_STYLES -from meshterm.platforms import PICOCALC, REGULAR, set_platform +from meshterm.platforms import PICOCALC_LYRA, REGULAR, set_platform from meshterm.ui import theme from meshterm.ui.fontset import FONT_CODEPOINTS from meshterm.ui.theme import MESH_THEME, MESH_THEME_16, fold_text, glyph, name_style @@ -25,7 +25,7 @@ from meshterm.ui.theme import MESH_THEME, MESH_THEME_16, fold_text, glyph, name_ _FONT_SCRIPT = ( Path(__file__).resolve().parent.parent / "scripts" - / "picocalc" + / "picocalc-lyra" / "calculinux-console-font-6x12.sh" ) @@ -101,7 +101,7 @@ def test_unknown_node_grey_survives_a_selected_row() -> None: from rich.console import Console from rich.text import Text - set_platform(PICOCALC) + set_platform(PICOCALC_LYRA) console = Console( theme=MESH_THEME_16, width=20, @@ -190,7 +190,7 @@ def test_glyph_is_identity_on_regular_and_compact_on_picocalc() -> None: """ set_platform(REGULAR) assert glyph("📡") == "📡" - set_platform(PICOCALC) + set_platform(PICOCALC_LYRA) assert glyph("📡") == "☼" assert glyph("★") == "★" # node/status marks pass through — they are font-native @@ -199,8 +199,8 @@ def test_glyph_is_identity_on_regular_and_compact_on_picocalc() -> None: def test_fold_is_identity_on_regular_even_after_picocalc_used_it() -> None: - """The bound impls may not leak cached picocalc folds into a regular render.""" - set_platform(PICOCALC) + """The bound impls may not leak cached picocalc-lyra folds into a regular render.""" + set_platform(PICOCALC_LYRA) assert fold_text("café") == "cafe" set_platform(REGULAR) assert fold_text("café") == "café" @@ -212,7 +212,7 @@ def test_fold_strips_accents_and_preserves_cell_widths() -> None: An accent drops to its base letter and an emoji becomes its mapped mark, each in place, so nothing downstream has to measure the row again. """ - set_platform(PICOCALC) + set_platform(PICOCALC_LYRA) for text in ("café ⚠", "Ĉu vi paroläs", "📡 Advert", "🗑 Clear", "…", "npo Waymarker 🇨🇦"): folded = fold_text(text) assert cell_len(folded) == cell_len(text), (text, folded) @@ -222,14 +222,14 @@ def test_fold_strips_accents_and_preserves_cell_widths() -> None: def test_fold_replaces_the_unmappable_at_width() -> None: """CJK and unmapped emoji leave as ``?`` at their own width — never as tofu.""" - set_platform(PICOCALC) + set_platform(PICOCALC_LYRA) assert fold_text("你好") == "????" assert cell_len(fold_text("🦕")) == cell_len("🦕") def test_fold_keeps_ansi_sequences_intact() -> None: """The fold rewrites text only: colour escapes and newlines cross it untouched.""" - set_platform(PICOCALC) + set_platform(PICOCALC_LYRA) line = "\x1b[1;93mwarn é\x1b[0m\nnext" folded = fold_text(line) assert folded == "\x1b[1;93mwarn e\x1b[0m\nnext" @@ -237,7 +237,7 @@ def test_fold_keeps_ansi_sequences_intact() -> None: def test_fold_quantizes_embedded_truecolor_to_the_slots() -> None: """Canvas-emitted truecolor (the braille rasters) lands on the nearest palette slot.""" - set_platform(PICOCALC) + set_platform(PICOCALC_LYRA) folded = fold_text("\x1b[38;2;148;163;184m○\x1b[0m") assert "38;2;" not in folded # #94a3b8 → nearest stock slot is 7 (#aaaaaa); a dim-bank slot states its intensity. @@ -255,7 +255,7 @@ def test_fold_quantizes_a_colour_that_shares_its_sequence_with_another() -> None The QR module's white-on-black is the case that found it: ``ESC[38;2;…;48;2;…m`` is two colours in one list, and a matcher for a colour standing alone saw neither. """ - set_platform(PICOCALC) + set_platform(PICOCALC_LYRA) folded = fold_text("\x1b[38;2;255;255;255;48;2;0;0;0m█\x1b[0m") assert "8;2;" not in folded, folded assert folded.startswith("\x1b[97;40m"), folded # bright white ink, black field @@ -282,7 +282,7 @@ def test_the_qr_style_is_white_on_black_on_both_themes() -> None: def test_fold_drops_zero_width_machinery() -> None: """Variation selectors and zero-width joiners are dropped — they have no cell to occupy.""" - set_platform(PICOCALC) + set_platform(PICOCALC_LYRA) assert fold_text("🕸️") == fold_text("🕸") assert "‍" not in fold_text("a‍b") @@ -292,7 +292,7 @@ def test_fold_drops_zero_width_machinery() -> None: def test_names_colour_by_key_on_both_platforms() -> None: """One rule everywhere: the key picks the hue, and only its first byte does.""" - for platform in (REGULAR, PICOCALC): + for platform in (REGULAR, PICOCALC_LYRA): set_platform(platform) hue = name_style("Hilltop-Repeater", "3d63c6429436") assert hue.startswith("bold #"), platform.name @@ -310,7 +310,7 @@ def test_picocalc_node_hues_land_on_their_own_palette_slots() -> None: Each returned hex is a slot's own RGB, so every downsample on the way out — Rich's, and the fold's — lands on that exact slot instead of guessing a neighbour. """ - set_platform(PICOCALC) + set_platform(PICOCALC_LYRA) slots = {hex_: slot for slot, _, hex_ in theme._VT_SLOTS} landed = [name_style("n", f"{byte:02x}").removeprefix("bold ") for byte in range(256)] assert set(landed) == set(theme._NODE_SLOT_HEXES) @@ -326,7 +326,7 @@ def test_route_graph_resolves_a_named_marker_colour_to_rgb() -> None: """ from meshterm.ui.widgets import route_graph_style - for platform in (REGULAR, PICOCALC): + for platform in (REGULAR, PICOCALC_LYRA): set_platform(platform) _glyph_of, _label_of, label_rgb_of = route_graph_style( resolve=lambda hop: None, @@ -339,7 +339,7 @@ def test_route_graph_resolves_a_named_marker_colour_to_rgb() -> None: def test_node_type_marks_stay_distinct_on_the_console() -> None: """Each type mark owns a slot — a naive downsample would grey the repeater's violet.""" - set_platform(PICOCALC) + set_platform(PICOCALC_LYRA) marks = ("type.node", "type.repeater", "type.room", "type.sensor") rgbs = [theme.mark_rgb(name) for name in marks] assert len(set(rgbs)) == len(marks) @@ -354,7 +354,7 @@ def test_heat_ladder_walks_jps_seven_slots_in_order() -> None: """ from meshterm.ui.widgets import _recency_style - set_platform(PICOCALC) + set_platform(PICOCALC_LYRA) # fmt: off expected = [ (60, 15), (299, 15), # under 5 minutes — white @@ -383,7 +383,7 @@ def test_canvas_drops_emphasis_where_bold_means_brightness() -> None: """ from meshterm.ui.mapcanvas import MapCanvas - for platform, expect_bold in ((REGULAR, True), (PICOCALC, False)): + for platform, expect_bold in ((REGULAR, True), (PICOCALC_LYRA, False)): set_platform(platform) canvas = MapCanvas(6, 1) canvas.marker(0, 0, "x", (148, 163, 184)) # markers always draw emboldened @@ -430,7 +430,7 @@ def test_font_script_marks_and_fontset_move_together() -> None: def test_specimen_renders_clean_on_picocalc() -> None: - """`meshterm specimen` obeys on picocalc every contract it demonstrates. + """`meshterm specimen` obeys on picocalc-lyra every contract it demonstrates. At most 53 cells per line, 16-slot SGR only, and console-font characters only. """ @@ -440,7 +440,7 @@ def test_specimen_renders_clean_on_picocalc() -> None: from meshterm.ui.specimen import specimen_lines - set_platform(PICOCALC) + set_platform(PICOCALC_LYRA) console = Console( theme=MESH_THEME_16, width=53, @@ -554,7 +554,7 @@ def test_the_mark_the_console_picks_stays_inside_its_font() -> None: from meshterm.ui.logo import load_logo - set_platform(PICOCALC) + set_platform(PICOCALC_LYRA) rows = load_logo(53) assert rows, "the 53-column mark should fit a 53-column console" for i, row in enumerate(rows): @@ -579,7 +579,7 @@ def test_narrow_wordmark_keeps_its_dim_rows_off_the_bright_bank() -> None: from meshterm.ui.logo import load_logo from meshterm.ui.tui.frame import _banner_lines - set_platform(PICOCALC) + set_platform(PICOCALC_LYRA) rows = _banner_lines(load_logo(53), 53) assert rows, "the 53-column mark should fit a 53-column console" dim = [ diff --git a/tests/test_timemachine.py b/tests/test_timemachine.py index 62313c6..1f94455 100644 --- a/tests/test_timemachine.py +++ b/tests/test_timemachine.py @@ -975,10 +975,10 @@ def test_screen_cycles_windows_and_caches(tmp_path: Path) -> None: # The F-key chip is the same behaviour under another name — the only way a platform # that draws no hint line can learn that `w` exists at all. It names the span it takes # you *to*, since the title already says where you are. - assert screen.picocalc_lane[2].label == "all" + assert screen.picocalc_lyra_lane[2].label == "all" screen.handle("window") assert "all time" in screen.title - assert screen.picocalc_lane[2].label == "24 h" # the ring wraps back around + assert screen.picocalc_lyra_lane[2].label == "24 h" # the ring wraps back around def test_picocalc_window_ring_stops_at_30_days() -> None: @@ -987,16 +987,16 @@ def test_picocalc_window_ring_stops_at_30_days() -> None: All time is the one span whose scan grows with the whole history — a desktop affordance (see ``_bind_windows``); the chip cycles the three spans that remain. """ - from meshterm.platforms import PICOCALC, set_platform + from meshterm.platforms import PICOCALC_LYRA, set_platform - set_platform(PICOCALC) + set_platform(PICOCALC_LYRA) screen = TimeMachineScreen( session=_FakeSession(), label="Hub", build=lambda window, width, scope: [] ) assert "7 d" in screen.title # opens on 7 d, as everywhere screen.handle("text", "w") assert "30 d" in screen.title - assert screen.picocalc_lane[2].label == "24 h" # never "all" on this ring + assert screen.picocalc_lyra_lane[2].label == "24 h" # never "all" on this ring screen.handle("window") assert "24 h" in screen.title # wrapped straight past where all time would sit diff --git a/tests/test_tui.py b/tests/test_tui.py index b5887fa..83d3fef 100644 --- a/tests/test_tui.py +++ b/tests/test_tui.py @@ -1053,11 +1053,11 @@ def test_startup_splash_fits_every_platform_width() -> None: the gallery doesn't cover, and it shipped torn there until the narrow mark landed — so this is the gate. """ - from meshterm.platforms import PICOCALC, REGULAR, set_platform + from meshterm.platforms import PICOCALC_LYRA, REGULAR, set_platform from meshterm.ui.logo import load_logo try: - for platform in (REGULAR, PICOCALC): + for platform in (REGULAR, PICOCALC_LYRA): set_platform(platform) cols = platform.readable_cols screen = SelectScreen("Choose a device", [Choice("alpha", 1)]) @@ -3413,7 +3413,7 @@ def test_the_splash_action_rows_share_one_icon_column() -> None: """ from rich.cells import cell_len - from meshterm.platforms import PICOCALC, REGULAR, set_platform + from meshterm.platforms import PICOCALC_LYRA, REGULAR, set_platform from meshterm.ui.device_picker import _ADD_TCP, _QUIT, _action_rows from meshterm.ui.tui import Choice @@ -3425,7 +3425,7 @@ def test_the_splash_action_rows_share_one_icon_column() -> None: } assert len(set(starts().values())) == 1 - set_platform(PICOCALC) + set_platform(PICOCALC_LYRA) try: assert set(starts().values()) == {2}, "the icons go, and no padding stays behind" finally: @@ -3504,7 +3504,7 @@ def test_the_splash_scrolls_the_whole_row_it_is_on() -> None: """ from meshterm.core.device_store import RememberedDevice from meshterm.core.discovery import serial_device - from meshterm.platforms import PICOCALC, REGULAR, set_platform + from meshterm.platforms import PICOCALC_LYRA, REGULAR, set_platform from meshterm.ui.device_picker import _build_items from meshterm.ui.tui import Choice, SelectScreen @@ -3520,7 +3520,7 @@ def test_the_splash_scrolls_the_whole_row_it_is_on() -> None: ) } try: - for platform, width in ((REGULAR, 66), (PICOCALC, 47)): + for platform, width in ((REGULAR, 66), (PICOCALC_LYRA, 47)): set_platform(platform) items = _build_items([radio], registry[radio.stable_id], registry) screen = SelectScreen( @@ -3553,14 +3553,14 @@ def test_the_splash_hint_stays_inside_the_box_it_is_drawn_in() -> None: from rich.cells import cell_len from meshterm.core.discovery import serial_device - from meshterm.platforms import PICOCALC, REGULAR + from meshterm.platforms import PICOCALC_LYRA, REGULAR from meshterm.ui.device_picker import _shortcut_hint from meshterm.ui.tui.select import splice_hint base = "↑↓ move · Enter select · Esc bye" # the splash's own send-off radio = serial_device("COM7", name="A Radio") common = splice_hint(base, _shortcut_hint(0)(radio)) - for platform in (REGULAR, PICOCALC): + for platform in (REGULAR, PICOCALC_LYRA): budget = platform.readable_cols - platform.dialog_margin - 2 assert cell_len(common) <= budget, (platform.name, common) diff --git a/tests/test_vt_console_font.py b/tests/test_vt_console_font.py index bf61b0a..7d4b539 100644 --- a/tests/test_vt_console_font.py +++ b/tests/test_vt_console_font.py @@ -29,7 +29,7 @@ from meshterm.core.config import Settings from meshterm.core.device_store import DeviceStore from meshterm.core.preferences import Preferences, by_group, get_spec from meshterm.persistence.repository import Repository -from meshterm.platforms import PICOCALC, REGULAR, set_platform +from meshterm.platforms import PICOCALC_LYRA, REGULAR, set_platform from meshterm.services import consolefont from meshterm.tools.preferences import PreferencesTool from meshterm.ui.theme import active_theme @@ -53,7 +53,7 @@ class _Recorder: @pytest.fixture def device(monkeypatch: pytest.MonkeyPatch) -> _Recorder: """Make the process look like MeshTerm running on the handheld's own VT.""" - set_platform(PICOCALC) + set_platform(PICOCALC_LYRA) monkeypatch.setattr(os, "ttyname", lambda fd: "/dev/tty1", raising=False) monkeypatch.setattr(consolefont.shutil, "which", lambda name: "/usr/bin/setfont") recorder = _Recorder() @@ -204,14 +204,14 @@ def test_a_failed_remember_leaves_nothing_to_restore( def test_the_preference_is_offered_on_the_handheld_only() -> None: """A row about hardware the desktop does not have is a question it cannot answer.""" spec = get_spec("console_font") - assert spec.offered_on("picocalc") is True + assert spec.offered_on("picocalc-lyra") is True assert spec.offered_on("regular") is False # Everything else is offered everywhere; the gate is the exception, not the rule. gated = {s.key for _, specs in by_group() for s in specs if s.platforms is not None} assert gated == {"console_font"} -@pytest.mark.parametrize("platform", [REGULAR, PICOCALC]) +@pytest.mark.parametrize("platform", [REGULAR, PICOCALC_LYRA]) def test_the_preference_round_trips_on_every_platform(tmp_path: Path, platform: Any) -> None: """A file written on the handheld loads, keeps its value, and saves back on a desktop.""" set_platform(platform) @@ -232,7 +232,7 @@ def test_the_page_draws_the_row_on_the_handheld_and_not_on_the_desktop() -> None """The gate's one visible effect: a Display row that exists on one platform.""" from meshterm.ui.preferences import _menu_items - set_platform(PICOCALC) + set_platform(PICOCALC_LYRA) _, items = _menu_items(Preferences(), {}) assert "console_font" in [getattr(item, "value", None) for item in items] diff --git a/tests/test_walk.py b/tests/test_walk.py index fd46d1e..86cb087 100644 --- a/tests/test_walk.py +++ b/tests/test_walk.py @@ -394,7 +394,7 @@ def test_walk_locate_refocuses_us_and_home_end_walk_the_list() -> None: def test_walk_echoes_the_find_query_above_the_matches_it_narrows() -> None: """The PicoCalc draws no hint line, so the query it carries moves into the body.""" - from meshterm.platforms import PICOCALC, REGULAR, set_platform + from meshterm.platforms import PICOCALC_LYRA, REGULAR, set_platform try: set_platform(REGULAR) @@ -405,7 +405,7 @@ def test_walk_echoes_the_find_query_above_the_matches_it_narrows() -> None: body = _plain(desktop.render_body(80)) assert "/al" not in body and "find: al" in desktop.footer_hint - set_platform(PICOCALC) + set_platform(PICOCALC_LYRA) device = _screen(_topo()) device.render_body(53) for ch in "al": @@ -428,11 +428,11 @@ def test_walk_echoes_the_find_query_above_the_matches_it_narrows() -> None: def test_walk_fkey_lane_gives_you_its_own_slot_over_the_pagers_ends() -> None: """``You`` is a verb of this screen (F3), not an end of the list the pager scrolls.""" - from meshterm.ui.tui.fkeys import PICOCALC_DECK + from meshterm.ui.tui.fkeys import PICOCALC_LYRA_DECK screen = _screen(_topo()) screen.render_body(80) - lane = screen.picocalc_lane + lane = screen.picocalc_lyra_lane assert [pair.label if pair else None for pair in lane] == [ None, @@ -441,26 +441,26 @@ def test_walk_fkey_lane_gives_you_its_own_slot_over_the_pagers_ends() -> None: "Page ↓", "Page ↑", ] - assert PICOCALC_DECK.action_for(lane, 3) == "locate" + assert PICOCALC_LYRA_DECK.action_for(lane, 3) == "locate" assert lane[2].opp_label == "" # nothing is the opposite of going home # And the pager's Shift bank means what it means everywhere else: the list's two ends. - assert lane[4].opp_label == "Top" and PICOCALC_DECK.action_for(lane, 10) == "home" - assert lane[3].opp_label == "Bottom" and PICOCALC_DECK.action_for(lane, 9) == "end" + assert lane[4].opp_label == "Top" and PICOCALC_LYRA_DECK.action_for(lane, 10) == "home" + assert lane[3].opp_label == "Bottom" and PICOCALC_LYRA_DECK.action_for(lane, 9) == "end" def test_walk_you_dims_once_the_focus_is_already_us() -> None: """Dim says *a thing here, just not right now* — there is nowhere to come back from.""" screen = _screen(_topo()) screen.render_body(80) - assert screen.picocalc_lane[2].enabled is False # opens on us, trail of one + assert screen.picocalc_lyra_lane[2].enabled is False # opens on us, trail of one screen.handle("enter") # walked away: now there is - assert screen.picocalc_lane[2].enabled is True + assert screen.picocalc_lyra_lane[2].enabled is True screen.handle("locate") - assert screen.picocalc_lane[2].enabled is False + assert screen.picocalc_lyra_lane[2].enabled is False screen.handle("text", "a") # a find narrows the list off our own neighbours too - assert screen.picocalc_lane[2].enabled is True + assert screen.picocalc_lyra_lane[2].enabled is True def test_walk_the_fan_is_all_east_and_holds_no_came_from() -> None: diff --git a/tests/test_watchtower.py b/tests/test_watchtower.py index 549b75b..73fc454 100644 --- a/tests/test_watchtower.py +++ b/tests/test_watchtower.py @@ -345,7 +345,7 @@ def test_watchtower_actions_start_every_label_in_the_same_cell() -> None: from rich.cells import cell_len from meshterm.core.watch_store import Alert - from meshterm.platforms import PICOCALC, REGULAR, set_platform + from meshterm.platforms import PICOCALC_LYRA, REGULAR, set_platform from meshterm.ui.watchtower_screen import _ACK_ALL, _CLEAR, _TOGGLE_NEW, _WATCH, _menu_items assert {cell_len("✓"), cell_len("⭐")} == {1, 2}, "a list of one icon width proves nothing" @@ -361,7 +361,7 @@ def test_watchtower_actions_start_every_label_in_the_same_cell() -> None: } assert set(_word_starts(_menu_items(alerts, {}, True), words).values()) == {3} try: - set_platform(PICOCALC) + set_platform(PICOCALC_LYRA) assert set(_word_starts(_menu_items(alerts, {}, True), words).values()) == {0} finally: set_platform(REGULAR) @@ -375,14 +375,14 @@ def test_node_rules_start_every_label_and_value_in_the_same_cell() -> None: here too: whatever the icon column measures, the values stay in one column. """ from meshterm.core.watch_store import WatchedNode - from meshterm.platforms import PICOCALC, REGULAR, set_platform + from meshterm.platforms import PICOCALC_LYRA, REGULAR, set_platform from meshterm.ui.watchtower_screen import _rule_items entry = WatchedNode(key="a1" * 6, name="Roof", silence_hours=12, snr_watch=True) words = {"silence": "Silence", "snr": "SNR", "unwatch": "Stop"} values = {"silence": "after 12 h", "snr": "on"} try: - for platform, start in ((REGULAR, 3), (PICOCALC, 0)): + for platform, start in ((REGULAR, 3), (PICOCALC_LYRA, 0)): set_platform(platform) items = _rule_items(entry) assert set(_word_starts(items, words).values()) == {start}