mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-28 23:11:19 -07:00
feat(sessions): add /resume slash command to open the session browser (#13621)
This commit is contained in:
@@ -190,6 +190,7 @@ describe('useSlashCommandProcessor', () => {
|
||||
openEditorDialog: vi.fn(),
|
||||
openPrivacyNotice: vi.fn(),
|
||||
openSettingsDialog: vi.fn(),
|
||||
openSessionBrowser: vi.fn(),
|
||||
openModelDialog: mockOpenModelDialog,
|
||||
openPermissionsDialog: vi.fn(),
|
||||
quit: mockSetQuittingMessages,
|
||||
|
||||
@@ -52,6 +52,7 @@ interface SlashCommandProcessorActions {
|
||||
openEditorDialog: () => void;
|
||||
openPrivacyNotice: () => void;
|
||||
openSettingsDialog: () => void;
|
||||
openSessionBrowser: () => void;
|
||||
openModelDialog: () => void;
|
||||
openPermissionsDialog: (props?: { targetDirectory?: string }) => void;
|
||||
quit: (messages: HistoryItem[]) => void;
|
||||
@@ -410,6 +411,9 @@ export const useSlashCommandProcessor = (
|
||||
case 'privacy':
|
||||
actions.openPrivacyNotice();
|
||||
return { type: 'handled' };
|
||||
case 'sessionBrowser':
|
||||
actions.openSessionBrowser();
|
||||
return { type: 'handled' };
|
||||
case 'settings':
|
||||
actions.openSettingsDialog();
|
||||
return { type: 'handled' };
|
||||
|
||||
@@ -91,12 +91,16 @@ export const useSessionBrowser = (
|
||||
*/
|
||||
handleDeleteSession: useCallback(
|
||||
(session: SessionInfo) => {
|
||||
// Note: Chat sessions are stored on disk using a filename derived from
|
||||
// the session, e.g. "session-<timestamp>-<sessionIdPrefix>.json".
|
||||
// The ChatRecordingService.deleteSession API expects this file basename
|
||||
// (without the ".json" extension), not the full session UUID.
|
||||
try {
|
||||
const chatRecordingService = config
|
||||
.getGeminiClient()
|
||||
?.getChatRecordingService();
|
||||
if (chatRecordingService) {
|
||||
chatRecordingService.deleteSession(session.id);
|
||||
chatRecordingService.deleteSession(session.file);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Error deleting session:', error);
|
||||
|
||||
Reference in New Issue
Block a user