diff --git a/src/lib/components/migration/EditorChooserControl.svelte b/src/lib/components/migration/EditorChooserControl.svelte deleted file mode 100644 index 13a48524..00000000 --- a/src/lib/components/migration/EditorChooserControl.svelte +++ /dev/null @@ -1,118 +0,0 @@ - - - - - Choose your editor - - You'll never see this again - - - -
- -
-
- Recommended -
- -
-
-

Mermaid Plus

-

Unlock AI, storage and collaboration

-
- -
-
- - 10% off with code JS26 - -
- - - - -
- -
    - {#each plusFeatures as feature (feature.label)} -
  • - - {feature.label} -
  • - {/each} -
-
-
- - -
-
-

Open Source

-

Code only, no login, always free

-
- -
-

Mermaid has a new home

- - - - -
- -
    - {#each openSourceFeatures as feature (feature.label)} -
  • - - {feature.label} -
  • - {/each} -
-
-
- - -
diff --git a/src/lib/components/migration/EditorChooserModal.svelte b/src/lib/components/migration/EditorChooserModal.svelte index 84edc78f..ee2ed9fc 100644 --- a/src/lib/components/migration/EditorChooserModal.svelte +++ b/src/lib/components/migration/EditorChooserModal.svelte @@ -1,10 +1,7 @@ - - - - Choose your editor - - Choose between the open source editor or Mermaid Plus - - - -
- -
-
- Mermaid Live Editor -
-
-

Open source

-

Code only, no login, always free

-
- -
    - {#each openSourceFeatures as feature (feature)} -
  • - - {feature} -
  • - {/each} -
- - -
- - -
-
- Mermaid Chart - - Recommended - -
-
-

Mermaid Plus

-

Unlock AI, storage and collaboration

-
- -
    - {#each plusFeatures as feature (feature)} -
  • - - {feature} -
  • - {/each} -
- - - - -
-
- - -
diff --git a/src/lib/components/migration/EditorChooserTestB.svelte b/src/lib/components/migration/EditorChooserTestB.svelte index 6df834db..14e423b9 100644 --- a/src/lib/components/migration/EditorChooserTestB.svelte +++ b/src/lib/components/migration/EditorChooserTestB.svelte @@ -9,9 +9,9 @@ import AmazonIcon from '~icons/logos/aws'; import GoogleIcon from '~icons/logos/google'; import MicrosoftIcon from '~icons/logos/microsoft'; - import type { EditorChooserVariantProps } from './editorChooserActions'; + import type { EditorChooserProps } from './editorChooserActions'; - let { actions }: EditorChooserVariantProps = $props(); + let { actions }: EditorChooserProps = $props(); const features = [ { title: 'AI diagram generation', description: 'Describe what you need, AI builds it' }, diff --git a/src/lib/components/migration/EditorChooserTestC.svelte b/src/lib/components/migration/EditorChooserTestC.svelte deleted file mode 100644 index bfc2bd02..00000000 --- a/src/lib/components/migration/EditorChooserTestC.svelte +++ /dev/null @@ -1,99 +0,0 @@ - - - - - Mermaid - How do you want to create? - - Choose how to start your diagram - - - -
- {#snippet optionButton(option: Option)} - - {/snippet} - {#each options as option (option.buttonClick)} - {#if option.external} - - {@render optionButton(option)} - - {:else} - {@render optionButton(option)} - {/if} - {/each} -
- -

- AI and visual editor are part of mermaid.ai. Start free today. -

- - -
diff --git a/src/lib/components/migration/editorChooserActions.ts b/src/lib/components/migration/editorChooserActions.ts index c4c78411..b5c28370 100644 --- a/src/lib/components/migration/editorChooserActions.ts +++ b/src/lib/components/migration/editorChooserActions.ts @@ -1,23 +1,8 @@ -import type { EditorChooserVariant } from '$/util/experiments'; import { logEvent, logMermaidChartClick } from '$/util/stats'; import { getCheckoutUrl, getMermaidAiLiveUrl } from '$/util/util'; const utmMedium = 'editorSelection'; - -// See MC-4486: UTM campaign per variant for CTAs routing to mermaid.ai. -// The campaign defaults to the variant name; TestC's two trial CTAs are disambiguated -// by buttonClick so we can tell AI vs visual-editor clicks apart in analytics. -const testCUtmCampaignByButtonClick: Record = { - createWithAi: 'testCAi', - useVisualEditor: 'testCVisual' -}; - -const resolveUtmCampaign = (variant: EditorChooserVariant, buttonClick: string): string => { - if (variant === 'testC') { - return testCUtmCampaignByButtonClick[buttonClick] ?? variant; - } - return variant; -}; +const utmCampaign = 'live_2026'; export interface EditorChooserActions { log: (buttonClick: string) => void; @@ -26,30 +11,20 @@ export interface EditorChooserActions { openMermaidAiLive: (buttonClick: string) => void; } -export interface EditorChooserVariantProps { +export interface EditorChooserProps { actions: EditorChooserActions; } -export const createEditorChooserActions = ( - variant: EditorChooserVariant, - close: () => void -): EditorChooserActions => { +export const createEditorChooserActions = (close: () => void): EditorChooserActions => { const log = (buttonClick: string) => { - logEvent('chooseEditor', { buttonClick, variant }); + logEvent('chooseEditor', { buttonClick }); }; const startTrial = (buttonClick = 'startTrial') => { log(buttonClick); logMermaidChartClick('editorPicker'); close(); - window.open( - getCheckoutUrl({ - utmCampaign: resolveUtmCampaign(variant, buttonClick), - utmMedium - }), - '_blank', - 'noopener' - ); + window.open(getCheckoutUrl({ utmCampaign, utmMedium }), '_blank', 'noopener'); }; const dismiss = (buttonClick: string) => { @@ -60,14 +35,7 @@ export const createEditorChooserActions = ( const openMermaidAiLive = (buttonClick: string) => { log(buttonClick); close(); - window.open( - getMermaidAiLiveUrl({ - utmCampaign: resolveUtmCampaign(variant, buttonClick), - utmMedium - }), - '_blank', - 'noopener' - ); + window.open(getMermaidAiLiveUrl({ utmCampaign, utmMedium }), '_blank', 'noopener'); }; return { log, startTrial, dismiss, openMermaidAiLive }; diff --git a/src/lib/constants.ts b/src/lib/constants.ts index 2d346622..f9b48755 100644 --- a/src/lib/constants.ts +++ b/src/lib/constants.ts @@ -12,6 +12,5 @@ export const TID = { export const C = { aiLiveEditor: 'ai_live_editor', editorChooserDismissedKey: 'mermaid-editor-chooser-dismissed', - editorChooserVariantKey: 'mermaid-editor-chooser-variant', utmSource: 'mermaid_live_editor' } as const; diff --git a/src/lib/util/experiments.ts b/src/lib/util/experiments.ts deleted file mode 100644 index 2f37b4b5..00000000 --- a/src/lib/util/experiments.ts +++ /dev/null @@ -1,2 +0,0 @@ -export const editorChooserVariants = ['control', 'testA', 'testB', 'testC'] as const; -export type EditorChooserVariant = (typeof editorChooserVariants)[number]; diff --git a/src/lib/util/migration/domainMigration.ts b/src/lib/util/migration/domainMigration.ts index c4b5159e..3177fa8c 100644 --- a/src/lib/util/migration/domainMigration.ts +++ b/src/lib/util/migration/domainMigration.ts @@ -1,6 +1,5 @@ import { C } from '$/constants'; import { env } from '$/util/env'; -import { editorChooserVariants, type EditorChooserVariant } from '$/util/experiments'; const mermaidAiDomain = 'mermaid.ai'; const mermaidLiveDomain = 'mermaid.live'; @@ -85,20 +84,3 @@ export const shouldShowEditorChooser = (): boolean => { export const dismissEditorChooser = (): void => { window.localStorage.setItem(C.editorChooserDismissedKey, 'true'); }; - -const isValidVariant = (value: string | null): value is EditorChooserVariant => { - return value !== null && (editorChooserVariants as readonly string[]).includes(value); -}; - -/** - * Get the A/B/C test variant assigned to this user for the editor chooser modal. - * Assigns a variant on first call (uniform random across variants), persists it - * in localStorage, and returns the same value on subsequent calls. - */ -export const getEditorChooserVariant = (): EditorChooserVariant => { - const stored = window.localStorage.getItem(C.editorChooserVariantKey); - if (isValidVariant(stored)) return stored; - const variant = editorChooserVariants[Math.floor(Math.random() * editorChooserVariants.length)]; - window.localStorage.setItem(C.editorChooserVariantKey, variant); - return variant; -};