Commit Graph

61 Commits

Author SHA1 Message Date
Ed Lee
7f8d24c805 Bug 1975262 - remove hugging chat from chatbot a=pascalc
Hide from the list in onboarding and dropdown.

Original Revision: https://phabricator.services.mozilla.com/D255875

Differential Revision: https://phabricator.services.mozilla.com/D255920
2025-07-03 09:41:46 +00:00
Beth Rennie
b03a810429 Bug 1961629 - Use ExperimentFeature.getEnrollmentMetadata() in browser/components/genai r=Mardak,firefox-ai-ml-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D246151
2025-04-29 23:26:30 +00:00
Ed Lee
7e38d55ea9 Bug 1959650 - simplify shortcuts listeners avoiding some duplication r=ngrato,firefox-ai-ml-reviewers
Refactor nested logic out of handleShortcutsMessage to set up on first usage instead of each ShowShortcuts. Remove duplicate states: active, type and panel. Restore #ask-chat-shortcuts to limit width of warning.

Differential Revision: https://phabricator.services.mozilla.com/D246698
2025-04-26 13:36:41 +00:00
Greg Stoll
0f76fa2f28 Bug 1959115 - monitor pastes into GenAI custom prompt for Content Analysis r=dlp-reviewers,firefox-ai-ml-reviewers,handyman,Mardak
We handle this similarly to pasting into a prompt() dialog, so I
refactored that logic into a new ContentAnalysisUtils and call it from
both places.

Also drive-by cleanup of BUG_COMPONENT for a few Content Analysis
moz.build's

Differential Revision: https://phabricator.services.mozilla.com/D244818
2025-04-10 20:48:22 +00:00
Cristian Tuns
0346c15046 Backed out changeset 8517aa5a4d0d (bug 1959115) for causing bc failures in /browser_clipboard_paste_prompt_content_analysis.js CLOSED TREE 2025-04-10 11:46:56 -04:00
Greg Stoll
09c5ab87cb Bug 1959115 - monitor pastes into GenAI custom prompt for Content Analysis r=dlp-reviewers,firefox-ai-ml-reviewers,handyman,Mardak
We handle this similarly to pasting into a prompt() dialog, so I
refactored that logic into a new ContentAnalysisUtils and call it from
both places.

Also drive-by cleanup of BUG_COMPONENT for a few Content Analysis
moz.build's

Differential Revision: https://phabricator.services.mozilla.com/D244818
2025-04-10 14:42:19 +00:00
Ed Lee
7b9c9c970e Bug 1952268 - shortcuts listener should be handled by current show r=ngrato,firefox-ai-ml-reviewers
Avoid duplicate listeners by removing on hide.

Differential Revision: https://phabricator.services.mozilla.com/D240656
2025-03-06 21:50:02 +00:00
Beth Rennie
e8677f7bfc Bug 1951311 - Remove GenAI about:preferences integration r=Mardak,settings-reviewers,firefox-ai-ml-reviewers,mossop
Differential Revision: https://phabricator.services.mozilla.com/D240373
2025-03-05 15:04:32 +00:00
Ed Lee
20ca09b713 Bug 1946099 - Unclear how to disable GenAI / "Ask" context menu after selecting a chatbot provider with old sidebar r=ngrato,firefox-ai-ml-reviewers,bolsson,fluent-reviewers,flod
Add context menu item to reset the provider with telemetry

Differential Revision: https://phabricator.services.mozilla.com/D237127
2025-02-07 07:01:31 +00:00
Nick Grato
a84d165198 Bug 1930656 - Use a dedicated icon for the AI button r=Mardak,firefox-ai-ml-reviewers
Updating Icon to use from global src and not addons module.

Differential Revision: https://phabricator.services.mozilla.com/D236899
2025-02-06 22:23:04 +00:00
Nick Grato
08ae817ec1 Bug 1922623 - [UX Follow] Styling updates for the shortcut popup r=Mardak,desktop-theme-reviewers,tabbrowser-reviewers,firefox-ai-ml-reviewers,dao
These are design enhancements and fixes for the shortcut to take into account addon theme and system settings

Differential Revision: https://phabricator.services.mozilla.com/D226847
2025-01-29 18:22:14 +00:00
Tim Xia
1e483f4009 Bug 1922595 - Change icon and label in sidebar to be that of the selected provider, r=Mardak,firefox-ai-ml-reviewers,fluent-reviewers,jsudiaman
- implement handling for unset ChatProvider selections
- add `iconUrl` attribute to ChatProvider object
- ensure icon and label synchronization when opening new windows or switching providers
- update tooltip l10nId string template to include `{ $provider } ({ $shortcut })`
- replace existing l10nId strings, sidebar-menu-open-ai-chatbot-tooltip
- use fluent strings for fallback
- fix ftl file: wrap shortcut in ()
- add property getter currentChatProviderInfo
- use lazy.chatProvider
- remove fallbackProvider10nId
- add new test_genai_chat_sidebar_tooltip test

Differential Revision: https://phabricator.services.mozilla.com/D231963
2025-01-24 23:29:22 +00:00
Ed Lee
d609af2b98 Bug 1940179 - Support providers that accept prompts via non-?q= query param r=txia,firefox-ai-ml-reviewers
Allow custom queryParam while defaulting to "q"

Differential Revision: https://phabricator.services.mozilla.com/D233312
2025-01-10 18:10:11 +00:00
Butkovits Atila
22716c87ab Backed out changeset 92c26781c421 (bug 1940179) for including unrelated code. CLOSED TREE 2025-01-10 19:48:27 +02:00
Ed Lee
269e916655 Bug 1940179 - Support providers that accept prompts via non-?q= query param r=txia,firefox-ai-ml-reviewers
Allow custom queryParam while defaulting to "q"

Differential Revision: https://phabricator.services.mozilla.com/D233312
2025-01-08 22:03:18 +00:00
Butkovits Atila
2164ad88b3 Backed out changeset 256c0878fcfd (bug 1922623) for causing failures at test_show_chat_entrypoint.js. CLOSED TREE 2024-12-31 09:30:24 +02:00
Nick Grato
b4fcdba37d Bug 1922623 - [UX Follow] Styling updates for the shortcut popup r=Mardak,desktop-theme-reviewers,tabbrowser-reviewers,firefox-ai-ml-reviewers,dao
These are design enhancements and fixes for the shortcut to take into account addon theme and system settings

Differential Revision: https://phabricator.services.mozilla.com/D226847
2024-12-31 06:41:06 +00:00
Nika Layzell
3e32140186 Bug 1935714 - Part 3: Avoid using nsISupportsCString to initialize nsStringInputStream instances, r=xpcom-reviewers,necko-reviewers,extension-reviewers,search-reviewers,devtools-reviewers,urlbar-reviewers,firefox-ai-ml-reviewers,mccr8,jteow,mcheang,ochameau,robwu,tarek
The method is equivalent to the `setByteStringData` method on `nsIStringInputStream`, which has been used to replace the `.data` setter in these places. There may still be callers of the `.data` getter/setter, however they aren't easy to find.

Differential Revision: https://phabricator.services.mozilla.com/D232257
2024-12-18 21:10:32 +00:00
Norisz Fay
86e902d55a Backed out changeset 2f7058ea3047 (bug 1935714) for causing mochitest failures on test_progress_events_for_gzip_data.html 2024-12-17 22:29:32 +02:00
Nika Layzell
bb544297d5 Bug 1935714 - Part 3: Avoid using nsISupportsCString to initialize nsStringInputStream instances, r=xpcom-reviewers,necko-reviewers,extension-reviewers,search-reviewers,devtools-reviewers,urlbar-reviewers,firefox-ai-ml-reviewers,mccr8,jteow,mcheang,ochameau,robwu,tarek
The method is equivalent to the `setByteStringData` method on `nsIStringInputStream`, which has been used to replace the `.data` setter in these places. There may still be callers of the `.data` getter/setter, however they aren't easy to find.

Differential Revision: https://phabricator.services.mozilla.com/D232257
2024-12-17 17:00:15 +00:00
Tim Xia
a66c86e121 Bug 1932930 Add "Writing & Grammar Check" option to list of AI Chatbot Prompts, r=Mardak,fluent-reviewers,bolsson,firefox-ai-ml-reviewers
- Name of Promopt Option: "Proofread" (subject to change)
- Updated default prefix prompt so it is more robust for LLM to understand what "selection" refers to
- Annotate prompt variables at replacement so we don't have to update l10nId or original prefix string
- Remove unnecessary NBSP
- Remove nightly targeting for proofread
- Update tests in test_build_chat_prompt.js

Differential Revision: https://phabricator.services.mozilla.com/D229954
2024-12-12 00:17:27 +00:00
Nick Grato
585702e09a Bug 1922379 - Add error message for when too many characters are selected before selecting a prompt r=Mardak,fluent-reviewers,desktop-theme-reviewers,tabbrowser-reviewers,bolsson,firefox-ai-ml-reviewers,emilio
Use moz-message-bar warning to conditionally show long selection warning.

Differential Revision: https://phabricator.services.mozilla.com/D225895
2024-12-10 08:18:11 +00:00
Mark Banner
3832e2355f Bug 1927798 - Re-enable the curly rule for ESLint. r=frontend-codestyle-reviewers,mossop
This was accidentally disabled in bug 1920531 with the re-organisation of how eslint-plugin-mozilla worked.
The rule needs to be (re)enabled after eslint-config-prettier is applied, as eslint-config-prettier turns it off by default.

Differential Revision: https://phabricator.services.mozilla.com/D227621
2024-11-01 14:15:01 +00:00
Ed Lee
8be1336fa3 Bug 1926932 - Add assets for future enabling Copilot r=ngrato,fluent-reviewers
Add icon and strings and update configs. Update huggingchat string.

Differential Revision: https://phabricator.services.mozilla.com/D226816
2024-10-26 06:43:23 +00:00
Ed Lee
b241ea258a Bug 1905898 - ChatGPT, HuggingChat and LeChat Mistral AI's are returning server Errors for trying to analyze large pieces of Text r=ngrato
Refactor length calculation with even more conservative adjustments. Point to copilot instead of bing but still hidden.

Differential Revision: https://phabricator.services.mozilla.com/D226076
2024-10-18 00:01:59 +00:00
Ed Lee
75132e2162 Bug 1911104 - Chatbot telemetry for 133 nimbus experiment with onboarding and menus r=tarek
Record onboarding events with AWSendEventTelemetry converted to chatbot glean. Instrument various menus including more, provider, shortcuts.

Differential Revision: https://phabricator.services.mozilla.com/D223938
2024-10-12 16:50:57 +00:00
Ed Lee
f568a27e32 Bug 1916274 - Improve nimbus chatbot behaviors, e.g., rollout and slugs r=tarek
Fix experiment vs rollout priority. Save full slug. Init on import no longer need test uninit. Enforce minimum versions.

Differential Revision: https://phabricator.services.mozilla.com/D223937
2024-10-03 13:51:55 +00:00
Ed Lee
82294b3cb0 Bug 1920778 - Enable custom prompts by default with multiline autosize r=tarek
Enable in all channels. Check for size on input and handle enter.

Differential Revision: https://phabricator.services.mozilla.com/D223930
2024-10-01 19:51:09 +00:00
Ed Lee
7ff0a56191 Bug 1903900 - Better handle different chat provider GET request limits for long text selection r=tarek
Still approximate but slightly smarter per-provider prompt max length limits.

Differential Revision: https://phabricator.services.mozilla.com/D223943
2024-10-01 12:26:39 +00:00
Ed Lee
2e7894ed89 Bug 1909986 - For sidebar revamp, only show chatbot entrypoints (context menu, shortcuts) when tools include aichat r=tarek
Convert existing entrypoint checks to getter that also checks sidebar.

Differential Revision: https://phabricator.services.mozilla.com/D223690
2024-09-28 01:53:48 +00:00
Ed Lee
92ec028ba5 Bug 1920102 - Update chatbot header controls r=tarek,fluent-reviewers
Populate menu popup on more button. Handle showing/hiding shortcut including from shortcut. Add reshow onboarding from provider list.

Differential Revision: https://phabricator.services.mozilla.com/D223267
2024-09-26 06:44:45 +00:00
Ed Lee
f89496d229 Bug 1914977 - In-sidebar chatbot initial onboarding r=tarek,desktop-theme-reviewers,fluent-reviewers,bolsson,hjones
Reuse welcome bundle for sidebar onboarding. Add/reuse icons including brands and import-export. Expose onboarding strings for localization.

Differential Revision: https://phabricator.services.mozilla.com/D220155
2024-09-25 23:01:19 +00:00
Ed Lee
0f53e2f734 Bug 1911631 - Disable shortcuts in the input fields r=tarek
Allow ignoring various input fields starting with <input>.

Differential Revision: https://phabricator.services.mozilla.com/D222804
2024-09-19 16:27:46 +00:00
Ed Lee
de85a49a56 Bug 1912564 - More shortcuts triggering and hiding improvements r=tarek
Check for selection change instead of just having a selection. Support inputs/textarea selection. Hide before unload.

Differential Revision: https://phabricator.services.mozilla.com/D219105
2024-08-14 10:53:09 +00:00
Ed Lee
5856999dde Bug 1912080 - Chatbot prompt prefix string missing from localization r=tarek,fluent-reviewers,flod
Allow prefix pref to be json with l10nId that allows localization.

Differential Revision: https://phabricator.services.mozilla.com/D218804
2024-08-08 11:55:10 +00:00
Ed Lee
54766e0f44 Bug 1911748 - Chatbot: too much insistent -> shortcuts Icon every where ( when using the touchpad ) r=tarek
Allow the long press delay to be pref controlled with a higher default 200ms -> 60s effectively turning it off. Record the delay with glean.

Differential Revision: https://phabricator.services.mozilla.com/D218662
2024-08-07 19:41:20 +00:00
Ed Lee
5450fb19b4 Bug 1911173 - Update the shortcut text selection UX focusing on mouseup instead of keyboard r=tarek
Immediately show shortcuts on mouseup with selection or detect mousedown/mouseup timing for long press.

Differential Revision: https://phabricator.services.mozilla.com/D218417
2024-08-05 07:53:38 +00:00
Ed Lee
991ab9bfa1 Bug 1905042 - The AI Chat Sidebar stays open when the user disables the AI chat integration feature from the Experiments page r=tarek
Detect enabled switched to false and close sidebar if on chatbot.

Differential Revision: https://phabricator.services.mozilla.com/D218480
2024-08-03 17:12:48 +00:00
Ed Lee
3cf73b5fe9 Bug 1910063 - Avoid perma TV genai_init with matching uninit r=tarek
Differential Revision: https://phabricator.services.mozilla.com/D218475
2024-08-03 07:11:06 +00:00
Ed Lee
035e010fe9 Bug 1907350 - Expose genai-settings-chat-title and other chatbot strings for localization r=tarek,fluent-reviewers,mconley,bolsson
Move featuregate title to features.ftl used by about:preferences and about:support; and other strings to genai.ftl. Allow prompts to use l10nId to get fluent attributes. Convert inline strings for menu and shortcuts to fluent. Update simplify, add explain prompts.

Differential Revision: https://phabricator.services.mozilla.com/D218279
2024-08-03 06:40:26 +00:00
Ed Lee
7fcb70613f Bug 1910005 - Expose chat shortcuts pref as part of experimental subitem r=tarek,fluent-reviewers,settings-reviewers,desktop-theme-reviewers,dao,mstriemer
Switch default shortcuts enabled with labs checkbox to disable and labs visibility. Add metric and event telemetry for shortcuts pref and usage. Bump pip labs ordering up one.

Differential Revision: https://phabricator.services.mozilla.com/D217782
2024-08-03 04:19:46 +00:00
Noemi Erli
5578e35afb Backed out changeset c9ad93d58c14 (bug 1910005) for causing bustages in GleanMetrics.h CLOSED TREE 2024-08-03 06:17:37 +03:00
Ed Lee
0e362c1019 Bug 1910005 - Expose chat shortcuts pref as part of experimental subitem r=tarek,fluent-reviewers,settings-reviewers,desktop-theme-reviewers,dao,mstriemer
Switch default shortcuts enabled with labs checkbox to disable and labs visibility. Add metric and event telemetry for shortcuts pref and usage. Bump pip labs ordering up one.

Differential Revision: https://phabricator.services.mozilla.com/D217782
2024-08-03 02:46:23 +00:00
Ed Lee
28b3b1086d Bug 1911124 - Support chatbot provider list configuration via pref to hide r=tarek
Add hidden providers pref to reorder and show/hide providers including localhost with its existing pref.

Differential Revision: https://phabricator.services.mozilla.com/D218387
2024-08-02 08:25:15 +00:00
Ed Lee
4ef77f9229 Bug 1909642 - Firefox Labs does not load the AI provider list if the user Starts Firefox and enables the AI chatbot integration right after startup r=tarek
Also check for existing preferences at init to build.

Differential Revision: https://phabricator.services.mozilla.com/D218271
2024-08-01 14:50:55 +00:00
Ed Lee
feb0477b8b Bug 1910067 - Allow focusing shortcuts chat prompts r=tarek
Add tabindex to make toolbarbuttons focusable via the accessibility API.

Differential Revision: https://phabricator.services.mozilla.com/D218270
2024-08-01 14:16:31 +00:00
Ed Lee
7f99bc3758 Bug 1910509 - Add nimbus variables for chatbot configuration r=tarek
Allow setting user and default branch prefs specified in the nimbus variable for chatbot.

Differential Revision: https://phabricator.services.mozilla.com/D218045
2024-07-31 17:29:43 +00:00
Ed Lee
2a0610e953 Bug 1905750 - Display shortcuts on text selection r=tarek
Detect selection to show shortcut icon near the cursor. Open panel with prompts when hovering the icon. Hide these on various events that might move content or no selection.

Differential Revision: https://phabricator.services.mozilla.com/D217545
2024-07-26 07:23:00 +00:00
Ed Lee
4158d9c453 Bug 1907246 - Add Anthropic Claude to chatbot provider list r=tarek,fluent-reviewers
Use ?q= to start while we figure out how to generalize &attachment=.

Differential Revision: https://phabricator.services.mozilla.com/D216242
2024-07-11 20:41:31 +00:00
Ed Lee
454b30249a Bug 1906976 - Treat modified prompts as custom for telemetry r=tarek
Detect user modified preferences to switch to "custom"

Differential Revision: https://phabricator.services.mozilla.com/D216114
2024-07-11 06:48:48 +00:00