diff --git a/app/api/chat/route.ts b/app/api/chat/route.ts index cc844658..e2374d34 100644 --- a/app/api/chat/route.ts +++ b/app/api/chat/route.ts @@ -355,12 +355,17 @@ ${userInputText} ] // Add image parts back - for (const filePart of fileParts) { - contentParts.push({ - type: "image", - image: filePart.url, - mimeType: filePart.mediaType, - }) + const allowImages = + typeof modelId === "string" && + !modelId.toLowerCase().includes("deepseek") + if (allowImages) { + for (const filePart of fileParts) { + contentParts.push({ + type: "image", + image: filePart.url, + mimeType: filePart.mediaType, + }) + } } enhancedMessages = [ diff --git a/app/globals.css b/app/globals.css index feaea6da..8262cdff 100644 --- a/app/globals.css +++ b/app/globals.css @@ -208,11 +208,11 @@ } .animate-fade-in { - animation: fadeIn 0.3s ease-out forwards; + animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards; } .animate-slide-in-right { - animation: slideInRight 0.3s ease-out forwards; + animation: slideInRight 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards; } /* Message bubble animations */ @@ -228,22 +228,33 @@ } .animate-message-in { - animation: messageIn 0.25s ease-out forwards; + animation: messageIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards; } /* Subtle floating shadow for cards */ .shadow-soft { box-shadow: - 0 1px 2px oklch(0.23 0.02 260 / 0.04), - 0 4px 12px oklch(0.23 0.02 260 / 0.06), - 0 8px 24px oklch(0.23 0.02 260 / 0.04); + 0 2px 4px oklch(0.23 0.02 260 / 0.02), + 0 6px 12px oklch(0.23 0.02 260 / 0.03), + 0 12px 24px oklch(0.23 0.02 260 / 0.03); } .shadow-soft-lg { box-shadow: - 0 2px 4px oklch(0.23 0.02 260 / 0.04), - 0 8px 20px oklch(0.23 0.02 260 / 0.08), - 0 16px 40px oklch(0.23 0.02 260 / 0.06); + 0 4px 8px oklch(0.23 0.02 260 / 0.03), + 0 12px 24px oklch(0.23 0.02 260 / 0.05), + 0 24px 48px oklch(0.23 0.02 260 / 0.04); +} + +/* Gradient borders */ +.border-gradient-primary { + position: relative; + background: + linear-gradient(var(--background), var(--background)) padding-box, + linear-gradient(135deg, oklch(0.55 0.18 265), oklch(0.6 0.2 290)) + border-box; + border: 2px solid transparent; + border-radius: var(--radius); } /* Gradient text utility */ diff --git a/components/chat-input.tsx b/components/chat-input.tsx index b63bbd12..48d05e5a 100644 --- a/components/chat-input.tsx +++ b/components/chat-input.tsx @@ -58,6 +58,7 @@ interface ValidationResult { function validateFiles( newFiles: File[], existingCount: number, + imageSupported: boolean, ): ValidationResult { const errors: string[] = [] const validFiles: File[] = [] @@ -74,7 +75,10 @@ function validateFiles( errors.push(`Only ${availableSlots} more file(s) allowed`) break } - if (!isValidFileType(file)) { + if ( + !isValidFileType(file) || + (!imageSupported && file.type.startsWith("image/")) + ) { errors.push(`"${file.name}" is not a supported file type`) continue } @@ -137,6 +141,7 @@ interface ChatInputProps { error?: Error | null minimalStyle?: boolean onMinimalStyleChange?: (value: boolean) => void + imageSupported?: boolean } export function ChatInput({ @@ -154,6 +159,7 @@ export function ChatInput({ error = null, minimalStyle = false, onMinimalStyleChange = () => {}, + imageSupported = true, }: ChatInputProps) { const { diagramHistory, @@ -224,6 +230,7 @@ export function ChatInput({ const { validFiles, errors } = validateFiles( imageFiles, files.length, + imageSupported, ) showValidationErrors(errors) if (validFiles.length > 0) { @@ -234,7 +241,11 @@ export function ChatInput({ const handleFileChange = (e: React.ChangeEvent) => { const newFiles = Array.from(e.target.files || []) - const { validFiles, errors } = validateFiles(newFiles, files.length) + const { validFiles, errors } = validateFiles( + newFiles, + files.length, + imageSupported, + ) showValidationErrors(errors) if (validFiles.length > 0) { onFileChange([...files, ...validFiles]) @@ -283,6 +294,7 @@ export function ChatInput({ const { validFiles, errors } = validateFiles( supportedFiles, files.length, + imageSupported, ) showValidationErrors(errors) if (validFiles.length > 0) { @@ -333,7 +345,7 @@ export function ChatInput({ /> {/* Action bar */} -
+
{/* Left actions */}
-
+
- + Use minimal for faster generation (no colors) @@ -394,7 +406,7 @@ export function ChatInput({ onClick={() => onToggleHistory(true)} disabled={isDisabled || diagramHistory.length === 0} tooltipContent="Diagram history" - className="h-8 w-8 p-0 text-muted-foreground hover:text-foreground" + className="h-8 w-8 p-0 text-muted-foreground hover:text-foreground transition-colors" > @@ -406,7 +418,7 @@ export function ChatInput({ onClick={() => setShowSaveDialog(true)} disabled={isDisabled} tooltipContent="Save diagram" - className="h-8 w-8 p-0 text-muted-foreground hover:text-foreground" + className="h-8 w-8 p-0 text-muted-foreground hover:text-foreground transition-colors" > @@ -428,8 +440,12 @@ export function ChatInput({ size="sm" onClick={triggerFileInput} disabled={isDisabled} - tooltipContent="Upload file (image, PDF, text)" - className="h-8 w-8 p-0 text-muted-foreground hover:text-foreground" + tooltipContent={ + imageSupported + ? "Upload file (image, PDF, text)" + : "Upload file (PDF, text)" + } + className="h-8 w-8 p-0 text-muted-foreground hover:text-foreground transition-colors" > @@ -448,9 +464,16 @@ export function ChatInput({