From 24b769087064c79a476a12099f665c0124b136d0 Mon Sep 17 00:00:00 2001 From: Jean-Pierre Martineau Date: Thu, 19 Nov 2026 22:49:23 -0500 Subject: [PATCH] The pixel image preference is show_mcoimg Renamed from chat_images, which no released version ever had, so the old name is not retired. Co-Authored-By: Claude Opus 5.5 --- CLAUDE.md | 2 +- meshterm/core/preferences.py | 2 +- meshterm/ui/chat.py | 6 +++--- meshterm/ui/pixelart.py | 2 +- tests/test_chat.py | 6 +++--- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 422fea3..8956a55 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -328,7 +328,7 @@ deliberately, one at a time, and say why in the code. and URL can't share the frame the code is whole at the top and the URL a page down. A picked message that is a pixel image (MCOimg, `ui/pixelart.py`) opens its image on the same bare frame instead, grown by a whole number to fill it (`ImageScreen`; the chip - reads `Image`, the hint `^U image`); with `chat_images` off, that is the only view. + reads `Image`, the hint `^U image`); with `show_mcoimg` off, that is the only view. A chat message's links open there too, on every platform: ^U on the picked message, 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 diff --git a/meshterm/core/preferences.py b/meshterm/core/preferences.py index 94b07e6..0bf7f3a 100644 --- a/meshterm/core/preferences.py +++ b/meshterm/core/preferences.py @@ -600,7 +600,7 @@ PREFERENCES: tuple[PrefSpec, ...] = ( unit="s", ), PrefSpec( - key="chat_images", + key="show_mcoimg", label="Chat images", help="Draw the pixel images of messages. Off: ^U shows one", group="Display", diff --git a/meshterm/ui/chat.py b/meshterm/ui/chat.py index 03fa4b3..efb7639 100644 --- a/meshterm/ui/chat.py +++ b/meshterm/ui/chat.py @@ -393,7 +393,7 @@ class ChatScreen(Screen): self._render_cache: dict | None = None # The clock tolerance of the last render: which times show as corrected. self._tolerance_s = clock_tolerance_s() - # Whether the last render drew the pixel images (the ``chat_images`` preference). + # Whether the last render drew the pixel images (the ``show_mcoimg`` preference). self._show_images = True # Strong references to the sends, resends, and spinner tickers that a key handler # starts. The event loop holds only a *weak* reference. Thus the garbage collector @@ -684,7 +684,7 @@ class ChatScreen(Screen): locks = self._pages.locked_keys() if self._pages is not None else frozenset() tolerance = clock_tolerance_s() self._tolerance_s = tolerance - images = bool(preferences.current().chat_images) + images = bool(preferences.current().show_mcoimg) self._show_images = images if ( cache is not None @@ -1367,7 +1367,7 @@ class ChatScreen(Screen): """Show the pixel image of the selected message on a bare frame (^U). The image is as large as the frame permits (refer to - :class:`~meshterm.ui.pixelart.ImageScreen`). When the ``chat_images`` preference is + :class:`~meshterm.ui.pixelart.ImageScreen`). When the ``show_mcoimg`` preference is off, this is the way to see an image. When it is on, this is the large view. Returns: diff --git a/meshterm/ui/pixelart.py b/meshterm/ui/pixelart.py index 95b1b30..da278e0 100644 --- a/meshterm/ui/pixelart.py +++ b/meshterm/ui/pixelart.py @@ -12,7 +12,7 @@ but an image that is cut loses more: the user sees only a part of it. On the picked message, ^U opens the image on a bare frame (:class:`ImageScreen`). There it becomes as large as the frame permits, by a whole number, so each pixel stays square. When -the ``chat_images`` preference is off, the chat shows only the line about the image, and +the ``show_mcoimg`` preference is off, the chat shows only the line about the image, and ^U is the way to see it. """ diff --git a/tests/test_chat.py b/tests/test_chat.py index aa84a0b..97111a5 100644 --- a/tests/test_chat.py +++ b/tests/test_chat.py @@ -991,13 +991,13 @@ def test_a_pixel_image_shows_a_short_line_not_its_text() -> None: assert lines[1].strip() and set(lines[1].strip()) <= set("▀▄█") -def test_with_chat_images_off_the_image_is_behind_ctrl_u(monkeypatch) -> None: - """With ``chat_images`` off, only the line shows, and ^U on the picked image opens it.""" +def test_with_show_mcoimg_off_the_image_is_behind_ctrl_u(monkeypatch) -> None: + """With ``show_mcoimg`` off, only the line shows, and ^U on the picked image opens it.""" from meshterm.core import preferences from meshterm.ui.pixelart import ImageScreen prefs = preferences.Preferences() - prefs.set("chat_images", False) + prefs.set("show_mcoimg", False) monkeypatch.setattr(preferences, "current", lambda: prefs) text = "im3:g/5WjAL`NA" messages = [ChatMessage(text=text, peer="d4e5f6a7")]