Closed Bug 1837051 Opened 11 months ago Closed 10 months ago

Add Embedded Migration Wizard support for spotlight dialog

Categories

(Firefox :: Messaging System, enhancement, P1)

enhancement

Tracking

()

VERIFIED FIXED
116 Branch
Iteration:
116.2 - June 19 - June 30
Tracking Status
firefox116 --- verified

People

(Reporter: pdahiya, Assigned: nsauermann, NeedInfo)

References

(Blocks 1 open bug)

Details

Attachments

(4 files)

With Bug 1820640 we have added card that shows embedded migration wizard in about:welcome

https://searchfox.org/mozilla-central/source/browser/components/newtab/aboutwelcome/lib/AboutWelcomeDefaults.jsm#346

Trying the same screen inside spotlight using below steps doesn't open embedded wizard in spotlight tab or window modal dialog. It's possible embedded migration wizard currently supports being invoked from content process and doesn't handle when screen is loaded in main process with spotlight dialog.

To test embedded screen in spotlight:

  1. Set pref browser.newtabpage.activity-stream.asrouter.devtoolsEnabled to true
  2. Open about:newtab#devtools
  3. Search for message MULTISTAGE_SPOTLIGHT_MESSAGE
  4. Add below inside screen with id AW_PIN_FIREFOX at same level as logo property

"tiles": { "type": "migration-wizard" },

  1. Hit Modify

Expected

  • Screen with Embedded Migration wizard should show up in Spotlight dialog

Actual

  • Migration wizard custom elements shows up in html but not visible in Spotlight dialog

Including @mconley to help scope work needed to show embedded migration wizard from spotlight dialog

Flags: needinfo?(mconley)
Blocks: 1821736

Hi pdahiya,

The problem is that the spotlight document both needs to import the migration wizard strings and modules, but also needs to be added to the list of URIs that can use the migration wizard (in BrowserGlue.sys.mjs). This patch allows the wizard to show up in the spotlight modal for me:

diff --git a/browser/base/content/spotlight.html b/browser/base/content/spotlight.html
--- a/browser/base/content/spotlight.html
+++ b/browser/base/content/spotlight.html
@@ -16,15 +16,22 @@
       type="text/css"
       href="chrome://global/skin/in-content/common.css"
     />
     <link rel="localization" href="branding/brand.ftl" />
     <link rel="localization" href="toolkit/branding/brandings.ftl" />
     <link rel="localization" href="browser/newtab/asrouter.ftl" />
     <link rel="localization" href="browser/newtab/onboarding.ftl" />
     <link rel="localization" href="browser/spotlight.ftl" />
+    <link rel="localization" href="browser/migrationWizard.ftl" />
   </head>
   <body role="dialog" aria-labelledby="title" aria-describedby="content">
     <script src="resource://activity-stream/vendor/react.js"></script>
     <script src="resource://activity-stream/vendor/react-dom.js"></script>
     <script src="chrome://browser/content/spotlight.js"></script>
+    <script src="chrome://global/content/elements/named-deck.js" async></script>
+    <script src="chrome://global/content/elements/panel-list.js" async></script>
+    <script
+      src="chrome://browser/content/migration/migration-wizard.mjs"
+      type="module"
+    ></script>
   </body>
 </html>
diff --git a/browser/components/BrowserGlue.sys.mjs b/browser/components/BrowserGlue.sys.mjs
--- a/browser/components/BrowserGlue.sys.mjs
+++ b/browser/components/BrowserGlue.sys.mjs
@@ -617,16 +617,17 @@ let JSWINDOWACTORS = {

     includeChrome: true,
     allFrames: true,
     matches: [
       "about:welcome",
       "about:welcome?*",
       "about:preferences",
       "chrome://browser/content/migration/migration-dialog-window.html",
+      "chrome://browser/content/spotlight.html",
     ],
   },

   PageInfo: {
     child: {
       esModuleURI: "resource:///actors/PageInfoChild.sys.mjs",
     },
Flags: needinfo?(mconley)
Assignee: nobody → nsauermann
Iteration: --- → 116.1 - June 5 - June 16
Priority: -- → P1

Hi Mike! Wondering if moving MigrationWizard from BrowserGlue to it's own MigrationUtils services impacts the ability to add Embedded Wizard to Spotlight modals in any way (that's the only thing I can think of that's changed) or if I'm missing something obvious?

I followed the same steps you mentioned above but added "chrome://browser/content/spotlight.html" in the matches array in browser/components/migration/MigrationUtils.sys.mjs instead but encountering an issue where I see the content but it's all in a loading state. The aria-state is set to busy and the content is in loading-blocks.

I do see a CSP error in console:

Content-Security-Policy: The page's settings blocked the loading of a resource at inline ("default-src"). 2 customElements.js:499:24
Content-Security-Policy: The page's settings blocked the loading of a resource at inline ("default-src"). panel.js:62:22

But it's not obvious to me why this would be blocked since it's a chrome resource (unless this isn't an issue at all).

Flags: needinfo?(mconley)
Depends on: 1838056

Spoke to negin about this yesterday - this is due to bug 1838056. Thanks for spotting that, negin!

Flags: needinfo?(mconley)
Attachment #9338689 - Attachment description: WIP: Bug 1837051 - Add Embedded Migration Wizard support for spotlight dialog → Bug 1837051 - Add Embedded Migration Wizard support for spotlight dialog
Attachment #9338689 - Attachment description: Bug 1837051 - Add Embedded Migration Wizard support for spotlight dialog → WIP: Bug 1837051 - Add Embedded Migration Wizard support for spotlight dialog

Hi Gabrielle! Was looking to get some feedback on the spotlight styles for embedded import wizard. I tried to the best of my ability to maintain our other spotlight styles/spacing and center alignment but open to any suggestions/fixes. This is currently only for internal use/testing.

Flags: needinfo?(glussier)
Attachment #9338689 - Attachment description: WIP: Bug 1837051 - Add Embedded Migration Wizard support for spotlight dialog → Bug 1837051 - Add Embedded Migration Wizard support for spotlight dialog
Iteration: 116.1 - June 5 - June 16 → 116.2 - June 19 - June 30

Updated spacing for Embedded Import Spotlight

Hi Mike! Hopefully last poke on my end, but wondering if you might have any ideas why a test checking for the PANEL-LIST seems to fail consistently only on linux? Anything I might be missing specifically for Linux OS?

  let [panelList] = win.document.querySelector("migration-wizard").children;
  Assert.equal(panelList.tagName, "PANEL-LIST");

failure
full log

Flags: needinfo?(mconley)

Responded in Phabricator!

Flags: needinfo?(mconley)
Pushed by nsauermann@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/c6d0b3c48379
Add Embedded Migration Wizard support for spotlight dialog r=omc-reviewers,pdahiya,mconley
Status: NEW → RESOLVED
Closed: 10 months ago
Resolution: --- → FIXED
Target Milestone: --- → 116 Branch
Duplicate of this bug: 1829042

I have verified this enhancement using the latest Firefox Beta 116.0b8 (Build ID: 20230720200012) installed on Windows 10 x64, macOS 13.4.1, and Linux Mint 21.1. I can confirm the following:

  • The "Embedded Migration Wizard" spotlight is successfully triggered if the "Show" button related to the "IMPORT_SETTINGS_EMBEDDED" from the ASRouter page is clicked.
  • All the available information is successfully imported into the browser if the spotlight's "Import" button is clicked.
Status: RESOLVED → VERIFIED
Blocks: 1848973
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: