feat(experiments): gate new_d1_experience on intro quest presence#6035
feat(experiments): gate new_d1_experience on intro quest presence#6035AmarTrebinjac wants to merge 6 commits into
Conversation
Only evaluate `featureNewD1Experience` for users who actually have intro quests assigned. Introduces a shared `useNewD1ExperienceFeature` hook that ANDs `hasIntroQuests` into the existing `shouldEvaluate`, so any user whose quest dashboard returns an empty `intro` array sees the feature as false regardless of GrowthBook assignment. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Default `shouldEvaluate` to `true` and rename the gating local to `enabled` so the predicate reads directly instead of going through a `!== false` comparison. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
@claude please fix the failing test if its clear why its failing. If its functionality conflicts with the stated changes in the PR, let me know |
|
Claude finished @AmarTrebinjac's task in 7m 0s —— View job Investigation summary
Failing test: Failure on CI: What I foundThe failing test is not exercising any of this PR's changes — it doesn't touch I re-ran Plausible (but not proven) link to this PR
RecommendationThis doesn't look like a functional conflict with the PR's stated changes, and I can't reproduce it. My suggestion is to re-run the I haven't pushed a change — flipping a passing-locally test on a flake we can't reproduce risks masking a real issue, and an unconditional |
Summary
Only show the
new_d1_experienceGrowthBook experiment to users who actually have intro quests assigned. IfuseQuestDashboard().data?.introis empty, the feature is forced tofalseregardless of GrowthBook assignment.Changes
useNewD1ExperienceFeatureinpackages/shared/src/hooks/that ANDshasIntroQuestsinto the caller'sshouldEvaluatebefore delegating touseConditionalFeature.useConditionalFeature({ feature: featureNewD1Experience, ... })call sites with the new hook (Feed, FeedContainer, IntroQuestButton, layout/common, ClickbaitShield, ToggleClickbaitShield, useProfileCompletionIndicator).shouldEvaluate: false, and loading semantics.Key decisions
featureNewD1Experiencedefinition unchanged: analytics/allocation tracking continues to function; only the post-evaluation value is gated.data === undefinedas no intro quests so the experiment can't briefly evaluate true then flip.Test plan
useNewD1ExperienceFeatureunit tests (empty intro, GrowthBook true/false, shouldEvaluate false, default param, loading)IntroQuestButton.spec.tsxupdated to mock the new hooklayout/common.spec.tsxupdated to mock the new hook (no QueryClientProvider in that suite)Closes ENG-1434
Created by Huginn 🐦⬛
Preview domain
https://eng-1434-add-criteria-to-new-d1.preview.app.daily.dev