Repository navigation
Share the dashboard's mail building blocks from email-blocks - #198
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
SequenceAnalyticstakesonRefreshand draws a refresh button in its header (spins until the promise settles). The broadcast and sequence pages now use it.sequenceStatsMetrics(moved fromapps/web/lib/stats.ts) mapsSequenceStatsto metrics.ViewInBrowserSetting(moved from the dashboard) takescheckedand an asynconCheckedChange; the dashboard keeps a thin wrapper that callsupdateSequence.@sendlit/email-blocks/footerexportsmarketingPreviewContextandDEFAULT_FOOTER_LABELS;createFooterBlock()defaults its labels.@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 --noEmitclean for the package andapps/web.bun test apps/web: the 6posthog browser wrapperfailures also fail onmain; nothing else fails.