From 43e3355eae0ed1cef2150e720512fe71993f607d Mon Sep 17 00:00:00 2001 From: Griffin Smith Date: Sun, 23 May 2021 14:31:12 +0200 Subject: 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 --- web/panettone/src/panettone.lisp | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/web/panettone/src/panettone.lisp b/web/panettone/src/panettone.lisp index 87b39ad9461d..fc69bc449229 100644 --- a/web/panettone/src/panettone.lisp +++ b/web/panettone/src/panettone.lisp @@ -324,21 +324,24 @@ :class "event" :id fragment (who:esc (displayname-if-known user)) - (if (string= (field event) "STATUS") - (who:htm - (who:esc - (switch ((new-value event) :test #'string=) - ("OPEN" " reopened ") - ("CLOSED" " closed "))) - " this issue ") - (who:htm - " changed the " - (who:esc (string-downcase (field event))) - " of this issue from \"" - (who:esc (previous-value event)) - "\" to \"" - (who:esc (new-value event)) - "\"")) + (switch ((field event) :test #'string=) + ("STATUS" + (who:htm + (who:esc + (switch ((new-value event) :test #'string=) + ("OPEN" " reopened ") + ("CLOSED" " closed "))) + " this issue ")) + ("BODY" (who:htm " updated the body of this issue")) + (t + (who:htm + " changed the " + (who:esc (string-downcase (field event))) + " of this issue from \"" + (who:esc (previous-value event)) + "\" to \"" + (who:esc (new-value event)) + "\""))) " at " (who:esc (format-dottime (created-at event))))))) -- cgit 1.4.1