From 9e293a58ea162c6b504676de40e254958ddcb583 Mon Sep 17 00:00:00 2001 From: G30 <50341825+silentoplayz@users.noreply.github.com> Date: Sat, 19 Sep 2026 11:02:11 -0400 Subject: [PATCH] fix: label the search modal's archive action Unarchive for archived chats and report what happened (#30177) --- backend/open_webui/models/chats.py | 1 + backend/open_webui/routers/chats.py | 1 + src/lib/components/layout/SearchModal.svelte | 5 +++-- src/lib/components/layout/Sidebar/ChatMenu.svelte | 5 ++++- src/lib/i18n/locales/en-US/translation.json | 2 ++ 5 files changed, 11 insertions(+), 3 deletions(-) diff --git a/backend/open_webui/models/chats.py b/backend/open_webui/models/chats.py index 2d1aeddd05..23b5276786 100644 --- a/backend/open_webui/models/chats.py +++ b/backend/open_webui/models/chats.py @@ -305,6 +305,7 @@ class ChatTitleIdResponse(BaseModel): last_read_at: int | None = None snippet: str | None = None active: bool = False + archived: bool = False class SharedChatResponse(BaseModel): diff --git a/backend/open_webui/routers/chats.py b/backend/open_webui/routers/chats.py index 9f7cd98c82..c3eb390a78 100644 --- a/backend/open_webui/routers/chats.py +++ b/backend/open_webui/routers/chats.py @@ -888,6 +888,7 @@ async def search_user_chats( created_at=chat.created_at, last_read_at=chat.last_read_at, snippet=chat_search_snippet(chat.chat, search_text), + archived=chat.archived, ) ) diff --git a/src/lib/components/layout/SearchModal.svelte b/src/lib/components/layout/SearchModal.svelte index c687b9b4bc..a3c0e78be3 100644 --- a/src/lib/components/layout/SearchModal.svelte +++ b/src/lib/components/layout/SearchModal.svelte @@ -101,7 +101,7 @@ const archiveChatHandler = async (id) => { try { - await archiveChatById(localStorage.token, id); + const res = await archiveChatById(localStorage.token, id); chatList = chatList?.filter((c) => c.id !== id) ?? null; @@ -111,7 +111,7 @@ } await refreshSidebar(); - toast.success($i18n.t('Chat archived.')); + toast.success(res?.archived ? $i18n.t('Chat archived.') : $i18n.t('Chat unarchived.')); } catch (error) { toast.error($i18n.t('Failed to archive chat.')); } @@ -816,6 +816,7 @@