From e83cd1f7d2cf703a86842e338932d490a882ff4c Mon Sep 17 00:00:00 2001 From: Agent Date: Mon, 14 Sep 2026 13:00:07 -0400 Subject: [PATCH] =?UTF-8?q?Rename=20Popular/HasPopular=20=E2=86=92=20Lates?= =?UTF-8?q?t/HasLatest=20in=20digest=20ts/mjml/render-preview?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The buildParameters function returns events sorted newest-first (sortBy created_at, slice(0,100)), and the mjml section is already labeled 'Latest Activity'. The object keys Popular/HasPopular no longer reflect the semantics, so rename them to Latest/HasLatest. --- script/render-preview.mjs | 4 ++-- src/digest.ts | 4 ++-- src/emails/digest.mjml | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/script/render-preview.mjs b/script/render-preview.mjs index c74d6ea..e2fec6d 100644 --- a/script/render-preview.mjs +++ b/script/render-preview.mjs @@ -16,8 +16,8 @@ const sample = { Duration: '24 hours', Total: 12, TopProfiles: 'bob, carol', - HasPopular: true, - Popular: [ + HasLatest: true, + Latest: [ { Link: 'https://app.flotilla.social/nevent1qqs...', Timestamp: 'Aug 25, 2026 at 9:00 AM', diff --git a/src/digest.ts b/src/digest.ts index 334c00b..ef9850a 100644 --- a/src/digest.ts +++ b/src/digest.ts @@ -77,8 +77,8 @@ export class Digest { return { Total: events.length, Duration: displayDuration(Math.floor(Date.now() / 1000) - this.since), - Popular: sorted.map((e) => getEventVariables(e)), - HasPopular: sorted.length > 0, + Latest: sorted.map((e) => getEventVariables(e)), + HasLatest: sorted.length > 0, UserName: displayProfile(userProfile, this.sub.email.split('@')[0]), TopProfiles: displayList(topProfiles.map(([pk]) => displayProfileByPubkey(pk))), } diff --git a/src/emails/digest.mjml b/src/emails/digest.mjml index 0e4ef68..58f5e2d 100644 --- a/src/emails/digest.mjml +++ b/src/emails/digest.mjml @@ -44,11 +44,11 @@ - {{#HasPopular}} + {{#HasLatest}} Latest Activity - {{#Popular}} + {{#Latest}}
@@ -72,10 +72,10 @@
- {{/Popular}} + {{/Latest}}
- {{/HasPopular}} + {{/HasLatest}}