Add click-to-expand for system prompt in HTML export

This commit is contained in:
Mario Zechner 2026-01-03 23:02:30 +01:00
parent f090ec214a
commit f5e38c4007
2 changed files with 19 additions and 2 deletions

View file

@ -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);

View file

@ -964,8 +964,11 @@
</div>`;
if (systemPrompt) {
html += `<div class="system-prompt">
const promptLines = systemPrompt.split('\n').length;
const promptChars = systemPrompt.length;
html += `<div class="system-prompt" onclick="this.classList.toggle('expanded')">
<div class="system-prompt-header">System Prompt</div>
<div class="system-prompt-collapsed">${promptLines} lines, ${promptChars.toLocaleString()} chars (click to expand)</div>
<div class="system-prompt-content">${escapeHtml(systemPrompt)}</div>
</div>`;
}