From f143de4005eb7a76d0edf79205561d69e89585ce Mon Sep 17 00:00:00 2001 From: codewithcheese Date: Thu, 1 Aug 2024 19:32:13 +1000 Subject: [PATCH] Add markdown view toggle for all revise messages --- src/routes/(app)/chat/[id]/MessageCard.svelte | 18 +++++++++++++++--- .../(app)/chat/[id]/revise/RevisePage.svelte | 2 +- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/routes/(app)/chat/[id]/MessageCard.svelte b/src/routes/(app)/chat/[id]/MessageCard.svelte index 0b7ee4a..1d58760 100644 --- a/src/routes/(app)/chat/[id]/MessageCard.svelte +++ b/src/routes/(app)/chat/[id]/MessageCard.svelte @@ -6,7 +6,7 @@ import type { ChatMessage } from "$lib/chat-service.svelte"; import MessageEditor from "./MessageEditor.svelte"; import { Button } from "@/components/ui/button"; - import { FilePlus2Icon, Trash2Icon } from "lucide-svelte"; + import { EditIcon, EyeIcon, FilePlus2Icon, Trash2Icon } from "lucide-svelte"; import AttachmentControls from "./AttachmentControls.svelte"; import { DropdownMenu, @@ -37,6 +37,7 @@ }: Props = $props(); let format = "markdown"; let showAttachmentControls = $state(false); + let mode: "edit" | "view" = $state("edit"); function handleKeyPress(event: KeyboardEvent) { if (event.ctrlKey && event.key === "Enter") { @@ -98,7 +99,18 @@ > - +