Skip to content

Commit 63441e5

Browse files
chore: remove plus_api_landing_v2 flag and hard-code API-first variation
The plus_api_landing_v2 experiment won and rolled out to 100% of users. Remove the feature flag and hard-code the winning variation across all 11 consumer components so the control branch is no longer maintained. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent db5f3e0 commit 63441e5

11 files changed

Lines changed: 20 additions & 83 deletions

File tree

packages/shared/src/components/CustomFeedEmptyScreen.tsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,13 @@ import {
1919
} from './typography/Typography';
2020
import { LogEvent, TargetId } from '../lib/log';
2121
import { Button } from './buttons/Button';
22-
import { useConditionalFeature, usePlusSubscription } from '../hooks';
22+
import { usePlusSubscription } from '../hooks';
2323
import { IconSize } from './Icon';
24-
import { featurePlusApiLanding } from '../lib/featureManagement';
2524
import Link from './utilities/Link';
2625

2726
export const CustomFeedEmptyScreen = (): ReactElement => {
2827
const { logSubscriptionEvent, isPlus } = usePlusSubscription();
29-
const { value: isApiLanding } = useConditionalFeature({
30-
feature: featurePlusApiLanding,
31-
shouldEvaluate: !isPlus,
32-
});
33-
const plusCta = isApiLanding ? 'Get API Access' : 'Level Up with Plus';
28+
const plusCta = 'Get API Access';
3429
const [selectedAlgo, setSelectedAlgo] = usePersistentContext(
3530
DEFAULT_ALGORITHM_KEY,
3631
DEFAULT_ALGORITHM_INDEX,

packages/shared/src/components/PlusUserBadge.tsx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ import { DateFormat } from './utilities';
1515
import { TimeFormatType } from '../lib/dateFormat';
1616
import { usePlusSubscription } from '../hooks/usePlusSubscription';
1717
import { LogEvent, TargetId } from '../lib/log';
18-
import { featurePlusApiLanding } from '../lib/featureManagement';
19-
import { useConditionalFeature } from '../hooks';
2018
import { IconSize } from './Icon';
2119

2220
export type Props = {
@@ -31,11 +29,7 @@ export const PlusUserBadge = ({
3129
size = IconSize.Size16,
3230
}: Props): ReactElement | null => {
3331
const { isPlus, logSubscriptionEvent } = usePlusSubscription();
34-
const { value: isApiLanding } = useConditionalFeature({
35-
feature: featurePlusApiLanding,
36-
shouldEvaluate: !isPlus,
37-
});
38-
const plusCta = isApiLanding ? 'Get API Access' : 'Level Up with Plus';
32+
const plusCta = 'Get API Access';
3933

4034
if (!user.isPlus) {
4135
return null;

packages/shared/src/components/UpgradeToPlus.tsx

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,13 @@ import { ButtonColor, Button, ButtonVariant } from './buttons/Button';
66
import { DevPlusIcon } from './icons';
77
import Link from './utilities/Link';
88
import { plusUrl } from '../lib/constants';
9-
import { useConditionalFeature, useViewSize, ViewSize } from '../hooks';
9+
import { useViewSize, ViewSize } from '../hooks';
1010
import { usePlusSubscription } from '../hooks/usePlusSubscription';
1111
import type { TargetId } from '../lib/log';
1212
import { LogEvent } from '../lib/log';
1313
import { useAuthContext } from '../contexts/AuthContext';
1414
import { AuthTriggers } from '../lib/auth';
1515
import type { WithClassNameProps } from './utilities';
16-
import { featurePlusApiLanding } from '../lib/featureManagement';
1716

1817
type Props = {
1918
iconOnly?: boolean;
@@ -37,15 +36,9 @@ export const UpgradeToPlus = ({
3736
const isLaptopXL = useViewSize(ViewSize.LaptopXL);
3837
const isFullCTAText = !isLaptop || isLaptopXL;
3938
const { isPlus, logSubscriptionEvent } = usePlusSubscription();
40-
const { value: isApiLanding } = useConditionalFeature({
41-
feature: featurePlusApiLanding,
42-
shouldEvaluate: !isPlus,
43-
});
44-
const ctaCopy = isApiLanding
45-
? { full: 'Get API Access', short: 'API access' }
46-
: { full: 'Level Up with Plus', short: 'Upgrade' };
39+
const ctaCopy = { full: 'Get API Access', short: 'API access' };
4740
const content = isFullCTAText ? ctaCopy.full : ctaCopy.short;
48-
const defaultColor = isApiLanding ? ButtonColor.Bacon : ButtonColor.Avocado;
41+
const defaultColor = ButtonColor.Bacon;
4942

5043
const onClick = useCallback(
5144
(e: React.MouseEvent) => {

packages/shared/src/components/cards/plus/PlusGrid.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ import { useBoot } from '../../../hooks';
1313
import { LogEvent, TargetType } from '../../../lib/log';
1414
import { useLogContext } from '../../../contexts/LogContext';
1515
import { PlusItemStatus, PlusListItem } from '../../plus/PlusListItem';
16-
import { useFeature } from '../../GrowthBookProvider';
17-
import { featurePlusApiLanding } from '../../../lib/featureManagement';
1816

1917
const bulletPointsControl = [
2018
{
@@ -42,13 +40,12 @@ const bulletPointsControl = [
4240
const PlusGrid = ({ flags, campaignId }: MarketingCta) => {
4341
const { logEvent } = useLogContext();
4442
const { clearMarketingCta } = useBoot();
45-
const isApiLanding = useFeature(featurePlusApiLanding);
4643

4744
if (!flags) {
4845
return null;
4946
}
5047
const { title, description, ctaText, ctaUrl } = flags;
51-
const ctaColor = isApiLanding ? ButtonColor.Bacon : ButtonColor.Avocado;
48+
const ctaColor = ButtonColor.Bacon;
5249

5350
const handleClose = () => {
5451
logEvent({

packages/shared/src/components/marketing/banners/PlusMobileEntryBanner.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ import type { TargetType } from '../../../lib/log';
1414
import { LogEvent } from '../../../lib/log';
1515
import { useLogContext } from '../../../contexts/LogContext';
1616
import { useBoot } from '../../../hooks';
17-
import { useFeature } from '../../GrowthBookProvider';
18-
import { featurePlusApiLanding } from '../../../lib/featureManagement';
1917

2018
type PlusBannerProps = Omit<MarketingCta, 'flags'> & {
2119
targetType: TargetType;
@@ -33,12 +31,11 @@ const PlusMobileEntryBanner = ({
3331
}: PlusBannerProps): ReactElement | null => {
3432
const { logEvent } = useLogContext();
3533
const { clearMarketingCta } = useBoot();
36-
const isApiLanding = useFeature(featurePlusApiLanding);
3734
if (!flags) {
3835
return null;
3936
}
4037
const { leadIn, description, ctaText, ctaUrl } = flags;
41-
const ctaColor = isApiLanding ? ButtonColor.Bacon : ButtonColor.Avocado;
38+
const ctaColor = ButtonColor.Bacon;
4239

4340
const handleClose = () => {
4441
logEvent({

packages/shared/src/components/plus/PlusDesktop.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ import { usePlusSubscription } from '../../hooks';
1313

1414
import { PurchaseType } from '../../graphql/paddle';
1515
import { PlusProductToggle } from './PlusProductToggle';
16-
import { useFeature } from '../GrowthBookProvider';
17-
import { featurePlusApiLanding } from '../../lib/featureManagement';
1816

1917
const PlusFAQs = dynamic(() => import('./PlusFAQ').then((mod) => mod.PlusFAQ));
2018
const PlusApiShowcase = dynamic(() =>
@@ -37,7 +35,6 @@ export const PlusDesktop = ({
3735
query: { selectedPlan },
3836
} = useRouter();
3937
const { isPlus } = usePlusSubscription();
40-
const isApiLanding = useFeature(featurePlusApiLanding);
4138
const initialPaymentOption = selectedPlan ? `${selectedPlan}` : null;
4239
const [selectedOption, setSelectedOption] = useState<string | null>(null);
4340
const ref = useRef<HTMLDivElement>(null);
@@ -126,7 +123,7 @@ export const PlusDesktop = ({
126123
)}
127124
</div>
128125
</div>
129-
{isApiLanding && !isOrganization && !giftToUser && <PlusApiShowcase />}
126+
{!isOrganization && !giftToUser && <PlusApiShowcase />}
130127
<PlusFAQs />
131128
</>
132129
);

packages/shared/src/components/plus/PlusFAQ.tsx

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,9 @@ import {
99
import { Accordion } from '../accordion';
1010
import { anchorDefaultRel } from '../../lib/strings';
1111
import { feedback } from '../../lib/constants';
12-
import { plusFAQItemsApi, plusFAQItemsControl } from './common';
12+
import { plusFAQItemsApi } from './common';
1313
import { useLogContext } from '../../contexts/LogContext';
1414
import { LogEvent } from '../../lib/log';
15-
import { useConditionalFeature } from '../../hooks';
16-
import { featurePlusApiLanding } from '../../lib/featureManagement';
17-
import { usePlusSubscription } from '../../hooks/usePlusSubscription';
1815

1916
interface FAQ {
2017
question: string;
@@ -53,12 +50,7 @@ const FAQItem = ({ item }: { item: FAQ }): ReactElement => {
5350
export const PlusFAQ = (): ReactElement => {
5451
const id = useId();
5552
const titleId = `${id}-title`;
56-
const { isPlus } = usePlusSubscription();
57-
const { value: isApiLanding } = useConditionalFeature({
58-
feature: featurePlusApiLanding,
59-
shouldEvaluate: !isPlus,
60-
});
61-
const items = isApiLanding ? plusFAQItemsApi : plusFAQItemsControl;
53+
const items = plusFAQItemsApi;
6254
return (
6355
<section aria-labelledby={titleId} className="my-10">
6456
<Typography

packages/shared/src/components/plus/PlusInfo.tsx

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ import {
1313
plusFeatureListApiFirst,
1414
plusOrganizationFeatureList,
1515
} from './PlusList';
16-
import { useConditionalFeature, usePlusSubscription } from '../../hooks';
17-
import { featurePlusApiLanding } from '../../lib/featureManagement';
16+
import { usePlusSubscription } from '../../hooks';
1817
import { usePaymentContext } from '../../contexts/payment/context';
1918
import type { OpenCheckoutFn } from '../../contexts/payment/context';
2019
import { Button, ButtonSize, ButtonVariant } from '../buttons/Button';
@@ -149,24 +148,16 @@ export const PlusInfo = ({
149148
const { giftOneYear, isOrganization, checkoutItemsLoading } =
150149
usePaymentContext();
151150
const { openModal } = useLazyModal();
152-
const { isPlus, logSubscriptionEvent } = usePlusSubscription();
151+
const { logSubscriptionEvent } = usePlusSubscription();
153152
const { giftToUser } = useGiftUserContext();
154153

155154
const [itemQuantity, setItemQuantity] = useState<number>(1);
156155

157-
const { value: isApiLanding } = useConditionalFeature({
158-
feature: featurePlusApiLanding,
159-
shouldEvaluate: !isPlus,
160-
});
161-
162156
const plusType = getPlusType({
163157
isGift: !!giftToUser,
164158
isOrganization,
165159
});
166-
const copySource = isApiLanding
167-
? plusInfoCopyApi
168-
: defaultPlusInfoCopyControl;
169-
const defaultCopy = copySource[plusType];
160+
const defaultCopy = plusInfoCopyApi[plusType];
170161
const titleCopy = title || defaultCopy.title;
171162
const descriptionCopy = description || defaultCopy.description;
172163
const subtitleCopy = subtitle || defaultCopy.subtitle;
@@ -177,7 +168,7 @@ export const PlusInfo = ({
177168
let plusListContent: ReactElement;
178169
if (isOrganization) {
179170
plusListContent = <PlusList items={plusOrganizationFeatureList} />;
180-
} else if (isApiLanding && plusType === PlusType.Self) {
171+
} else if (plusType === PlusType.Self) {
181172
plusListContent = <PlusList items={plusFeatureListApiFirst} />;
182173
} else {
183174
plusListContent = <PlusList />;

packages/shared/src/components/plus/PlusMobile.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ import { plusUrl } from '../../lib/constants';
1111
import { objectToQueryParams } from '../../lib';
1212
import { PlusProductToggle } from './PlusProductToggle';
1313
import { PurchaseType } from '../../graphql/paddle';
14-
import { useFeature } from '../GrowthBookProvider';
15-
import { featurePlusApiLanding } from '../../lib/featureManagement';
1614

1715
const PlusTrustRefund = dynamic(() =>
1816
import('./PlusTrustRefund').then((mod) => mod.PlusTrustRefund),
@@ -29,7 +27,6 @@ export const PlusMobile = ({
2927
const router = useRouter();
3028
const { giftToUser } = useGiftUserContext();
3129
const { productOptions, isOrganization } = usePaymentContext();
32-
const isApiLanding = useFeature(featurePlusApiLanding);
3330
const [selectedOption, setSelectedOption] = useState<string | null>(null);
3431

3532
const selectionChange: OpenCheckoutFn = useCallback(({ priceId }) => {
@@ -83,7 +80,7 @@ export const PlusMobile = ({
8380
shouldShowPlusHeader={shouldShowPlusHeader}
8481
/>
8582
<PlusTrustRefund className="mt-6" />
86-
{isApiLanding && !isOrganization && !giftToUser && <PlusApiShowcase />}
83+
{!isOrganization && !giftToUser && <PlusApiShowcase />}
8784
<PlusFAQs />
8885
</div>
8986
);

packages/shared/src/components/sidebar/sections/MainSection.tsx

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,7 @@ import useCustomDefaultFeed from '../../../hooks/feed/useCustomDefaultFeed';
2626
import { SharedFeedPage } from '../../utilities';
2727
import { isExtension } from '../../../lib/func';
2828
import { useConditionalFeature } from '../../../hooks';
29-
import {
30-
featurePlusApiLanding,
31-
featureYearInReview,
32-
} from '../../../lib/featureManagement';
29+
import { featureYearInReview } from '../../../lib/featureManagement';
3330
import { useQuestDashboard } from '../../../hooks/useQuestDashboard';
3431
import { Typography, TypographyColor } from '../../typography/Typography';
3532

@@ -41,13 +38,7 @@ export const MainSection = ({
4138
const { user, isLoggedIn } = useAuthContext();
4239
const { isCustomDefaultFeed } = useCustomDefaultFeed();
4340
const isPlus = user?.isPlus;
44-
const { value: isApiLanding } = useConditionalFeature({
45-
feature: featurePlusApiLanding,
46-
shouldEvaluate: !isPlus,
47-
});
48-
const ctaCopy = isApiLanding
49-
? { full: 'Get API Access', short: 'API access' }
50-
: { full: 'Level Up with Plus', short: 'Upgrade' };
41+
const ctaCopy = { full: 'Get API Access', short: 'API access' };
5142
const { value: showYearInReview } = useConditionalFeature({
5243
feature: featureYearInReview,
5344
shouldEvaluate: isLoggedIn,
@@ -96,12 +87,8 @@ export const MainSection = ({
9687
path: plusUrl,
9788
isForcedLink: true,
9889
requiresLogin: true,
99-
color: isApiLanding
100-
? 'text-action-plus-default'
101-
: 'text-accent-avocado-default',
102-
itemClassName: isApiLanding
103-
? 'bg-action-plus-float/50 hover:bg-action-plus-float'
104-
: 'bg-action-upvote-float/50 hover:bg-action-upvote-float',
90+
color: 'text-action-plus-default',
91+
itemClassName: 'bg-action-plus-float/50 hover:bg-action-plus-float',
10592
disableDefaultBackground: true,
10693
}
10794
: undefined;
@@ -192,7 +179,6 @@ export const MainSection = ({
192179
}, [
193180
claimableMilestoneCount,
194181
ctaCopy.full,
195-
isApiLanding,
196182
isCustomDefaultFeed,
197183
isLoggedIn,
198184
isPlus,

0 commit comments

Comments
 (0)