diff --git a/studio-v2/app/learn/[unitId]/match/page.tsx b/studio-v2/app/learn/[unitId]/match/page.tsx index 18e4224..e393d92 100644 --- a/studio-v2/app/learn/[unitId]/match/page.tsx +++ b/studio-v2/app/learn/[unitId]/match/page.tsx @@ -124,9 +124,9 @@ export default function MatchPage() { return ( router.push('/learn')} progress={{ current: matchedTotal, total: totalPairs }} - exerciseExplanation={undefined} nativeHelper={nativePanel} score={
diff --git a/studio-v2/components/learn/ExerciseLayout.tsx b/studio-v2/components/learn/ExerciseLayout.tsx index d6d1614..2b1fbc5 100644 --- a/studio-v2/components/learn/ExerciseLayout.tsx +++ b/studio-v2/components/learn/ExerciseLayout.tsx @@ -11,6 +11,8 @@ interface ExerciseLayoutProps { nativeHelper?: React.ReactNode /** Explanation text for parents (shown above native words) */ exerciseExplanation?: string + /** Exercise type key for auto-explanation lookup (e.g. 'match', 'flashcards') */ + exerciseType?: string /** Title for the exercise in the header */ title: string /** Progress: current / total */ @@ -50,6 +52,7 @@ export function ExerciseLayout({ children, nativeHelper, exerciseExplanation, + exerciseType, title, progress, onBack, @@ -62,9 +65,10 @@ export function ExerciseLayout({ ? 'bg-white/10 backdrop-blur-xl border border-white/10' : 'bg-white/80 backdrop-blur-xl border border-black/5' + const typeKey = exerciseType || title.toLowerCase() const explanation = exerciseExplanation - || explanations[title.toLowerCase()]?.[nativeLang] - || explanations[title.toLowerCase()]?.['de'] + || explanations[typeKey]?.[nativeLang] + || explanations[typeKey]?.['de'] || '' return ( @@ -100,23 +104,29 @@ export function ExerciseLayout({ {/* Main content: 2/3 left + 1/3 right */}
-
+
{/* Left: Exercise area (2/3 or full) */} -
+
{children}
+ {/* Divider line */} + {isThirdLanguage && ( +
+ )} + {/* Right: Native language helper (1/3) — only for migrants */} {isThirdLanguage && ( -
-
+
+
{/* Explanation card */} {explanation && ( -
-

+
+

+ 💡 {nativeLang.toUpperCase()} · {t('english')} · {t('german')}

-

+

{explanation}