refactor(sessions): persist archive state in SQLite (#6536)
* feat(webui): add archived chat management * fix(webui): keep archived chats in the sidebar * feat(webui): scope archived topics to sidebar groups * fix(webui): reuse group dissolve label * fix(webui): fail fast when adding panes * refactor(sessions): persist archive state in SQLite * refactor: limit archive changes to SQLite storage * perf(sessions): avoid redundant archive I/O and read barriers * fix(sessions): archive only persisted conversations
This commit is contained in:
1 parent
58a05ea3e0
commit
80ac41b1f4
16 files changed
+751
-107
No files matched your search
+7
-2
@@ -2072,7 +2072,11 @@ function Shell({
|
||||
|
||||
const onArchiveMany = useCallback(
|
||||
(keys: string[], archive: boolean) => {
|
||||
const selected = new Set(keys);
|
||||
const persistedKeys = new Set(sessions
|
||||
.filter((session) => session.projectLocked !== false)
|
||||
.map((session) => session.key));
|
||||
const selected = new Set(keys.filter((key) => persistedKeys.has(key)));
|
||||
if (selected.size === 0) return;
|
||||
void updateSidebarState((current) => {
|
||||
const archived = new Set(current.archived_keys);
|
||||
for (const key of selected) {
|
||||
@@ -2095,7 +2099,7 @@ function Shell({
|
||||
});
|
||||
}
|
||||
},
|
||||
[activeKey, navigate, sidebarState.archived_keys, topicSessions, updateSidebarState],
|
||||
[activeKey, navigate, sessions, sidebarState.archived_keys, topicSessions, updateSidebarState],
|
||||
);
|
||||
|
||||
const onToggleArchive = useCallback((key: string) => {
|
||||
@@ -2652,6 +2656,7 @@ function Shell({
|
||||
chatId: session.chatId,
|
||||
title: titleForSession(session),
|
||||
handle: session.handle,
|
||||
projectLocked: session.projectLocked !== false,
|
||||
}));
|
||||
return [presentation.rowKey, {
|
||||
tabKey: orderedTab.tabKey,
|
||||
|
||||
Reference in new issue
Block a user