enh: apply edit to artifacts

This commit is contained in:
Timothy J. Baek 2024-10-06 01:12:30 -07:00
parent f5e10704c0
commit 3082d0de7a
4 changed files with 8 additions and 6 deletions

View File

@ -6,16 +6,19 @@
import { showArtifacts, showControls } from '$lib/stores';
import XMark from '../icons/XMark.svelte';
import { createMessagesList } from '$lib/utils';
export let messages;
export let overlay = false;
export let history;
let messages = [];
let contents: Array<{ content: string }> = [];
let selectedContentIdx = 0;
let iframeElement: HTMLIFrameElement;
$: if (messages) {
$: if (history.currentId) {
messages = createMessagesList(history, history.currentId);
getContents();
}

View File

@ -2088,7 +2088,6 @@
bind:files
bind:pane={controlPane}
chatId={$chatId}
messages={createMessagesList(history.currentId)}
modelId={selectedModelIds?.at(0) ?? null}
models={selectedModelIds.reduce((a, e, i, arr) => {
const model = $models.find((m) => m.id === e);

View File

@ -18,7 +18,6 @@
export let models = [];
export let chatId = null;
export let messages = [];
export let chatFiles = [];
export let params = {};
@ -126,7 +125,7 @@
/>
</div>
{:else if $showArtifacts}
<Artifacts {messages} />
<Artifacts {history} />
{:else if $showOverview}
<Overview
{history}
@ -201,7 +200,7 @@
/>
</div>
{:else if $showArtifacts}
<Artifacts {messages} overlay={dragged} />
<Artifacts {history} overlay={dragged} />
{:else if $showOverview}
<Overview
{history}

View File

@ -80,6 +80,7 @@
const updateChatHistory = async () => {
await tick();
history = history;
await updateChatById(localStorage.token, chatId, {
history: history,
messages: messages