feat: add new-feature badge + 50/50 A/B test on play queue button#14254
Merged
dylanjeffers merged 2 commits intomainfrom May 7, 2026
Merged
feat: add new-feature badge + 50/50 A/B test on play queue button#14254dylanjeffers merged 2 commits intomainfrom
dylanjeffers merged 2 commits intomainfrom
Conversation
Match the union of filters (genre, mood, key, bpm, isPremium, hasDownloads, isVerified) on both web and mobile so the All tab isn't forced to clear filters when switching off a sub-category. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Introduces QUEUE_NEW_FEATURE_BADGE feature flag (default off) gating a pulsing accent dot on the queue button in the web play bar and the mobile now-playing actions bar. The badge is dismissed permanently on first queue open via local storage, ensuring users only see the highlight once. The 50/50 split is configured via Optimizely on the flag, so cohort assignment lives outside code and existing PLAY_QUEUE_OPEN analytics can be split by treatment in the experiment dashboard. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Contributor
🌐 Web preview readyPreview URL: https://audius-web-preview-pr-14254.audius.workers.dev Unique preview for this PR (deployed from this branch). |
4 tasks
dylanjeffers
added a commit
that referenced
this pull request
May 7, 2026
#14269) ## Summary Sets an Amplitude user property `queue_new_feature_badge` = `'on' | 'off'` so the A/B test for the play-queue "New" badge ([#14254](#14254)) can be sliced in Amplitude. Currently nothing surfaces the variation to Amplitude, so charts can't filter by treatment vs. control. - Adds `queue_new_feature_badge?: 'on' | 'off'` to `IdentifyTraits`. - In `useQueueNewFeatureBadge`, dispatches `ANALYTICS/IDENTIFY` once when the feature flag has loaded, with the variation as a trait. The existing analytics saga forwards it to both web and mobile Amplitude SDKs as a user property via `Identify.set(...)`. - Per-mount `useRef` guard so it dispatches at most once per mount; Amplitude `Identify.set` is idempotent so re-fires across mounts are harmless. ## Optimizely setup (separate, not in this PR) Create a flag named `queue_new_feature_badge` (lowercase, exact) with a Targeted Delivery rule at 50% included → variation `on`. The flag default is `false` ([feature-flags.ts](packages/common/src/services/remote-config/feature-flags.ts)), so until the rule is on, all users get tagged `'off'`. ## Test plan - [ ] In dev with the flag forced on, confirm an `Identify` call fires once with `queue_new_feature_badge: 'on'` (Amplitude network panel / Redux DevTools `ANALYTICS/IDENTIFY` action). - [ ] In dev with the flag forced off, same check with `'off'`. - [ ] Verify on web (`QueueButton`) and mobile (`ActionsBar`) — both consume the hook. - [ ] Verify in Amplitude that the user property shows up on the next event after the dispatch. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
QUEUE_NEW_FEATURE_BADGEfeature flag (default off), so the 50/50 cohort split is configured in Optimizely — existingPLAY_QUEUE_OPENanalytics can be split by treatment in the experiment dashboard without new events.@queue-new-feature-badge-dismissed), so users only see the highlight once.Implementation
FeatureFlags.QUEUE_NEW_FEATURE_BADGEinpackages/common/src/services/remote-config/feature-flags.ts.useQueueNewFeatureBadgeinpackages/common/src/hooks/useQueueNewFeatureBadge.ts— composesuseFeatureFlagwith the dismissed-flag inuseAppContext().localStorage(uses the same wrapper that backs both weblocalStorageand mobileAsyncStorage). Returns{ showBadge, dismiss }.QueueButton.tsxrenders an absolutely positioned pulsing dot (Emotionkeyframes) at the icon's top-right whenshowBadgeis true; callsdismiss()in the click handler before toggling open. Tooltip flips to "New" when badge is showing.ActionsBar.tsxwraps the queueIconButtonin aViewwith a siblingAnimated.Viewdot driven byreact-native-reanimated'suseSharedValue+withRepeat/withTiming(matchingSkeleton.tsx's shimmer pattern);handleOpenQueuedismisses before delegating toopenQueue.Notes on the A/B split
The 50/50 traffic allocation is configured in the Optimizely dashboard for the
queue_new_feature_badgeflag — this is the existing pattern in the repo (defaults stay false in code; rollout is a remote-config concern). Treatment-arm users see the badge until first interaction; control-arm users see the queue button as before.Test plan
PLAY_QUEUE_OPENanalytics still fire normally after dismissal.🤖 Generated with Claude Code