feat: detect artifacts toggle

This commit is contained in:
Timothy Jaeryang Baek
2025-04-10 10:36:57 -07:00
parent d4297a3e3e
commit d8780e4de2
2 changed files with 32 additions and 1 deletions
@@ -4,7 +4,7 @@
const dispatch = createEventDispatcher();
import Markdown from './Markdown.svelte';
import { chatId, mobile, showArtifacts, showControls, showOverview } from '$lib/stores';
import { chatId, mobile, settings, showArtifacts, showControls, showOverview } from '$lib/stores';
import FloatingButtons from '../ContentRenderer/FloatingButtons.svelte';
import { createMessagesList } from '$lib/utils';
@@ -161,6 +161,7 @@
const { lang, code } = e.detail;
if (
($settings?.detectArtifacts ?? true) &&
(['html', 'svg'].includes(lang) || (lang === 'xml' && code.includes('svg'))) &&
!$mobile &&
$chatId