1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
|
(ns frq.hiccup
"glimmer's hiccup, painted by Flutter.
This is a backend, not a port. `frq.app` is 1,834 lines of
`[:vbox {:spacing 6} ...]` over about twenty tags, and it names no toolkit
anywhere — the same trick `frq.cosmic` and `frq.tui` rely on, where the
components do not know what is under the reconciler. So the screens do not
get rewritten for the phone; this interprets them.
The tags are glimmer's and so is the styling: every arm below is what
`crates/jolt-cosmic` asks libcosmic for, in `frq.theme`'s tokens. `:title` is
title3 and `:title-2` is title4; `:card` is Container::Card — padding 12,
spacing 8, a surface a step from the background rather than an elevation,
because COSMIC does not float things; `:button` is suggested, destructive or
standard; `:dim-label` is the caption class, which is the body colour stepped
back rather than a colour of its own.
Material is underneath and deliberately not visible. No elevation, no ripple
shadows, no Material 3 pill heights — a screen laid out against libcosmic's
4/8/12/16/24 spacing lands at the same proportions here.
What this does NOT do is glimmer's reconciliation. glimmer patches the tree
it painted last; Flutter rebuilds from the top and diffs its own element
tree, which is the same job done by the framework instead of by us. The cost
is that a cell firing rebuilds the whole screen rather than the subtree that
read it — fine at this size, and the thing to revisit if a message list ever
feels it."
(:require ["dart:io" :as io]
["package:flutter/material.dart" :as m]
[cljd.flutter :as f]
[frq.theme :as t]))
(defn- width-of
"A `:width-request`, or nil when there is none to honour.
Zero means no request, not a width of nothing — the chat screen writes
`(if show-users? (messages-width) 0)` and every number is truthy in Clojure,
so taking it at face value gave the message list a SizedBox of zero and an
empty screen."
[p]
(let [w (:width-request p)]
(when (and (number? w) (pos? w)) (double w))))
(defn- dbl [x default]
(cond (number? x) (double x)
:else default))
;; ------------------------------------------------------------- text entry
(defonce ^:private controllers
;; TextEditingController per `:key`, because a controller made during a build
;; is a new one every rebuild — the cursor jumps to the start and the
;; selection is lost on the keystroke after it.
;;
;; Keyed rather than positional: glimmer's own reconciler matches children by
;; `:key` for the same reason, and an entry that moves in the tree should
;; keep what is typed in it.
(atom {}))
(defn- controller-for [k text]
(let [k (or k ::anonymous)
c (or (get @controllers k)
(let [c (m/TextEditingController .text (or text ""))]
(swap! controllers assoc k c)
c))]
;; Only when it differs, and never while it would move the caret: the cell
;; is the authority for what the entry says, but the person typing is the
;; authority for where they are in it.
(when (and text (not= text (.-text c)))
(set! (.-text c) text))
c))
;; ------------------------------------------------------------------ props
(defn- props [node]
(let [p (second node)] (if (map? p) p {})))
(defn- body [node]
(let [p (second node)] (if (map? p) (drop 2 node) (drop 1 node))))
(declare render fills-row?)
(defn- expand
"A component vector reduced to the tags it produces.
`[chat-screen]` is a function, and asking whether it fills means calling it —
the root wraps every screen in a plain `:vbox`, and without this the wrapper
could not see that the screen inside it wants the whole height. Expanded
once and both asked and rendered, so the component runs once either way."
[node]
(if (and (vector? node) (seq node) (not (keyword? (first node))))
(expand (apply (first node) (rest node)))
node))
(defn- fills-row?
"Whether a node takes the width its row has left over.
jolt-cosmic gives an entry Length::Fixed(w) when it has a width and
Length::Fill otherwise; Fill in a Row is Flutter's Expanded. A TextField that
is neither is offered unbounded width, which is a layout error."
[node]
(and (vector? node)
(= :entry (first node))
(let [p (second node)]
(or (not (map? p)) (nil? (width-of p)) (:hexpand p)))))
(declare body)
(defn- prose?
"Whether a subtree is prose — text that should wrap — rather than controls.
The distinction matters because of what Flexible does: it hands every such
child an equal share of the row, and a child whose natural size is larger
then shrinks into it. That is right for a message body, which wraps to fit,
and wrong for a button, whose label then wraps down the middle of the word.
A header of four buttons came out reading Ch/at/s."
[node]
(cond
(seq? node) (boolean (some prose? node))
(not (vector? node)) false
:else
(let [tag (first node)]
(cond
(contains? #{:button :entry :checkbutton :image :avatar :emoji :reaction} tag) false
(contains? #{:label :dim-label :text :title :title-2 :link} tag) true
(contains? #{:vbox :hbox :card} tag)
(let [kids (let [p (second node)] (if (map? p) (drop 2 node) (drop 1 node)))]
(and (some prose? kids)
(not (some #(and (vector? %)
(contains? #{:button :entry :checkbutton} (first %)))
kids))))
:else false))))
(defn- flexes-in-row?
"Whether a node should be given the width a row has left, loosely.
iced wraps a line of text at whatever width is available; Flutter's Text in
an unbounded Row does not wrap at all, and the longest message then decides
the width of the conversation and overflows off the right. So prose in a row
is Flexible — it takes what is there and wraps inside it, rather than
insisting on it the way Expanded does."
[node]
(prose? node))
;; What was last done with each `:scroll-key`.
;;
;; The controller itself is not here — it belongs to the widget, see `:scroll`
;; below. This outlives it on purpose: whether a reader had been taken to the
;; end is a fact about the conversation, not about the widget currently
;; showing it, and it has to survive the rebuild that replaces one.
(defonce ^:private scroll-marks (atom {}))
(defn- end-ward!
"Put `k` at the end after this frame, when it should be.
Two reasons to, and they are not the same reason. The token — what the
screen passes as `:scroll-to-bottom`, which is `jump-tick` — changing means
someone asked to be taken to the present. Already being at the end means new
lines should push the view along rather than pile up below it, which is what
a conversation does and the whole reason a chat opens at the bottom.
And not otherwise: someone reading back through the backlog is at neither,
and yanking them to the end as each message arrives is the one behaviour
worse than not following at all.
After the frame, because the extent being scrolled to is the height of
content that has not been laid out yet at the point this is called."
[k ctrl token]
(let [mark (get @scroll-marks k ::fresh)
pos (when (.-hasClients ctrl) (.-position ctrl))
at-end (or (= mark ::fresh)
(nil? pos)
(>= (.-pixels pos) (- (.-maxScrollExtent pos) 24.0)))]
(when (or (not= mark token) at-end)
(swap! scroll-marks assoc k token)
(.addPostFrameCallback
(.-instance m/WidgetsBinding)
(fn [_]
(when (.-hasClients ctrl)
(.jumpTo ctrl (.-maxScrollExtent (.-position ctrl)))))))))
(defn- fills-column?
"Whether a node takes the height its column has left over.
`:fill-height` is Length::Fill down the other axis — Expanded, not a taller
mainAxisSize. A `:scroll` fills by definition; it is what the space is left
over *for*.
And it is recursive, which is the part that is easy to miss: a plain `:vbox`
holding a `:scroll` fills too, because the scroll inside it needs a height
and a column sized to its contents hands its children an unbounded one. The
chat screen is three such wrappers deep, and each one has to pass the
question up or the innermost Expanded lands in unbounded space —
\"RenderFlex children have non-zero flex but incoming height constraints are
unbounded\", which paints nothing."
[node]
(and (vector? node)
(let [tag (first node)
p (second node)]
(or (contains? #{:scroll :page} tag)
(and (map? p) (:fill-height p))
;; A `:page` fills for the same reason a `:scroll` does — it is
;; one — but it does not pass the question *up* from its
;; children, because nothing inside a scroll can take what is
;; left of a height the scroll does not have. Sized to its
;; contents instead, a page overflows the moment the viewport
;; shrinks under it, which on a phone is every time the keyboard
;; opens.
;;
;; `:hbox` is in the list for the chat screen: its message band is
;; a fill-height column sitting in a row beside the people panel,
;; so the row must be given a height before the column can take
;; what is left of it.
(and (contains? #{:vbox :card :hbox} tag)
(boolean (some #(fills-column? (expand %)) (body node))))))))
(defn- children
"Flatten seqs, drop nils. `(for [...] ...)` in a component yields a seq in
the child position and glimmer splices it; so does this."
[nodes]
(persistent!
(reduce (fn [acc n]
(cond (nil? n) acc
(seq? n) (reduce conj! acc (children n))
:else (conj! acc (render n))))
(transient []) nodes)))
;; ------------------------------------------------------------------ text
(defn- flexed
"Children of a Flex, with the ones that fill wrapped in Expanded.
`fills?` says which, so a Row asks about width and a Column about height."
[fills? nodes]
(persistent!
(reduce (fn [acc n0]
(let [n (expand n0)]
(cond (nil? n) acc
(seq? n) (reduce conj! acc (flexed fills? n))
(fills? n) (conj! acc (m/Expanded .child (render n)))
;; A pane that fills the column takes the row's width too:
;; the message list sits in a row beside the people panel,
;; and left to its natural width it is as wide as its
;; longest line — which is one URL and a screen and a half
;; of overflow.
(and (identical? fills? fills-row?) (fills-column? n))
(conj! acc (m/Expanded .child (render n)))
(and (identical? fills? fills-row?) (flexes-in-row? n))
(conj! acc (m/Flexible .child (render n)))
:else (conj! acc (render n)))))
(transient []) nodes)))
(defn- txt
[ctx s size color & {:keys [weight]}]
(m/Text (str s)
.style (m/TextStyle .fontSize size
.color color
.height 1.35
.fontWeight (or weight m/FontWeight.w400))))
;; ---------------------------------------------------------------- buttons
(defn- cosmic-button
"libcosmic's three button classes. Filled accent for suggested, filled red
for destructive, and a component-coloured fill for standard — COSMIC's
standard button is a filled surface, not an outline."
[ctx p on]
;; `:kind` carries a keyword in frq.app's own hiccup — `:kind :primary` —
;; and a string was what this compared against, so the connect screen's
;; Connect button came out standard. Both spellings, since `:primary true`
;; is also written.
(let [k (:kind p)
kind (cond (or (:destructive p) (= :destructive k) (= "destructive" k))
:destructive
(or (:primary p) (= :primary k) (= "primary" k))
:suggested
:else :standard)
bg (case kind
:suggested t/accent
:destructive t/destructive
t/component)
;; COSMIC names the foreground for each role, and for this theme both
;; accent.on and destructive.on are black — a cream accent with white
;; text on it is unreadable, which is exactly what guessing produced.
fg (case kind
:suggested t/on-accent
:destructive t/on-destructive
t/on-bg)]
(m/Material
.color bg
.borderRadius (m/BorderRadius.circular t/radius-m)
.child (m/InkWell
.borderRadius (m/BorderRadius.circular t/radius-m)
.onTap (when on #(on))
.child (m/Padding
.padding (m/EdgeInsets.symmetric .horizontal t/space-s
.vertical t/space-xxs)
.child (txt ctx (:label p "") t/text-body fg
:weight m/FontWeight.w500))))))
;; ----------------------------------------------------------------- widget
(defn- render-tag [tag node]
(f/widget
:context ctx
(let [p (props node)
kids (children (body node))
;; One column builder for every container, so the rule about what
;; fills is applied in one place: children that take what is left are
;; wrapped, and a column holding one asks for the whole height rather
;; than for its contents. Doing this only in `:vbox` left a `:card`
;; and a `:scroll` handing their children unbounded space.
col (fn [sp nodes]
(m/Column .crossAxisAlignment m/CrossAxisAlignment.start
.mainAxisSize (if (some #(fills-column? (expand %)) nodes)
m/MainAxisSize.max
m/MainAxisSize.min)
.spacing sp
.children (flexed fills-column? nodes)))]
(case tag
:vbox
;; `:fill-height` is what pins a tab bar to the bottom: the band above
;; it asks for the rest of the screen, and a column sized to its
;; contents has no rest to give.
(let [c (m/Column
.crossAxisAlignment m/CrossAxisAlignment.start
;; Max when something inside wants the space left over: a
;; column sized to its contents has none to give.
.mainAxisSize (if (or (:fill-height p)
(some #(fills-column? (expand %)) (body node)))
m/MainAxisSize.max
m/MainAxisSize.min)
.spacing (dbl (:spacing p) 0.0)
.children (flexed fills-column? (body node)))
c (if-let [mg (:margin p)]
(m/Padding .padding (m/EdgeInsets.all (dbl mg 0.0)) .child c)
c)]
(if-let [w (width-of p)]
(m/SizedBox .width w .child c)
c))
;; `page` is jolt-cosmic's scrollable container, centred and capped.
;;
;; Align with a heightFactor rather than Center: a Center inside an
;; unbounded height — which is what a scroll view gives — grows to
;; infinity and centres its content somewhere far below the screen.
;; The page looked blank and nothing was logged, because nothing was
;; wrong: the content was exactly where it had been asked to go.
:page
(m/SingleChildScrollView
.child
(m/Align
.alignment m/Alignment.topCenter
.heightFactor 1.0
.child (m/ConstrainedBox
.constraints (m/BoxConstraints .maxWidth (dbl (:max-width p) 520.0))
.child (m/Padding
.padding (m/EdgeInsets.all t/space-s)
.child (col t/space-xs (body node))))))
;; `:wrap true` is a row that runs onto the next line — how a message
;; body lays its words, its links and its emoji out, since a line of
;; text is a row of runs here rather than one string. Flutter calls it
;; Wrap. Without it the longest message decided the width of the
;; conversation and the rest overflowed off the right.
:hbox
(if (true? (:wrap p))
(m/Wrap
.spacing (dbl (:spacing p) 0.0)
.runSpacing (dbl (:spacing p) 0.0)
.crossAxisAlignment m/WrapCrossAlignment.center
.children kids)
(m/Row
;; Stretch when a child fills vertically: a Row hands its children a
;; loose height by default, and a column that wants what is left of it
;; needs a tight one.
.crossAxisAlignment (if (some #(fills-column? (expand %)) (body node))
m/CrossAxisAlignment.stretch
m/CrossAxisAlignment.center)
;; A row holding something that fills has to be given the width to
;; divide, so it is max rather than min whenever a child asks.
.mainAxisSize (if (some #(fills-row? (expand %)) (body node))
m/MainAxisSize.max
m/MainAxisSize.min)
.spacing (dbl (:spacing p) 0.0)
.children (flexed fills-row? (body node))))
:label (txt ctx (:label p "") t/text-body t/on-bg)
:dim-label (txt ctx (:label p "") t/text-caption t/dim)
:title (txt ctx (:label p "") t/text-title-3 t/on-bg
:weight m/FontWeight.w600)
:title-2 (txt ctx (:label p "") t/text-title-4 t/on-bg
:weight m/FontWeight.w600)
:button (cosmic-button ctx p (:on-click p))
;; button::link — accent text, no underline. COSMIC links are buttons.
:link
(m/InkWell
.onTap (when-let [on (:on-click p)] #(on))
.child (txt ctx (:label p "") t/text-body t/accent))
;; Container::Card: padding 12, spacing 8, fills its width unless it is
;; sitting in a row.
:card
(m/Container
.width double/infinity
.padding (m/EdgeInsets.all t/space-xs)
.decoration (m/BoxDecoration
.color t/card
.borderRadius (m/BorderRadius.circular t/radius-s))
.child (col (dbl (:spacing p) t/space-xxs) (body node)))
:separator (m/Divider .height 1.0 .thickness 1.0 .color t/divider)
;; A 16px indeterminate circle, with the label as a caption beside it.
:spinner
(m/Row
.mainAxisSize m/MainAxisSize.min
.spacing t/space-xxs
.children (into [(m/SizedBox
.width 16.0 .height 16.0
.child (m/CircularProgressIndicator
.strokeWidth 2.0
.color t/accent))]
(when-let [l (not-empty (str (:label p "")))]
[(txt ctx l t/text-caption t/dim)])))
;; A dot that says whether the thing is live, and the words beside it.
:status
(m/Row
.mainAxisSize m/MainAxisSize.min
.spacing 6.0
.children [(m/Container
.width 8.0 .height 8.0
.decoration (m/BoxDecoration
.color (if (:live p) t/success t/dim)
.borderRadius (m/BorderRadius.circular t/radius-xs)))
(txt ctx (:label p "") t/text-caption t/dim)])
:spacer
(let [size (dbl (or (:size p) (:gap p) (:width-request p)) t/space-xxs)]
(m/SizedBox .width size .height size))
:checkbutton
(let [on (:on-toggled p)]
(m/Row
.mainAxisSize m/MainAxisSize.min
.spacing t/space-xxxs
.children [(m/SizedBox
.width 20.0 .height 20.0
.child (m/Checkbox
.value (boolean (:active p))
.activeColor t/accent
.onChanged (when on (fn [v] (on (boolean v))))))
(txt ctx (:label p "") t/text-body t/on-bg)]))
;; text_input: a filled rounded field, no outline. COSMIC entries sit in
;; the component colour rather than behind a border.
;; An entry sizes itself, as it does in jolt-cosmic: Fixed(w) from
;; :width-request unless :hexpand asks for the rest of the row.
;;
;; Not optional. A TextField takes its width from its parent, and a Row
;; offers its children unbounded width — so two entries side by side in
;; an :hbox, which is exactly what the connect screen's host and port
;; are, is a hard layout error. That is what painted the whole screen
;; blank with nothing in the log.
:entry
(let [on-change (:on-change p)
on-activate (:on-activate p)
rows (:rows p)
w (width-of p)
field (m/TextField
.controller (controller-for (:key p) (:text p))
.onChanged (when on-change #(on-change %))
.onSubmitted (when on-activate (fn [_] (on-activate)))
.maxLines (if rows (int rows) 1)
.style (m/TextStyle .fontSize t/text-body .color t/on-bg)
.cursorColor t/accent
.decoration (m/InputDecoration
.isDense true
.filled true
.fillColor t/component
.hintText (:placeholder p)
.hintStyle (m/TextStyle .fontSize t/text-body
.color t/dim)
.contentPadding (m/EdgeInsets.symmetric
.horizontal t/space-xs
.vertical t/space-xxs)
.border (m/OutlineInputBorder
.borderRadius (m/BorderRadius.circular t/radius-s)
.borderSide m/BorderSide.none)
.enabledBorder (m/OutlineInputBorder
.borderRadius (m/BorderRadius.circular t/radius-s)
.borderSide m/BorderSide.none)
.focusedBorder (m/OutlineInputBorder
.borderRadius (m/BorderRadius.circular t/radius-s)
.borderSide (m/BorderSide .color t/accent
.width 1.0))))]
;; No Expanded when there is no width: Expanded in a Column expands
;; along the main axis, which is vertical, and an entry in a card
;; would grow to fill the card. A bare field is right there — a
;; Column hands its children bounded width — and a row wants the
;; width-request the caller already writes.
(if w
(m/SizedBox .width w .child field)
field))
:emoji
(m/Text (str (:emoji p "")) .style (m/TextStyle .fontSize (dbl (:size p) 16.0)))
:avatar
(let [s (dbl (:size p) 32.0)
src (:src p)]
(m/CircleAvatar
.radius (/ s 2.0)
.backgroundColor t/component
.backgroundImage (when (and src (not= "" src)) (m/NetworkImage src))
.child (when (or (nil? src) (= "" src))
(txt ctx (let [l (str (:label p ""))]
(if (pos? (count l)) (.toUpperCase (subs l 0 1)) "?"))
t/text-body t/on-bg))))
:image
(let [src (or (:src p) (:path p))
w (:max-width p)
h (:max-height p)
img (cond
(nil? src) (m/SizedBox .width 0.0 .height 0.0)
(or (.startsWith (str src) "http://")
(.startsWith (str src) "https://"))
(m/Image.network (str src) .fit m/BoxFit.contain)
:else (m/Image.file (io/File. (str src)) .fit m/BoxFit.contain))
img (m/ClipRRect .borderRadius (m/BorderRadius.circular t/radius-s)
.child img)
img (if (or w h)
(m/ConstrainedBox
.constraints (m/BoxConstraints
.maxWidth (dbl w double/infinity)
.maxHeight (dbl h double/infinity))
.child img)
img)]
(if-let [on (:on-click p)]
(m/InkWell .onTap #(on) .child img)
img))
;; No Expanded of its own: `fills-column?` says a scroll takes what is
;; left, so its parent column wraps it — and wrapping here as well put
;; two ParentDataWidgets on one RenderObject, which Flutter calls
;; "competing" and then draws nothing.
:scroll
(let [k (str (:scroll-key p))
token (:scroll-to-bottom p)]
(f/widget
;; `:managed`, so the controller belongs to this widget and is
;; disposed with it. One controller per key in a global map was the
;; obvious thing and the wrong thing: Flutter builds a new subtree
;; before unmounting the old one whenever the tree changes shape, so
;; two live scroll views briefly shared it and it asserted —
;; "ScrollController attached to multiple scroll views", which took
;; the whole screen.
:managed [ctrl (m/ScrollController)]
:let [_ (end-ward! k ctrl token)]
(m/SingleChildScrollView
.controller ctrl
.child (col (dbl (:spacing p) 0.0) (body node)))))
;; A tag this backend has not grown yet still shows its children — which
;; is what libvidya did and what jolt-cosmic kept. The marker is here so
;; it is obvious which ones are missing: glimmer-cosmic's spike painted
;; every unknown tag as a silent column, and that is why most of frq
;; came out of it as stacked text.
(m/Column
.crossAxisAlignment m/CrossAxisAlignment.start
.mainAxisSize m/MainAxisSize.min
.children (into [(txt ctx (str "?" (name tag)) 10.0 m/Colors.orange)]
kids))))))
(defn render
"One hiccup node as a Flutter widget.
A vector whose head is a function is a component: glimmer calls it with the
rest of the vector as arguments and renders what comes back, and so does
this. Everything else is a tag."
[node]
(cond
(nil? node) (m/SizedBox .width 0.0 .height 0.0)
(string? node) (m/Text node)
(vector? node)
(let [head (first node)]
(if (keyword? head)
(render-tag head node)
(render (apply head (rest node)))))
(seq? node)
(m/Column .crossAxisAlignment m/CrossAxisAlignment.start
.mainAxisSize m/MainAxisSize.min
.children (children node))
:else (m/Text (str node))))
|