feat: add Firefox AI sidebar (?q=) support to dashboard#1814
Conversation
Firefox's built-in AI sidebar sends the user's prompt as a ?q=<encoded> query parameter to the configured provider URL. This change: - Parses ?q= on page load and cleans the URL with history.replaceState - Defers auto-send until cluster state and model list are loaded, so handleAutoSend can correctly auto-select a running or fitting model - Uses a Svelte that watches pendingFirefoxQuery, data, and models to fire exactly once when all dependencies are ready See: https://support.mozilla.org/en-US/kb/ai-chatbot
|
Hey - this is really cool; it looks good to me, but I think it would be better if we put this at a /firefox endpoint so that we don't reserve the top-level ?q= for only Firefox. |
|
@rltakashige Hmmm, I see the confusion with my variable naming and comments. However, there is not really anything functional that makes this Firefox specific, the |
rltakashige
left a comment
There was a problem hiding this comment.
Tried to think of an example where we might want to use the ?q= with anything else, but we agreed this seems like a sensible default. We can always move it if it ever becomes necessary.
Thanks for this contribution - I might add this to our integrations in #1810 .
This PR builds on #1677 to enable custom prompts sent from Firefox
browser.ml.chatto EXO dashboard using URL parameters in sidebar for summary and other browser interactions. See "Summarize page" example below.Summary
?q=<encoded prompt>URL parameter on page load and auto-submit it as a chat messagehistory.replaceStateto prevent re-submission on refreshContext
Firefox's built-in AI sidebar (
about:config: browser.ml.chat.enabled) integrates with chat providers by appending the user's prompt as?q=<URL-encoded prompt>. Previously the exo dashboard ignored this parameter. Users can now configurehttp://localhost:52415as a Firefox AI chatbot provider.See: https://support.mozilla.org/en-US/kb/ai-chatbot
Technical notes
dashboard/src/routes/+page.svelte$effectthat reacts topendingFirefoxQuery,data(cluster state), andmodels.length— fires exactly once when all three are readyhandleAutoSendauto-picks the best available model; if no model fits memory, a toast is shownTesting