Skip to content

Commit

Permalink
Release build 6.41.0 [ci release]
Browse files Browse the repository at this point in the history
  • Loading branch information
shakyShane authored and github-actions[bot] committed Nov 28, 2024
1 parent e51efbc commit c4bb146
Show file tree
Hide file tree
Showing 18 changed files with 439 additions and 203 deletions.
24 changes: 3 additions & 21 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,21 +1,3 @@
- ntp: favicon fixes (#1286)
- ntp: missing translations (#1285)
- ntp: temporary events for show more/less (#1281)
- Weekly dependabot.yml updates (#1275)
- Add install steps to README.md (#1282)
- ntp: add telemetry events for show/hide (#1280)
- ntp: added translations (#1279)
- ntp: virtual list for favorites (#1269)
- NTP: UI Privacy Stats spacing and secondary expansion (#1270)
- Update .git-blame-ignore-revs (#1273)
- Bump @playwright/test from 1.48.2 to 1.49.0 (#1239)
- build(deps-dev): bump the rollup group across 1 directory with 2 updates (#1267)
- build(deps-dev): bump @duckduckgo/privacy-configuration (#1271)
- build(deps): bump @rive-app/canvas-single from 2.23.8 to 2.23.10 (#1258)
- Bump typescript-eslint from 8.14.0 to 8.15.0 (#1241)
- ntp: prepare translations (#1262)
- add test covering insecure context (#1264)
- ntp: support window->window drop in favorites (#1260)
- ntp: per-widget error boundary (#1249)
- ntp: handle drag + drop outside of favorites (#1256)
- New Tab Page and NTP Widget styles (#1229)
- ntp: display tweaks + stats show more fix (#1288)
- ntp: remove bullet from update-notification notes (#1287)
- build(deps-dev): bump typescript-eslint from 8.15.0 to 8.16.0 (#1276)
47 changes: 28 additions & 19 deletions Sources/ContentScopeScripts/dist/pages/new-tab/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5545,6 +5545,9 @@
}
return sorted;
}
function displayNameForCompany(companyName) {
return companyName.replace(/\.[a-z]+$/i, "");
}
var init_privacy_stats_utils = __esm({
"pages/new-tab/app/privacy-stats/privacy-stats.utils.js"() {
"use strict";
Expand Down Expand Up @@ -5618,43 +5621,41 @@
const defaultRowMax = 5;
const sorted = sortStatsForDisplay(trackerCompanies);
const max = sorted[0]?.count ?? 0;
const [visible, setVisible] = h2(defaultRowMax);
const hasmore = sorted.length > visible;
const [expansion, setExpansion] = h2(
/** @type {Expansion} */
"collapsed"
);
const toggleListExpansion = () => {
if (hasmore) {
if (expansion === "collapsed") {
messaging2.statsShowMore();
} else {
messaging2.statsShowLess();
}
if (visible === defaultRowMax) {
setVisible(sorted.length);
}
if (visible === sorted.length) {
setVisible(defaultRowMax);
}
setExpansion(expansion === "collapsed" ? "expanded" : "collapsed");
};
return /* @__PURE__ */ _(b, null, /* @__PURE__ */ _("ul", { ...listAttrs, class: PrivacyStats_default.list, "data-testid": "CompanyList" }, sorted.slice(0, visible).map((company) => {
const rows = expansion === "expanded" ? sorted : sorted.slice(0, defaultRowMax);
return /* @__PURE__ */ _(b, null, /* @__PURE__ */ _("ul", { ...listAttrs, class: PrivacyStats_default.list, "data-testid": "CompanyList" }, rows.map((company) => {
const percentage = Math.min(company.count * 100 / max, 100);
const valueOrMin = Math.max(percentage, 10);
const inlineStyles = {
width: `${valueOrMin}%`
};
const countText = formatter.format(company.count);
const displayName = company.displayName;
const displayName = displayNameForCompany(company.displayName);
if (company.displayName === DDG_STATS_OTHER_COMPANY_IDENTIFIER) {
const otherText2 = t3("stats_otherCount", { count: String(company.count) });
return /* @__PURE__ */ _("li", { key: company.displayName, class: PrivacyStats_default.otherTrackersRow }, otherText2);
}
return /* @__PURE__ */ _("li", { key: company.displayName, class: PrivacyStats_default.row }, /* @__PURE__ */ _("div", { class: PrivacyStats_default.company }, /* @__PURE__ */ _(CompanyIcon, { displayName: company.displayName }), /* @__PURE__ */ _("span", { class: PrivacyStats_default.name }, displayName)), /* @__PURE__ */ _("span", { class: PrivacyStats_default.count }, countText), /* @__PURE__ */ _("span", { class: PrivacyStats_default.bar }), /* @__PURE__ */ _("span", { class: PrivacyStats_default.fill, style: inlineStyles }));
return /* @__PURE__ */ _("li", { key: company.displayName, class: PrivacyStats_default.row }, /* @__PURE__ */ _("div", { class: PrivacyStats_default.company }, /* @__PURE__ */ _(CompanyIcon, { displayName }), /* @__PURE__ */ _("span", { class: PrivacyStats_default.name }, displayName)), /* @__PURE__ */ _("span", { class: PrivacyStats_default.count }, countText), /* @__PURE__ */ _("span", { class: PrivacyStats_default.bar }), /* @__PURE__ */ _("span", { class: PrivacyStats_default.fill, style: inlineStyles }));
})), sorted.length > defaultRowMax && /* @__PURE__ */ _("div", { class: PrivacyStats_default.listExpander }, /* @__PURE__ */ _(
ShowHideButton,
{
onClick: toggleListExpansion,
text: hasmore ? t3("ntp_show_more") : t3("ntp_show_less"),
text: expansion === "collapsed" ? t3("ntp_show_more") : t3("ntp_show_less"),
showText: true,
buttonAttrs: {
"aria-expanded": !hasmore,
"aria-pressed": visible === sorted.length
"aria-expanded": expansion === "expanded",
"aria-pressed": expansion === "expanded"
}
}
)));
Expand Down Expand Up @@ -5743,7 +5744,7 @@
factory: () => factory3
});
function factory3() {
return /* @__PURE__ */ _(Centered, null, /* @__PURE__ */ _(PrivacyStatsCustomized, null));
return /* @__PURE__ */ _(Centered, { "data-entry-point": "privacyStats" }, /* @__PURE__ */ _(PrivacyStatsCustomized, null));
}
var init_privacyStats = __esm({
"pages/new-tab/app/entry-points/privacyStats.js"() {
Expand Down Expand Up @@ -6134,7 +6135,11 @@
}
);
return /* @__PURE__ */ _("details", { ref }, /* @__PURE__ */ _("summary", { tabIndex: -1, className: UpdateNotification_default.summary }, t3("updateNotification_updated_version", { version }), " ", inlineLink), /* @__PURE__ */ _("div", { id, class: UpdateNotification_default.detailsContent }, /* @__PURE__ */ _("ul", { class: UpdateNotification_default.list }, notes.map((note, index) => {
return /* @__PURE__ */ _("li", { key: note + index }, note);
let trimmed = note.trim();
if (trimmed.startsWith("\u2022")) {
trimmed = trimmed.slice(1).trim();
}
return /* @__PURE__ */ _("li", { key: note + index }, trimmed);
}))));
}
function WithoutNotes({ version }) {
Expand Down Expand Up @@ -6889,7 +6894,7 @@
count: 210
},
{
displayName: "Amazon",
displayName: "Amazon.com",
count: 67
},
{
Expand Down Expand Up @@ -6931,7 +6936,7 @@
count: 1
},
{
displayName: "Amazon",
displayName: "Amazon.com",
count: 1
},
{
Expand All @@ -6940,6 +6945,10 @@
}
]
},
growing: {
totalCount: 0,
trackerCompanies: []
},
many: {
totalCount: 890,
trackerCompanies: [
Expand Down
130 changes: 88 additions & 42 deletions build/integration/pages/new-tab/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5550,6 +5550,9 @@
}
return sorted;
}
function displayNameForCompany(companyName) {
return companyName.replace(/\.[a-z]+$/i, "");
}
var init_privacy_stats_utils = __esm({
"pages/new-tab/app/privacy-stats/privacy-stats.utils.js"() {
"use strict";
Expand Down Expand Up @@ -5623,43 +5626,41 @@
const defaultRowMax = 5;
const sorted = sortStatsForDisplay(trackerCompanies);
const max = sorted[0]?.count ?? 0;
const [visible, setVisible] = h2(defaultRowMax);
const hasmore = sorted.length > visible;
const [expansion, setExpansion] = h2(
/** @type {Expansion} */
"collapsed"
);
const toggleListExpansion = () => {
if (hasmore) {
if (expansion === "collapsed") {
messaging2.statsShowMore();
} else {
messaging2.statsShowLess();
}
if (visible === defaultRowMax) {
setVisible(sorted.length);
}
if (visible === sorted.length) {
setVisible(defaultRowMax);
}
setExpansion(expansion === "collapsed" ? "expanded" : "collapsed");
};
return /* @__PURE__ */ _(b, null, /* @__PURE__ */ _("ul", { ...listAttrs, class: PrivacyStats_default.list, "data-testid": "CompanyList" }, sorted.slice(0, visible).map((company) => {
const rows = expansion === "expanded" ? sorted : sorted.slice(0, defaultRowMax);
return /* @__PURE__ */ _(b, null, /* @__PURE__ */ _("ul", { ...listAttrs, class: PrivacyStats_default.list, "data-testid": "CompanyList" }, rows.map((company) => {
const percentage = Math.min(company.count * 100 / max, 100);
const valueOrMin = Math.max(percentage, 10);
const inlineStyles = {
width: `${valueOrMin}%`
};
const countText = formatter.format(company.count);
const displayName = company.displayName;
const displayName = displayNameForCompany(company.displayName);
if (company.displayName === DDG_STATS_OTHER_COMPANY_IDENTIFIER) {
const otherText2 = t3("stats_otherCount", { count: String(company.count) });
return /* @__PURE__ */ _("li", { key: company.displayName, class: PrivacyStats_default.otherTrackersRow }, otherText2);
}
return /* @__PURE__ */ _("li", { key: company.displayName, class: PrivacyStats_default.row }, /* @__PURE__ */ _("div", { class: PrivacyStats_default.company }, /* @__PURE__ */ _(CompanyIcon, { displayName: company.displayName }), /* @__PURE__ */ _("span", { class: PrivacyStats_default.name }, displayName)), /* @__PURE__ */ _("span", { class: PrivacyStats_default.count }, countText), /* @__PURE__ */ _("span", { class: PrivacyStats_default.bar }), /* @__PURE__ */ _("span", { class: PrivacyStats_default.fill, style: inlineStyles }));
return /* @__PURE__ */ _("li", { key: company.displayName, class: PrivacyStats_default.row }, /* @__PURE__ */ _("div", { class: PrivacyStats_default.company }, /* @__PURE__ */ _(CompanyIcon, { displayName }), /* @__PURE__ */ _("span", { class: PrivacyStats_default.name }, displayName)), /* @__PURE__ */ _("span", { class: PrivacyStats_default.count }, countText), /* @__PURE__ */ _("span", { class: PrivacyStats_default.bar }), /* @__PURE__ */ _("span", { class: PrivacyStats_default.fill, style: inlineStyles }));
})), sorted.length > defaultRowMax && /* @__PURE__ */ _("div", { class: PrivacyStats_default.listExpander }, /* @__PURE__ */ _(
ShowHideButton,
{
onClick: toggleListExpansion,
text: hasmore ? t3("ntp_show_more") : t3("ntp_show_less"),
text: expansion === "collapsed" ? t3("ntp_show_more") : t3("ntp_show_less"),
showText: true,
buttonAttrs: {
"aria-expanded": !hasmore,
"aria-pressed": visible === sorted.length
"aria-expanded": expansion === "expanded",
"aria-pressed": expansion === "expanded"
}
}
)));
Expand Down Expand Up @@ -5748,7 +5749,7 @@
factory: () => factory3
});
function factory3() {
return /* @__PURE__ */ _(Centered, null, /* @__PURE__ */ _(PrivacyStatsCustomized, null));
return /* @__PURE__ */ _(Centered, { "data-entry-point": "privacyStats" }, /* @__PURE__ */ _(PrivacyStatsCustomized, null));
}
var init_privacyStats = __esm({
"pages/new-tab/app/entry-points/privacyStats.js"() {
Expand Down Expand Up @@ -6139,7 +6140,11 @@
}
);
return /* @__PURE__ */ _("details", { ref }, /* @__PURE__ */ _("summary", { tabIndex: -1, className: UpdateNotification_default.summary }, t3("updateNotification_updated_version", { version }), " ", inlineLink), /* @__PURE__ */ _("div", { id, class: UpdateNotification_default.detailsContent }, /* @__PURE__ */ _("ul", { class: UpdateNotification_default.list }, notes.map((note, index) => {
return /* @__PURE__ */ _("li", { key: note + index }, note);
let trimmed = note.trim();
if (trimmed.startsWith("\u2022")) {
trimmed = trimmed.slice(1).trim();
}
return /* @__PURE__ */ _("li", { key: note + index }, trimmed);
}))));
}
function WithoutNotes({ version }) {
Expand Down Expand Up @@ -7054,7 +7059,7 @@
count: 210
},
{
displayName: "Amazon",
displayName: "Amazon.com",
count: 67
},
{
Expand Down Expand Up @@ -7096,7 +7101,7 @@
count: 1
},
{
displayName: "Amazon",
displayName: "Amazon.com",
count: 1
},
{
Expand All @@ -7105,6 +7110,10 @@
}
]
},
growing: {
totalCount: 0,
trackerCompanies: []
},
many: {
totalCount: 890,
trackerCompanies: [
Expand Down Expand Up @@ -8831,7 +8840,11 @@
},
populated: {
content: {
notes: ["Bug fixes and improvements"],
// prettier-ignore
notes: [
"\u2022 Bug fixes and improvements",
"Optimized performance for faster load times"
],
version: "1.91"
}
}
Expand All @@ -8843,6 +8856,14 @@
var url2 = new URL(window.location.href);
function mockTransport() {
const channel = new BroadcastChannel("ntp");
const subscriptions = /* @__PURE__ */ new Map();
if ("__playwright_01" in window) {
window.__playwright_01.publishSubscriptionEvent = (evt) => {
const matchingCallback = subscriptions.get(evt.subscriptionName);
if (!matchingCallback) return console.error("no matching callback for subscription", evt);
matchingCallback(evt.params);
};
}
function broadcast(named) {
setTimeout(() => {
channel.postMessage({
Expand Down Expand Up @@ -8952,11 +8973,17 @@
}
},
subscribe(_msg, cb) {
window.__playwright_01?.mocks?.outgoing?.push?.({ payload: structuredClone(_msg) });
const sub = (
/** @type {any} */
_msg.subscriptionName
);
if ("__playwright_01" in window) {
window.__playwright_01?.mocks?.outgoing?.push?.({ payload: structuredClone(_msg) });
subscriptions.set(sub, cb);
return () => {
subscriptions.delete(sub);
};
}
switch (sub) {
case "widgets_onConfigUpdated": {
const controller = new AbortController();
Expand Down Expand Up @@ -9040,30 +9067,49 @@
}
case "stats_onDataUpdate": {
const statsVariant = url2.searchParams.get("stats");
if (statsVariant !== "willUpdate") return () => {
};
const count = url2.searchParams.get("stats-update-count");
const max = Math.min(parseInt(count || "0"), 10);
if (max === 0) return () => {
const updateMaxCount = parseInt(count || "0");
if (updateMaxCount === 0) return () => {
};
let inc = 1;
const int = setInterval(() => {
if (inc === max) return clearInterval(int);
const next = {
...stats.willUpdate,
trackerCompanies: stats.willUpdate.trackerCompanies.map((x4, index) => {
return {
...x4,
count: x4.count + inc * index
};
})
if (statsVariant === "willUpdate") {
let inc = 1;
const max = Math.min(updateMaxCount, 10);
const int = setInterval(() => {
if (inc === max) return clearInterval(int);
const next = {
...stats.willUpdate,
trackerCompanies: stats.willUpdate.trackerCompanies.map((x4, index) => {
return {
...x4,
count: x4.count + inc * index
};
})
};
cb(next);
inc++;
}, 500);
return () => {
clearInterval(int);
};
cb(next);
inc++;
}, 500);
return () => {
clearInterval(int);
};
} else if (statsVariant === "growing") {
const list2 = stats.many.trackerCompanies;
let index = 0;
const max = Math.min(updateMaxCount, list2.length);
const int = setInterval(() => {
if (index === max) return clearInterval(int);
console.log({ index, max });
cb({
trackerCompanies: list2.slice(0, index + 1)
});
index++;
}, 200);
return () => {
};
} else {
console.log(statsVariant);
return () => {
};
}
}
case "favorites_onConfigUpdate": {
const controller = new AbortController();
Expand Down
Loading

0 comments on commit c4bb146

Please sign in to comment.