Commit Graph

98 Commits

Author SHA1 Message Date
Ed Lee
01ab2e3de0 Bug 1943394 - Hook up model to generate preview content r=firefox-ai-ml-reviewers,atossou,txia
Introduce some text pre/post-processing and mostly hardcoded engine config in a new module. Allow some pref configuration.

Differential Revision: https://phabricator.services.mozilla.com/D241268
2025-03-13 00:35:01 +00:00
Tim Xia
736aabff21 Bug 1952011 - Implement fetch for Link Preview - r=Mardak,firefox-desktop-core-reviewers ,firefox-ai-ml-reviewers,mconley
- add fetch in child process
- DOM parsing only once
- check content-type to be text/html before fetching content
- add custom request header x-firefox-ai so publisher has option to allow/disallow the fetch request
- more fetch safeguards(max content-length) may come in the near future

Differential Revision: https://phabricator.services.mozilla.com/D240654
2025-03-11 05:15:02 +00:00
Tim Xia
3554189dec Bug 1943391 - Initial entrypoint to detect preview reqeust - r=Mardak,firefox-desktop-core-reviewers ,firefox-ai-ml-reviewers,mossop
- alt+hover to trigger LinkPreview
- add LinkPreview.sys.mjs modules
- disable browser.ml.linkPreview.enabled by default
- use setOverLink and LinkPreview.sys to handle keyboard shortcut
- dispatch CustomEvent OverLink from browser.js
- add/remove event listeners in sync with state of "browser.ml.linkPreview.enabled"
- update all_files_referenced to handle moz-src

Differential Revision: https://phabricator.services.mozilla.com/D239535
2025-03-10 17:31:36 +00:00
Cosmin Sabou
14d1baf63f Merge mozilla-central to autoland. 2025-03-07 06:10:55 +02:00
Cosmin Sabou
8b1371211e Backed out changeset 9d7cf2733400 (bug 1943391) for causing leaks on browser_tab_groups_closed.
CLOSED TREE
2025-03-07 06:05:55 +02: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
Tim Xia
f4c4d3cc09 Bug 1943391 - Initial entrypoint to detect preview reqeust - r=Mardak,firefox-desktop-core-reviewers ,firefox-ai-ml-reviewers,mossop
- alt+hover to trigger LinkPreview
- add LinkPreview.sys.mjs modules
- disable browser.ml.linkPreview.enabled by default
- use setOverLink and LinkPreview.sys to handle keyboard shortcut
- dispatch CustomEvent OverLink from browser.js
- add/remove event listeners in sync with state of "browser.ml.linkPreview.enabled"
- update all_files_referenced to handle moz-src

Differential Revision: https://phabricator.services.mozilla.com/D239535
2025-03-06 03:03:09 +00:00
Butkovits Atila
625fda149e Backed out changeset 04574e76f8f5 (bug 1943391) for causing high frequency failures at browser_bannerClicking.js. CLOSED TREE 2025-03-06 15:40:06 +02:00
Tim Xia
1d372a23a6 Bug 1943391 - Initial entrypoint to detect preview reqeust - r=Mardak,firefox-desktop-core-reviewers ,firefox-ai-ml-reviewers,mossop
- alt+hover to trigger LinkPreview
- add LinkPreview.sys.mjs modules
- disable browser.ml.linkPreview.enabled by default
- use setOverLink and LinkPreview.sys to handle keyboard shortcut
- dispatch CustomEvent OverLink from browser.js
- add/remove event listeners in sync with state of "browser.ml.linkPreview.enabled"
- update all_files_referenced to handle moz-src

Differential Revision: https://phabricator.services.mozilla.com/D239535
2025-03-06 03:03:09 +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
33c904822e Bug 1925671 - Add responsive design for provider choice modal r=ngrato,firefox-ai-ml-reviewers
Add faders sticky to the top and bottom of provider selection container that avoid overlapping content with extra padding. Adjust margins/heights based on available space. Allow for experimentation with unresponsive pref.

Differential Revision: https://phabricator.services.mozilla.com/D239029
2025-02-21 20:37:20 +00:00
Ed Lee
694a588ca5 Bug 1945904 - GenAIChild spams the parent process with HideShortcuts messages and should manage event listeners more efficiently r=ngrato,firefox-desktop-core-reviewers ,firefox-ai-ml-reviewers,mossop
Register actor on mousedown and conditionally register hide related events after showing shortcuts.

Differential Revision: https://phabricator.services.mozilla.com/D237975
2025-02-13 17:02:19 +00:00
Emilio Cobos Álvarez
c67d8c9c9c Bug 1946764 - Support non-boolean media query prefs via -moz-pref(). r=firefox-style-system-reviewers,desktop-theme-reviewers,settings-reviewers,tabbrowser-reviewers,places-reviewers,sidebar-reviewers,urlbar-reviewers,firefox-ai-ml-reviewers,dao,mconley,dshin,mak
Allow querying int and string prefs too via functional syntax:

```
@media -moz-pref("pref-name", <value>) {
```

No argument means the pref exists and has a non-zero/false/empty value.
Unfortunately stylelint is still unhappy with this so we need to keep
the annoying comments...

Differential Revision: https://phabricator.services.mozilla.com/D237275
2025-02-12 12:14:42 +00:00
Butkovits Atila
3bc2e1759e Backed out changeset f1089681a6c6 (bug 1946764) for causing failures at browser_preferences_usage.js. 2025-02-11 21:24:36 +02:00
Emilio Cobos Álvarez
bab7f36d0f Bug 1946764 - Support non-boolean media query prefs via -moz-pref(). r=firefox-style-system-reviewers,desktop-theme-reviewers,settings-reviewers,tabbrowser-reviewers,places-reviewers,sidebar-reviewers,urlbar-reviewers,firefox-ai-ml-reviewers,dao,mconley,dshin,mak
Allow querying int and string prefs too via functional syntax:

```
@media -moz-pref("pref-name", <value>) {
```

No argument implies bool. Unfortunately stylelint is still unhappy with
this so we need to keep the annoying comments...

Differential Revision: https://phabricator.services.mozilla.com/D237275
2025-02-11 17:26:17 +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
Tooru Fujisawa
84cf92ea72 Bug 1938261 - Make the AI chatbot keyboard shortcut no-op when the feature is disabled. r=Mardak,firefox-ai-ml-reviewers
Given the chatbot feature is now enabled by default, the pref being disabled
means explicitly turned off.  The shortcut key shouldn't turn it back to on.

Differential Revision: https://phabricator.services.mozilla.com/D236477
2025-02-04 02:37:23 +00:00
Nick Grato
09c9774047 Bug 1911609 - AI shortcut zoomed incorrect location r=Mardak,firefox-ai-ml-reviewers
Zoom functionality was taken care of in another patch, however there was a new bug in nightly that distorted the formula to create the popup destitation. This patch fixes some scoping issues with the variables to keep the intentional values and produce an accurate placement of the popup

Differential Revision: https://phabricator.services.mozilla.com/D236369
2025-01-31 19:38:30 +00:00
Ed Lee
8b77709dbf Bug 1933524 - Flip chatbot default and remove from Labs in Nightly and Release r=ngrato,settings-reviewers,sidebar-reviewers,nsharpley,firefox-desktop-core-reviewers ,firefox-ai-ml-reviewers,jsudiaman,Gijs,sclements,desktop-theme-reviewers,hjones
Flip default pref to true and remove featuregate entry/strings/styles. Switch actor enabled to actual opt-in / provider. Update sidebar tests for chatbot as default tool.

Differential Revision: https://phabricator.services.mozilla.com/D233204
2025-01-31 16:58:55 +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
Jonathan Sudiaman
28e3caf8b0 Bug 1940163 - Add telemetry probe to distinguish between panel toggles coming from the old and new sidebar r=sidebar-reviewers,firefox-ai-ml-reviewers,nsharpley,Mardak
Differential Revision: https://phabricator.services.mozilla.com/D233882
2025-01-16 18:04:24 +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
Punam Dahiya
cf58fbd5e3 Bug 1618001 - Move React vendored libraries to the toolkit to prevent multiple instances r=sylvestre,omc-reviewers,home-newtab-reviewers,frontend-codestyle-reviewers,firefox-ai-ml-reviewers,aminomancer,mconley
Differential Revision: https://phabricator.services.mozilla.com/D232431
2025-01-08 21:08:16 +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
Tim Xia
46dbb1add4 Bug 1930681 - Use button-* css variables for select element on chat ui header, r=Mardak,desktop-theme-reviewers,firefox-ai-ml-reviewers,dao
Differential Revision: https://phabricator.services.mozilla.com/D228679
2024-12-20 23:14:36 +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
Ed Lee
bed4bb2696 Bug 1937650 - Strengthen embedded <browser> element flags in AI sidebar r=ngrato,firefox-ai-ml-reviewers
Set additional attributes on the chatbot browser.

Differential Revision: https://phabricator.services.mozilla.com/D232291
2024-12-17 21:25:51 +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
Ed Lee
7138179e8f Bug 1905027 - There should be a Keyboard shortcut for the AI chat sidebar r=sidebar-reviewers,sclements,fluent-reviewers,flod,ngrato
Toggle chatbot with Ctrl-Alt-X / Ctrl-X macOS enabling if necessary. Record event on using keyboard shortcut.

Differential Revision: https://phabricator.services.mozilla.com/D226205
2024-12-11 09:01:57 +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
Sandor Molnar
aab5624276 Backed out changeset 85e2f9195dc0 (bug 1905027) for causing failures @ test_no_errors_clean_profile 2024-12-05 23:37:36 +02:00
Ed Lee
4d9a31854e Bug 1905027 - There should be a Keyboard shortcut for the AI chat sidebar r=sidebar-reviewers,sclements,fluent-reviewers,flod,ngrato
Toggle chatbot with Ctrl-Alt-X / Ctrl-X macOS enabling if necessary. Record event on using keyboard shortcut.

Differential Revision: https://phabricator.services.mozilla.com/D226205
2024-12-05 18:31:34 +00:00
Tim Xia
1527c04f7e Bug 1930166 - Update Chatbot to meet UX spec, r=Mardak,desktop-theme-reviewers,firefox-ai-ml-reviewers,hjones
- Add border radius of 4px to select and buttons
- Add padding left and right for header
- Reduce caret-padding 'cause now we have left-padding from header
- First moz-button should have 4px margin spacing on the right
- Add margin-block: var(--space-xsmall) to select element to make header 40px.

Differential Revision: https://phabricator.services.mozilla.com/D228680
2024-12-04 20:09:11 +00:00
Logan Rosen
d24c9d9ff4 Bug 1857834 - auto-formatting with Prettier v3 r=linter-reviewers,webdriver-reviewers,perftest-reviewers,search-reviewers,devtools-reviewers,sync-reviewers,reusable-components-reviewers,profiler-reviewers,dom-storage-reviewers,android-reviewers,firefox-ai-ml-reviewers,hjones,mcheang,mstange,sparky,janv,nchevobbe,tarek,Standard8,markh
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D230598
2024-11-29 15:18:25 +00:00
Tim Xia
940a632657 Bug 1922630 - Header of chatbot panel is themable like the history, tabs, r=Mardak,firefox-ai-ml-reviewers
- Use variables from theme for background-color and color in chat-ui
- Changed moz-button to be type of "icon ghost"
- Header background is updated 'cause moz-button bg-color is transparent
- use --button-* token styles for select hover

Differential Revision: https://phabricator.services.mozilla.com/D228456
2024-11-09 05:43:20 +00:00
Tim Xia
3309fc0d8a Bug 1922628 - Move dropdown arrow for provider select to the left in the chatbot panel r=Mardak,firefox-ai-ml-reviewers
- Adjust arrow with background-position
- Changes for Eric Pang's design spec, 16px on the left padding, 8px on the gap between caret and text

Differential Revision: https://phabricator.services.mozilla.com/D228106
2024-11-06 23:13:15 +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
Tamas Szentpeteri
7aa7c6235f Backed out changeset 08df39c35f9d (bug 1905027) as requested by Mardak for causing 1927304. CLOSED TREE 2024-10-27 18:38:15 +02: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
0e72f5e021 Bug 1905027 - There should be a Keyboard shortcut for the AI chat sidebar r=sidebar-reviewers,sclements,fluent-reviewers,flod,ngrato
Toggle chatbot with accel-shift-i enabling if necessary. Record event on using keyboard shortcut.

Differential Revision: https://phabricator.services.mozilla.com/D226205
2024-10-25 14:33:50 +00:00
Norisz Fay
327e2a6efe Backed out changeset 298bca8a48dc (bug 1905027) for causing multiple dt failures 2024-10-23 23:47:43 +03:00
Ed Lee
3896deb1b4 Bug 1905027 - There should be a Keyboard shortcut for the AI chat sidebar r=sidebar-reviewers,sclements,fluent-reviewers,flod,ngrato
Toggle chatbot with accel-shift-i enabling if necessary. Record event on using keyboard shortcut.

Differential Revision: https://phabricator.services.mozilla.com/D226205
2024-10-23 17:42:19 +00:00
Nick Grato
c0f370837e Bug 1926336 - Selecting provider during onboarding shows preview but no details r=Mardak
Changed the action object in previous commit, values are now set to appropriate config

Differential Revision: https://phabricator.services.mozilla.com/D226542
2024-10-22 22:18:55 +00:00