Skip to content

feat(profile): industry / usage / marketing opt-in (Phase 3) - #14

Merged
hades217 merged 1 commit into
mainfrom
feat/profile-extension
May 18, 2026
Merged

feat(profile): industry / usage / marketing opt-in (Phase 3)#14
hades217 merged 1 commit into
mainfrom
feat/profile-extension

Conversation

@hades217

Copy link
Copy Markdown

Summary

Adds the three "About you" fields the onboarding PRD §3 carved out:

  • Industry (education / finance / ecommerce / gaming / individual / saas / other, + "prefer not to say")
  • Expected usage (just trying / under 1k daily / 1k-100k daily / over 100k daily, + "prefer not to say")
  • Marketing emails opt-in (explicit checkbox, default off)

These were intentionally not in the registration wizard — that stays ≤ 3 steps. They live on /profile under "About you (optional)" so the user can fill them in later. Used internally to prioritize model/channel/docs work; never for billing or access. Hence the "prefer not to say" value on each enum.

Implementation

  • controller/user.go: extend partial-PATCH UpdateUserSetting with Industry / ExpectedVolume / MarketingEmails pointer fields. Same pattern as Persona/BrandPreference from PR fix(onboarding): hydrate authStore on signup + cover OAuth InsertWithTx #12.
  • web/default/.../profile-extension-card.tsx (new): TitledCard with two Selects + one Checkbox. Save-on-change via partial-PATCH endpoint, Loader2 spinner per row during the round trip.
  • web/default/.../profile/index.tsx: mount card under OnboardingPreferencesCard.
  • web/default/.../profile/types.ts: extend UpdateUserSettingsRequest TS type.

End-to-end verified

POST /api/user/register      → user persona=casual
PUT  /api/user/setting {industry:"saas"}
PUT  /api/user/setting {expected_volume:"daily-medium", marketing_emails:true}
# DB: persona=casual, industry=saas, expected_volume=daily-medium,
#     marketing_emails=true, sidebar_modules unchanged

What I deliberately did NOT do here

  • Event instrumentation (Sentry / first-party analytics) — needs a vendor decision + privacy stance; not a code-only change.
  • A/B testing infra — needs a flag / cohort system; same caveat.
  • 7d/30d retention emails + first-topup nudges — depend on email pipeline that doesn't exist yet. PR feat(onboarding): CI safety + profile editor + dashboard nudges #13's low-quota banner covers the immediate "trial credit low" hint.

🤖 Generated with Claude Code

Adds the three "About you" fields the onboarding PRD §3 carved out:

  - Industry (education / finance / ecommerce / gaming / individual /
    saas / other, plus "prefer not to say")
  - Expected usage (just trying / under 1k daily / 1k-100k daily /
    over 100k daily, plus "prefer not to say")
  - Marketing emails opt-in (explicit checkbox, defaults to off)

These were intentionally left out of the registration wizard to keep
signup ≤ 3 steps; they live on /profile under "About you (optional)"
where the user can fill them in later — used internally to prioritize
model/channel/docs work for whoever shows up, never for billing or
access. Hence the "prefer not to say" value on each enum + the
marketing-emails default of false (CAN-SPAM / GDPR style explicit
opt-in regardless of whether we ship the email pipeline).

Implementation:

  - controller/user.go: extend the partial-PATCH UpdateUserSetting
    handler with three new pointer fields (Industry, ExpectedVolume,
    MarketingEmails). Same pattern as Persona/BrandPreference/etc
    from PR #12 — pointers so a caller can leave any field untouched.
  - web/default/src/features/profile/components/profile-extension-card.tsx:
    new TitledCard with two Selects + one Checkbox. Each control
    saves on change via the partial-PATCH endpoint and shows a
    Loader2 spinner during the round trip.
  - web/default/src/features/profile/index.tsx: mount under
    OnboardingPreferencesCard so both onboarding-derived cards sit
    together.
  - web/default/src/features/profile/types.ts: extend
    UpdateUserSettingsRequest TS type to match.

Verified end-to-end with the now-rebuilt backend:

  POST /api/user/register      → user with persona=casual
  PUT  /api/user/setting       → {industry:"saas"}
  PUT  /api/user/setting       → {expected_volume:"daily-medium",
                                  marketing_emails:true}
  DB row: persona=casual, industry=saas, expected_volume=daily-medium,
          marketing_emails=true, sidebar_modules unchanged

Notes on the other Phase 3/4 items deliberately not done here:

  - Event instrumentation (Sentry / first-party analytics) — needs
    a vendor decision and a privacy stance; not a code-only change.
  - A/B testing infra — needs a flag/cohort system; same caveat.
  - 7d/30d retention emails and first-topup nudges — depend on an
    email pipeline we don't have wired yet. The frontend banner
    landed in PR #13 covers the immediate "trial credit low" hint.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@hades217
hades217 merged commit 5f4b5ca into main May 18, 2026
2 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.

1 participant