Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1304,11 +1304,12 @@ const SessionsSection: React.FC<SessionsSectionProps> = ({
try {
await flowChatManager.archiveChatSession(sessionId);
window.dispatchEvent(new CustomEvent('openbitfun:session-archived'));
notificationService.success(t('nav.sessions.archivedAll', { count: 1 }), { duration: 3000 });
} catch (err) {
log.error('Failed to archive session', err);
}
},
[]
[t]
);

const handleCopySessionId = useCallback(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1207,7 +1207,10 @@ describe('SessionModule historical session coordination', () => {
expect(persistenceMocks.cleanupSaveState).toHaveBeenCalledWith(context, 'active-1');
});

it('cancels a speculative history-open transition when deleting its target', async () => {
it.each([
['deleting', deleteChatSession],
['archiving', archiveChatSession],
] as const)('cancels a speculative history-open transition when %s its target', async (_action, removeSession) => {
const historicalSession = createSession({
sessionId: 'history-delete',
isHistorical: true,
Expand All @@ -1223,7 +1226,7 @@ describe('SessionModule historical session coordination', () => {
sessionId: historicalSession.sessionId,
});

await deleteChatSession(context, historicalSession.sessionId);
await removeSession(context, historicalSession.sessionId);

expect(getHistorySessionOpenTransitionSnapshot()).toBeNull();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -898,6 +898,13 @@ export async function archiveChatSession(
&& removedSessionIdSet.has(stateBeforeArchive.activeSessionId)
);

// Match deletion: a removed session must not leave a pending history-open
// shield or navigation intent behind while the archive request settles.
removedSessionIds.forEach(removedSessionId => {
clearRecentHistorySessionOpenIntent(removedSessionId);
clearHistorySessionOpenTransition(removedSessionId);
});

await driverForSession(sessionId, session).archiveSession(context, sessionId, {
removedSessionIds,
removedActiveSession,
Expand Down
2 changes: 1 addition & 1 deletion src/web-ui/src/locales/en-US/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@
"restore": "Restore",
"restoreSucceeded": "Restored “{{name}}” in {{workspace}}.",
"restoreRefreshFailed": "The session was restored, but the session list could not refresh. Refresh the workspace manually.",
"archivedAll": "{{count}} sessions archived",
"archivedAll": "Archived {{count}} sessions. View them in Settings → Archived Sessions.",
"restoreFailed": "Failed to restore session",
"deleteArchivedFailed": "Failed to delete session",
"deleteAllArchivedFailed": "Failed to delete all archived sessions",
Expand Down
2 changes: 1 addition & 1 deletion src/web-ui/src/locales/zh-CN/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@
"restore": "恢复",
"restoreSucceeded": "已恢复“{{name}}”({{workspace}})。",
"restoreRefreshFailed": "会话已恢复,但会话列表刷新失败;请手动刷新工作区。",
"archivedAll": "已归档 {{count}} 个会话",
"archivedAll": "已归档 {{count}} 个会话,可在设置 → 已归档会话中查看。",
"restoreFailed": "恢复会话失败",
"deleteArchivedFailed": "删除会话失败",
"deleteAllArchivedFailed": "删除全部已归档会话失败",
Expand Down
2 changes: 1 addition & 1 deletion src/web-ui/src/locales/zh-TW/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@
"restore": "恢復",
"restoreSucceeded": "已恢復「{{name}}」({{workspace}})。",
"restoreRefreshFailed": "會話已恢復,但會話列表重新整理失敗;請手動重新整理工作區。",
"archivedAll": "已歸檔 {{count}} 個會話",
"archivedAll": "已歸檔 {{count}} 個會話,可在設定 → 已歸檔會話中檢視。",
"restoreFailed": "恢復會話失敗",
"deleteArchivedFailed": "刪除會話失敗",
"deleteAllArchivedFailed": "刪除全部已歸檔會話失敗",
Expand Down
Loading