feat: Add user setting for "Always Enable Search"

This commit is contained in:
hurxxxx
2025-01-29 02:01:46 +09:00
parent 24ab79f5e9
commit af979ce49a
52 changed files with 85 additions and 1 deletions
+5
View File
@@ -715,6 +715,11 @@
if ($page.url.searchParams.get('web-search') === 'true') {
webSearchEnabled = true;
}
if($settings?.alwaysOnWebSearch) {
webSearchEnabled = true;
}
if ($page.url.searchParams.get('image-generation') === 'true') {
imageGenerationEnabled = true;
}
@@ -52,6 +52,8 @@
let voiceInterruption = false;
let hapticFeedback = false;
let alwaysOnWebSearch = false;
const toggleSplitLargeChunks = async () => {
splitLargeChunks = !splitLargeChunks;
saveSettings({ splitLargeChunks: splitLargeChunks });
@@ -198,6 +200,11 @@
});
};
const toggleAlwaysOnWebSearch = async () => {
alwaysOnWebSearch = !alwaysOnWebSearch;
saveSettings({ alwaysOnWebSearch });
};
onMount(async () => {
titleAutoGenerate = $settings?.title?.auto ?? true;
autoTags = $settings.autoTags ?? true;
@@ -235,6 +242,8 @@
}
backgroundImageUrl = $settings.backgroundImageUrl ?? null;
alwaysOnWebSearch = $settings.alwaysOnWebSearch ?? false;
});
</script>
@@ -666,6 +675,26 @@
</div>
</div>
<div>
<div class=" py-0.5 flex w-full justify-between">
<div class=" self-center text-xs">{$i18n.t('Always-On Web Search')}</div>
<button
class="p-1 px-3 text-xs flex rounded transition"
on:click={() => {
toggleAlwaysOnWebSearch();
}}
type="button"
>
{#if alwaysOnWebSearch === true}
<span class="ml-2 self-center">{$i18n.t('On')}</span>
{:else}
<span class="ml-2 self-center">{$i18n.t('Off')}</span>
{/if}
</button>
</div>
</div>
<div class=" my-1.5 text-sm font-medium">{$i18n.t('Voice')}</div>
<div>
+2 -1
View File
@@ -118,7 +118,8 @@
'displayemoji',
'save',
'interfaceoptions',
'interfacecustomization'
'interfacecustomization',
'alwaysonwebsearch',
]
},
{