Skip to content

feat(quiz): replace emojis with lucide-react icons#139

Merged
ViktorSvertoka merged 2 commits intodevelopfrom
sl/feat/quiz
Jan 13, 2026
Merged

feat(quiz): replace emojis with lucide-react icons#139
ViktorSvertoka merged 2 commits intodevelopfrom
sl/feat/quiz

Conversation

@LesiaUKR
Copy link
Collaborator

@LesiaUKR LesiaUKR commented Jan 13, 2026

Week 5

Closes #138

Summary

  • Replace all emoji characters with lucide-react icons in quiz flow components
  • Add semantic colors: blue for info, red for errors, amber for warnings, green for success
  • Icons now adapt to dark/light theme

Test plan

  • Verify QuizCard displays FileText and Clock icons on /quizzes page
  • Start a quiz and check rules screen icons (FileText, Ban, AlertTriangle, Clock)
  • Answer questions and verify Check/X icons in progress bar
  • Complete quiz and verify result icons (Trophy, BookOpen, TrendingUp, Clock)
  • Check explanation section shows Lightbulb icon
  • Test dark mode - all icons should be visible
  • Test light mode - all icons should be visible

Summary by CodeRabbit

  • Style
    • Replaced emoji/text symbols with consistent iconography across the quiz UI (timer warnings, question metadata, rules, progress/status indicators, result screens, and violation badges) for improved visual consistency and accessibility.
  • Documentation
    • Added localized "incomplete" result messages (en, pl, uk) to surface a clear "time's up / partial completion" outcome.

✏️ Tip: You can customize this high-level summary in your review settings.

@netlify
Copy link

netlify bot commented Jan 13, 2026

Deploy Preview for develop-devlovers ready!

Name Link
🔨 Latest commit c18bbaa
🔍 Latest deploy log https://app.netlify.com/projects/develop-devlovers/deploys/6966ccd64e3f92000837bae5
😎 Deploy Preview https://deploy-preview-139--develop-devlovers.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 13, 2026

📝 Walkthrough

Walkthrough

Replaced inline emoji characters with lucide-react icon components across quiz UI components and added an "incomplete" localized quiz result entry in en/pl/uk message files. All changes are presentation and localization only; no control-flow or public API changes.

Changes

Cohort / File(s) Summary
Icon swaps — timer
frontend/components/quiz/CountdownTimer.tsx
Replaced warning emoji with AlertTriangle import and icon render in low-time warning.
Icon swaps — card
frontend/components/quiz/QuizCard.tsx
Replaced text emojis with FileText and Clock icons; adjusted markup and styling for counts.
Icon swaps — container/rules
frontend/components/quiz/QuizContainer.tsx
Replaced rule emojis with FileText, Ban, AlertTriangle, Clock; adjusted classes for sizing/color.
Icon swaps — progress
frontend/components/quiz/QuizProgress.tsx
Replaced ✓/✗ with Check and X icons in answer status rendering.
Icon swaps — question
frontend/components/quiz/QuizQuestion.tsx
Replaced ✓/✗/💡 with Check, X, Lightbulb icons and applied size/color classes.
Icon swaps — result
frontend/components/quiz/QuizResult.tsx
Replaced motivational/violation emoji with Clock, BookOpen, TrendingUp, Trophy, AlertTriangle; updated getMotivationalMessage to return icon props and adjusted markup.
Translations — add incomplete result
frontend/messages/en.json, frontend/messages/pl.json, frontend/messages/uk.json
Added quiz.result.incomplete entry with localized title and message for incomplete/timeout result.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • AM1007
  • ViktorSvertoka

Poem

🐰
I swapped the smiles for clever lines of light,
Lucide hops in, tidy, crisp, and bright.
No more emoji wobble across the scene,
Icons snug in dark and day — oh so keen! 🥕

🚥 Pre-merge checks | ✅ 3 | ❌ 2
❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning Additions to translation files (en.json, pl.json, uk.json) for incomplete quiz result messaging are beyond the icon replacement scope defined in issue #138. Either move translation changes to a separate PR or clarify if incomplete result messaging is part of the icon replacement feature.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title accurately summarizes the primary change: replacing emojis with lucide-react icons across quiz components.
Linked Issues check ✅ Passed All code changes fully implement the requirements from issue #138: emoji-to-icon replacements in all specified components with appropriate lucide-react icons and styling.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

🧹 Recent nitpick comments
frontend/messages/en.json (1)

133-136: Minor capitalization inconsistency.

The incomplete.title uses "Time's up" (lowercase 'u'), while timeUp.title on line 114 uses "Time's Up" (uppercase 'U'). Consider aligning the capitalization for consistency.

✏️ Suggested fix
       "incomplete": {
-        "title": "Time's up",
+        "title": "Time's Up",
         "message": "You answered {answeredCount} out of {total} questions. Result not counted."
       },
frontend/messages/pl.json (1)

133-136: Minor capitalization inconsistency.

Similar to the English locale, incomplete.title uses "Czas minął" (lowercase 'm'), while timeUp.title on line 114 uses "Czas Minął" (uppercase 'M'). Consider aligning the capitalization for consistency with existing entries.

✏️ Suggested fix
       "incomplete": {
-        "title": "Czas minął",
+        "title": "Czas Minął",
         "message": "Odpowiedzi udzielono na {answeredCount} z {total} pytań. Wynik nie został zaliczony."
       },
📜 Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 45b81d9 and c18bbaa.

📒 Files selected for processing (4)
  • frontend/components/quiz/QuizResult.tsx
  • frontend/messages/en.json
  • frontend/messages/pl.json
  • frontend/messages/uk.json
🚧 Files skipped from review as they are similar to previous changes (1)
  • frontend/components/quiz/QuizResult.tsx
🔇 Additional comments (1)
frontend/messages/uk.json (1)

133-136: LGTM!

The new incomplete translation entry is well-structured with correct Ukrainian text and consistent placeholders ({answeredCount}, {total}). The title appropriately reuses the same phrasing as timeUp.title for consistency.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
frontend/components/quiz/CountdownTimer.tsx (1)

105-116: Incomplete emoji replacement: still present on line 113.

The PR objective is to replace all emojis with lucide-react icons, but line 113 still uses the emoji for the "hurryUp" message. For consistency with the rest of the migration, this should also be replaced with a Clock icon.

Proposed fix
+import { AlertTriangle, Clock } from 'lucide-react';
-import { AlertTriangle } from 'lucide-react';
           ) : (
             <>
-              <span aria-hidden="true">⏰</span> {t('hurryUp')}
+              <Clock className="w-4 h-4 inline text-amber-500" /> {t('hurryUp')}
             </>
           )}
frontend/components/quiz/QuizContainer.tsx (1)

464-468: Hardcoded "Exit Quiz" text should use translations.

This file uses tExit for the exit modal translations, but the button text is hardcoded in English. For i18n consistency, this should use a translation key.

Proposed fix
-            Exit Quiz
+            {tExit('button')}

Note: Ensure the corresponding translation key exists in your i18n files.

🤖 Fix all issues with AI agents
In @frontend/components/quiz/QuizResult.tsx:
- Around line 38-45: The branch that handles the incomplete quiz result in
QuizResult.tsx currently uses hardcoded Ukrainian strings; replace those
literals with calls to the translation function t() (e.g., use
t('quiz.result.incomplete.title'), t('quiz.result.incomplete.message', {
answeredCount, total })) and keep the same properties (icon and color) intact so
the returned object structure is unchanged; then add matching keys (title and
message with interpolation for answeredCount/total) to your locale files under
quiz.result.incomplete.
🧹 Nitpick comments (1)
frontend/components/quiz/QuizResult.tsx (1)

125-131: Consider improving inline icon alignment.

The inline class positions the icon inline but may cause slight vertical misalignment with the adjacent text. Adding alignment classes improves visual consistency.

✨ Optional alignment improvement
-           <AlertTriangle className="w-4 h-4 inline" /> {t('violations', { count: violationsCount })}
+           <AlertTriangle className="w-4 h-4 inline-block align-text-bottom" /> {t('violations', { count: violationsCount })}

Alternatively, you could use align-middle or wrap both in a flex container with items-center.

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7d152a3 and 45b81d9.

📒 Files selected for processing (6)
  • frontend/components/quiz/CountdownTimer.tsx
  • frontend/components/quiz/QuizCard.tsx
  • frontend/components/quiz/QuizContainer.tsx
  • frontend/components/quiz/QuizProgress.tsx
  • frontend/components/quiz/QuizQuestion.tsx
  • frontend/components/quiz/QuizResult.tsx
🧰 Additional context used
🧬 Code graph analysis (2)
frontend/components/quiz/QuizCard.tsx (1)
frontend/db/seed-quiz-types.ts (1)
  • t (42-48)
frontend/components/quiz/QuizQuestion.tsx (1)
frontend/db/seed-quiz-types.ts (1)
  • t (42-48)
🔇 Additional comments (7)
frontend/components/quiz/QuizContainer.tsx (1)

384-424: LGTM! Icon replacements in the rules section are well-implemented.

The icons are consistently sized (w-5 h-5), properly aligned with flex-shrink-0 mt-0.5, and have appropriate semantic colors with dark mode support:

  • Blue for informational items (FileText, Clock)
  • Red for forbidden actions (Ban)
  • Amber for warnings (AlertTriangle)
frontend/components/quiz/QuizProgress.tsx (1)

92-95: LGTM! Icon replacements look good.

The Check and X icons are appropriately sized for the progress indicator circles. Minor note: the font-bold class on line 93 has no effect on SVG icons, but it's harmless.

frontend/components/quiz/QuizQuestion.tsx (2)

68-77: LGTM! Correct/incorrect indicators are well-implemented.

The Check and X icons with inline class ensure proper text alignment, and the semantic colors (green for correct, red for incorrect) are consistent with the design system.


102-103: LGTM! Lightbulb icon for recommendation is appropriate.

The amber-500 color for the tip/recommendation section follows the semantic color mapping defined in the PR objectives.

frontend/components/quiz/QuizCard.tsx (1)

48-57: LGTM! Metadata icons are cleanly implemented.

The FileText and Clock icons are properly sized for the context, theme-aware with dark mode variants, and well-aligned using flex layout. This provides a consistent visual representation of quiz metadata.

frontend/components/quiz/QuizResult.tsx (2)

6-6: LGTM!

All imported lucide-react icons are used appropriately throughout the component.


47-93: Icon implementation looks good.

The icon choices align well with their semantic meanings (Clock for time-related states, BookOpen for learning, TrendingUp for progress, Trophy for success). Consistent sizing and appropriate color theming for dark/light modes.

@ViktorSvertoka ViktorSvertoka merged commit eb4dc6a into develop Jan 13, 2026
8 checks passed
@ViktorSvertoka ViktorSvertoka deleted the sl/feat/quiz branch January 13, 2026 23:00
@LesiaUKR LesiaUKR restored the sl/feat/quiz branch January 13, 2026 23:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

(SP: 1) [UI] Replace emoji icons with lucide-react in quiz components

2 participants