Skip to content

Share the dashboard's mail building blocks from email-blocks - #198

Merged
s3rot0n1n merged 1 commit into
mainfrom
feat/sequence-analytics-actions
Nov 12, 2026
Merged

s3rot0n1n merged 1 commit into
mainfrom
feat/sequence-analytics-actions

Conversation

@clbotdev

Copy link
Copy Markdown
Contributor

Why

Hosts that embed SendLit (e.g. CourseLit) were re-implementing parts of the dashboard — the stats metrics, the "View in browser" switch, the footer labels and the preview footer context — and the copies drifted. One host's editor kept showing the "View in browser" link after the setting was turned off, because only the dashboard's preview context knew to hide it. These now live in @sendlit/email-blocks, and the dashboard uses the same exports.

What

  • SequenceAnalytics takes onRefresh and draws a refresh button in its header (spins until the promise settles). The broadcast and sequence pages now use it.
  • sequenceStatsMetrics (moved from apps/web/lib/stats.ts) maps SequenceStats to metrics.
  • ViewInBrowserSetting (moved from the dashboard) takes checked and an async onCheckedChange; the dashboard keeps a thin wrapper that calls updateSequence.
  • @sendlit/email-blocks/footer exports marketingPreviewContext and DEFAULT_FOOTER_LABELS; createFooterBlock() defaults its labels.
  • Docs for all of the above; minor changeset for @sendlit/email-blocks.

Small visible change: the dashboard's preview footer placeholder now reads "Your mailing address" instead of "Your workspace mailing address".

Tests

  • bun test packages/email-blocks/src: 17 pass (new tests for the refresh wiring, stats metrics, preview context and default labels).
  • tsc --noEmit clean for the package and apps/web.
  • bun test apps/web: the 6 posthog browser wrapper failures also fail on main; nothing else fails.

Hosts such as CourseLit were re-implementing pieces of the dashboard and
drifting from it (a host's preview kept the "View in browser" link after the
setting was turned off). Move them into @sendlit/email-blocks and use them
from the dashboard too:

- SequenceAnalytics takes onRefresh and shows a refresh button
- sequenceStatsMetrics maps SequenceStats to analytics metrics
- ViewInBrowserSetting is the shared "View in browser" switch
- footer exports marketingPreviewContext and DEFAULT_FOOTER_LABELS;
  createFooterBlock() defaults to those labels
@s3rot0n1n
s3rot0n1n merged commit 0141456 into main Nov 12, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants