@@ -102,6 +102,7 @@ import { type UpdateObject } from './utils/updateCheck.js';
102102import { setUpdateHandler } from '../utils/handleAutoUpdate.js' ;
103103import { registerCleanup , runExitCleanup } from '../utils/cleanup.js' ;
104104import { RELAUNCH_EXIT_CODE } from '../utils/processUtils.js' ;
105+ import type { SessionInfo } from '../utils/sessionUtils.js' ;
105106import { useMessageQueue } from './hooks/useMessageQueue.js' ;
106107import { useAutoAcceptIndicator } from './hooks/useAutoAcceptIndicator.js' ;
107108import { useSessionStats } from './contexts/SessionContext.js' ;
@@ -121,9 +122,10 @@ import {
121122 useExtensionUpdates ,
122123} from './hooks/useExtensionUpdates.js' ;
123124import { ShellFocusContext } from './contexts/ShellFocusContext.js' ;
124- import { useSessionResume } from './hooks/useSessionResume.js' ;
125125import { type ExtensionManager } from '../config/extension-manager.js' ;
126126import { requestConsentInteractive } from '../config/extensions/consent.js' ;
127+ import { useSessionBrowser } from './hooks/useSessionBrowser.js' ;
128+ import { useSessionResume } from './hooks/useSessionResume.js' ;
127129import { useIncludeDirsTrust } from './hooks/useIncludeDirsTrust.js' ;
128130import { isWorkspaceTrusted } from '../config/trustedFolders.js' ;
129131import { useAlternateBuffer } from './hooks/useAlternateBuffer.js' ;
@@ -449,7 +451,7 @@ export const AppContainer = (props: AppContainerProps) => {
449451 // Session browser and resume functionality
450452 const isGeminiClientInitialized = config . getGeminiClient ( ) ?. isInitialized ( ) ;
451453
452- useSessionResume ( {
454+ const { loadHistoryForResume } = useSessionResume ( {
453455 config,
454456 historyManager,
455457 refreshStatic,
@@ -458,6 +460,20 @@ export const AppContainer = (props: AppContainerProps) => {
458460 resumedSessionData,
459461 isAuthenticating,
460462 } ) ;
463+ const {
464+ isSessionBrowserOpen,
465+ openSessionBrowser,
466+ closeSessionBrowser,
467+ handleResumeSession,
468+ handleDeleteSession : handleDeleteSessionSync ,
469+ } = useSessionBrowser ( config , loadHistoryForResume ) ;
470+ // Wrap handleDeleteSession to return a Promise for UIActions interface
471+ const handleDeleteSession = useCallback (
472+ async ( session : SessionInfo ) : Promise < void > => {
473+ handleDeleteSessionSync ( session ) ;
474+ } ,
475+ [ handleDeleteSessionSync ] ,
476+ ) ;
461477
462478 // Create handleAuthSelect wrapper for backward compatibility
463479 const handleAuthSelect = useCallback (
@@ -593,6 +609,7 @@ Logging in with Google... Restarting Gemini CLI to continue.
593609 openLanguageDialog,
594610 openPrivacyNotice : ( ) => setShowPrivacyNotice ( true ) ,
595611 openSettingsDialog,
612+ openSessionBrowser,
596613 openModelDialog,
597614 openPermissionsDialog,
598615 quit : ( messages : HistoryItem [ ] ) => {
@@ -614,6 +631,7 @@ Logging in with Google... Restarting Gemini CLI to continue.
614631 openEditorDialog ,
615632 openLanguageDialog ,
616633 openSettingsDialog ,
634+ openSessionBrowser ,
617635 openModelDialog ,
618636 setQuittingMessages ,
619637 setDebugMessage ,
@@ -1356,6 +1374,7 @@ Logging in with Google... Restarting Gemini CLI to continue.
13561374 showPrivacyNotice ||
13571375 showIdeRestartPrompt ||
13581376 ! ! proQuotaRequest ||
1377+ isSessionBrowserOpen ||
13591378 isAuthDialogOpen ||
13601379 authState === AuthState . AwaitingApiKeyInput ;
13611380
@@ -1586,7 +1605,8 @@ Logging in with Google... Restarting Gemini CLI to continue.
15861605 let reason = 'general' ;
15871606
15881607 if ( shouldShowIdePrompt ) {
1589- message = 'IDE integration prompt is displayed. Please respond to connect your editor to Auditaria CLI in the terminal.' ;
1608+ message =
1609+ 'IDE integration prompt is displayed. Please respond to connect your editor to Auditaria CLI in the terminal.' ;
15901610 reason = 'ide_integration' ;
15911611 } else if ( isAuthenticating || isAuthDialogOpen ) {
15921612 const authMessage = isAuthenticating
@@ -1595,37 +1615,47 @@ Logging in with Google... Restarting Gemini CLI to continue.
15951615 message = authMessage ;
15961616 reason = 'authentication' ;
15971617 } else if ( isThemeDialogOpen ) {
1598- message = 'Theme selection is open. Please choose a theme in the CLI terminal.' ;
1618+ message =
1619+ 'Theme selection is open. Please choose a theme in the CLI terminal.' ;
15991620 reason = 'theme_selection' ;
16001621 } else if ( isEditorDialogOpen ) {
1601- message = 'Editor settings are open. Please configure your editor in the CLI terminal.' ;
1622+ message =
1623+ 'Editor settings are open. Please configure your editor in the CLI terminal.' ;
16021624 reason = 'editor_settings' ;
16031625 } else if ( isLanguageDialogOpen ) {
1604- message = 'Language selection is open. Please choose a language in the CLI terminal.' ;
1626+ message =
1627+ 'Language selection is open. Please choose a language in the CLI terminal.' ;
16051628 reason = 'language_selection' ;
16061629 } else if ( isSettingsDialogOpen ) {
1607- message = 'Settings dialog is open. Please configure settings in the CLI terminal.' ;
1630+ message =
1631+ 'Settings dialog is open. Please configure settings in the CLI terminal.' ;
16081632 reason = 'settings' ;
16091633 } else if ( isModelDialogOpen ) {
1610- message = 'Model selection is open. Please choose a model in the CLI terminal.' ;
1634+ message =
1635+ 'Model selection is open. Please choose a model in the CLI terminal.' ;
16111636 reason = 'model_selection' ;
16121637 } else if ( isFolderTrustDialogOpen ) {
1613- message = 'Folder trust dialog is open. Please respond in the CLI terminal.' ;
1638+ message =
1639+ 'Folder trust dialog is open. Please respond in the CLI terminal.' ;
16141640 reason = 'folder_trust' ;
16151641 } else if ( showPrivacyNotice ) {
1616- message = 'Privacy notice is displayed. Please review in the CLI terminal.' ;
1642+ message =
1643+ 'Privacy notice is displayed. Please review in the CLI terminal.' ;
16171644 reason = 'privacy_notice' ;
16181645 } else if ( proQuotaRequest ) {
1619- message = 'Quota exceeded dialog is open. Please choose an option in the CLI terminal.' ;
1646+ message =
1647+ 'Quota exceeded dialog is open. Please choose an option in the CLI terminal.' ;
16201648 reason = 'quota_exceeded' ;
16211649 } else if ( shellConfirmationRequest ) {
1622- message = 'Shell command confirmation required. Please respond in the CLI terminal.' ;
1650+ message =
1651+ 'Shell command confirmation required. Please respond in the CLI terminal.' ;
16231652 reason = 'shell_confirmation' ;
16241653 } else if ( confirmationRequest ) {
16251654 message = 'Confirmation required. Please respond in the CLI terminal.' ;
16261655 reason = 'confirmation' ;
16271656 } else if ( loopDetectionConfirmationRequest ) {
1628- message = 'Loop detection confirmation required. Please choose whether to keep or disable loop detection in the CLI terminal.' ;
1657+ message =
1658+ 'Loop detection confirmation required. Please choose whether to keep or disable loop detection in the CLI terminal.' ;
16291659 reason = 'loop_detection' ;
16301660 }
16311661
@@ -1825,6 +1855,7 @@ Logging in with Google... Restarting Gemini CLI to continue.
18251855 debugMessage,
18261856 quittingMessages,
18271857 isSettingsDialogOpen,
1858+ isSessionBrowserOpen,
18281859 isModelDialogOpen,
18291860 isPermissionsDialogOpen,
18301861 permissionsDialogProps,
@@ -1917,6 +1948,7 @@ Logging in with Google... Restarting Gemini CLI to continue.
19171948 debugMessage ,
19181949 quittingMessages ,
19191950 isSettingsDialogOpen ,
1951+ isSessionBrowserOpen ,
19201952 isModelDialogOpen ,
19211953 isPermissionsDialogOpen ,
19221954 permissionsDialogProps ,
@@ -2027,6 +2059,10 @@ Logging in with Google... Restarting Gemini CLI to continue.
20272059 handleFinalSubmit,
20282060 handleClearScreen,
20292061 handleProQuotaChoice,
2062+ openSessionBrowser,
2063+ closeSessionBrowser,
2064+ handleResumeSession,
2065+ handleDeleteSession,
20302066 setQueueErrorMessage,
20312067 popAllMessages,
20322068 handleApiKeySubmit,
@@ -2059,6 +2095,10 @@ Logging in with Google... Restarting Gemini CLI to continue.
20592095 handleFinalSubmit ,
20602096 handleClearScreen ,
20612097 handleProQuotaChoice ,
2098+ openSessionBrowser ,
2099+ closeSessionBrowser ,
2100+ handleResumeSession ,
2101+ handleDeleteSession ,
20622102 setQueueErrorMessage ,
20632103 popAllMessages ,
20642104 handleApiKeySubmit ,
0 commit comments