Skip to content

Share the Tags screen from email-blocks as TagManager - #200

Merged
s3rot0n1n merged 1 commit into
mainfrom
feat/shared-tag-manager
Nov 13, 2026
Merged

s3rot0n1n merged 1 commit into
mainfrom
feat/shared-tag-manager

Conversation

@clbotdev

Copy link
Copy Markdown
Contributor

Why

CourseLit needs tag management (contact counts, rename everywhere, delete) and would otherwise re-implement the dashboard's Tags page, which is how the last round of copies drifted. The screen now lives in @sendlit/email-blocks and the dashboard uses the same export.

What

  • TagManager in @sendlit/email-blocks: lists every tag with its contact count, renames a tag everywhere it's used, and deletes one after showing the segments, broadcasts, sequences and signup forms that still name it. The host passes:
    • listTags, getTagReferences, renameTag, deleteTag (its calls to SendLit's /tags endpoints, made through its own backend);
    • optional sequenceHref and linkComponent for the "still used in" links, a loadingIndicator, and an errorMessage mapper.
  • The dashboard's Contacts → Tags page is now TagManager with the dashboard's API calls, Link, Loading and ApiError messages. Behaviour and copy are unchanged.
  • Tag types (TagSummary, TagReferences, RenameTagResult, DeleteTagResult) are declared in the package and exported. Importing them from the private @sendlit/api-contract made the published .d.ts point at a chunk that doesn't exist; a test checks the local types match the contract.
  • Docs page and a minor changeset for @sendlit/email-blocks.

Tests

  • bun --filter @sendlit/email-blocks test: 22 pass, including new tests for the notice text and for the types matching the contract.
  • tsc --noEmit clean for the package and apps/web; bun run build of the package emits tag-manager.d.ts resolving to tag-manager-types.
  • Not checked in a browser here: the dashboard page is a thin wrapper over the component, and CourseLit's local test of the component was blocked by an older local SendLit API without /tags.

Hosts such as CourseLit need tag management (counts, rename, delete) and
would otherwise re-implement the dashboard's Tags page. Move it into
@sendlit/email-blocks as TagManager and use it from the dashboard:

- The host passes functions for SendLit's /tags endpoints, an optional
  sequenceHref and link component for the "still used in" list, a loading
  indicator and an error-message mapper
- Tag types are declared in the package (with a test that they match the
  contract) so the published types don't point at the private api-contract
- Docs page and changeset
@s3rot0n1n
s3rot0n1n merged commit ba28256 into main Nov 13, 2026
6 of 7 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