Commit Graph

135 Commits

Author SHA1 Message Date
camachoh
fce9ba1bc5 Bug 1323331 - Improve reader mode code dealing with detected language/direction. r=Gijs,firefox-ai-ml-reviewers,Mardak
Differential Revision: https://phabricator.services.mozilla.com/D244820
2025-04-22 18:17:32 +00:00
Tim Xia
5aa2cc1632 Bug 1958982 - more preview panel polish, e.g., always show site name - r=Mardak,firefox-ai-ml-reviewers
- add site name fallback
- add visit page and icons
- move visit page position to bottom

Differential Revision: https://phabricator.services.mozilla.com/D244896
2025-04-22 17:40:05 +00:00
Rob Wu
62248a8bcc Bug 1953004 - Run test-manifest-toml --fix on all toml files in the trees r=credential-management-reviewers,places-reviewers,desktop-theme-reviewers,Standard8,devtools-reviewers,hjones,jmaher,jdescottes,dimi,necko-reviewers,sidebar-reviewers,jsudiaman,kershaw
This diff was generated as follows:

List all toml files in the tree:

`find * -name '*.toml' > /tmp/toml`

Manually edited /tmp/toml to drop non-relevant entries (objdir).

Ran the toml linter for all files:

`cat /tmp/toml | xargs ./mach lint -l test-manifest-toml --fix`

Differential Revision: https://phabricator.services.mozilla.com/D240948
2025-04-14 08:30:13 +00:00
Tim Xia
a5eb2cfb05 Bug 1954812 - show animated skeleton of 3 points replaced by generated content - r=Mardak,firefox-ai-ml-reviewers,ngrato
- use tab-group-suggestions loading animation color
- set progressPercentage to init to 0
- add non-impactful references to the CSS variables to satisfy the test browser_parsable_css

Differential Revision: https://phabricator.services.mozilla.com/D243322
2025-04-12 03:44:29 +00:00
Cristina Horotan
3884d2b5ac Backed out changeset 36723da90fe1 (bug 1954812) for causing bc failures at browser_parsable_css.js CLOSED TREE 2025-04-11 22:32:58 +03:00
Tim Xia
02e039347d Bug 1954812 - show animated skeleton of 3 points replaced by generated content - r=Mardak,firefox-ai-ml-reviewers,ngrato
- use tab-group-suggestions loading animation color
- set progressPercentage to init to 0

Differential Revision: https://phabricator.services.mozilla.com/D243322
2025-04-11 16:43:54 +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
4571a3c7c8 Bug 1951148 - add metrics and events related to link preview feature usage r=txia,firefox-ai-ml-reviewers
Instrument various events for enabling, showing preview and interactions. Support prefetch on enable with metrics. Include wllamapreview for success metrics.

Differential Revision: https://phabricator.services.mozilla.com/D243790
2025-04-03 01:00:18 +00:00
Tim Xia
53bd3d86af Bug 1957612 fix link Preview can no longer generate key points from reader view content - r=Mardak,firefox-ai-ml-reviewers
- add articleData excerpt back to as a source of description for Link Preview
- increase MAX_CONTENT_LENGTH to 5mb
- add imageurl extraction to extractNormalizedMetadata
- move extractMetadataContent to LinkPreviewChild.sys.mjs
- update test test_fetch_page_data
- update regex for contentType.match to suport optional quotes, i.e "utf-8"
- trigger 'unable-to-preview' error state only if title, description, and readerMode.textContent are all missing.
- add title fallback with filename component of url
- ensure imageUrl is with https

Differential Revision: https://phabricator.services.mozilla.com/D243670
2025-04-02 20:07:21 +00:00
Nick Grato
5d6e28533b Bug 1957708 - Add link place holder to optin message r=fluent-reviewers,tabbrowser-reviewers,firefox-ai-ml-reviewers,flod,txia
Adding additional functionality for there to be a link in the message part of the optin component. Using a place holder link to support for now. This will be updated to a new SUMO article.

Differential Revision: https://phabricator.services.mozilla.com/D244069
2025-04-02 16:28:38 +00:00
Ed Lee
b8e5807722 Bug 1957507 - "Foxfooding feedback" for link previews wants better link and/or copy r=txia,firefox-ai-ml-reviewers
Update hardcoded link and copy

Differential Revision: https://phabricator.services.mozilla.com/D244074
2025-04-02 07:57:02 +00:00
Aristide Tossou
5dfb00fd4f Bug 1957310 - [linkPreview] Allow model improvments - r=txia,firefox-ai-ml-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D243614
2025-03-31 06:00:46 +00:00
Aristide Tossou
67eed6ab8b Bug 1957305 - [linkPreview] Use blocklist for AI generation - r=txia,firefox-ai-ml-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D243612
2025-03-31 06:00:46 +00:00
Tim Xia
6188625264 Bug 1955095 - update error state card for link preview - r=atossou,firefox-ai-ml-reviewers
- remove articleData.excerpt for description 'cause reader mode might come with its own error fallback text
- switch between normal vs. error type of og-card since error UI does not relate to the normal card layout anymore
- different placeholder feedback link

Differential Revision: https://phabricator.services.mozilla.com/D243348
2025-03-31 05:14:37 +00:00
Tim Xia
4e850ba6b1 Bug 1957226 - Progress indicator for initial model download for Link Preview - r=atossou,firefox-ai-ml-reviewers
- change text on Generating key points... if downloading model
- show % progress on below instead of the static text "This may take a moment the first time you preview a link. Key points should appear more quickly next time."
- add aiContentTitle to manage state of the heading text

Differential Revision: https://phabricator.services.mozilla.com/D243602
2025-03-30 17:26:51 +00:00
Tim Xia
68cf8125ad Bug 1957054 - Improve Non-English Content Handling for Link Preview - r=Mardak,firefox-ai-ml-reviewers
- skip non-English urls for keypoint generation
- update test for test_skip_generate_if_non_eng, test_link_preview_panel_shown, test_fetch_page_data
- add static html assets: readableFr.html and readableEn.html
- introduce pref to allow any or specified languages

Differential Revision: https://phabricator.services.mozilla.com/D243533
2025-03-29 16:16:05 +00:00
Tim Xia
a3c3ab49e0 Bug 1955089 - Update to use alt+shift+hover to trigger link preview - r=Mardak,firefox-ai-ml-reviewers
- exclude meta and ctrl key on keyboard shortcut
- handle both key press and release for active shortcut

Differential Revision: https://phabricator.services.mozilla.com/D243379
2025-03-29 08:03:41 +00:00
Tim Xia
081deac007 Bug 1956528 - Skip keypoint generation if url is not 'readable' - r=atossou,firefox-ai-ml-reviewers
- temporarily copy over the code for isProbablyReaderable from Readability-readerable.js
- use reader mode html page to fix test_link_preview_panel_shown
- add test_skip_keypoints_generation_if_url_not_readable

Differential Revision: https://phabricator.services.mozilla.com/D243115
2025-03-28 13:08:02 +00:00
Tim Xia
05f00a5dc5 Bug 1956845 - Update Link Preveiw disclaimer text - r=Mardak,firefox-ai-ml-reviewers
- Update Link Preveiw disclaimer text to "Key points are AI-generated and may have mistakes."

Differential Revision: https://phabricator.services.mozilla.com/D243327
2025-03-27 23:06:48 +00:00
Cosmin Sabou
9fd9b0903d Backed out changeset 9579d6a5dc23 (bug 1952011) for causing key point related failures on browser_link_preview. 2025-03-27 03:07:41 +02:00
Tim Xia
2da2773a99 Bug 1952011 - Skip keypoint generation if url is not 'readable' - r=atossou,firefox-ai-ml-reviewers
- temporarily copy over the code for isProbablyReaderable from Readability-readerable.js

Differential Revision: https://phabricator.services.mozilla.com/D243115
2025-03-26 18:49:59 +00:00
Nick Grato
4113c7ce84 Bug 1956077 - Enhance STG user flow with assorted UX callouts r=rrando,fluent-reviewers,desktop-theme-reviewers,tabbrowser-reviewers,firefox-ai-ml-reviewers,sthompson,bolsson,hjones
Update strings in STG user flow. Update button styles. Add new footer paragraph and link to model optin component. Expand the panel when showing suggested tabs. Fix messaging coloring when there are no tabs to suggest.

Differential Revision: https://phabricator.services.mozilla.com/D242786
2025-03-26 17:16:39 +00:00
Aristide Tossou
849d116a53 Bug 1956329 - [linkPreview] Keep spacing for reader view parsed text - r=txia,firefox-ai-ml-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D242989
2025-03-26 00:03:12 +00:00
Sarah Clements
3435c4b131 Bug 1947997 - Make sidebar.main.tools user customized r=sidebar-reviewers,firefox-desktop-core-reviewers ,mossop
* Update sidebar.main.tools default values and include a migration
* Modify updateDefaultTools in SidebarManager
* Update tests

Differential Revision: https://phabricator.services.mozilla.com/D240903
2025-03-24 18:32:29 +00:00
Ed Lee
6382a37ac1 Bug 1943395 - Refine request logic to match spec r=txia,firefox-ai-ml-reviewers
Switch to channel to get url-classifier behavior. Move some logic into channel listener to simplify without HEAD.

Differential Revision: https://phabricator.services.mozilla.com/D242562
2025-03-23 21:10:05 +00:00
Ed Lee
0279f7751e Bug 1946507 - support experimental chatbot onboarding r=firefox-ai-ml-reviewers,ngrato
Allow setting a pref to override default onboarding config. Inject some dynamic behaviors, e.g., providers and limit. Refactor support link to custom action.

Differential Revision: https://phabricator.services.mozilla.com/D240085
2025-03-22 06:41:02 +00:00
Aristide Tossou
0623de0c1d Bug 1955234 - Enhance LinkPreview Model: Block List and Early Generation Stopping Support - r=Mardak,tarek,firefox-ai-ml-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D242298
2025-03-21 16:32:39 +00:00
Tim Xia
56c4dd0e8b Bug 1943399 - Refine preview panel content to better match spec - r=Mardak,firefox-ai-ml-reviewers
- full width card even with narrow content
- reading time
- image padding
- site name 1.2em
- update font color using new css variable
- move content card shadow downward
- update border radius for image and padding
- update readingTimeMinsFast for single number or single min

Differential Revision: https://phabricator.services.mozilla.com/D242333
2025-03-21 04:41:15 +00:00
Ed Lee
1e6628313b Bug 1954815 - add first usage message, feedback link, visit page link r=txia,firefox-ai-ml-reviewers,atossou
Hardcode some text that gets shown on first time and additional links

Differential Revision: https://phabricator.services.mozilla.com/D242045
2025-03-20 00:05:38 +00:00
Norisz Fay
7055cc99ca Bug 1953000 - Fix lint failure r=lint-fix CLOSED TREE 2025-03-17 21:09:22 +02:00
Nick Grato
8449e3c96d Bug 1953000 - Reusable model optin UI component r=Mardak,fluent-reviewers,firefox-ai-ml-reviewers,bolsson
Create a reusable component to handle the ML model opt in. First use case will be for STG.

Differential Revision: https://phabricator.services.mozilla.com/D240935
2025-03-17 16:50:51 +00:00
Tim Xia
d2054b7d31 Bug 1943393 - Display link preview panel with page metadata r=Mardak,firefox-ai-ml-reviewers
- use lit component
- pop-up at where mouse is via MousePosTracker
- add image to the card
- use external css file

Differential Revision: https://phabricator.services.mozilla.com/D240958
2025-03-15 08:21:21 +00:00
Aristide Tossou
1cda079a5a Bug 1953986 - Update Link Preview Model prompt and preprocessing - r=Mardak,firefox-ai-ml-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D241545
2025-03-14 21:59:32 +00:00
Goloman Adrian
723bc47635 Backed out changeset e8898c2b7d0a (bug 1953000) for causing failures @test_model_optin.html. 2025-03-14 08:40:19 +02:00
Nick Grato
b2fdb8a527 Bug 1953000 - Reusable model optin UI component r=Mardak,fluent-reviewers,firefox-ai-ml-reviewers,bolsson
Create a reusable component to handle the ML model opt in. First use case will be for STG.

Differential Revision: https://phabricator.services.mozilla.com/D240935
2025-03-13 20:08:00 +00:00
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