Skip to content

Commit 87555d9

Browse files
committed
💬 Adds disclaimer text when using Explain code
1 parent 79d76c7 commit 87555d9

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

‎src/scripts/explain-code.ts‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,10 +160,25 @@ function createSheet(
160160
<p class="text-xs opacity-70 mt-6">Note: This is a placeholder with extended content for testing purposes. Connect to your preferred AI service to enable real explanations.</p>
161161
`;
162162

163+
const disclaimer = document.createElement("div");
164+
disclaimer.className =
165+
"flex items-start gap-3 p-4 mt-4 rounded bg-[var(--sl-color-orange-low)] border border-[var(--sl-color-orange)] text-sm text-[var(--sl-color-text)]";
166+
disclaimer.innerHTML = `
167+
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="flex-shrink-0 mt-0.5" style="color: var(--sl-color-orange);">
168+
<path d="m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z"/>
169+
<line x1="12" y1="9" x2="12" y2="13"/>
170+
<line x1="12" y1="17" x2="12.01" y2="17"/>
171+
</svg>
172+
<div>
173+
<p>Explain Code is experimental and may produce incorrect answers. Always verify the output before executing.</p>
174+
</div>
175+
`;
176+
163177
content.appendChild(closeButton);
164178
content.appendChild(title);
165179
content.appendChild(description);
166180
content.appendChild(explanationText);
181+
content.appendChild(disclaimer);
167182

168183
container.appendChild(content);
169184

0 commit comments

Comments
 (0)