From b07d141397240ea01be88fc3981c16b0383e68f3 Mon Sep 17 00:00:00 2001 From: Antoine Clausse Date: Wed, 3 Jun 2026 13:43:18 +0200 Subject: [PATCH] [web] Fix /user/subscription/plans#ai-assist redirects (#34124) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [web] Redirect missing AI add-on purchase to subscription dashboard The two error paths in `previewAddonPurchase` redirected to `/user/subscription/plans#ai-assist`, but the `#ai-assist` anchor was removed when the AI Assist add-on was retired, so users land at the top of the plans page with no context. Align both with the other error branches in the same function and the `plans-2026-phase-1` enabled branch, which already redirect to `/user/subscription?redirect-reason=ai-assist-unavailable` — the subscription dashboard shows the matching warning alert (`redirect-alerts.tsx`). Update the acceptance test to match the new redirect target. Closes #34074 Co-Authored-By: Claude Opus 4.7 (1M context) * [web] Update ai-assist-unavailable warning to reflect bundled AI features The previous copy said "AI Assist isn't available to you due to your current subscription type", which read as a hard block. Now that the AI Assist add-on has been retired and AI features are included with every paid plan, the warning should point users to the pricing page instead of implying their plan can't access AI at all. Keep the existing translation key for now — a follow-up can rename it once #33624 (AI page CTA destination) is resolved. Co-Authored-By: Claude Opus 4.7 (1M context) * [web] Link the ai-assist-unavailable warning to the pricing page * [web] Rename key `ai_assist_unavailable_due_to_subscription_type` -> `ai_assist_unavailable` * [web] Update french and german translations --------- Co-authored-by: Claude Opus 4.7 (1M context) GitOrigin-RevId: ae1319fa5b857d8f292de77c82ef0bda1c7ad144 --- .../Features/Subscription/SubscriptionController.mjs | 8 ++++++-- services/web/frontend/extracted-translations.json | 2 +- .../components/dashboard/redirect-alerts.tsx | 12 ++++++++++-- services/web/locales/de.json | 2 +- services/web/locales/en.json | 2 +- services/web/locales/fr.json | 1 + 6 files changed, 20 insertions(+), 7 deletions(-) diff --git a/services/web/app/src/Features/Subscription/SubscriptionController.mjs b/services/web/app/src/Features/Subscription/SubscriptionController.mjs index 44c442ff12..989c780fca 100644 --- a/services/web/app/src/Features/Subscription/SubscriptionController.mjs +++ b/services/web/app/src/Features/Subscription/SubscriptionController.mjs @@ -598,7 +598,9 @@ async function previewAddonPurchase(req, res) { err instanceof Error && err.constructor.name === 'PaymentServiceResourceNotFoundError' ) { - return res.redirect('/user/subscription/plans#ai-assist') + return res.redirect( + '/user/subscription?redirect-reason=ai-assist-unavailable' + ) } throw err } @@ -624,7 +626,9 @@ async function previewAddonPurchase(req, res) { err instanceof Error && err.constructor.name === 'PaymentServiceResourceNotFoundError' ) { - return res.redirect('/user/subscription/plans#ai-assist') + return res.redirect( + '/user/subscription?redirect-reason=ai-assist-unavailable' + ) } throw err } diff --git a/services/web/frontend/extracted-translations.json b/services/web/frontend/extracted-translations.json index 73b7e40b72..9fddae835a 100644 --- a/services/web/frontend/extracted-translations.json +++ b/services/web/frontend/extracted-translations.json @@ -121,7 +121,7 @@ "ai_assist_in_overleaf_is_included_via_writefull_groups": "", "ai_assist_in_overleaf_is_included_via_writefull_individual": "", "ai_assist_subscriber_can_now_write_smarter": "", - "ai_assist_unavailable_due_to_subscription_type": "", + "ai_assist_unavailable": "", "ai_assistance": "", "ai_assistant": "", "ai_can_make_mistakes": "", diff --git a/services/web/frontend/js/features/subscription/components/dashboard/redirect-alerts.tsx b/services/web/frontend/js/features/subscription/components/dashboard/redirect-alerts.tsx index 00332230c8..53856cbd73 100644 --- a/services/web/frontend/js/features/subscription/components/dashboard/redirect-alerts.tsx +++ b/services/web/frontend/js/features/subscription/components/dashboard/redirect-alerts.tsx @@ -1,4 +1,4 @@ -import { useTranslation } from 'react-i18next' +import { Trans, useTranslation } from 'react-i18next' import OLNotification from '@/shared/components/ol/ol-notification' function RedirectAlerts() { @@ -16,7 +16,15 @@ function RedirectAlerts() { } else if (redirectReason === 'double-buy') { warning = t('good_news_you_already_purchased_this_add_on') } else if (redirectReason === 'ai-assist-unavailable') { - warning = t('ai_assist_unavailable_due_to_subscription_type') + warning = ( + , + ]} + /> + ) } else if (redirectReason === 'subscription-paused') { warning = t('no_add_on_purchase_while_paused') } else { diff --git a/services/web/locales/de.json b/services/web/locales/de.json index f3646dd962..41ef741740 100644 --- a/services/web/locales/de.json +++ b/services/web/locales/de.json @@ -135,7 +135,7 @@ "ai_assist_description": "AI Assist kombiniert KI-Tools von Overleaf und Writefull, damit du schneller, intelligenter und sicherer schreiben kannst.", "ai_assist_in_overleaf_is_included_via_writefull_groups": "AI Assist in Overleaf ist Teil des Writefull-Abonnements deiner Gruppe oder Organisation. Um Änderungen vorzunehmen, musst du dich an den Administrator deines Abonnements wenden.", "ai_assist_in_overleaf_is_included_via_writefull_individual": "AI Assist in Overleaf ist Teil deines Writefull-Abonnements. Du kannst deinen Zugriff auf AI Assist in deinen Writefull-Abonnementeinstellungen kündigen oder verwalten.", - "ai_assist_unavailable_due_to_subscription_type": "Es tut uns leid – anscheinend ist AI Assist aufgrund deines aktuellen Abonnementtyps noch nicht für dich verfügbar.", + "ai_assist_unavailable": "KI-Funktionen sind jetzt in jedem kostenpflichtigen Plan enthalten. Auf der <0>Preisseite erfahren Sie, was die einzelnen Pläne beinhalten.", "ai_can_make_mistakes": "KI kann Fehler machen. Überprüfe Korrekturen, bevor du sie anwendest.", "ai_features": "KI-Funktionen", "ai_feedback_please_provide_more_detail": "Bitte gib mehr Details dazu an, was nicht gestimmt hat (optional)", diff --git a/services/web/locales/en.json b/services/web/locales/en.json index 24acee42e8..9c0fc5ff07 100644 --- a/services/web/locales/en.json +++ b/services/web/locales/en.json @@ -154,7 +154,7 @@ "ai_assist_in_overleaf_is_included_via_writefull_groups": "AI Assist in Overleaf is included as part of your group or organization’s Writefull subscription. To make changes you’ll need to speak to your subscription admin", "ai_assist_in_overleaf_is_included_via_writefull_individual": "AI Assist in Overleaf is included as part of your Writefull subscription. You can cancel or manage your access to AI Assist in your Writefull subscription settings.", "ai_assist_subscriber_can_now_write_smarter": "AI Assist subscribers can now write smarter, find citations, and generate LaTeX from prompts and images.", - "ai_assist_unavailable_due_to_subscription_type": "We’re sorry—it looks like AI Assist isn’t available to you just yet due to your current subscription type.", + "ai_assist_unavailable": "AI features are now included in every paid plan. See the <0>pricing page for what each plan includes.", "ai_assistance": "AI assistance", "ai_assistant": "AI Assistant", "ai_assistant_explanation": "A LaTeX-fluent AI Assistant built into your editor.", diff --git a/services/web/locales/fr.json b/services/web/locales/fr.json index afa5216001..5cc46ca3d7 100644 --- a/services/web/locales/fr.json +++ b/services/web/locales/fr.json @@ -87,6 +87,7 @@ "aggregate_changed": "Modification de", "aggregate_to": "en", "agree_with_the_terms": "J’accepte les conditions d’utilisation d’Overleaf", + "ai_assist_unavailable": "Les fonctionnalités d’IA sont désormais incluses dans les offres payantes. Consultez la <0>page des offres et prix pour en savoir plus.", "ai_can_make_mistakes": "Une IA peut commettre des erreurs. Examinez les corrections avant de les appliquer.", "ai_feedback_tell_us_what_was_wrong_so_we_can_improve": "Dites-nous ce qui n’allait pas afin que nous puissions nous améliorer.", "ai_feedback_the_answer_was_too_long": "La réponse était trop longue",