Only send what is new, and lead with a picture

The window now starts at the last dispatch, so pressing send twice does not
repeat a digest. Cards prefer entries that have a cover, the newest one of
them opens the message as a full width image, and the page says when the
last digest went out.
This commit is contained in:
Matthias G
2026-08-03 13:24:46 +02:00
parent 78ff7d2c3f
commit c1cfd41ad3
8 changed files with 133 additions and 16 deletions
+22
View File
@@ -133,3 +133,25 @@ describe('Karten', () => {
expect(sections).toHaveLength(5)
})
})
describe('windowFor mit letztem Versand', () => {
it('beginnt beim letzten Versand, wenn der jünger ist', () => {
const { from } = windowFor(
new Date('2026-08-03T06:00:00.000Z'),
7,
new Date('2026-08-01T09:00:00.000Z'),
)
expect(from.toISOString()).toBe('2026-08-01T09:00:00.000Z')
})
it('bleibt bei sieben Tagen, wenn der letzte Versand älter ist', () => {
const { from } = windowFor(
new Date('2026-08-03T06:00:00.000Z'),
7,
new Date('2026-06-01T09:00:00.000Z'),
)
expect(from.toISOString()).toBe('2026-07-27T06:00:00.000Z')
})
})