File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
packages/ai-chat-ui/src/browser Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -398,6 +398,8 @@ export class AIChatContribution extends AbstractViewContribution<ChatViewWidget>
398398 }
399399 } ) ;
400400 } else if ( context . button === AIChatContribution . REMOVE_CHAT_BUTTON ) {
401+ const activeSession = this . chatService . getActiveSession ( ) ;
402+
401403 // Wait for deletion to complete before refreshing the list
402404 this . chatService . deleteSession ( context . item . id ! ) . then ( ( ) => getItems ( ) ) . then ( items => {
403405 quickPick . items = items ;
@@ -406,6 +408,13 @@ export class AIChatContribution extends AbstractViewContribution<ChatViewWidget>
406408 }
407409 // Update persisted sessions flag after deletion
408410 this . checkPersistedSessions ( ) ;
411+
412+ if ( activeSession && activeSession . id === context . item . id ) {
413+ this . chatService . createSession ( ChatAgentLocation . Panel , {
414+ // Auto-focus only when the quick pick is no longer visible
415+ focus : items . length === 0
416+ } ) ;
417+ }
409418 } ) . catch ( error => {
410419 this . logger . error ( 'Failed to delete chat session' , error ) ;
411420 this . messageService . error ( nls . localize ( 'theia/ai/chat-ui/failedToDeleteSession' , 'Failed to delete chat session' ) ) ;
You can’t perform that action at this time.
0 commit comments