summaryrefslogtreecommitdiff
path: root/Omni/Jr
diff options
context:
space:
mode:
authorBen Sima <ben@bensima.com>2025-12-01 10:32:56 -0500
committerBen Sima <ben@bensima.com>2025-12-01 10:32:56 -0500
commit4f8a0a916ee8727d1bbb41e44bbf8a8314519fbb (patch)
tree0fbbf486a7c3056d79b23ee4820b3f02001c91aa /Omni/Jr
parentfb019f46c3adcf772df2dacf688cc75c30ed6e8e (diff)
Make Result sections collapsible in Agent Log (collapsed by default)
Wrap entire tool result in a <details> element so it starts collapsed. User can click to expand and see full output. Task-Id: t-205
Diffstat (limited to 'Omni/Jr')
-rw-r--r--Omni/Jr/Web.hs12
1 files changed, 3 insertions, 9 deletions
diff --git a/Omni/Jr/Web.hs b/Omni/Jr/Web.hs
index 6f5029d..7555e22 100644
--- a/Omni/Jr/Web.hs
+++ b/Omni/Jr/Web.hs
@@ -2487,20 +2487,14 @@ renderToolCallEvent content timestamp now =
renderToolResultEvent :: (Monad m) => Text -> UTCTime -> UTCTime -> Lucid.HtmlT m ()
renderToolResultEvent content timestamp now =
let lineCount = length (Text.lines content)
- isLong = lineCount > 20
- in Lucid.div_ [Lucid.class_ "event-tool-result"] <| do
- Lucid.div_ [Lucid.class_ "event-header result-header"] <| do
+ in Lucid.details_ [Lucid.class_ "event-tool-result"] <| do
+ Lucid.summary_ <| do
Lucid.span_ [Lucid.class_ "event-icon"] "📋"
Lucid.span_ [Lucid.class_ "event-label"] "Result"
when (lineCount > 1)
<| Lucid.span_ [Lucid.class_ "line-count"] (Lucid.toHtml (tshow lineCount <> " lines"))
renderRelativeTimestamp now timestamp
- if isLong
- then
- Lucid.details_ [Lucid.class_ "result-collapsible"] <| do
- Lucid.summary_ "Show output"
- Lucid.pre_ [Lucid.class_ "event-content tool-output"] (renderDecodedToolResult content)
- else Lucid.pre_ [Lucid.class_ "event-content tool-output"] (renderDecodedToolResult content)
+ Lucid.pre_ [Lucid.class_ "event-content tool-output"] (renderDecodedToolResult content)
renderCostEvent :: (Monad m) => Text -> Lucid.HtmlT m ()
renderCostEvent content =