Преглед изворни кода

feat: remove old assist split test (#31787)

GitOrigin-RevId: bd05b5b13c603aea648cd522372bdf3242091ae8
Jimmy Domagala-Tang пре 5 месеци
родитељ
комит
f1137cbabb

+ 5 - 8
services/web/app/src/Features/Project/ProjectController.mjs

@@ -450,7 +450,6 @@ const _ProjectController = {
       'track-pdf-download',
       !anonymous && 'writefull-oauth-promotion',
       'hotjar',
-      'overleaf-assist-bundle',
       'word-count-client',
       'editor-popup-ux-survey-03-2026',
       'editor-redesign-new-users',
@@ -840,9 +839,6 @@ const _ProjectController = {
         capabilities.push('link-sharing')
       }
 
-      const isOverleafAssistBundleEnabled =
-        splitTestAssignments['overleaf-assist-bundle']?.variant === 'enabled'
-
       let fullFeatureSet = user?.features
       if (!anonymous) {
         fullFeatureSet = await UserGetter.promises.getUserFeatures(userId)
@@ -851,9 +847,10 @@ const _ProjectController = {
       const hasPaidSubscription = isPaidSubscription(subscription)
       const aiFeaturesDisabled = user.aiFeatures?.enabled === false
 
+      const showAiFeatures = aiFeaturesAllowed && !aiFeaturesDisabled
+      // only add-on is ai based, so we only need its pricing info if ai features are usable
       const addonPrices =
-        isOverleafAssistBundleEnabled &&
-        (await ProjectController._getAddonPrices(req, res))
+        showAiFeatures && (await ProjectController._getAddonPrices(req, res))
 
       let standardPlanPricing
       let recommendedCurrency
@@ -955,7 +952,7 @@ const _ProjectController = {
         showSymbolPalette,
         symbolPaletteAvailable: Features.hasFeature('symbol-palette'),
         userRestrictions: Array.from(req.userRestrictions || []),
-        showAiFeatures: aiFeaturesAllowed && !aiFeaturesDisabled,
+        showAiFeatures,
         onAiFreeTrial:
           user.features?.aiUsageQuota === Settings.aiFeatures?.freeTrialQuota,
         detachRole,
@@ -967,7 +964,6 @@ const _ProjectController = {
         projectTags,
         isSaas: Features.hasFeature('saas'),
         shouldLoadHotjar,
-        isOverleafAssistBundleEnabled,
         customerIoEnabled: true,
         addonPrices,
         compileSettings: {
@@ -1012,6 +1008,7 @@ const _ProjectController = {
     }
   },
 
+  // todo: quota clean-up: these can be removed potentially?
   async _getAddonPrices(req, res, addonPlans = ['assistant']) {
     const plansData = {}
 

+ 0 - 6
services/web/app/src/Features/Subscription/SubscriptionController.mjs

@@ -586,12 +586,6 @@ async function previewAddonPurchase(req, res) {
     paymentMethod[0]
   )
 
-  await SplitTestHandler.promises.getAssignment(
-    req,
-    res,
-    'overleaf-assist-bundle'
-  )
-
   res.render('subscriptions/preview-change', {
     changePreview,
     purchaseReferrer,

+ 1 - 3
services/web/app/views/project/editor/_meta.pug

@@ -43,9 +43,7 @@ meta(name="ol-isSaas" data-type="boolean" content=isSaas)
 meta(name="ol-shouldLoadHotjar" data-type="boolean" content=shouldLoadHotjar)
 meta(name='ol-customerIoEnabled' data-type="boolean" content=customerIoEnabled)
 meta(name='ol-compileSettings' data-type="json" content=compileSettings)
-if(isOverleafAssistBundleEnabled)
-	//- expose plans info to show prices in paywall-change-compile-timeout test 
-	meta(name="ol-addonPrices" data-type="json" content=addonPrices)
+meta(name="ol-addonPrices" data-type="json" content=addonPrices)
 if (standardPlanPricing)
 	meta(
 		name='ol-recommendedCurrency'

+ 0 - 3
services/web/frontend/extracted-translations.json

@@ -83,8 +83,6 @@
   "add_company_details": "",
   "add_email_address": "",
   "add_email_to_claim_features": "",
-  "add_error_assist_annual_to_your_projects": "",
-  "add_error_assist_to_your_projects": "",
   "add_files": "",
   "add_more_collaborators": "",
   "add_more_licenses_to_my_plan": "",
@@ -695,7 +693,6 @@
   "get_collaborative_benefits": "",
   "get_discounted_plan": "",
   "get_early_access_with_ai_assist_add_on": "",
-  "get_error_assist": "",
   "get_exclusive_access_to_labs": "",
   "get_in_touch": "",
   "get_language_suggestions": "",

+ 14 - 33
services/web/frontend/js/features/subscription/components/preview-subscription-change/root.tsx

@@ -19,7 +19,6 @@ import OLButton from '@/shared/components/ol/ol-button'
 import { subscriptionUpdateUrl } from '@/features/subscription/data/subscription-url'
 import * as eventTracking from '@/infrastructure/event-tracking'
 import sparkleText from '@/shared/svgs/ai-sparkle-text.svg'
-import { useFeatureFlag } from '@/shared/context/split-test-context'
 import PaymentErrorNotification from '@/features/subscription/components/shared/payment-error-notification'
 import handleStripePaymentAction from '../../util/handle-stripe-payment-action'
 import RedirectedPaymentErrorNotification from '../shared/redirected-payment-error-notification'
@@ -33,7 +32,6 @@ function PreviewSubscriptionChange() {
   const { t } = useTranslation()
   const payNowTask = useAsync()
   const location = useLocation()
-  const aiAssistEnabled = useFeatureFlag('overleaf-assist-bundle')
 
   // Filter out items that cancel each other out (AI assist items with subtotals that sum to 0)
   const filteredLineItems = preview.immediateCharge.lineItems.filter(
@@ -124,37 +122,20 @@ function PreviewSubscriptionChange() {
 
             {aiAddOnChange && (
               <div>
-                {aiAssistEnabled ? (
-                  <Trans
-                    i18nKey="add_ai_assist_to_your_plan"
-                    components={{
-                      sparkle: (
-                        <img
-                          alt="sparkle"
-                          className="ai-error-assistant-sparkle"
-                          src={sparkleText}
-                          aria-hidden="true"
-                          key="sparkle"
-                        />
-                      ),
-                    }}
-                  />
-                ) : (
-                  <Trans
-                    i18nKey="add_error_assist_to_your_projects"
-                    components={{
-                      sparkle: (
-                        <img
-                          alt="sparkle"
-                          className="ai-error-assistant-sparkle"
-                          src={sparkleText}
-                          aria-hidden="true"
-                          key="sparkle"
-                        />
-                      ),
-                    }}
-                  />
-                )}
+                <Trans
+                  i18nKey="add_ai_assist_to_your_plan"
+                  components={{
+                    sparkle: (
+                      <img
+                        alt="sparkle"
+                        className="ai-error-assistant-sparkle"
+                        src={sparkleText}
+                        aria-hidden="true"
+                        key="sparkle"
+                      />
+                    ),
+                  }}
+                />
               </div>
             )}
 

+ 0 - 3
services/web/locales/en.json

@@ -95,8 +95,6 @@
   "add_email": "Add email",
   "add_email_address": "Add email address",
   "add_email_to_claim_features": "Add an institutional email address to claim your features.",
-  "add_error_assist_annual_to_your_projects": "Add Error Assist Annual <sparkle/> to your projects and get unlimited AI help to fix LaTeX errors faster.",
-  "add_error_assist_to_your_projects": "Add Error Assist <sparkle/> to your projects and get unlimited AI help to fix LaTeX errors faster.",
   "add_files": "Add files",
   "add_manager_user_not_found": "This email address is not registered in Overleaf. Please ask the person you are trying to add as a manager to create an Overleaf account if they have not already done so. When adding a manager, please use one of the email addresses that are associated with their account.",
   "add_more_collaborators": "Add more collaborators",
@@ -894,7 +892,6 @@
   "get_collaborative_benefits": "Get the collaborative benefits from __appName__, even if you prefer to work offline",
   "get_discounted_plan": "Get discounted plan",
   "get_early_access_with_ai_assist_add_on": "Get early access with the AI Assist add-on",
-  "get_error_assist": "Get Error Assist",
   "get_exclusive_access_to_labs": "Get exclusive access to early-stage experiments when you join Overleaf Labs. All we ask in return is your honest feedback to help us develop and improve.",
   "get_in_touch": "Get in touch",
   "get_in_touch_having_problems": "<a href=\"__link__\">Get in touch with support</a> if you’re having problems",