This commit is contained in:
Timothy Jaeryang Baek
2026-06-09 12:57:50 +01:00
Unverified
parent 59a5325286
commit 0f1d358bec
5 changed files with 6 additions and 27 deletions
@@ -3,7 +3,7 @@
import { onMount } from 'svelte';
import { getAdminConfig, updateConfig as apiUpdateConfig } from '$lib/apis/admin';
import { t } from '$lib/i18n';
import ToggleSwitch from '$lib/components/ToggleSwitch.svelte';
import ToggleSwitch from '$lib/components/common/ToggleSwitch.svelte';
import Spinner from '$lib/components/common/Spinner.svelte';
let config = $state<Record<string, any>>({});
@@ -6,6 +6,7 @@
import { t, locale, changeLocale, supportedLocales } from '$lib/i18n';
import { notificationsEnabled, notificationSound } from '$lib/stores/chat';
import { fetchJSON } from '$lib/apis';
import ToggleSwitch from '../common/ToggleSwitch.svelte';
import { onMount } from 'svelte';
function setTheme(v: Theme) {
@@ -92,18 +93,7 @@
<!-- Browser notifications toggle -->
<label class="flex items-center justify-between cursor-pointer">
<span class="text-xs text-gray-600 dark:text-gray-400">Browser notifications</span>
<button
class="relative w-8 h-[18px] rounded-full transition-colors duration-150
{$notificationsEnabled ? 'bg-blue-500' : 'bg-gray-300 dark:bg-gray-700'}"
onclick={toggleNotifications}
role="switch"
aria-checked={$notificationsEnabled}
>
<span
class="absolute top-[2px] left-[2px] w-[14px] h-[14px] rounded-full bg-white shadow transition-transform duration-150
{$notificationsEnabled ? 'translate-x-[14px]' : ''}"
></span>
</button>
<ToggleSwitch value={$notificationsEnabled} onchange={() => toggleNotifications()} />
</label>
<p class="text-[11px] text-gray-400 dark:text-gray-600 -mt-1">
Show OS-level notifications when a task completes and the tab is not focused.
@@ -112,18 +102,7 @@
<!-- Sound toggle -->
<label class="flex items-center justify-between cursor-pointer">
<span class="text-xs text-gray-600 dark:text-gray-400">Notification sound</span>
<button
class="relative w-8 h-[18px] rounded-full transition-colors duration-150
{$notificationSound ? 'bg-blue-500' : 'bg-gray-300 dark:bg-gray-700'}"
onclick={() => notificationSound.update((v) => !v)}
role="switch"
aria-checked={$notificationSound}
>
<span
class="absolute top-[2px] left-[2px] w-[14px] h-[14px] rounded-full bg-white shadow transition-transform duration-150
{$notificationSound ? 'translate-x-[14px]' : ''}"
></span>
</button>
<ToggleSwitch value={$notificationSound} onchange={(v) => notificationSound.set(v)} />
</label>
<!-- Webhook URL -->
@@ -5,7 +5,7 @@
*/
import { goto } from '$app/navigation';
import Icon from '../Icon.svelte';
import ToggleSwitch from '../ToggleSwitch.svelte';
import ToggleSwitch from '../common/ToggleSwitch.svelte';
import Spinner from '../common/Spinner.svelte';
import AutomationModal from './AutomationModal.svelte';
import { openChatTab, sidebarOpen } from '$lib/stores';
@@ -3,7 +3,7 @@
import { toolApprovalMode, planMode, type ToolApprovalMode } from '$lib/stores';
import { tooltip } from '$lib/tooltip';
import Icon from '../Icon.svelte';
import ToggleSwitch from '../ToggleSwitch.svelte';
import ToggleSwitch from '../common/ToggleSwitch.svelte';
interface Props {
onfiles: (files: FileList) => void;