mirror of
https://github.com/open-webui/open-webui.git
synced 2026-11-30 08:55:12 -05:00
refac
This commit is contained in:
1 parent
65f64e37b8
commit
ee7846286c
3 files changed
+10
-1
No files matched your search
@@ -115,10 +115,18 @@ class PanelTabs(ViewModel):
|
||||
raise ValueError('Layout must contain every group exactly once')
|
||||
|
||||
|
||||
class FolderPage(ViewModel):
|
||||
"""What a folder's own page showed: its section and the directory browsed in Files."""
|
||||
|
||||
section: Literal['files', 'chats', 'notes', 'automations', 'knowledge']
|
||||
directory: str | None = None
|
||||
|
||||
|
||||
class ChatViewData(ViewModel):
|
||||
schemaVersion: Literal[1]
|
||||
selectedMachineId: str | None
|
||||
panels: PanelTabs
|
||||
folderPage: FolderPage | None = None
|
||||
|
||||
@model_validator(mode='before')
|
||||
@classmethod
|
||||
|
||||
@@ -34,7 +34,6 @@
|
||||
<li>
|
||||
<a
|
||||
href="/folders/{folder.id}"
|
||||
data-sveltekit-keepfocus
|
||||
class="group flex items-center gap-2 h-7 -mx-2 px-2 rounded-lg text-sm transition-colors duration-75 hover:bg-base-50 dark:hover:bg-base-850"
|
||||
title={[
|
||||
folder.name,
|
||||
|
||||
@@ -473,6 +473,8 @@
|
||||
}
|
||||
/** Keeps the layout in step with the chat: carry it over, attach it to the new chat id, or load. */
|
||||
function followChat(current: ViewState, id: string | null) {
|
||||
// Leaving a folder for anything else, even without a restore, means returning to it is not opening it again from inside.
|
||||
if (!isFolderSessionId(id)) lastFolderView = null;
|
||||
if (current.status === 'idle') return void restoreChatView(id);
|
||||
// A folder keeps its own tabs; nothing is carried into it.
|
||||
if (isFolderSessionId(id) && current.entry.chatId !== id) return void restoreChatView(id);
|
||||
|
||||
Reference in new issue
Block a user