The full-screen image shows the message's im3: string under its caption
The ^U view now shows the text the sender transmitted, as a centred block under the caption, so it can be examined or copied. The string never shrinks the image below its own size: when both cannot fit, the image keeps the rows and the string goes a page down, as a large QR code's URL does. A test now pins that ^U opens the view with images shown too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
24b7690870
commit
2f2225b8bb
4 files changed
+95
-13
No files matched your search
@@ -991,6 +991,35 @@ 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_show_mcoimg_on_ctrl_u_still_opens_the_full_screen(monkeypatch) -> None:
|
||||
"""With the image in the transcript, ^U on the picked image opens the full screen too."""
|
||||
from meshterm.core import preferences
|
||||
from meshterm.ui.pixelart import ImageScreen
|
||||
|
||||
prefs = preferences.Preferences()
|
||||
monkeypatch.setattr(preferences, "current", lambda: prefs)
|
||||
text = "im3:g/5WjAL`NA"
|
||||
session = _StubSession()
|
||||
opened = []
|
||||
|
||||
async def run_screen(screen): # noqa: ANN001, ANN202
|
||||
opened.append(screen)
|
||||
|
||||
session.run_screen = run_screen
|
||||
screen = _screen(session, send=None, messages=[ChatMessage(text=text, peer="d4e5f6a7")])
|
||||
screen._render_grouped(60)
|
||||
screen._selected = 0
|
||||
assert "^U image" in screen.footer_hint
|
||||
|
||||
async def press() -> None:
|
||||
screen.handle("url_code")
|
||||
await asyncio.sleep(0)
|
||||
|
||||
asyncio.run(press())
|
||||
assert len(opened) == 1 and isinstance(opened[0], ImageScreen)
|
||||
assert opened[0].raw == text
|
||||
|
||||
|
||||
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
|
||||
|
||||
Reference in new issue
Block a user