From 57c02b25234e2b3182879e020c52fa36c924544b Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Sun, 28 Sep 2025 16:10:00 +0000 Subject: [PATCH] feat: add toggle to show/hide chat title in browser tab This commit introduces a new setting in the Interface settings that allows users to control whether the chat title is used as the browser's tab title. The following changes were made: - Added `useChatTitleAsTabTitle` to the `Settings` type in `src/lib/stores/index.ts`. - Added a toggle switch in `src/lib/components/chat/Settings/Interface.svelte` to manage this new setting. - Updated `src/lib/components/chat/Chat.svelte` to conditionally set the document title based on the `useChatTitleAsTabTitle` setting. --- src/lib/components/chat/Chat.svelte | 2 +- .../components/chat/Settings/Interface.svelte | 21 +++++++++++++++++++ src/lib/stores/index.ts | 1 + 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/src/lib/components/chat/Chat.svelte b/src/lib/components/chat/Chat.svelte index 67b0047750..6157096e44 100644 --- a/src/lib/components/chat/Chat.svelte +++ b/src/lib/components/chat/Chat.svelte @@ -2230,7 +2230,7 @@ - {$chatTitle + {$settings.useChatTitleAsTabTitle !== false && $chatTitle ? `${$chatTitle.length > 30 ? `${$chatTitle.slice(0, 30)}...` : $chatTitle} • ${$WEBUI_NAME}` : `${$WEBUI_NAME}`} diff --git a/src/lib/components/chat/Settings/Interface.svelte b/src/lib/components/chat/Settings/Interface.svelte index 185c4e147f..9f6e1a11a2 100644 --- a/src/lib/components/chat/Settings/Interface.svelte +++ b/src/lib/components/chat/Settings/Interface.svelte @@ -66,6 +66,7 @@ let chatFadeStreamingText = true; let collapseCodeBlocks = false; let expandDetails = false; + let useChatTitleAsTabTitle = true; let showFloatingActionButtons = true; let floatingActionButtons = null; @@ -224,6 +225,7 @@ temporaryChatByDefault = $settings?.temporaryChatByDefault ?? false; chatDirection = $settings?.chatDirection ?? 'auto'; userLocation = $settings?.userLocation ?? false; + useChatTitleAsTabTitle = $settings?.useChatTitleAsTabTitle ?? true; notificationSound = $settings?.notificationSound ?? true; notificationSoundAlways = $settings?.notificationSoundAlways ?? false; @@ -329,6 +331,25 @@ +
+
+
+ {$i18n.t("Use the chat title as the browser's tab title")} +
+ +
+ { + saveSettings({ useChatTitleAsTabTitle }); + }} + /> +
+
+
+
diff --git a/src/lib/stores/index.ts b/src/lib/stores/index.ts index 40563a6765..d4ae4d4623 100644 --- a/src/lib/stores/index.ts +++ b/src/lib/stores/index.ts @@ -184,6 +184,7 @@ type Settings = { notificationEnabled?: boolean; highContrastMode?: boolean; title?: TitleSettings; + useChatTitleAsTabTitle?: boolean; splitLargeDeltas?: boolean; chatDirection?: 'LTR' | 'RTL' | 'auto'; ctrlEnterToSend?: boolean;