Skip to content

feat(claw): evaluate button-vs-card feature flag for PostHog experiment#1338

Open
kilo-code-bot[bot] wants to merge 2 commits intomainfrom
feat/button-vs-card-flag-evaluation
Open

feat(claw): evaluate button-vs-card feature flag for PostHog experiment#1338
kilo-code-bot[bot] wants to merge 2 commits intomainfrom
feat/button-vs-card-flag-evaluation

Conversation

@kilo-code-bot
Copy link
Contributor

@kilo-code-bot kilo-code-bot bot commented Mar 20, 2026

Summary

Evaluates the button-vs-card PostHog feature flag in CreateInstanceCard so the SDK attaches $feature/button-vs-card to subsequent events (including claw_create_instance_clicked). Without this, the cloud app's PostHog SDK never evaluates the flag, so the experiment gets 0 conversions even though users are clicking.

The flag is evaluated in CreateInstanceCard (not ClawDashboard) so only users who can actually see the create CTA are marked as exposed. ClawDashboard also renders for users with existing instances, mid-onboarding, or viewing settings — evaluating there would dilute the experiment population.

Verification

  • Verified formatting with oxfmt on changed files
  • Typecheck passes (no new errors from this change)
  • Confirmed useFeatureFlagVariantKey is exported by posthog-js/react (v1.360.2)

Visual Changes

N/A

Reviewer Notes

  • No UI or behavior changes. The hook return value is intentionally unused — the sole purpose is flag evaluation so PostHog auto-attaches $feature/button-vs-card to tracked events.
  • Users who reach CreateInstanceCard without coming through the landing page will get a variant assigned by the cloud app SDK. This is expected — PostHog uses the same hash for the same distinct_id, so the variant will be consistent.

@kilo-code-bot
Copy link
Contributor Author

kilo-code-bot bot commented Mar 20, 2026

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (2 files)
  • src/app/(app)/claw/components/ClawDashboard.tsx
  • src/app/(app)/claw/components/CreateInstanceCard.tsx

Reviewed by gpt-5.4-20260305 · 77,877 tokens

Moves useFeatureFlagVariantKey('button-vs-card') from ClawDashboard
(which renders for all users including those with existing instances)
to CreateInstanceCard (which only renders for users who haven't
provisioned yet). This scopes the experiment exposure to users who
can actually see the create CTA, avoiding population dilution.
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