mirror of
https://github.com/open-webui/open-webui.git
synced 2026-12-04 18:47:56 -05:00
refac
This commit is contained in:
1 parent
4615d30a61
commit
75f8ae5584
9 files changed
+103
-43
No files matched your search
@@ -362,9 +362,12 @@
|
||||
});
|
||||
let noteCommentCount = 0;
|
||||
$: if (currentNoteComments) showNoteChat = true;
|
||||
const closeNotePanel = () => {
|
||||
const closeNotePanel = async () => {
|
||||
currentNoteComments = null;
|
||||
showNoteChat = false;
|
||||
|
||||
await tick();
|
||||
if (document.activeElement === document.body) noteChatButtonElement?.focus();
|
||||
};
|
||||
let noteChatId = null;
|
||||
let noteChatLoading = false;
|
||||
@@ -390,6 +393,9 @@
|
||||
let ignoreBlur = false;
|
||||
let titleInputFocused = false;
|
||||
let titleGenerating = false;
|
||||
let titleInputElement: HTMLInputElement;
|
||||
let noteChatButtonElement: HTMLButtonElement;
|
||||
let pagesToggleElement: HTMLButtonElement;
|
||||
|
||||
let dragged = false;
|
||||
let loading = false;
|
||||
@@ -579,6 +585,7 @@ ${content}
|
||||
|
||||
titleGenerating = false;
|
||||
await tick();
|
||||
if (document.activeElement === document.body) titleInputElement?.focus();
|
||||
changeDebounceHandler();
|
||||
};
|
||||
|
||||
@@ -1150,6 +1157,7 @@ ${content}
|
||||
? 'ml-1'
|
||||
: ''}"
|
||||
type="text"
|
||||
bind:this={titleInputElement}
|
||||
bind:value={note.title}
|
||||
placeholder={titleGenerating ? $i18n.t('Generating...') : $i18n.t('Title')}
|
||||
aria-label={$i18n.t('Title')}
|
||||
@@ -1249,6 +1257,7 @@ ${content}
|
||||
type="button"
|
||||
class="p-1 bg-transparent hover:bg-white/5 transition rounded-lg"
|
||||
aria-label={$i18n.t('Chat')}
|
||||
bind:this={noteChatButtonElement}
|
||||
on:click={openNoteChat}
|
||||
>
|
||||
<ChatBubbleOval className="size-4" strokeWidth="1.8" />
|
||||
@@ -1423,6 +1432,7 @@ ${content}
|
||||
class="flex max-w-full items-center gap-1 bg-transparent text-xs text-gray-500 hover:text-gray-900 dark:hover:text-gray-100 transition"
|
||||
aria-expanded={showNoteTabs}
|
||||
aria-controls="note-tabs-panel"
|
||||
bind:this={pagesToggleElement}
|
||||
on:click={() => {
|
||||
showNoteTabs = !showNoteTabs;
|
||||
}}
|
||||
@@ -1521,7 +1531,11 @@ ${content}
|
||||
floating
|
||||
>
|
||||
<NoteTabs
|
||||
onClose={() => (showNoteTabs = false)}
|
||||
onClose={async () => {
|
||||
showNoteTabs = false;
|
||||
await tick();
|
||||
pagesToggleElement?.focus();
|
||||
}}
|
||||
pages={note.data.pages.map((page) =>
|
||||
page.id === 'main' && page.inherit_note_title !== false
|
||||
? { ...page, title: note.title || $i18n.t('Untitled') }
|
||||
|
||||
Reference in new issue
Block a user