Skip to content

docs(lexicon): align activation & analytics comments with new canonical definitions - #2468

Open
0xkkonrad wants to merge 1 commit into
devfrom
feat/lexicon-ui-fixes
Open

docs(lexicon): align activation & analytics comments with new canonical definitions#2468
0xkkonrad wants to merge 1 commit into
devfrom
feat/lexicon-ui-fixes

Conversation

@0xkkonrad

Copy link
Copy Markdown
Contributor

What

Comment/doc-only pass bringing peanut-ui in line with the new canonical lexicon (Activated = ≥1 spend transaction: card spend — qualifying event = authorization — or QR spend on Mercado Pago/Pix; "churned"/"dormant" banned in favor of Inactive; rewards never count as transactions).

  • src/hooks/useActivationStatus.ts — JSDoc/comments updated to the spend-only Activated definition. No behavior change: the hook consumes isActivated / activatedAt / activationMilestone from the BE (/users/me), so the semantic narrowing lands via the parallel backend PR and everything gated on this hook (home carousel CTAs, rewards/referral gating) inherits it automatically. The 'outbound' step id is kept (2 consumers) but documented as "make your first spend". Also fixed a stale fallback note — the code defaults isActivated to false when the BE omits it, not true.
  • src/constants/analytics.consts.ts — comment-only: "Error / Churn" section header → "Error" (banned term); CARD_LAUNCH_CTA_* comment corrected from "banner" to Home Carousel CTA. No event string values renamed — PostHog history intact (incl. CLAIM_LINK_*).
  • src/components/Badges/badge.utils.ts — CARD_PIONEER comment: "cashback" → "rewards".

The latam-cashback-invite CTA id was intentionally left untouched (tracking continuity).

Verification

  • tsc --noEmit: no errors in touched files
  • jest: ActivationCTAs.test.tsx + badge.utils.test.ts — 6/6 pass
  • Prettier clean

Companion change: quiz definitional update on #2465

🤖 Generated with Claude Code

… definitions

Activated is now >=1 SPEND transaction (card spend or QR spend on
Mercado Pago/Pix) — computed backend-side on /users/me; the hook only
consumes isActivated/activationMilestone, so this narrows semantics
without code changes here. Also drops the banned "Churn" wording from
the analytics section header, corrects the CARD_LAUNCH_CTA comment
(Home Carousel CTA, not a banner), and replaces "cashback" with
"rewards" in the CARD_PIONEER note. No event strings or identifiers
renamed — PostHog history stays intact.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: d0c0364c-fd5a-467d-80ac-465b8cae8f56

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/lexicon-ui-fixes

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@vercel

vercel Bot commented Jul 22, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
peanut-wallet Ready Ready Preview, Comment Jul 22, 2026 10:43am

Request Review

@github-actions

Copy link
Copy Markdown
Contributor

Code-analysis diff

Painscore total: 6232.6 → 6233.02 (+0.42)
Findings: 0 net (+5 new, -5 resolved)

🆕 New findings (5)

  • high hotspot — src/components/Badges/badge.utils.ts — 37 commits, +376/-111 lines since 6 months ago
  • high hotspot — src/constants/analytics.consts.ts — 35 commits, +324/-11 lines since 6 months ago
  • medium high-mdd — src/hooks/useActivationStatus.ts:47 — useActivationStatus: MDD 24.4 (uses across many lines from declarations)
  • low high-mdd — src/hooks/useActivationStatus.ts:77 — : MDD 19.8 (uses across many lines from declarations)
  • low high-dlt — src/hooks/useActivationStatus.ts:47 — useActivationStatus: DLT 15 (calls 15 distinct functions — high context load)

✅ Resolved (5)

  • src/components/Badges/badge.utils.ts — 36 commits, +375/-110 lines since 6 months ago
  • src/constants/analytics.consts.ts — 34 commits, +320/-7 lines since 6 months ago
  • src/hooks/useActivationStatus.ts:43 — useActivationStatus: MDD 24.4 (uses across many lines from declarations)
  • src/hooks/useActivationStatus.ts:73 — : MDD 19.8 (uses across many lines from declarations)
  • src/hooks/useActivationStatus.ts:43 — useActivationStatus: DLT 15 (calls 15 distinct functions — high context load)

@github-actions

Copy link
Copy Markdown
Contributor

🧪 UI test report — ✅ all green

Suites

  • unit: 2010 ran, 0 failed, 0 skipped, 33.0s

📊 Coverage (unit)

metric %
statements 59.8%
branches 43.4%
functions 48.7%
lines 60.0%
⏱ 10 slowest test cases
time test
4.3s src/components/Card/share-asset/__tests__/shareAssetLayout.test.ts › never places two stickers in heavy overlap (broad seed sweep)
1.2s src/utils/__tests__/demo-api.test.ts › isDemoMode() is false when not running under Capacitor
0.5s src/components/Card/share-asset/__tests__/shareAssetLayout.test.ts › every sticker stays within canvas at any count
0.3s src/app/(mobile-ui)/withdraw/__tests__/withdraw-states.test.tsx › Bank withdrawal keeps the $1 minimum for sub-$1 amounts
0.3s src/app/actions/__tests__/api-headers-extended.test.ts › should not include apiKey in validateInviteCode body
0.2s src/app/actions/__tests__/api-headers.test.ts › should include Content-Type in validateInviteCode
0.2s src/components/Card/share-asset/__tests__/shareAssetLayout.test.ts › keeps stickers off the username pill (final pass respects the keep-out)
0.2s src/utils/__tests__/demo-balance.test.ts › auto-refills a stored balance that has no timestamp (legacy install)
0.1s src/utils/__tests__/demo-balance.test.ts › starts at the full balance on a fresh install and stamps a timestamp
0.1s src/components/Global/GeneralRecipientInput/__tests__/GeneralRecipientInput.test.tsx › should handle valid 9-digit US account
📍 Inline annotations are in the **Unit test report** check above. Coverage artifact: `coverage-unit`. Generated by `.github/workflows/tests.yml`.

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