{ stopTerminalChoice?.(true); stopTerminalChoice = null; }} on:cancel={() => { stopTerminalChoice?.(false); stopTerminalChoice = null; }} /> {activeTab?.kind === 'page' || (activeTab?.kind === 'chat' && activeTab.id !== mainChatTabId && $settings.showChatTitleInTab !== false) ? `${activeTab.label} / ${$WEBUI_NAME}` : $settings.showChatTitleInTab !== false && chatId && title ? `${title.length > 30 ? `${title.slice(0, 30)}...` : title} / ${$WEBUI_NAME}` : $WEBUI_NAME} { if (event.target instanceof Element && event.target.closest('#sidebar')) isDragging = true; }} on:dragend|capture={() => { isDragging = false; clearChatDropPreview(); }} on:drop|capture={clearChatDropPreview} on:blur={clearChatDropPreview} /> {#if chatDropPreview}
{$i18n.t('Open in side panel')}
{/if} {#if voiceNoteDestination} {@const target = voiceNoteDestination} { voiceNoteDestination = null; }} onsaved={(path) => openFile(path, target.target.selector)} /> {/if} {#if showQuickOpen && supportsMachineFiles && selectedConnection} {#key JSON.stringify([selectedConnection.baseUrl, selectedConnection.context.modelId, chatId])} { showQuickOpen = false; }} onselect={(path) => openFile(path, selectedConnection!.selector)} /> {/key} {/if} {#if pendingMachineAction} { pendingMachineAction = null; }} onselect={runWithMachine} /> {/if} {#snippet tabBar(group: TabGroup)}
{ const strip = event.currentTarget; if ( event.ctrlKey || event.shiftKey || Math.abs(event.deltaY) <= Math.abs(event.deltaX) || strip.scrollWidth <= strip.clientWidth ) return; const unit = event.deltaMode === 1 ? 16 : event.deltaMode === 2 ? strip.clientWidth : 1; event.preventDefault(); strip.scrollLeft += event.deltaY * unit; }} > {#each group.tabIds.map((id) => tabs.tabs.find((tab) => tab.id === id)!) as tab (tab.id)} {@const titleEditor = tab.id === mainChatTabId ? mainTabFolder ? undefined : tabTitleEditor : chatTitleEditors[tab.id]} {@const PageIcon = tab.kind === 'page' ? pageIcons[tab.href?.split(/[/?#]/)[1] ?? ''] : null}
selectTab(tab.id)} class="panel-tab flex cursor-pointer items-center gap-1.5 ps-2.5 pe-2 h-7 rounded-lg text-sm font-normal whitespace-nowrap shrink-0 transition {group.activeId === tab.id ? 'bg-base-100/40 dark:bg-base-800/25 text-base-700 dark:text-base-200' : 'text-base-500 dark:text-base-400 hover:bg-base-100/30 dark:hover:bg-base-800/20 hover:text-base-600 dark:hover:text-base-300'}" > {@render titleEditor?.()} {#if tab.untitled || dirtyFiles[tab.id]}{/if} {#if tab.id === mainChatTabId} {#if mainTabFolder && isRenamingFolder} { if (e.isComposing || e.keyCode === 229) return; if (e.key === 'Enter') { e.preventDefault(); void saveFolderRename(); } else if (e.key === 'Escape') { e.preventDefault(); isRenamingFolder = false; } }} on:blur={saveFolderRename} /> {/if} {@render tabActions?.()} {:else if !titleEditor}{#if chatTabActions[tab.id]}{@render chatTabActions[tab.id]?.()}{/if}{/if}
{/each}
{#if canOpenNewTab && viewReady && !chatLoading}
{#if showFilesTab || canSelectMachine} {/if} {#if supportsMachineFiles || canSelectMachine}{/if} {#if supportsMachine || canSelectMachine}{/if} {#if canVoiceNote || canSelectMachine} {/if} {#if supportsBrowser || canSelectMachine}{/if} {#if supportsDesktop || canSelectMachine}{/if} {#each newTabViews.filter((view) => view.kind !== 'artifacts') as view} {/each} {#if groupChatOverview(group) ? Object.keys(groupChatOverview(group)?.history?.messages ?? {}).length > 0 : hasMessages} {/if} {#if showArtifactsTab} {/if}
{/if}
{#if group.activeId === mainChatTabId}
{@render tabBarActions?.()}
{/if} {#if !fullWidth && (!isLargeScreen || group.id === tabs.groups[0].id)} {/if}
{/snippet} {#if !isLargeScreen} showTabs.set(open)} let:visible let:panelStyle let:backdropStyle > {#if visible} showTabs.set(false)} onRequestClose={() => showTabs.set(false)} panelStyle={$mobile ? panelStyle : ''} backdropStyle={$mobile ? backdropStyle : ''} swipeSide={$mobile ? 'right' : undefined} className="min-h-[100dvh] !bg-base-0 dark:!bg-base-900" >
{/if}
{:else if fullWidth}
{/if}