From 2637da3215873074e806479b7812e06b9be33ec8 Mon Sep 17 00:00:00 2001 From: Dayuan Jiang <34411969+DayuanJiang@users.noreply.github.com> Date: Sun, 4 Jan 2026 12:49:57 +0900 Subject: [PATCH] fix: restore draw.io native save button functionality (#503) PR #442 accidentally changed showSaveDialog from using the diagram context to local state, breaking draw.io's native save button (Ctrl+S) that was fixed in PR #296. This restores the original behavior by using the context's showSaveDialog so both draw.io native save and the download button open the same dialog. --- components/chat-input.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/components/chat-input.tsx b/components/chat-input.tsx index 49ae3ee..407e782 100644 --- a/components/chat-input.tsx +++ b/components/chat-input.tsx @@ -172,13 +172,17 @@ export function ChatInput({ onConfigureModels = () => {}, }: ChatInputProps) { const dict = useDictionary() - const { diagramHistory, saveDiagramToFile } = useDiagram() + const { + diagramHistory, + saveDiagramToFile, + showSaveDialog, + setShowSaveDialog, + } = useDiagram() const textareaRef = useRef(null) const fileInputRef = useRef(null) const [isDragging, setIsDragging] = useState(false) const [showHistory, setShowHistory] = useState(false) - const [showSaveDialog, setShowSaveDialog] = useState(false) // Allow retry when there's an error (even if status is still "streaming" or "submitted") const isDisabled = (status === "streaming" || status === "submitted") && !error