@@ -10,15 +10,8 @@ import {
1010} from "lucide-react" ;
1111import { useRouter } from "next/navigation" ;
1212
13- import { Button } from "@/components/ui/button" ;
14- import {
15- DropdownMenu ,
16- DropdownMenuContent ,
17- DropdownMenuItem ,
18- DropdownMenuTrigger ,
19- } from "@/components/ui/dropdownMenu" ;
13+ import { Button , Dropdown } from "antd" ;
2014import { Input } from "@/components/ui/input" ;
21- import { App } from "antd" ;
2215import { Tooltip , TooltipProvider } from "@/components/ui/tooltip" ;
2316import { StaticScrollArea } from "@/components/ui/scrollArea" ;
2417import { USER_ROLES } from "@/const/modelConfig" ;
@@ -234,64 +227,77 @@ export function ChatSidebar({
234227 overlayStyle = { { maxWidth : "300px" } }
235228 >
236229 < Button
237- variant = "ghost"
238- className = "flex-1 justify-start text-left hover:bg-transparent min-w-0 max-w-[250px]"
239- onClick = { ( ) => onDialogClick ( dialog ) }
240- >
241- < ConversationStatusIndicator
242- isStreaming = { streamingConversations . has (
243- dialog . conversation_id
244- ) }
245- isCompleted = { completedConversations . has (
246- dialog . conversation_id
247- ) }
248- />
249- < span className = "truncate block text-base font-normal text-gray-800 tracking-wide font-sans" >
250- { dialog . conversation_title }
251- </ span >
252- </ Button >
230+ type = "text"
231+ size = "middle"
232+ className = "flex-1 justify-start text-left min-w-0 max-w-[250px] px-3 py-2 h-auto border-0 shadow-none bg-transparent hover:!bg-transparent active:!bg-transparent"
233+ onClick = { ( ) => onDialogClick ( dialog ) }
234+ >
235+ < ConversationStatusIndicator
236+ isStreaming = { streamingConversations . has (
237+ dialog . conversation_id
238+ ) }
239+ isCompleted = { completedConversations . has (
240+ dialog . conversation_id
241+ ) }
242+ />
243+ < span className = "truncate block text-base font-normal text-gray-800 tracking-wide font-sans" >
244+ { dialog . conversation_title }
245+ </ span >
246+ </ Button >
253247 </ Tooltip >
254248 </ TooltipProvider >
255249
256- < DropdownMenu
250+ < Dropdown
257251 open = { openDropdownId === dialog . conversation_id . toString ( ) }
258252 onOpenChange = { ( open ) =>
259253 onDropdownOpenChange (
260254 open ,
261255 dialog . conversation_id . toString ( )
262256 )
263257 }
264- >
265- < DropdownMenuTrigger asChild >
266- < Button
267- variant = "ghost"
268- size = "icon"
269- className = "h-6 w-6 flex-shrink-0 opacity-0 group-hover:opacity-100 hover:bg-slate-100 hover:border hover:border-slate-200 mr-1 focus:outline-none focus:ring-0"
270- >
271- < MoreHorizontal className = "h-4 w-4" />
272- </ Button >
273- </ DropdownMenuTrigger >
274- < DropdownMenuContent align = "end" side = "bottom" >
275- < DropdownMenuItem
276- onClick = { ( ) =>
258+ menu = { {
259+ items : [
260+ {
261+ key : "rename" ,
262+ label : (
263+ < span className = "flex items-center" >
264+ < Pencil className = "mr-2 h-5 w-5" />
265+ { t ( "chatLeftSidebar.rename" ) }
266+ </ span >
267+ ) ,
268+ } ,
269+ {
270+ key : "delete" ,
271+ label : (
272+ < span className = "flex items-center text-red-500" >
273+ < Trash2 className = "mr-2 h-5 w-5" />
274+ { t ( "chatLeftSidebar.delete" ) }
275+ </ span >
276+ ) ,
277+ } ,
278+ ] ,
279+ onClick : ( { key } ) => {
280+ if ( key === "rename" ) {
277281 handleStartEdit (
278282 dialog . conversation_id ,
279283 dialog . conversation_title
280- )
284+ ) ;
285+ } else if ( key === "delete" ) {
286+ handleDeleteClick ( dialog . conversation_id ) ;
281287 }
282- >
283- < Pencil className = "mr-2 h-5 w-5" />
284- { t ( "chatLeftSidebar.rename" ) }
285- </ DropdownMenuItem >
286- < DropdownMenuItem
287- className = "text-red-500 hover:text-red-600 hover:bg-red-50"
288- onClick = { ( ) => handleDeleteClick ( dialog . conversation_id ) }
289- >
290- < Trash2 className = "mr-2 h-5 w-5" />
291- { t ( "chatLeftSidebar.delete" ) }
292- </ DropdownMenuItem >
293- </ DropdownMenuContent >
294- </ DropdownMenu >
288+ } ,
289+ } }
290+ placement = "bottomRight"
291+ trigger = { [ "click" ] }
292+ >
293+ < Button
294+ type = "text"
295+ size = "small"
296+ className = "h-6 w-6 min-w-[24px] p-0 flex-shrink-0 opacity-0 group-hover:opacity-100 hover:bg-slate-100 hover:border hover:border-slate-200 mr-1 focus:outline-none focus:ring-0 rounded-full transition-opacity duration-200 flex items-center justify-center"
297+ >
298+ < MoreHorizontal className = "h-4 w-4" / >
299+ </ Button >
300+ </ Dropdown >
295301 </ >
296302 ) }
297303 </ div >
@@ -309,12 +315,12 @@ export function ChatSidebar({
309315 < TooltipProvider >
310316 < Tooltip title = { t ( "chatLeftSidebar.expandSidebar" ) } placement = "right" >
311317 < Button
312- variant = "ghost "
313- size = "icon "
314- className = "h-10 w-10 rounded-full hover:bg-slate-100"
318+ type = "text "
319+ size = "middle "
320+ className = "h-10 w-10 min-w-[40px] p-0 flex-shrink-0 hover:bg-slate-100 active:bg-slate-200 flex items-center justify-center rounded-full transition-colors duration-200 "
315321 onClick = { onToggleSidebar }
316322 >
317- < ChevronRight className = "h-6 w-6" strokeWidth = { 2.5 } />
323+ < ChevronRight className = "h-5 w-5" />
318324 </ Button >
319325 </ Tooltip >
320326 </ TooltipProvider >
@@ -325,12 +331,12 @@ export function ChatSidebar({
325331 < TooltipProvider >
326332 < Tooltip title = { t ( "chatLeftSidebar.newConversation" ) } placement = "right" >
327333 < Button
328- variant = "ghost "
329- size = "icon "
330- className = "h-10 w-10 rounded-full hover:bg-slate-100"
334+ type = "text "
335+ size = "middle "
336+ className = "h-10 w-10 min-w-[40px] p-0 flex-shrink-0 hover:bg-slate-100 active:bg-slate-200 flex items-center justify-center rounded-full transition-colors duration-200 "
331337 onClick = { onNewConversation }
332338 >
333- < Plus className = "h-6 w-6" strokeWidth = { 2.5 } />
339+ < Plus className = "h-5 w-5" />
334340 </ Button >
335341 </ Tooltip >
336342 </ TooltipProvider >
@@ -353,8 +359,9 @@ export function ChatSidebar({
353359 < div className = "m-4 mt-3" >
354360 < div className = "flex items-center gap-2" >
355361 < Button
356- variant = "outline"
357- className = "flex-1 justify-start text-base overflow-hidden"
362+ type = "default"
363+ size = "middle"
364+ className = "flex-1 justify-start text-base overflow-hidden h-10 border border-slate-300 hover:border-slate-400 hover:bg-white transition-colors duration-200"
358365 onClick = { onNewConversation }
359366 >
360367 < Plus
@@ -369,9 +376,9 @@ export function ChatSidebar({
369376 < Tooltip >
370377 < Tooltip title = { t ( "chatLeftSidebar.collapseSidebar" ) } >
371378 < Button
372- variant = "ghost "
373- size = "icon "
374- className = "h-10 w-10 flex-shrink-0 hover:bg-slate-100"
379+ type = "text "
380+ size = "middle "
381+ className = "h-10 w-10 min-w-[40px] p-0 flex-shrink-0 hover:bg-slate-100 active:bg-slate-200 flex items-center justify-center rounded-full transition-colors duration-200 "
375382 onClick = { onToggleSidebar }
376383 >
377384 < ChevronLeft className = "h-5 w-5" />
@@ -395,7 +402,11 @@ export function ChatSidebar({
395402 < p className = "px-2 text-sm font-medium text-muted-foreground" >
396403 { t ( "chatLeftSidebar.recentConversations" ) }
397404 </ p >
398- < Button variant = "ghost" className = "w-full justify-start" >
405+ < Button
406+ type = "text"
407+ size = "middle"
408+ className = "w-full justify-start flex items-center px-3 py-2 h-auto hover:bg-slate-50 transition-colors duration-200"
409+ >
399410 < Clock className = "mr-2 h-5 w-5" />
400411 { t ( "chatLeftSidebar.noHistory" ) }
401412 </ Button >
0 commit comments