From f5e38c40077568703eb54602f865ca30930637ca Mon Sep 17 00:00:00 2001 From: Mario Zechner Date: Sat, 3 Jan 2026 23:02:30 +0100 Subject: [PATCH] Add click-to-expand for system prompt in HTML export --- .../src/core/export-html/template.css | 16 +++++++++++++++- .../src/core/export-html/template.js | 5 ++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/packages/coding-agent/src/core/export-html/template.css b/packages/coding-agent/src/core/export-html/template.css index 733224b4..61b0a75a 100644 --- a/packages/coding-agent/src/core/export-html/template.css +++ b/packages/coding-agent/src/core/export-html/template.css @@ -495,6 +495,7 @@ padding: var(--line-height); border-radius: 4px; margin-bottom: var(--line-height); + cursor: pointer; } .system-prompt-header { @@ -502,16 +503,29 @@ color: var(--customMessageLabel); } + .system-prompt-collapsed { + color: var(--customMessageText); + } + .system-prompt-content { + display: none; color: var(--customMessageText); white-space: pre-wrap; word-wrap: break-word; font-size: 11px; - max-height: 200px; + max-height: 400px; overflow-y: auto; margin-top: var(--line-height); } + .system-prompt.expanded .system-prompt-collapsed { + display: none; + } + + .system-prompt.expanded .system-prompt-content { + display: block; + } + /* Tools list */ .tools-list { background: var(--customMessageBg); diff --git a/packages/coding-agent/src/core/export-html/template.js b/packages/coding-agent/src/core/export-html/template.js index b6137a9b..f967949d 100644 --- a/packages/coding-agent/src/core/export-html/template.js +++ b/packages/coding-agent/src/core/export-html/template.js @@ -964,8 +964,11 @@ `; if (systemPrompt) { - html += `
+ const promptLines = systemPrompt.split('\n').length; + const promptChars = systemPrompt.length; + html += `
System Prompt
+
${promptLines} lines, ${promptChars.toLocaleString()} chars (click to expand)
${escapeHtml(systemPrompt)}
`; }