Rename Popular/HasPopular → Latest/HasLatest in digest ts/mjml/render-preview

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.
This commit is contained in:
Agent 2026-09-14 13:00:07 -04:00
parent 7cdb84a0a1
commit e83cd1f7d2
3 changed files with 8 additions and 8 deletions

View file

@ -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',

View file

@ -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))),
}

View file

@ -44,11 +44,11 @@
</mj-column>
</mj-section>
{{#HasPopular}}
{{#HasLatest}}
<mj-section background-color="#ffffff" padding="0 32px 24px 32px">
<mj-column>
<mj-text css-class="section-header">Latest Activity</mj-text>
{{#Popular}}
{{#Latest}}
<mj-text>
<div class="event-item">
<div class="event-meta">
@ -72,10 +72,10 @@
</div>
</div>
</mj-text>
{{/Popular}}
{{/Latest}}
</mj-column>
</mj-section>
{{/HasPopular}}
{{/HasLatest}}
<mj-section background-color="#ffffff" padding="0 32px 24px 32px">
<mj-column>