mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-21 05:02:14 +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);
|
padding: var(--line-height);
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
margin-bottom: var(--line-height);
|
margin-bottom: var(--line-height);
|
||||||
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
.system-prompt-header {
|
.system-prompt-header {
|
||||||
|
|
@ -502,16 +503,29 @@
|
||||||
color: var(--customMessageLabel);
|
color: var(--customMessageLabel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.system-prompt-collapsed {
|
||||||
|
color: var(--customMessageText);
|
||||||
|
}
|
||||||
|
|
||||||
.system-prompt-content {
|
.system-prompt-content {
|
||||||
|
display: none;
|
||||||
color: var(--customMessageText);
|
color: var(--customMessageText);
|
||||||
white-space: pre-wrap;
|
white-space: pre-wrap;
|
||||||
word-wrap: break-word;
|
word-wrap: break-word;
|
||||||
font-size: 11px;
|
font-size: 11px;
|
||||||
max-height: 200px;
|
max-height: 400px;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
margin-top: var(--line-height);
|
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 */
|
||||||
.tools-list {
|
.tools-list {
|
||||||
background: var(--customMessageBg);
|
background: var(--customMessageBg);
|
||||||
|
|
|
||||||
|
|
@ -964,8 +964,11 @@
|
||||||
</div>`;
|
</div>`;
|
||||||
|
|
||||||
if (systemPrompt) {
|
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-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 class="system-prompt-content">${escapeHtml(systemPrompt)}</div>
|
||||||
</div>`;
|
</div>`;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue