From 0eb13f214d252df0e8eb3e8af008a5c7340d4883 Mon Sep 17 00:00:00 2001 From: Andrea Marchesini Date: Tue, 30 Sep 2025 17:48:00 +0200 Subject: [PATCH 1/7] Survey view --- package.json | 2 +- src/img/survey.svg | 36 +++++++++++++++++++++++++ src/js/background/messageHandler.js | 31 ++++++++++++++++++++- src/js/popup.js | 42 +++++++++++++++++++++++------ src/manifest.json | 2 +- src/popup.html | 12 +++++++++ 6 files changed, 114 insertions(+), 11 deletions(-) create mode 100644 src/img/survey.svg diff --git a/package.json b/package.json index 33f40e4..c92a48f 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "testpilot-containers", "title": "Multi-Account Containers", "description": "Containers helps you keep all the parts of your online life contained in different tabs. Custom labels and color-coded tabs help keep different activities — like online shopping, travel planning, or checking work email — separate.", - "version": "8.3.0", + "version": "8.3.1", "author": "Andrea Marchesini, Luke Crouch, Lesley Norton, Kendall Werts, Maxx Crawford, Jonathan Kingston", "bugs": { "url": "https://github.com/mozilla/multi-account-containers/issues" diff --git a/src/img/survey.svg b/src/img/survey.svg new file mode 100644 index 0000000..bb4e727 --- /dev/null +++ b/src/img/survey.svg @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/js/background/messageHandler.js b/src/js/background/messageHandler.js index 1335d4d..9e8a087 100644 --- a/src/js/background/messageHandler.js +++ b/src/js/background/messageHandler.js @@ -257,6 +257,8 @@ const messageHandler = { browser.browserAction.setBadgeBackgroundColor({color: "rgba(0,217,0,255)"}); browser.browserAction.setBadgeText({text: "NEW"}); } + + this.maybePrepareSurveyAchievementOnUpdate(countOfContainerTabsOpened); }, async onFocusChangedCallback(windowId) { @@ -273,7 +275,34 @@ const messageHandler = { }).catch((e) => { throw e; }); - } + }, + + async maybePrepareSurveyAchievementOnUpdate(countOpened) { + if (countOpened < 10) { + return; + } + + // Show the survey only for English locales (en or en-*). + const uiLang = browser.i18n.getUILanguage(); + const lang = (uiLang || "").toLowerCase(); + if (lang !== "en" && !lang.startsWith("en-")) { + return; + } + + // Check if already scheduled in the past; if so, do not show again. + const achievementsStorage = await browser.storage.local.get({ achievements: [] }); + const achievements = achievementsStorage.achievements; + const existing = achievements.find(a => a.name === "survey"); + if (existing) { + return; + } + + // Ensure the achievement exists and is pending. + achievements.push({ name: "survey", done: false }); + browser.storage.local.set({ achievements }); + browser.browserAction.setBadgeBackgroundColor({color: "rgba(0,217,0,255)"}); + browser.browserAction.setBadgeText({text: "NEW"}); + }, }; // Lets do this last as theme manager did a check before connecting before diff --git a/src/js/popup.js b/src/js/popup.js index dd2492a..4419f15 100644 --- a/src/js/popup.js +++ b/src/js/popup.js @@ -31,6 +31,7 @@ const P_CONTAINER_INFO = "containerInfo"; const P_CONTAINER_EDIT = "containerEdit"; const P_CONTAINER_DELETE = "containerDelete"; const P_CONTAINERS_ACHIEVEMENT = "containersAchievement"; +const P_SURVEY_ACHIEVEMENT = "surveyAchievement"; const P_CONTAINER_ASSIGNMENTS = "containerAssignments"; const P_CLEAR_CONTAINER_STORAGE = "clearContainerStorage"; @@ -138,18 +139,23 @@ const Logic = { async showAchievementOrContainersListPanel() { // Do we need to show an achievement panel? - let showAchievements = false; const achievementsStorage = await browser.storage.local.get({ achievements: [] }); - for (const achievement of achievementsStorage.achievements) { - if (!achievement.done) { - showAchievements = true; + const pending = achievementsStorage.achievements.filter(a => !a.done); + + if (pending.length) { + // Prefer showing the survey view first if present, otherwise fall back + // to the existing achievement panel. + const survey = pending.find(a => a.name === "survey"); + if (survey) { + this.showPanel(P_SURVEY_ACHIEVEMENT); + return; } - } - if (showAchievements) { + this.showPanel(P_CONTAINERS_ACHIEVEMENT); - } else { - this.showPanel(P_CONTAINERS_LIST); + return; } + + this.showPanel(P_CONTAINERS_LIST); }, // In case the user wants to click multiple actions, @@ -2376,6 +2382,26 @@ Logic.registerPanel(P_CONTAINERS_ACHIEVEMENT, { }, }); +// P_SURVEY_ACHIEVEMENT: A simple survey view. +// ---------------------------------------------------------------------------- + +Logic.registerPanel(P_SURVEY_ACHIEVEMENT, { + panelSelector: ".survey-panel", + + // This method is called when the object is registered. + initialize() { + Utils.addEnterHandler(document.querySelector("#survey-achievement-done-button"), async () => { + await Logic.setAchievementDone("survey"); + Logic.showPanel(P_CONTAINERS_LIST); + }); + }, + + // This method is called when the panel is shown. + prepare() { + return Promise.resolve(null); + }, +}); + Logic.init(); window.addEventListener("resize", function () { diff --git a/src/manifest.json b/src/manifest.json index c87c44c..809c02d 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 2, "name": "Firefox Multi-Account Containers", - "version": "8.3.0", + "version": "8.3.1", "incognito": "not_allowed", "description": "__MSG_extensionDescription__", "icons": { diff --git a/src/popup.html b/src/popup.html index 5a87ae9..9a881cc 100644 --- a/src/popup.html +++ b/src/popup.html @@ -106,6 +106,18 @@ +
+ +

Participate in Paid Research with Firefox

+

We'd love to learn about your experiences with this add-on!

+

Join a 1:1 Zoom interview and receive a $75 Amazon e-giftcard or Paypal payment.

+

Thank you for helping us improve Firefox.

+ + Back +
+
- +

Participate in Paid Research with Firefox

-

We'd love to learn about your experiences with this add-on!

-

Join a 1:1 Zoom interview and receive a $75 Amazon e-giftcard or Paypal payment.

-

Thank you for helping us improve Firefox.

-

We'd love to learn about your experiences with this add-on! Join a 1:1 Zoom interview and receive a $75 Amazon e-giftcard or Paypal payment.

+

Thank you for helping us improve Firefox.

+ Back
From eeefaaba1ea39726346e98f430c84b807491dc3e Mon Sep 17 00:00:00 2001 From: Lesley Norton Date: Wed, 1 Oct 2025 12:48:17 -0500 Subject: [PATCH 3/7] Fix CSS lint errors --- src/css/popup.css | 42 ++++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/src/css/popup.css b/src/css/popup.css index ad2ada7..b0532b7 100644 --- a/src/css/popup.css +++ b/src/css/popup.css @@ -37,6 +37,7 @@ :root { --fontInter: "Inter", sans-serif; --fontInterMedium: "Inter-Medium", sans-serif; + --fontInterSemiBold: "Inter-SemiBold", sans-serif; --fontMetropolis: "Metropolis", sans-serif; --fontMetropolisLight: "Metropolis-Light", sans-serif; --iconArrowLeft: url("/img/arrow-icon-left.svg"); @@ -1658,6 +1659,17 @@ input[type=text] { background-color: var(--button-bg-hover-color-primary); } +#survey-achievement-done-button { + color: var(--button-bg-color-primary); + transition: color 0.1s ease; + font-size: 14px; + padding-inline: 3px; + padding-block: 1px; + border-radius: 1px; + text-align: center; + margin-inline: auto; +} + .onboarding-button:focus, .half-onboarding-button:focus, #survey-achievement-done-button:focus { @@ -2418,27 +2430,24 @@ tr:hover > td > .reset-button { inline-size: 100%; } -/* Survey Popup */ +/* Survey Popup */ .survey-blurb, -#survey-panel h3.onboarding-title, -#survey-achievement-done-button { +#survey-panel h3.onboarding-title { text-align: center; - margin: auto; + margin-inline: auto; } #survey-panel h3.onboarding-title { max-inline-size: 100%; - font-family: "Inter-SemiBold"; - + font-family: var(--fontInterSemiBold); line-height: 24px; margin-block-end: 12px; } #survey-panel { - padding-block: 40px 32px; - padding-inline: 0px; - padding: 40px, 0px; + padding-block: 40px; + padding-inline: 0; } .survey-blurb { @@ -2452,21 +2461,14 @@ tr:hover > td > .reset-button { } #survey-button { - padding: 4px 16px; - margin-block: 0px 8px; + padding-block: 4px; + padding-inline: 16px; + margin-block: 0 8px; min-block-size: 32px; } .share-ctas.survey-back { - margin: auto; -} - -#survey-achievement-done-button { - color: var(--button-bg-color-primary); - transition: color 0.1s ease; - font-size: 14px; - padding: 1px 3px; - border-radius: 1px; + margin-inline: auto; } #survey-achievement-done-button:hover { From dcc42e2a3a48831b0291ae40ad3c82e5057ec24f Mon Sep 17 00:00:00 2001 From: Andrea Marchesini Date: Thu, 2 Oct 2025 18:19:24 +0200 Subject: [PATCH 4/7] Update src/popup.html Co-authored-by: Maxx Crawford --- src/popup.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/popup.html b/src/popup.html index b116e87..a1363ae 100644 --- a/src/popup.html +++ b/src/popup.html @@ -109,7 +109,7 @@

Participate in Paid Research with Firefox

-

We'd love to learn about your experiences with this add-on! Join a 1:1 Zoom interview and receive a $75 Amazon e-giftcard or Paypal payment.

+

We'd love to learn about your experiences with this add-on! Join a 1:1 Zoom interview and receive a $75 Amazon e-giftcard or PayPal payment.

Thank you for helping us improve Firefox.

Participate in Paid Research with Firefox

-

We'd love to learn about your experiences with this add-on! Join a 1:1 Zoom interview and receive a $75 Amazon e-giftcard or PayPal payment.

+

We'd love to learn about your experiences with this add-on! Join a 1:1 Zoom interview and receive a $75 Amazon e-gift card or PayPal payment.

Thank you for helping us improve Firefox.