Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
71 changes: 70 additions & 1 deletion src/css/popup.css
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,18 @@
src: url("/fonts/Inter-Medium.woff2") format("woff2");
}

@font-face {
font-family: "Inter-SemiBold";
font-style: normal;
font-weight: 700;
src: url("/fonts/Inter-SemiBold.woff2") format("woff2");
}

[data-theme="light"],
: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");
Expand Down Expand Up @@ -1651,8 +1659,20 @@ 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 {
.half-onboarding-button:focus,
#survey-achievement-done-button:focus {
box-shadow:
0 0 0 2px var(--button-bg-color-secondary),
0 0 0 4px var(--button-bg-focus-color-primary);
Expand Down Expand Up @@ -2409,3 +2429,52 @@ tr:hover > td > .reset-button {
.searchbar input {
inline-size: 100%;
}

/* Survey Popup */

.survey-blurb,
#survey-panel h3.onboarding-title {
text-align: center;
margin-inline: auto;
}

#survey-panel h3.onboarding-title {
max-inline-size: 100%;
font-family: var(--fontInterSemiBold);
line-height: 24px;
margin-block-end: 12px;
}

#survey-panel {
padding-block: 40px;
padding-inline: 0;
}

.survey-blurb {
margin-block-end: 16px;
margin-inline: 24px;
}

#survey-img {
block-size: 180px;
margin-block-end: 16px;
}

#survey-button {
padding-block: 4px;
padding-inline: 16px;
margin-block: 0 8px;
min-block-size: 32px;
}

.share-ctas.survey-back {
margin-inline: auto;
}

#survey-achievement-done-button:hover {
color: var(--button-bg-hover-color-primary);
}

#survey-achievement-done-button:active {
color: var(--button-bg-active-color-primary);
}
Binary file added src/fonts/Inter-SemiBold.woff2
Binary file not shown.
39 changes: 39 additions & 0 deletions src/img/survey.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 29 additions & 1 deletion src/js/background/messageHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
});
break;
case "checkIncompatibleAddons":
// TODO

Check warning on line 67 in src/js/background/messageHandler.js

View workflow job for this annotation

GitHub Actions / Run tests

Unexpected 'todo' comment: 'TODO'
break;
case "moveTabsToWindow":
response = backgroundLogic.moveTabsToWindow({
Expand Down Expand Up @@ -257,6 +257,8 @@
browser.browserAction.setBadgeBackgroundColor({color: "rgba(0,217,0,255)"});
browser.browserAction.setBadgeText({text: "NEW"});
}

this.maybePrepareSurveyAchievementOnUpdate(countOfContainerTabsOpened);
},

async onFocusChangedCallback(windowId) {
Expand All @@ -273,7 +275,33 @@
}).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 shown in the past; if so, do not show again.
const { achievements } = await browser.storage.local.get({ 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
Expand Down
46 changes: 38 additions & 8 deletions src/js/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
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";

Expand Down Expand Up @@ -138,18 +139,23 @@

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,
Expand Down Expand Up @@ -811,7 +817,7 @@
const td = document.createElement("td");
const openTabs = identity.numberOfOpenTabs || "" ;

// TODO get UX and content decision on how to message and block clicks to containers with Mozilla VPN proxy configs

Check warning on line 820 in src/js/popup.js

View workflow job for this annotation

GitHub Actions / Run tests

Unexpected 'todo' comment: 'TODO get UX and content decision on how...'
// when Mozilla VPN app is disconnected.

td.innerHTML = Utils.escaped`
Expand Down Expand Up @@ -2376,6 +2382,30 @@
},
});

// 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);
});
Utils.addEnterHandler(document.querySelector("#survey-button"), async () => {
await Logic.setAchievementDone("survey");
window.close();
});
},

// This method is called when the panel is shown.
prepare() {
return Promise.resolve(null);
},
});

Logic.init();

window.addEventListener("resize", function () {
Expand Down
2 changes: 1 addition & 1 deletion src/manifest.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
11 changes: 11 additions & 0 deletions src/popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,17 @@ <h3 class="onboarding-title" data-i18n-message-id="oneHundredTabsHeader"></h3>
<a href="#" id="achievement-done-button" class="onboarding-button keyboard-nav" data-i18n-message-id="done"></a>
</div>

<div class="panel survey-panel hide" id="survey-panel">
<img id="survey-img" alt="" src="/img/survey.svg" />
<h3 class="onboarding-title">Participate in Paid Research with Firefox</h3>
<p class="survey-blurb">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.</p>
<p class="survey-blurb">Thank you for helping us improve Firefox.</p>
<p class="share-ctas survey-back">
<a class="cta-link onboarding-button keyboard-nav" href="https://qsurvey.mozilla.com/s3/Multi-Account-Containers-Research-Interest-Form" id="survey-button" target="_blank">Take Interest Survey</a>
</p>
<a href="#" id="survey-achievement-done-button">Back</a>
</div>

<div class="panel menu-panel container-panel hide" id="container-panel">
<span class="popup-notification-card"></span>
<h3 class="title">Firefox Multi-Account Containers</h3>
Expand Down
Loading