nandi/frqpublic Fork 0
2085edc
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.

Count a wrapped row without Math, which common/ cannot have

`terminal-draft-rows` reached for `Math/ceil`, and common/ is compiled twice:
ClojureDart has no java.lang.Math, so the phone stopped building the moment
the shared chat screen grew a compose bar that measures itself. The same
edge `frq.clock` spells floor-div out for, and `frq.io` has utf8-bytes for.

Ceiling division is integer arithmetic anyway — (n + cols - 1) quot cols —
so this drops the float on the way as well, and nothing rounds a line the
wrong way at the boundary. Same rows out: the headless terminal draws the
one-row bar it drew before.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
nandi committed 2026-09-12T00:19:06-07:00 Browse files
2085edc parent: dd67233
modified common/frq/screens/chat.cljc +5 -1
@@ -65,7 +65,11 @@
6565 nowhere to go."
6666 []
6767 (let [cols (max 20 (quot (- @cells/window-width (* 22 8)) 8))
68- wrapped (fn [line] (max 1 (long (Math/ceil (/ (count line) (double cols))))))]
68+ ;; Ceiling division, written out: `Math/ceil` is Java and there is no
69+ ;; Math under ClojureDart — the same reason `frq.clock` spells out
70+ ;; floor-div. Integers throughout, so no float rounds a line the wrong
71+ ;; way at the boundary either.
72+ wrapped (fn [line] (max 1 (quot (+ (count line) cols -1) cols)))]
6973 (min draft-max-rows
7074 (max 1 (reduce + (map wrapped (str/split-lines (or @cells/draft ""))))))))
7175
@@ -65,7 +65,11 @@
65 nowhere to go."65 nowhere to go."
66 []66 []
67 (let [cols (max 20 (quot (- @cells/window-width (* 22 8)) 8))67 (let [cols (max 20 (quot (- @cells/window-width (* 22 8)) 8))
68- wrapped (fn [line] (max 1 (long (Math/ceil (/ (count line) (double cols))))))]68+ ;; Ceiling division, written out: `Math/ceil` is Java and there is no
69+ ;; Math under ClojureDart — the same reason `frq.clock` spells out
70+ ;; floor-div. Integers throughout, so no float rounds a line the wrong
71+ ;; way at the boundary either.
72+ wrapped (fn [line] (max 1 (quot (+ (count line) cols -1) cols)))]
69 (min draft-max-rows73 (min draft-max-rows
70 (max 1 (reduce + (map wrapped (str/split-lines (or @cells/draft ""))))))))74 (max 1 (reduce + (map wrapped (str/split-lines (or @cells/draft ""))))))))
71 75