diff --git a/tools/server/public/index.html.gz b/tools/server/public/index.html.gz index f516db853a..c5b9166a30 100644 Binary files a/tools/server/public/index.html.gz and b/tools/server/public/index.html.gz differ diff --git a/tools/server/webui/src/lib/components/app/notebook/NotebookScreen.svelte b/tools/server/webui/src/lib/components/app/notebook/NotebookScreen.svelte index 8c5c7e8b1d..932172e58a 100644 --- a/tools/server/webui/src/lib/components/app/notebook/NotebookScreen.svelte +++ b/tools/server/webui/src/lib/components/app/notebook/NotebookScreen.svelte @@ -2,7 +2,7 @@ import { notebookStore } from '$lib/stores/notebook.svelte'; import Button from '$lib/components/ui/button/button.svelte'; import Textarea from '$lib/components/ui/textarea/textarea.svelte'; - import { Play, Square, Settings } from '@lucide/svelte'; + import { Play, Square, Settings, Undo, Redo } from '@lucide/svelte'; import { config } from '$lib/stores/settings.svelte'; import DialogChatSettings from '$lib/components/app/dialogs/DialogChatSettings.svelte'; import { ModelsSelector, ChatMessageStatistics, DialogChatError } from '$lib/components/app'; @@ -35,6 +35,8 @@ let isRouter = $derived(isRouterMode()); let errorDialog = $derived(notebookStore.error); + let canUndo = $derived(notebookStore.previousContent !== null && !notebookStore.isGenerating); + let canRedo = $derived(notebookStore.undoneContent !== null && !notebookStore.isGenerating); // Sync local input with store content $effect(() => { @@ -44,6 +46,7 @@ function handleInput(e: Event) { const target = e.target as HTMLTextAreaElement; notebookStore.content = target.value; + notebookStore.resetUndoRedo(); } function handleErrorDialogOpenChange(open: boolean) { @@ -65,6 +68,13 @@ await notebookStore.generate(notebookModel); } + function handleUndo() { + notebookStore.undo(); + } + + function handleRedo() { + notebookStore.redo(); + } function handleStop() { notebookStore.stop(); @@ -223,13 +233,45 @@
Undo last generation
+Redo last generation
+