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.
This commit is contained in:
google-labs-jules[bot]
2025-09-28 16:10:00 +00:00
parent 2c80f60f3e
commit 57c02b2523
3 changed files with 23 additions and 1 deletions
+1 -1
View File
@@ -2230,7 +2230,7 @@
<svelte:head>
<title>
{$chatTitle
{$settings.useChatTitleAsTabTitle !== false && $chatTitle
? `${$chatTitle.length > 30 ? `${$chatTitle.slice(0, 30)}...` : $chatTitle} • ${$WEBUI_NAME}`
: `${$WEBUI_NAME}`}
</title>
@@ -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 @@
</div>
</div>
<div>
<div class=" py-0.5 flex w-full justify-between">
<div id="use-chat-title-as-tab-title-label" class=" self-center text-xs">
{$i18n.t("Use the chat title as the browser's tab title")}
</div>
<div class="flex items-center gap-2 p-1">
<Switch
ariaLabelledbyId="use-chat-title-as-tab-title-label"
tooltip={true}
bind:state={useChatTitleAsTabTitle}
on:change={() => {
saveSettings({ useChatTitleAsTabTitle });
}}
/>
</div>
</div>
</div>
<div>
<div class="py-0.5 flex w-full justify-between">
<div id="notification-sound-label" class=" self-center text-xs">
+1
View File
@@ -184,6 +184,7 @@ type Settings = {
notificationEnabled?: boolean;
highContrastMode?: boolean;
title?: TitleSettings;
useChatTitleAsTabTitle?: boolean;
splitLargeDeltas?: boolean;
chatDirection?: 'LTR' | 'RTL' | 'auto';
ctrlEnterToSend?: boolean;