On the Cardputer, a link's code is on ^U, as on the desktop

Its 14 rows can't spare a code under every message that carries a link,
so it keeps url_codes off and reaches a link's code the desktop's way,
on the share screen. Its braille code is small enough that a link and its
code share the panel. A test pins all three: no code under the message,
QR on the lane's Shift bank, and the share screen inside 53x14.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jean-Pierre MartineauandClaude Opus 5.5 committed 2026-10-02 00:18:33 -04:00
1 parent 8755adc6f8
commit cd68498feb
2 files changed
+27 -1

No files matched your search

+3 -1
View File
@@ -253,7 +253,9 @@ deliberately, one at a time, and say why in the code.
and with several, one code at a time that ←→ step through, clamped. That screen's URL
line is flanked `←`/`→`, lit toward another code and dim at an end — the one mark the
bare frame carries beyond the code and its URL, because nothing else could say the
others are there.
others are there. On the Cardputer it is the *only* way to a link's code, as on the
desktop: its 14 rows have none to spare under every message that carries one, and its
braille code is small enough that a link and its code share the panel.
Two codes sit inline instead: a ` ```qr ` fence in a written page, where the code is an
illustration drawn in the prose where the fence is, and — on the PicoCalc alone
(`Platform.url_codes`) — a chat message's URLs, each drawn as a code under the message
+24
View File
@@ -2530,3 +2530,27 @@ def test_ctrl_u_is_named_only_on_a_picked_message_with_a_link() -> None:
for screen in (linked, direct, scoped):
assert "^U QR" in screen.footer_hint
assert len(screen.footer_hint) <= 72, screen.footer_hint
def test_on_the_cardputer_a_link_takes_the_share_screen_as_on_the_desktop() -> None:
"""Its 14 rows can't spare a code under every message, so ^U is the way to one.
No code hangs under the message, the lane deals QR on its Shift bank (Shift+Fn+5),
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.ui.qr import QrScreen
set_platform(CARDPUTER)
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"
share = QrScreen(url, title="Links")
share.note_viewport(14)
lines = _strip_ansi(share.render_body(53)).splitlines()
assert len(lines) <= 14 and lines[-1].strip() == url
assert _code_rows(lines), "the code is braille, one module a dot"