Repository navigation
feat(templates): add Mailbag newsletter template (newsletter-mailbag) - #428
Conversation
anurag629
left a comment
There was a problem hiding this comment.
Hey @Saifjafri212213, nice work, the header, pill and three rows match #410, a blank question drops its whole row and the rest close up, and with all three blank the title sits right under the pill. In the long preview the questions stop with an ellipsis before the askers, which truncate too, and the Q circles and askers read fine on the light background.
One thing before I can merge: the title is held to one line (whiteSpace: 'nowrap' at src/templates/newsletter/mailbag.ts:333), so a title past roughly 50 characters gets cut, while the defaults leave about 170px empty at the bottom of the card. In the long preview it stops around 70 of its 140 characters. Reader Poll lets its title run to two lines (src/templates/newsletter/poll.ts:186), so please do the same here: drop the nowrap, cap it at two lines with display: 'block' and lineClamp: 2 the way Transcript does (src/templates/podcast/transcript.ts:122), and move the size steps up toward Poll's (58, 48, 40 and 34px). Three rows still fit under a two-line title at that size. The test at tests/templates/mailbag.test.ts:134 will need to change to match.
Everything else looks good.
|
Thanks for the review @anurag629! I've updated this in b86dbd7:
All 10 unit tests, 112 test files (2152 tests), Resvg preview renders (all 4 variants), and TypeScript checks pass cleanly. |
Description
Adds the Mailbag newsletter template (
newsletter-mailbag) in the Newsletter category, as requested in #410.How it works:
src/templates/newsletter/mailbag.ts(id: 'newsletter-mailbag'):siteNameorissueleaves no gap in the header, and an empty header row is omitted entirelyisLightColor()andmixColors()so the pill, Q circles, and askers stay readabletests/templates/mailbag.test.ts(10 tests) covering registration, defaults, dropped question rows, all blank questions, blank asker width expansion, title auto-sizing, question and asker truncation, empty header fields, and light background readability.src/templates/newsletter/index.tsand registered in the newsletter block ofsrc/templates/registry.ts.Closes #410
How I Tested This
npx vitest run tests/templates/mailbag.test.ts→ 10/10 tests passednpm test→ 112 test files, 2152/2152 tests passedPREVIEW_FILES=src/templates/newsletter/mailbag.ts npx vitest run tests/templates/previews.test.ts→ rendered all 4 variants (defaults, empty, light, long)npx tsc --noEmit→ 0 errorsAI Assistance
Antigravity for layout structure, Satori element hierarchy, and unit test coverage.
Type of Change
Checklist
devnpm run check/tsc --noEmitpassesnpm run testpasses