Skip to content

feat: expand event types for reuse (waitlist, addon_cancel, consoleErrors)#6

Merged
mattdecrevel merged 2 commits into
mainfrom
feat/reusable-event-expansions
May 29, 2026
Merged

feat: expand event types for reuse (waitlist, addon_cancel, consoleErrors)#6
mattdecrevel merged 2 commits into
mainfrom
feat/reusable-event-expansions

Conversation

@mattdecrevel

Copy link
Copy Markdown
Owner

What & why

Poyse is migrating off direct Slack onto Loop. While scoping it, three Poyse notification cases had no representation in Loop. Rather than add narrow one-off types, these are additive expansions of existing types — nothing here is Poyse-specific; any product reuses them.

No new event types, no new categories, no new base-envelope fields.

Changes

Addition Reusable concept
signup.kind: 'signup' | 'waitlist' Any app with a waitlist — renders 📝 + "Waitlist signup"
subscription.kind: + 'addon_cancel' Pairs with existing 'addon' so activate vs cancel are distinct (➖)
feedback.consoleErrors: string[] Any web feedback widget — renders a "Console errors" sub-section + included in auto-filed GitHub issues

Wired end-to-end: client types → zod schema → renderer → GitHub issue builder, each with unit tests.

Deliberately not added

  • Free signup — a free signup is just a signup routed to the revenue channel via the existing category override (loop.signup(..., { category: 'revenue' })). No new kind earns its place.
  • Daily-health report — already expressible with cron (summary/bullets/table) or generic (fields/subSections/table).

Console previews (operator app)

  • Refactored samples from a type-keyed Record → a SampleEntry list so variant kinds are first-class.
  • Added waitlist signup + addon-cancel sample cards, enriched the feedback sample with consoleErrors, and made the "Fire all" button count dynamic.
  • New tests/samples.test.ts guards that every preview sample parses + renders (the previews page only surfaced bad samples at runtime before).

Docs

  • Documented the new fields in the root + client READMEs.
  • Corrected stale client-README notes: the digest cron (0 */6 * * *) and idempotency dedup are live, not "pending".

Verification

  • Server tests 144/144 (added 6 samples + variant cases)
  • Client tests 45/45
  • tsc --noEmit clean · eslint clean
  • No DB schema change → no migration

Client package bumped 0.5.0 → 0.6.0 (additive, backward-compatible).

🤖 Generated with Claude Code

…rors)

Three additive, backward-compatible expansions of existing event types — no
new types or categories, everything reusable across products:

- signup.kind: 'signup' | 'waitlist' — waitlist joins render with a 📝 +
  "Waitlist signup" title (a waitlist is just a signup, not a new type)
- subscription.kind: + 'addon_cancel' — pairs with the existing 'addon' so
  add-on activation vs cancellation are distinct (➖)
- feedback.consoleErrors: string[] — captured client console errors render as
  a "Console errors" sub-section and are included in auto-filed GitHub issues

Wired end-to-end: client types → zod schema → renderer → issue builder, with
unit tests for each. "Free signup" intentionally needs no new kind — it's a
signup routed to the revenue channel via the existing category override.

Console previews: samples refactored from a type-keyed record to a SampleEntry
list so variant kinds are first-class. Added waitlist + addon-cancel sample
cards, enriched the feedback sample with consoleErrors, and made the fire-all
button count dynamic.

Docs: documented the new fields in both READMEs and corrected the stale client
README notes — the digest cron and idempotency dedup are live, not pending.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented May 29, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
loop Error Error May 29, 2026 4:28pm

Request Review

…plumbing

Review feedback: the previews refactor loosened the send-action + button props
from EventType to `string`. Restore type safety by making SAMPLE_ENTRIES the
source of truth (`as const satisfies readonly SampleEntry[]`) and deriving
`SampleId = Sample['id']` — the same as-const→derived-union pattern the package
already uses for LOOP_CATEGORIES et al.

sendPreview, SendLiveButton, FireAllResult, sampleById, and PreviewCard now use
the precise SampleId/Sample types. This is stricter than the pre-refactor code,
which typed these as EventType and couldn't express the variant ids
(signup-waitlist, subscription-addon-cancel) at all.

The published package contract was never loosened — this only ever affected the
internal operator-console plumbing.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@mattdecrevel mattdecrevel merged commit ade95d0 into main May 29, 2026
3 of 4 checks passed
@mattdecrevel mattdecrevel deleted the feat/reusable-event-expansions branch May 29, 2026 16:32
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.

1 participant