fix(desktop): match send button to web

This commit is contained in:
zhayujie
2026-06-29 16:33:10 +08:00
parent 2959cfea32
commit 2786148153

View File

@@ -1,9 +1,17 @@
import React, { useState, useRef, useCallback, useEffect, forwardRef, useImperativeHandle } from 'react'
import { Plus, Paperclip, Send, Square, X, File as FileIcon, Loader2, Trash2 } from 'lucide-react'
import { Plus, Paperclip, Square, X, File as FileIcon, Loader2, Trash2 } from 'lucide-react'
import { t } from '../i18n'
import type { Attachment } from '../types'
import apiClient from '../api/client'
// Solid paper-plane icon (Font Awesome's fa-paper-plane path) so the send
// button matches the web console exactly.
const PaperPlaneIcon: React.FC<{ size?: number }> = ({ size = 16 }) => (
<svg width={size} height={size} viewBox="0 0 512 512" fill="currentColor" aria-hidden="true">
<path d="M498.1 5.6c10.1 7 15.4 19.1 13.5 31.2l-64 416c-1.5 9.7-7.4 18.2-16 23s-18.9 5.4-28 1.6L284 427.7l-68.5 74.1c-8.9 9.7-22.9 12.9-35.2 8.1S160 493.2 160 480l0-83.6c0-4 1.5-7.8 4.2-10.8L331.8 202.8c5.8-6.3 5.6-16-.4-22s-15.7-6.4-22-.7L106 360.8 17.7 316.6C7.1 311.3 .3 300.7 0 288.9s5.9-22.8 16.1-28.7l448-256c10.7-6.1 23.9-5.5 34 1.4z"/>
</svg>
)
export type ChatInputHandle = (text: string, attachments: Attachment[]) => void
interface SlashCommand {
@@ -382,10 +390,10 @@ const ChatInput = forwardRef<ChatInputHandle, ChatInputProps>(function ChatInput
<button
onClick={handleSubmit}
disabled={!canSend}
className="flex-shrink-0 w-10 h-10 flex items-center justify-center rounded-btn bg-accent text-accent-contrast hover:bg-accent-hover disabled:bg-surface-2 disabled:text-content-disabled disabled:cursor-not-allowed cursor-pointer transition-colors"
className="flex-shrink-0 w-10 h-10 flex items-center justify-center rounded-btn bg-accent text-white hover:bg-accent-hover disabled:bg-surface-2 disabled:text-content-disabled disabled:cursor-not-allowed cursor-pointer transition-colors"
title={t('chat_send')}
>
<Send size={17} />
<PaperPlaneIcon size={15} />
</button>
)}
</div>