fix(panettone): Don't display the full before/after of issue bodies

Issue bodies tend to be very long, so displaying the full diff whenever
the issue is updated takes up a lot of visual room and is very hard to
read. Specifically for this field, this changes the display to only show
"updated the body of this issue", hiding the previous and new values.

At some point in the future, I'd love to have some CSS fun with active
anchor links to have an "expanded" view that *does* display the previous
and new value, but for now this should be fine - the data isn't gone,
after all!

Fixes: b/111
Change-Id: I0188540188729142e0b9205ff5cc9ea576c4edb6
Reviewed-on: https://cl.tvl.fyi/c/depot/+/3142
Tested-by: BuildkiteCI
Reviewed-by: sterni <sternenseemann@systemli.org>
This commit is contained in:
Griffin Smith 2021-05-23 14:31:12 +02:00 committed by grfn
parent a7d07e1a8a
commit 43e3355eae

View file

@ -324,21 +324,24 @@
:class "event" :class "event"
:id fragment :id fragment
(who:esc (displayname-if-known user)) (who:esc (displayname-if-known user))
(if (string= (field event) "STATUS") (switch ((field event) :test #'string=)
(who:htm ("STATUS"
(who:esc (who:htm
(switch ((new-value event) :test #'string=) (who:esc
("OPEN" " reopened ") (switch ((new-value event) :test #'string=)
("CLOSED" " closed "))) ("OPEN" " reopened ")
" this issue ") ("CLOSED" " closed ")))
(who:htm " this issue "))
" changed the " ("BODY" (who:htm " updated the body of this issue"))
(who:esc (string-downcase (field event))) (t
" of this issue from \"" (who:htm
(who:esc (previous-value event)) " changed the "
"\" to \"" (who:esc (string-downcase (field event)))
(who:esc (new-value event)) " of this issue from \""
"\"")) (who:esc (previous-value event))
"\" to \""
(who:esc (new-value event))
"\"")))
" at " " at "
(who:esc (format-dottime (created-at event))))))) (who:esc (format-dottime (created-at event)))))))