webui: support q URL parameter (#16728)

* webui: support q URL parameter

Fixes #16722
I’ve checked that it works with Firefox’s AI tools

* webui: apply suggestions from code review

Co-authored-by: Aleksander Grygier <aleksander.grygier@gmail.com>

* chore: update webui static build

---------

Co-authored-by: Aleksander Grygier <aleksander.grygier@gmail.com>
This commit is contained in:
Florian Badie
2025-10-24 14:10:29 +02:00
committed by GitHub
parent 5a91109a5d
commit 69e9ff0103
2 changed files with 8 additions and 0 deletions

Binary file not shown.

View File

@@ -2,6 +2,9 @@
import { ChatScreen } from '$lib/components/app'; import { ChatScreen } from '$lib/components/app';
import { chatStore, isInitialized } from '$lib/stores/chat.svelte'; import { chatStore, isInitialized } from '$lib/stores/chat.svelte';
import { onMount } from 'svelte'; import { onMount } from 'svelte';
import { page } from '$app/state';
let qParam = $derived(page.url.searchParams.get('q'));
onMount(async () => { onMount(async () => {
if (!isInitialized) { if (!isInitialized) {
@@ -9,6 +12,11 @@
} }
chatStore.clearActiveConversation(); chatStore.clearActiveConversation();
if (qParam !== null) {
await chatStore.createConversation();
await chatStore.sendMessage(qParam);
}
}); });
</script> </script>