Skip to content

Commit 867546a

Browse files
committed
Add subtle translation system guidance for users
- Enhance reading instruction to mention hover/click for translations - Add informative tooltip explaining credit system and visual feedback - Add subtle info icon next to credit display for additional help - Add low credit warning when credits are 2 or fewer - Change credit display color to orange when low - All guidance is subtle and non-intrusive to the interface - Helps users understand translation system without cluttering UI
1 parent 34245a5 commit 867546a

File tree

2 files changed

+25
-9
lines changed

2 files changed

+25
-9
lines changed

app/components/TextGenerator/ReadingPassage.tsx

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use client';
22

33
import React from 'react';
4-
import { BookOpenIcon } from '@heroicons/react/24/outline';
4+
import { BookOpenIcon, InformationCircleIcon } from '@heroicons/react/24/outline';
55
import { useTranslation } from 'react-i18next';
66
import { motion } from 'motion/react';
77
import { getTextDirection } from 'app/domain/language';
@@ -48,12 +48,27 @@ const ReadingPassage = () => {
4848
</div>
4949
<div className="flex items-center space-x-4">
5050
{hover.progressionPhase === 'credits' && (
51-
<div
52-
className="flex items-center justify-center w-8 h-8 rounded-full text-sm font-medium text-yellow-400 bg-gray-700/50"
53-
data-testid="hover-credits-display"
54-
title={t('practice.hoverCreditsTooltip') || 'Hover Credits'}
55-
>
56-
<span>{hover.creditsAvailable}</span>
51+
<div className="flex items-center space-x-2">
52+
<div
53+
className={`flex items-center justify-center w-8 h-8 rounded-full text-sm font-medium ${
54+
hover.creditsAvailable <= 2
55+
? 'text-orange-400 bg-orange-900/30'
56+
: 'text-yellow-400 bg-gray-700/50'
57+
}`}
58+
data-testid="hover-credits-display"
59+
title={t('practice.hoverCreditsTooltip') || 'Hover Credits'}
60+
>
61+
<span>{hover.creditsAvailable}</span>
62+
</div>
63+
<InformationCircleIcon
64+
className="w-4 h-4 text-gray-400 hover:text-gray-300 cursor-help transition-colors"
65+
title={t('practice.hoverCreditsTooltip') || 'Translation Credits Info'}
66+
/>
67+
{hover.creditsAvailable <= 2 && (
68+
<span className="text-xs text-orange-300 hidden sm:inline">
69+
{t('practice.lowCredits')}
70+
</span>
71+
)}
5772
</div>
5873
)}
5974
<AudioControls />

public/locales/en/common.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,12 @@
7878
"almostLevelUp": "One more correct answer to level up!",
7979
"correctAnswer": "Correct Answer",
8080
"hoverCredits": "{{count}}",
81-
"hoverCreditsTooltip": "Hover or click on words for translation. Credits are limited.",
81+
"hoverCreditsTooltip": "Translation credits: Hover or click words for translations. Credits reset each question. Underlined words show you've translated them.",
82+
"lowCredits": "Low credits",
8283
"relevantText": "Relevant Text",
8384
"showExplanation": "Show Explanation",
8485
"hideExplanation": "Hide Explanation",
85-
"readingInstruction": "Read the passage carefully to answer the question below",
86+
"readingInstruction": "Read the passage carefully to answer the question below. Hover or click words for translations.",
8687
"questionPrompt": "Based on the passage above, answer this question:",
8788
"readComplete": "Passage read",
8889
"reading": "Reading...",

0 commit comments

Comments
 (0)