open-webui/src/lib/components/layout
G30 06d2189b26
fix(chat): keep sidebar chat selection in sync with the active chat (#26977)
When navigating from a chat to a non-chat route (e.g. the admin panel),
the previously-viewed chat stayed selected in the sidebar and
deleting/archiving it wrongly redirected back to the new-chat page.
Cloning a chat also left the source chat highlighted alongside the new
clone, so two chats appeared selected at once.

Two independent sources kept the stale selection:

- The chatId store was never cleared when the Chat component unmounted,
  so $chatId still pointed at the last-viewed chat (this drove the
  delete/archive redirect). Clear chatId/chatTitle in Chat's onDestroy.
- The sidebar's optimistic selectedChatId highlight, set on click, was
  only cleared on window blur (hence it appeared to fix itself after a
  tab switch) and never followed programmatic navigation. Bind it to the
  chatId store so it tracks the active chat for leave, delete and clone.
2026-07-24 01:45:37 -05:00
..
Navbar refac 2026-07-14 03:10:12 -04:00
Overlay refac 2026-07-14 04:15:20 -04:00
Sidebar refac 2026-07-24 00:40:21 -04:00
ChatsModal.svelte refac 2026-07-15 05:17:41 -04:00
FilesModal.svelte refac 2026-07-15 04:25:51 -04:00
SearchModal.svelte refac 2026-07-23 17:53:13 -04:00
SharedChatsModal.svelte refac 2026-07-14 04:15:20 -04:00
Sidebar.svelte fix(chat): keep sidebar chat selection in sync with the active chat (#26977) 2026-07-24 01:45:37 -05:00
UpdateInfoToast.svelte refac 2026-07-14 04:15:20 -04:00