feat(admin): enable 30 day default retention for chat history & remove warning (#20853)

This commit is contained in:
Shreya Keshive
2026-03-02 17:44:49 -05:00
committed by GitHub
parent 3f7ef816f1
commit 06ddfa5c4c
14 changed files with 16 additions and 623 deletions

View File

@@ -37,9 +37,6 @@ import { AdminSettingsChangedDialog } from './AdminSettingsChangedDialog.js';
import { IdeTrustChangeDialog } from './IdeTrustChangeDialog.js';
import { NewAgentsNotification } from './NewAgentsNotification.js';
import { AgentConfigDialog } from './AgentConfigDialog.js';
import { SessionRetentionWarningDialog } from './SessionRetentionWarningDialog.js';
import { useCallback } from 'react';
import { SettingScope } from '../../config/settings.js';
import { PolicyUpdateDialog } from './PolicyUpdateDialog.js';
interface DialogManagerProps {
@@ -62,56 +59,8 @@ export const DialogManager = ({
terminalHeight,
staticExtraHeight,
terminalWidth: uiTerminalWidth,
shouldShowRetentionWarning,
sessionsToDeleteCount,
} = uiState;
const handleKeep120Days = useCallback(() => {
settings.setValue(
SettingScope.User,
'general.sessionRetention.warningAcknowledged',
true,
);
settings.setValue(
SettingScope.User,
'general.sessionRetention.enabled',
true,
);
settings.setValue(
SettingScope.User,
'general.sessionRetention.maxAge',
'120d',
);
}, [settings]);
const handleKeep30Days = useCallback(() => {
settings.setValue(
SettingScope.User,
'general.sessionRetention.warningAcknowledged',
true,
);
settings.setValue(
SettingScope.User,
'general.sessionRetention.enabled',
true,
);
settings.setValue(
SettingScope.User,
'general.sessionRetention.maxAge',
'30d',
);
}, [settings]);
if (shouldShowRetentionWarning && sessionsToDeleteCount !== undefined) {
return (
<SessionRetentionWarningDialog
onKeep120Days={handleKeep120Days}
onKeep30Days={handleKeep30Days}
sessionsToDeleteCount={sessionsToDeleteCount ?? 0}
/>
);
}
if (uiState.adminSettingsChanged) {
return <AdminSettingsChangedDialog />;
}