fix: restore save button disabled check and add displayName

This commit is contained in:
dayuan.jiang
2026-01-18 00:19:12 +09:00
parent 44699940ce
commit dcb6505b49
2 changed files with 6 additions and 2 deletions

View File

@@ -197,6 +197,7 @@ export const ChatInput = forwardRef<ChatInputRef, ChatInputProps>(
) => {
const dict = useDictionary()
const {
chartXML,
diagramHistory,
saveDiagramToFile,
showSaveDialog,
@@ -483,7 +484,9 @@ export const ChatInput = forwardRef<ChatInputRef, ChatInputProps>(
variant="ghost"
size="sm"
onClick={() => setShowSaveDialog(true)}
disabled={isDisabled}
disabled={
isDisabled || !isRealDiagram(chartXML)
}
tooltipContent={dict.chat.saveDiagram}
className="h-8 w-8 p-0 text-muted-foreground hover:text-foreground"
>
@@ -586,3 +589,5 @@ export const ChatInput = forwardRef<ChatInputRef, ChatInputProps>(
)
},
)
ChatInput.displayName = "ChatInput"

View File

@@ -888,7 +888,6 @@ export default function ChatPanel({
dict.dialogs.clearSuccess,
buildSessionData,
setDiagramHistory,
chatInputRef,
])
const handleInputChange = (