mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-16 14:01:06 +00:00
Add click-to-expand for system prompt in HTML export
This commit is contained in:
parent
f090ec214a
commit
f5e38c4007
2 changed files with 19 additions and 2 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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>`;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue