Skip to content

Commit a34dc5a

Browse files
committed
Remove redundant comments and inline the dialog variant type
Drop a few explanatory comments and replace the `SubscriptionDialogVariant` type alias with a plain string. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SE1tavFh7qJRq7hfMimbVa
1 parent 5eaead2 commit a34dc5a

5 files changed

Lines changed: 5 additions & 16 deletions

File tree

newIDE/app/src/Profile/Subscription/SubscriptionContext.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import {
55
sendSubscriptionDialogShown,
66
type SubscriptionDialogDisplayReason,
77
type SubscriptionPlacementId,
8-
type SubscriptionDialogVariant,
98
} from '../../Utils/Analytics/EventSender';
109
import { isNativeMobileApp } from '../../Utils/Platform';
1110
import {
@@ -39,13 +38,13 @@ export type SubscriptionAnalyticsMetadata = {|
3938
// Which version of the subscription dialog was shown. Computed when the dialog
4039
// is opened (see `resolveSubscriptionDialogDisplay`) and sent with analytics
4140
// events.
42-
dialogVariant?: SubscriptionDialogVariant,
41+
dialogVariant?: string,
4342
// Plan featured by the simplified dialog, when shown.
4443
featuredPlanId?: string,
4544
|};
4645

4746
export type SubscriptionDialogDisplay = {|
48-
dialogVariant: SubscriptionDialogVariant,
47+
dialogVariant: string,
4948
featuredPlanId?: string,
5049
|};
5150

newIDE/app/src/Profile/Subscription/SubscriptionDialog/SimplifiedSubscriptionDialog.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -303,8 +303,6 @@ const getYearlyDiscountText = (
303303
type Props = {|
304304
onClose: Function,
305305
availableSubscriptionPlansWithPrices: ?(SubscriptionPlanWithPricingSystems[]),
306-
// Plan to feature, provided by the backend A/B test config. Falls back to a
307-
// default when not provided (e.g. older callers).
308306
featuredPlanId?: ?string,
309307
onOpenPendingDialog: (open: boolean) => void,
310308
couponCode?: ?string,
@@ -371,7 +369,7 @@ export default function SimplifiedSubscriptionDialog({
371369
);
372370

373371
// We feature the yearly plan (billed annually) when available, as it is the
374-
// most advantageous one and matches the mockup.
372+
// most advantageous one.
375373
const pricingSystemToBuy =
376374
yearlyPricingSystem ||
377375
monthlyPricingSystem ||

newIDE/app/src/Profile/Subscription/SubscriptionDialog/useBuyUpdateOrCancelPlan.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import {
1111
import {
1212
sendCancelSubscriptionToChange,
1313
sendChoosePlanClicked,
14-
type SubscriptionDialogVariant,
1514
} from '../../../Utils/Analytics/EventSender';
1615
import Window from '../../../Utils/Window';
1716
import useAlertDialog from '../../../UI/Alert/useAlertDialog';
@@ -54,7 +53,7 @@ type Props = {|
5453
// to 1 when not provided (the simplified dialog does not support the education plan).
5554
getEducationPlanSeatsCount?: () => number,
5655
// The variant of the dialog from which the action is triggered, for analytics.
57-
dialogVariant?: SubscriptionDialogVariant,
56+
dialogVariant?: string,
5857
|};
5958

6059
type BuyUpdateOrCancelPlanState = {|

newIDE/app/src/Utils/Analytics/EventSender.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -545,10 +545,6 @@ export type SubscriptionDialogDisplayReason =
545545
| 'AI requests history'
546546
| 'Coupon code entered';
547547

548-
// Which version of the subscription dialog is shown to the user. This is used
549-
// to run A/B tests between the standard (detailed) dialog and a simplified one.
550-
export type SubscriptionDialogVariant = 'standard' | 'simplified';
551-
552548
export type SubscriptionPlacementId =
553549
| 'builds'
554550
| 'debugger'
@@ -617,7 +613,7 @@ export const sendShowcaseGameLinkOpened = (title: string, linkType: string) => {
617613
export const sendChoosePlanClicked = (metadata: {|
618614
planId: string | null,
619615
pricingSystemId: string | null,
620-
dialogVariant?: SubscriptionDialogVariant,
616+
dialogVariant?: string,
621617
|}) => {
622618
recordEvent('choose-plan-click', metadata);
623619
};

newIDE/app/src/Utils/GDevelopServices/Usage.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,6 @@ export type Quotas = {
162162
[string]: Quota,
163163
};
164164

165-
// A/B test configuration for the subscription dialog, served by the backend.
166-
// Forward-compatible: unknown variant types and unconfigured placements fall
167-
// back to the standard dialog on the client.
168165
export type SubscriptionDialogVariantConfig = {|
169166
type: string,
170167
weight: number,

0 commit comments

Comments
 (0)