@@ -452,12 +452,17 @@ export function ChatPanel({
452452 threadKey : string ,
453453 displayLabel : string ,
454454 hasCustomName : boolean ,
455+ isPinned : boolean ,
455456 ) : MenuProps => ( {
456457 items : [
457458 {
458459 key : "rename" ,
459460 label : "Rename chat" ,
460461 } ,
462+ {
463+ key : isPinned ? "unpin" : "pin" ,
464+ label : isPinned ? "Unpin chat" : "Pin chat" ,
465+ } ,
461466 {
462467 type : "divider" ,
463468 } ,
@@ -469,14 +474,27 @@ export function ChatPanel({
469474 onClick : ( { key } ) => {
470475 if ( key === "rename" ) {
471476 openRenameModal ( threadKey , displayLabel , hasCustomName ) ;
477+ } else if ( key === "pin" || key === "unpin" ) {
478+ if ( ! actions ?. setThreadPin ) {
479+ antdMessage . error ( "Pinning chats is not available." ) ;
480+ return ;
481+ }
482+ const pinned = key === "pin" ;
483+ const success = actions . setThreadPin ( threadKey , pinned ) ;
484+ if ( ! success ) {
485+ antdMessage . error ( "Unable to update chat pin state." ) ;
486+ return ;
487+ }
488+ antdMessage . success ( pinned ? "Chat pinned." : "Chat unpinned." ) ;
472489 } else if ( key === "delete" ) {
473490 confirmDeleteThread ( threadKey ) ;
474491 }
475492 } ,
476493 } ) ;
477494
478495 const renderThreadRow = ( thread : ThreadMeta ) => {
479- const { key, displayLabel, hasCustomName, unreadCount, isAI } = thread ;
496+ const { key, displayLabel, hasCustomName, unreadCount, isAI, isPinned } =
497+ thread ;
480498 const plainLabel = stripHtml ( displayLabel ) ;
481499 const isHovered = hoveredThread === key ;
482500 const showMenu = isHovered || selectedThreadKey === key ;
@@ -510,7 +528,7 @@ export function ChatPanel({
510528 ) }
511529 { showMenu && (
512530 < Dropdown
513- menu = { threadMenuProps ( key , plainLabel , hasCustomName ) }
531+ menu = { threadMenuProps ( key , plainLabel , hasCustomName , isPinned ) }
514532 trigger = { [ "click" ] }
515533 >
516534 < Button
@@ -1006,7 +1024,6 @@ export function ChatPanel({
10061024 if ( ! message ) {
10071025 return ;
10081026 }
1009- console . log ( "start video chat returned" , { message } ) ;
10101027 sendMessage ( undefined , "\n\n" + message ) ;
10111028 } }
10121029 >
0 commit comments