nandi/frqpublic Fork 0
0623590
Commits
Clone
git clone https://git.rickub.com/nandi/frq.git
git clone ssh://git@rickub.com/nandi/frq.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

Keep a picture to twelve rows of a terminal

The window gives a preview four fifths of its height, because the
pictures that arrive here are mostly phone screenshots and it is their
height that binds. Four fifths of a terminal is a conversation with one
message in it: the rows a picture takes are rows that cannot hold a line,
and there are twenty of them, not a thousand.

Twelve is enough to see what a picture is of, and to decide whether to
open it — which is what the preview is for either way.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
nandi committed 2026-09-03T01:30:09-07:00 Browse files
0623590 parent: 25a3f7b
modified src/frq/app.jolt +11 -2
@@ -632,10 +632,19 @@
632632
633633 Clamped at both ends, and falling back to the old fixed height until the
634634 first poll has landed: a preview is a preview either way, and the lightbox
635- is what full size is for."
635+ is what full size is for.
636+
637+ A terminal gets less of its screen, and a hard ceiling on top of that. Four
638+ fifths of a window is a picture you look at; four fifths of a terminal is a
639+ conversation with one message in it, and the rows a picture takes are rows
640+ that cannot hold a line. Twelve of them is enough to see what a picture is
641+ of, and to decide whether to open it."
636642 []
637643 (let [h @s/window-height]
638- (if (pos? h) (min 900 (max 240 (long (* 0.8 h)))) 260)))
644+ (cond
645+ (not (pos? h)) 260
646+ @terminal? (max 80 (min 192 (long (* 0.4 h))))
647+ :else (min 900 (max 240 (long (* 0.8 h)))))))
639648
640649 (defn- preview-width
641650 "How wide a picture in the conversation may be.
@@ -632,10 +632,19 @@
632 632
633 Clamped at both ends, and falling back to the old fixed height until the633 Clamped at both ends, and falling back to the old fixed height until the
634 first poll has landed: a preview is a preview either way, and the lightbox634 first poll has landed: a preview is a preview either way, and the lightbox
635- is what full size is for."635+ is what full size is for.
636+
637+ A terminal gets less of its screen, and a hard ceiling on top of that. Four
638+ fifths of a window is a picture you look at; four fifths of a terminal is a
639+ conversation with one message in it, and the rows a picture takes are rows
640+ that cannot hold a line. Twelve of them is enough to see what a picture is
641+ of, and to decide whether to open it."
636 []642 []
637 (let [h @s/window-height]643 (let [h @s/window-height]
638- (if (pos? h) (min 900 (max 240 (long (* 0.8 h)))) 260)))644+ (cond
645+ (not (pos? h)) 260
646+ @terminal? (max 80 (min 192 (long (* 0.4 h))))
647+ :else (min 900 (max 240 (long (* 0.8 h)))))))
639 648
640 (defn- preview-width649 (defn- preview-width
641 "How wide a picture in the conversation may be.650 "How wide a picture in the conversation may be.