From 25f1b42b15e041c88067176823e8f23bd259ebd3 Mon Sep 17 00:00:00 2001 From: Jean-Pierre Martineau Date: Fri, 20 Nov 2026 17:00:23 -0500 Subject: [PATCH] Demo world gets a #mcoimg channel; the screenshot tour captures it The demo device holds #mcoimg in slot 4: a short talk about pixel art around three images, the real 30x30 woodpecker last so the chat opens on it. The tour saves it as mcoimg.png after the map, waiting on the channel's title, which every set draws. Co-Authored-By: Claude Opus 5.5 --- meshterm/demo/script.py | 22 ++++++++++++++++++++++ meshterm/demo/world.py | 4 +++- scripts/screenshots.py | 16 +++++++++++++++- 3 files changed, 40 insertions(+), 2 deletions(-) diff --git a/meshterm/demo/script.py b/meshterm/demo/script.py index 7a97bdd..38be42c 100644 --- a/meshterm/demo/script.py +++ b/meshterm/demo/script.py @@ -64,6 +64,19 @@ class Line: #: The sender name of our own lines. ME = SELF.name +#: The pixel images (MCOimg) of the ``#mcoimg`` channel. The woodpecker is a real image +#: from an MCOimg encoder (30 x 30, 74 bytes). The leaf and the smiley are not compressed: +#: the small encoder of ``tests/test_mcoimg.py`` made them. +WOODPECKER = ( + 'im3:J!jBVY"9UPkugAX54#9BX:e"FM|cL0G|IS.@$q^=N:4D*B9d1d$450M>W/tOqmq`wqd..bJp|}' + "d/4v2vpi5BAZ9wD/B" +) +MAPLE_LEAF = ( + 'im3:g/U"eLAAAAAAAAC"BAAAAA5JAAAA_98(AA|;umiCv(umb$1I~lb$O=2AB=0maToIumb$8(umb$O=:EY' + "$O=0mDAumb$NAAAumbAAAAAYAAAAA@QAAAAAAAAAAA" +) +SMILEY = 'im3:g/U"aLdZSA%ZpL[c%Z>M5wqOW0Dz9Z3BfzEA' + #: The channel conversations, by channel name, oldest line first. CHANNEL_LINES: dict[str, tuple[Line, ...]] = { "Public": ( @@ -227,6 +240,15 @@ CHANNEL_LINES: dict[str, tuple[Line, ...]] = { Line(at(0, "08:15"), "Léa", "It's 2 degrees this morning, dress warm!"), Line(at(0, "08:18"), ME, "Too late, I'm already outside 🥶"), ), + "#mcoimg": ( + Line(at(2, "19:05"), "Noor", "Is this the channel for the pixel art?"), + Line(at(2, "19:09"), "Kim-NDG", "Yes! Images go here, so that Public stays readable"), + Line(at(0, "08:50"), ME, MAPLE_LEAF), + Line(at(0, "09:10"), "Marie-Ève", "Nice leaf 🍁"), + Line(at(0, "10:20"), "Noor", SMILEY), + Line(at(0, "11:05"), "Kim-NDG", "Pileated woodpecker on Mont-Royal this morning!"), + Line(at(0, "11:06"), "Kim-NDG", WOODPECKER), + ), } #: The direct conversations, by the name of the other node, oldest line first. diff --git a/meshterm/demo/world.py b/meshterm/demo/world.py index c3d51ce..a98d293 100644 --- a/meshterm/demo/world.py +++ b/meshterm/demo/world.py @@ -610,12 +610,14 @@ class Channel: #: The channels of the demo device. ``Family`` is a private channel, with a fixed secret -#: that is not derived from its name. +#: that is not derived from its name. ``#mcoimg`` carries pixel images (MCOimg), so that +#: the screenshots can show how the chat draws them. CHANNELS: tuple[Channel, ...] = ( Channel(0, "Public", DEFAULT_PUBLIC_SECRET), Channel(1, "#montreal", derive_secret("#montreal"), scope="yul"), Channel(2, "#cycling", derive_secret("#cycling")), Channel(3, "Family", hashlib.sha256(b"meshterm-demo/Family").digest()[:16]), + Channel(4, "#mcoimg", derive_secret("#mcoimg")), ) #: Hashtag channels that other people of the mesh use and our device does not have. Our diff --git a/scripts/screenshots.py b/scripts/screenshots.py index b5253ac..c069ced 100644 --- a/scripts/screenshots.py +++ b/scripts/screenshots.py @@ -6,7 +6,8 @@ The script runs MeshTerm three times, one time for each set: ``terminal`` (the desktop, in an 80×24 terminal), ``cardputer-zero``, and ``picocalc-lyra``. Each run uses ``--demo`` (refer to :mod:`meshterm.demo`) and types the same keys: it opens the chat on Public, -the paths of a message, and the map, and it saves each screen as a PNG. The result is +the paths of a message, the map, and the pixel images of the ``#mcoimg`` channel, and it +saves each screen as a PNG. The result is ``DIR//.png`` (``DIR`` is ``docs/screenshots`` by default). The script also draws each wordmark of the startup splash (``meshterm/assets/splash``) as @@ -361,6 +362,19 @@ def _tour(capture: Capture, type_text: Callable[[str], None], save: Callable[[st press("enter") capture.settle(quiet=4.0, timeout=120.0) save("map") + # The pixel images of the #mcoimg channel, from the main menu. + press(text="w", ctrl=True) + capture.settle(quiet=0.8) + press("escape") + typed("chat") + press("enter") + capture.wait_for("Public") + capture.settle() + typed("mcoimg") + press("enter") + capture.wait_for("#mcoimg") + capture.settle(quiet=1.5) + save("mcoimg") # --------------------------------------------------------------------------- drawing