File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -479,6 +479,20 @@ function SessionsPage() {
479479 // then delete from the session store. Errors are logged but don't block the UI.
480480 const sidebarQueryClient = useQueryClient ( )
481481
482+ const renameSessionFromSidebar = useCallback ( async ( sessionId : string , currentName : string ) => {
483+ if ( ! api ) return
484+ const next = window . prompt ( 'Rename session' , currentName )
485+ if ( next === null ) return
486+ const trimmed = next . trim ( )
487+ if ( ! trimmed || trimmed === currentName ) return
488+ try {
489+ await api . renameSession ( sessionId , trimmed )
490+ await sidebarQueryClient . invalidateQueries ( { queryKey : queryKeys . sessions } )
491+ } catch ( err ) {
492+ console . error ( 'Failed to rename session from sidebar:' , err )
493+ }
494+ } , [ api , sidebarQueryClient ] )
495+
482496 const shareSessionFromSidebar = useCallback ( async ( sessionId : string ) => {
483497 if ( typeof window === 'undefined' ) return
484498 const url = `${ window . location . origin } /sessions/${ sessionId } `
@@ -707,6 +721,17 @@ function SessionsPage() {
707721 zIndex : 200 ,
708722 } }
709723 >
724+ < button
725+ className = "menu-action"
726+ onClick = { ( e ) => {
727+ e . stopPropagation ( )
728+ setOpenMenuSessionId ( null )
729+ setSessionMenuAnchor ( null )
730+ void renameSessionFromSidebar ( session . id , title )
731+ } }
732+ >
733+ Rename
734+ </ button >
710735 < button
711736 className = "menu-action"
712737 onClick = { ( e ) => {
You can’t perform that action at this time.
0 commit comments