Skip to content

Commit c874ded

Browse files
authored
feat(campaigns): add batch progress info to delivery card (#2659)
* refactor(campaigns): simplify UI by moving info to subtitle - Move sender to title: "Subject by Name <email>" - Move date to subtitle with batch info - Remove Recipients card from metrics (info now in subtitle) - Update grid to 4 columns (was 5) * feat(campaigns): add batch progress info to delivery card - Show batch progress in delivery card: Batch 1/3 · ~12:34 - Add tooltip with detailed batch info and next batch time - Update i18n translations for EN and FR * fix: use PrimeVue pi-sign-out icon instead of Material Symbols - Revert Material Symbols due to loading issues - Use pi-sign-out icon which is already available in PrimeIcons
1 parent de46008 commit c874ded

File tree

5 files changed

+52
-16
lines changed

5 files changed

+52
-16
lines changed

frontend/nuxt.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ export default defineNuxtConfig({
136136
},
137137
},
138138

139-
css: ['~/assets/css/tailwind.css', '@fontsource/material-symbols-outlined'],
139+
css: ['~/assets/css/tailwind.css'],
140140

141141
supabase: {
142142
url: process.env.SUPABASE_PROJECT_URL,

frontend/package-lock.json

Lines changed: 0 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

frontend/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@
5656
"vue-tsc": "^3.1.0"
5757
},
5858
"dependencies": {
59-
"@fontsource/material-symbols-outlined": "^5.2.37",
6059
"@primeuix/themes": "^1.2.5",
6160
"@sentry/nuxt": "^10.17.0",
6261
"@vueuse/core": "^13.9.0",

frontend/src/pages/campaigns.vue

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@
9494
<div class="font-semibold">
9595
{{ campaign.delivered }}/{{ campaign.attempted }}
9696
</div>
97-
<div>{{ formatRate(campaign.delivery_rate) }}</div>
97+
<div>{{ getBatchProgress(campaign) }}</div>
9898
</div>
9999

100100
<div class="p-2 rounded bg-surface-50">
@@ -260,11 +260,56 @@ function formatRate(value: number) {
260260
return `${Number(value || 0).toFixed(2)}%`;
261261
}
262262
263+
function getBatchProgress(campaign: CampaignOverview): string {
264+
if (!campaign.total_batches || campaign.status === 'completed') {
265+
return formatRate(campaign.delivery_rate);
266+
}
267+
268+
const currentBatch = calculateCurrentBatch(campaign);
269+
const nextBatchTime = new Date(Date.now() + 10 * 60 * 1000);
270+
const timeStr = nextBatchTime.toLocaleTimeString([], {
271+
hour: '2-digit',
272+
minute: '2-digit',
273+
});
274+
275+
return t('delivery_batch_progress', {
276+
current: currentBatch,
277+
total: campaign.total_batches,
278+
time: timeStr,
279+
});
280+
}
281+
263282
function formatDate(value: string) {
264283
return new Date(value).toLocaleString();
265284
}
266285
267286
function deliveryTooltip(campaign: CampaignOverview) {
287+
if (
288+
campaign.total_batches &&
289+
campaign.status !== 'completed' &&
290+
campaign.status !== 'failed'
291+
) {
292+
const currentBatch = calculateCurrentBatch(campaign);
293+
const nextBatchTime = new Date(Date.now() + 10 * 60 * 1000);
294+
const timeStr = nextBatchTime.toLocaleString([], {
295+
day: '2-digit',
296+
month: '2-digit',
297+
year: 'numeric',
298+
hour: '2-digit',
299+
minute: '2-digit',
300+
});
301+
return t('delivery_tooltip_with_batch', {
302+
delivered: campaign.delivered,
303+
attempted: campaign.attempted,
304+
hard: campaign.hard_bounced,
305+
soft: campaign.soft_bounced,
306+
other: campaign.failed_other,
307+
current: currentBatch,
308+
total: campaign.total_batches,
309+
time: timeStr,
310+
});
311+
}
312+
268313
return t('delivery_tooltip', {
269314
delivered: campaign.delivered,
270315
attempted: campaign.attempted,
@@ -454,6 +499,8 @@ onBeforeUnmount(() => {
454499
"unsubscribes": "Unsubscribes",
455500
"recipients": "Recipients",
456501
"delivery_tooltip": "Delivered: {delivered}/{attempted} | Hard bounces: {hard} | Soft bounces: {soft} | Other failures: {other}",
502+
"delivery_batch_progress": "Batch {current}/{total} · ~{time}",
503+
"delivery_tooltip_with_batch": "Batch {current} of {total}\nNext batch: {time}\nProcessed: {delivered}/{attempted} delivered\nHard bounces: {hard} | Soft bounces: {soft} | Other: {other}",
457504
"opens_tooltip_enabled": "Open tracking is enabled. Open rates are indicative only and can be inflated by Apple Mail Privacy Protection (especially on iOS) and email client prefetching.",
458505
"opens_tooltip_disabled": "Open tracking is disabled for this campaign, so opening metrics are not measured.",
459506
"clicks_tooltip_enabled": "Click tracking is enabled. Unique clicks are counted per recipient when they click tracked links.",
@@ -497,6 +544,8 @@ onBeforeUnmount(() => {
497544
"unsubscribes": "Désinscriptions",
498545
"recipients": "Destinataires",
499546
"delivery_tooltip": "Livrés : {delivered}/{attempted} | Hard bounces : {hard} | Soft bounces : {soft} | Autres échecs : {other}",
547+
"delivery_batch_progress": "Lot {current}/{total} · ~{time}",
548+
"delivery_tooltip_with_batch": "Lot {current} sur {total}\nProchain lot : {time}\nTraités : {delivered}/{attempted} livrés\nHard bounces : {hard} | Soft bounces : {soft} | Autres : {other}",
500549
"opens_tooltip_enabled": "Le tracking des ouvertures est activé. Le taux d'ouverture reste indicatif et peut être surestimé (Apple Mail Privacy Protection, notamment sur iOS, et préchargements des clients email).",
501550
"opens_tooltip_disabled": "Le tracking des ouvertures est désactivé pour cette campagne, les ouvertures ne sont donc pas mesurées.",
502551
"clicks_tooltip_enabled": "Le tracking des clics est activé. Les clics uniques sont comptés une seule fois par destinataire et par lien.",

frontend/src/pages/unsubscribe/success.vue

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
<div class="m-auto text-center flex flex-col space-y-6 max-w-[30rem]">
33
<div>
44
<div class="inline-flex p-3">
5-
<span class="material-symbols-outlined text-7xl text-orange-400"
6-
>unsubscribe</span
7-
>
5+
<i class="pi pi-sign-out !text-7xl !text-orange-400"></i>
86
</div>
97
<div class="text-4xl font-bold font-serif">
108
{{ $t('unsubscribe.success_header') }}

0 commit comments

Comments
 (0)