display all grandchild messages from sub and pub

This commit is contained in:
hanfel-dovned 2024-06-06 14:54:05 -07:00
parent e6a2a10fe7
commit 11d21bc25c
4 changed files with 43 additions and 14 deletions

View File

@ -0,0 +1,19 @@
/@ message
/@ groupchat
/- feather-icons
/- messages
:- [%groupchat %$ %htmx]
|= =groupchat
|= =bowl:neo
^- manx
;div.p2
=label "Chat"
;div.ma.fc.g2
=style "max-width: 650px;"
;div.fc.g2
=id "children"
;+ (render-messages:messages bowl)
==
;+ (render-sender:messages [bowl /pub])
==
==

View File

@ -0,0 +1,10 @@
/@ message
/@ groupchat
/- feather-icons
/- messages
:- [%sig %$ %htmx]
|= =groupchat
|= =bowl:neo
^- manx
;div.p2
==

View File

@ -24,7 +24,7 @@
:: XX - maybe move ordering is unpredictable here
?~ old
:_ :- %groupchat
!>([(sy our.bowl ~) ~ (snoc here.bowl %pub)])
!>([(sy our.bowl ~) ~ here.bowl])
:~ :- (snoc here.bowl %pub)
[%make %message-pub ~ ~]
::

View File

@ -1,6 +1,9 @@
/@ message
/- feather-icons
|%
:: This arm expects messages to be stored at
:: ~[%pub [%da ~2024.1.1]] or ~[%sub [%da ~2024.1.1]]
:: relative to here.bowl.
++ render-messages
|= =bowl:neo
^- manx
@ -8,25 +11,22 @@
=label "Messages"
;*
%+ turn
::%+ sort
:: %+ murn
%+ sort
%+ murn
~(tap of:neo kids.bowl)
:: |= [=pith =idea:neo]
:: ?~ pith ~
:: ?@ -.pith ~
:: ?. =(-<.pith %da) ~
:: `[pith idea]
:: |= [a=[=pith *] b=[=pith *]]
:: (lth ->.pith.a ->.pith.b)
|= [=pith =idea:neo]
?~ pith ~
?. =(%message p.pail.idea) ~
`[pith idea]
|= [a=[=pith *] b=[=pith *]]
=/ adate +:(snag 1 pith.a)
=/ bdate +:(snag 1 pith.b)
(lth adate bdate)
render-message
==
::
++ render-message
|= [pax=pith =idea:neo]
?. =(%message p.pail.idea)
?@ p.pail.idea
;p: {(en-tape:pith:neo pax)}
;p: {(trip mark.p.pail.idea)}
=/ msg !<(message q.pail.idea)
^- manx
;div.fc.g2.border.p3.br1