From 6ebde6bbbaac25a774df38068f2a4f55b6bfd271 Mon Sep 17 00:00:00 2001 From: BN Date: Sun, 24 May 2026 18:51:15 -0400 Subject: [PATCH 1/2] Add mailbox size and attachment count metrics --- public/_locales/en/messages.json | 2 ++ src/Stats.vue | 15 +++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/public/_locales/en/messages.json b/public/_locales/en/messages.json index 03384d9..f465438 100644 --- a/public/_locales/en/messages.json +++ b/public/_locales/en/messages.json @@ -207,6 +207,7 @@ "mailsSent": "Mails sent", "mailsStarred": "Mails starred", "mailsTagged": "{0} mails tagged", + "mailsWithAttachments": "{0} with attachments", "mailsTotal": "Mails total", "mailsUnread": "Mails unread", "message": "-", @@ -215,6 +216,7 @@ "percentOfReceived": "{0}% of received", "percentOfTotal": "{0}% of total", "timePeriod": "Date range", + "totalMailSize": "Total mail size", "title": "Statistics", "tooltips": { "clear": "Clear selection", diff --git a/src/Stats.vue b/src/Stats.vue index 32c5f26..49aa4e7 100644 --- a/src/Stats.vue +++ b/src/Stats.vue @@ -316,6 +316,12 @@ +
+
{{ t('stats.totalMailSize') }}
+ +
{{ t('stats.mailsWithAttachments', [mailsWithAttachments]) }}
+
+
{{ t('stats.mailsStarred') }}
@@ -872,6 +878,7 @@ import { import { contactInvolved, extractEmailAddress, + formatBytes, formatDate, isSelfMessage, monthNames, @@ -985,6 +992,8 @@ const initData = () => ({ }, numbers: { total: 0, + totalSize: 0, + withAttachments: 0, unread: 0, received: 0, sent: 0, @@ -1192,6 +1201,8 @@ const analyzeMessage = (data, m, identityList) => { const author = extractEmailAddress(m.author); // numbers data.numbers.total++; + data.numbers.totalSize += m.size ?? 0; + if (m.hasAttachments) data.numbers.withAttachments++; if (m.read === false) data.numbers.unread++; if (identityList.includes(author)) { data.numbers.sent++; @@ -1499,6 +1510,8 @@ const loadAccount = async (id, refresh, auto=false) => { sum.meta.timestamp = accountsData.reduce((p,c) => p < c.meta.timestamp ? p : c.meta.timestamp, Date.now()); // numbers sum.numbers.total = accountsData.reduce((p,c) => p+c.numbers.total, 0); + sum.numbers.totalSize = accountsData.reduce((p,c) => p+(c.numbers.totalSize ?? 0), 0); + sum.numbers.withAttachments = accountsData.reduce((p,c) => p+(c.numbers.withAttachments ?? 0), 0); sum.numbers.unread = accountsData.reduce((p,c) => p+c.numbers.unread, 0); sum.numbers.received = accountsData.reduce((p,c) => p+c.numbers.received, 0); sum.numbers.sent = accountsData.reduce((p,c) => p+c.numbers.sent, 0); @@ -1880,6 +1893,8 @@ const perYear = computed(() => { ? oneDigit(display.value.numbers.total/years.value) : 0; }); +const totalMailSize = computed(() => formatBytes(display.value.numbers.totalSize ?? 0)); +const mailsWithAttachments = computed(() => (display.value.numbers.withAttachments ?? 0).toLocaleString()); // number of starred mails const starred = computed(() => { return (display.value.numbers.starred && display.value.numbers.starred > 0) From a644018051f0368de10065c10eafd12526137404 Mon Sep 17 00:00:00 2001 From: Test Date: Sun, 24 May 2026 22:06:40 -0400 Subject: [PATCH 2/2] Enhance storage size visualizations --- src/Stats.vue | 841 ++++++++++++++++++++++++++++++++--- src/charts/BarChart.vue | 24 +- src/charts/DoughnutChart.vue | 8 +- src/charts/LineChart.vue | 13 +- src/charts/MatrixChart.vue | 3 +- src/dev/messenger-mock.js | 228 ++++++++++ src/options.js | 4 +- src/popup.js | 4 +- src/stats.js | 9 +- src/translations.js | 90 ++-- src/utils.js | 33 +- 11 files changed, 1133 insertions(+), 124 deletions(-) create mode 100644 src/dev/messenger-mock.js diff --git a/src/Stats.vue b/src/Stats.vue index 49aa4e7..1b949b8 100644 --- a/src/Stats.vue +++ b/src/Stats.vue @@ -1,5 +1,8 @@