fix(loyalty): conditional subtitle on enrollment success page
Some checks failed
CI / ruff (push) Successful in 18s
CI / validate (push) Has been cancelled
CI / dependency-scanning (push) Has been cancelled
CI / docs (push) Has been cancelled
CI / deploy (push) Has been cancelled
CI / pytest (push) Has been cancelled

When re-enrolling (already a member), the success page showed two
contradicting messages stacked:
  Title:    "Vous êtes déjà membre !"          (correct, conditional)
  Subtitle: "Vous êtes maintenant membre..."   (wrong — static)

The title was already x-text-conditional based on
enrollContext.already_enrolled, but the subtitle was a server-side
{{ _('success.message') }} so it always rendered the "you're now a
member" copy regardless of branch.

Make the subtitle conditional the same way:
- new i18n key already_enrolled_message in en/fr/de/lb
  ("Welcome back — your card is ready whenever you are." and
  locale-appropriate equivalents)
- expose success_message + already_enrolled_message in i18nStrings
- subtitle becomes x-text="already_enrolled ? msg2 : msg1"

Found during Test 2 round 2 — cross-store re-enrollment at
FASHIONOUTLET with the email from Test 1.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-19 22:15:15 +02:00
parent f68a30a820
commit dee2eab266
5 changed files with 10 additions and 1 deletions

View File

@@ -137,6 +137,7 @@
"back_to_home": "Zurück zur Startseite" "back_to_home": "Zurück zur Startseite"
}, },
"already_enrolled_title": "Sie sind bereits Mitglied!", "already_enrolled_title": "Sie sind bereits Mitglied!",
"already_enrolled_message": "Willkommen zurück — Ihre Karte ist einsatzbereit.",
"cross_location_message": "Ihre Karte gilt an allen unseren Standorten:", "cross_location_message": "Ihre Karte gilt an allen unseren Standorten:",
"single_location_message": "Ihre Karte ist bei {store_name} registriert", "single_location_message": "Ihre Karte ist bei {store_name} registriert",
"available_locations": "Nutzen Sie Ihre Karte an allen unseren Standorten:", "available_locations": "Nutzen Sie Ihre Karte an allen unseren Standorten:",

View File

@@ -137,6 +137,7 @@
"back_to_home": "Back to Home" "back_to_home": "Back to Home"
}, },
"already_enrolled_title": "You're already a member!", "already_enrolled_title": "You're already a member!",
"already_enrolled_message": "Welcome back — your card is ready whenever you are.",
"cross_location_message": "Your card works at all our locations:", "cross_location_message": "Your card works at all our locations:",
"single_location_message": "Your card is registered at {store_name}", "single_location_message": "Your card is registered at {store_name}",
"available_locations": "Use your card at all our locations:", "available_locations": "Use your card at all our locations:",

View File

@@ -137,6 +137,7 @@
"back_to_home": "Retour à l'accueil" "back_to_home": "Retour à l'accueil"
}, },
"already_enrolled_title": "Vous êtes déjà membre !", "already_enrolled_title": "Vous êtes déjà membre !",
"already_enrolled_message": "Heureux de vous revoir — votre carte est prête à l'emploi.",
"cross_location_message": "Votre carte est valable dans tous nos points de vente :", "cross_location_message": "Votre carte est valable dans tous nos points de vente :",
"single_location_message": "Votre carte est enregistrée chez {store_name}", "single_location_message": "Votre carte est enregistrée chez {store_name}",
"available_locations": "Utilisez votre carte dans tous nos points de vente :", "available_locations": "Utilisez votre carte dans tous nos points de vente :",

View File

@@ -137,6 +137,7 @@
"back_to_home": "Zréck op d'Haaptsäit" "back_to_home": "Zréck op d'Haaptsäit"
}, },
"already_enrolled_title": "Dir sidd schonn Member!", "already_enrolled_title": "Dir sidd schonn Member!",
"already_enrolled_message": "Wëllkomm zréck — Är Kaart ass prett wann Dir et sidd.",
"cross_location_message": "Är Kaart gëllt an all eise Standuerter:", "cross_location_message": "Är Kaart gëllt an all eise Standuerter:",
"single_location_message": "Är Kaart ass bei {store_name} registréiert", "single_location_message": "Är Kaart ass bei {store_name} registréiert",
"available_locations": "Benotzt Är Kaart an all eise Standuerter:", "available_locations": "Benotzt Är Kaart an all eise Standuerter:",

View File

@@ -21,7 +21,10 @@
x-text="enrollContext.already_enrolled ? i18nStrings.already_enrolled_title : i18nStrings.success_title"> x-text="enrollContext.already_enrolled ? i18nStrings.already_enrolled_title : i18nStrings.success_title">
{{ _('loyalty.enrollment.success.title') }} {{ _('loyalty.enrollment.success.title') }}
</h1> </h1>
<p class="text-gray-600 dark:text-gray-400 mb-8">{{ _('loyalty.enrollment.success.message') }}</p> <p class="text-gray-600 dark:text-gray-400 mb-8"
x-text="enrollContext.already_enrolled ? i18nStrings.already_enrolled_message : i18nStrings.success_message">
{{ _('loyalty.enrollment.success.message') }}
</p>
<!-- Card Number Display --> <!-- Card Number Display -->
<div class="bg-white dark:bg-gray-800 rounded-lg shadow-lg p-6 mb-8"> <div class="bg-white dark:bg-gray-800 rounded-lg shadow-lg p-6 mb-8">
@@ -137,7 +140,9 @@ function customerLoyaltyEnrollSuccess() {
}, },
i18nStrings: { i18nStrings: {
success_title: {{ _('loyalty.enrollment.success.title')|tojson }}, success_title: {{ _('loyalty.enrollment.success.title')|tojson }},
success_message: {{ _('loyalty.enrollment.success.message')|tojson }},
already_enrolled_title: {{ _('loyalty.enrollment.already_enrolled_title')|tojson }}, already_enrolled_title: {{ _('loyalty.enrollment.already_enrolled_title')|tojson }},
already_enrolled_message: {{ _('loyalty.enrollment.already_enrolled_message')|tojson }},
cross_location_message: {{ _('loyalty.enrollment.cross_location_message')|tojson }}, cross_location_message: {{ _('loyalty.enrollment.cross_location_message')|tojson }},
single_location_message: {{ _('loyalty.enrollment.single_location_message')|tojson }}, single_location_message: {{ _('loyalty.enrollment.single_location_message')|tojson }},
available_locations: {{ _('loyalty.enrollment.available_locations')|tojson }}, available_locations: {{ _('loyalty.enrollment.available_locations')|tojson }},