From b31ae40d2eb4b078309f5a39f5d2b33c883a291e Mon Sep 17 00:00:00 2001 From: Classic298 <27028174+Classic298@users.noreply.github.com> Date: Sat, 7 Nov 2026 03:32:30 +0100 Subject: [PATCH] fix: New File, New Terminal and Browser tabs do nothing over plain HTTP (#33847) Opening a file, terminal or browser tab from the + menu in the side panel silently did nothing when Open WebUI was reached over plain HTTP on a LAN or Docker host address. The browser only offers its built-in id generator on HTTPS or localhost, so the click failed before the tab was created. Tab and split ids now use the same uuid helper as the rest of the app, which works on every connection. Fixes #33845 --- src/lib/components/chat/ChatTabs.svelte | 11 ++++++----- src/lib/components/chat/ChatTabs/tabs.ts | 5 +++-- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/lib/components/chat/ChatTabs.svelte b/src/lib/components/chat/ChatTabs.svelte index 7c55627290..8c3122f611 100644 --- a/src/lib/components/chat/ChatTabs.svelte +++ b/src/lib/components/chat/ChatTabs.svelte @@ -5,6 +5,7 @@ let fileGitDiffModes: Record = {}; let fileGitHideWhitespace: Record = {}; import { onMount, onDestroy, tick, getContext } from 'svelte'; + import { v4 as uuidv4 } from 'uuid'; import Sortable from 'sortablejs'; import { beforeNavigate, goto } from '$app/navigation'; import { @@ -276,7 +277,7 @@ let number = 1; while (tabs.tabs.some((tab) => tab.untitled && tab.label === `Untitled-${number}`)) number++; openPanel({ - id: crypto.randomUUID(), + id: uuidv4(), kind: 'file', label: `Untitled-${number}`, terminalId: selectedConnection.selector, @@ -296,7 +297,7 @@ const initialPrompt = pending?.parentId === chatId ? pending.prompt : ''; if (pending?.parentId === chatId) sideChatRequest.set(null); openPanel({ - id: crypto.randomUUID(), + id: uuidv4(), kind, label: `${view.label} ${sideChatNumber}`, sideChatNumber, @@ -418,7 +419,7 @@ let id = existing; if (!id) { focusGroup(groupId); - id = crypto.randomUUID(); + id = uuidv4(); tabs = openTab(tabs, { id, kind: 'side', label: $i18n.t('Chat'), chatId: savedId }); } tabs = bounds.edge @@ -466,7 +467,7 @@ terminalNumber++; } openPanel({ - id: crypto.randomUUID(), + id: uuidv4(), kind: 'terminal', label: `${$i18n.t('Terminal')} ${terminalNumber}`, terminalNumber, @@ -518,7 +519,7 @@ ? `${connection.baseUrl}/chats/${encodeURIComponent(chatId)}` : connection?.baseUrl); openPanel({ - id: crypto.randomUUID(), + id: uuidv4(), kind: 'browser', label: port ? `localhost:${port}` : $i18n.t('Browser'), path: url, diff --git a/src/lib/components/chat/ChatTabs/tabs.ts b/src/lib/components/chat/ChatTabs/tabs.ts index c5f47ec9ea..f5a5a81e25 100644 --- a/src/lib/components/chat/ChatTabs/tabs.ts +++ b/src/lib/components/chat/ChatTabs/tabs.ts @@ -1,3 +1,4 @@ +import { v4 as uuidv4 } from 'uuid'; import type { TerminalContext } from '$lib/types'; import type { TerminalConnection } from '$lib/apis/terminal'; @@ -221,7 +222,7 @@ export function splitTab( if (!source || !state.groups.some((group) => group.id === groupId)) return state; if (source.id === groupId && source.tabIds.length === 1) return state; const next = removeFromGroup(state, id); - const newGroup: PanelGroup = { id: crypto.randomUUID(), tabIds: [id], activeId: id }; + const newGroup: PanelGroup = { id: uuidv4(), tabIds: [id], activeId: id }; const replace = (layout: PanelLayout): PanelLayout => { if (layout.type === 'group') { if (layout.groupId !== groupId) return layout; @@ -229,7 +230,7 @@ export function splitTab( const before = edge === 'left' || edge === 'top'; return { type: 'split', - id: crypto.randomUUID(), + id: uuidv4(), direction: edge === 'left' || edge === 'right' ? 'horizontal' : 'vertical', ratio: 0.5, first: before ? leaf : layout,