Skip to content

fix: correct login redirect and improve i18n UX in quiz flow#127

Merged
ViktorSvertoka merged 1 commit into
developfrom
localize-main-pages
Jan 11, 2026
Merged

fix: correct login redirect and improve i18n UX in quiz flow#127
ViktorSvertoka merged 1 commit into
developfrom
localize-main-pages

Conversation

@TiZorii
Copy link
Copy Markdown
Collaborator

@TiZorii TiZorii commented Jan 11, 2026

  • Fix login button navigation (was pointing to signup)
  • Remove debug console logs
  • Move emojis from translations to JSX for better accessibility

Summary by CodeRabbit

  • New Features

    • Timer now displays visual emoji indicators (⚠️ for critical, ⏰ for low time) when time remaining drops below 30%.
    • Quiz violations notice now includes a warning emoji for enhanced visibility.
  • Bug Fixes

    • Corrected guest checkout login flow navigation.

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

- Fix login button navigation (was pointing to signup)
- Remove debug console logs
- Move emojis from translations to JSX for better accessibility
@netlify
Copy link
Copy Markdown

netlify Bot commented Jan 11, 2026

Deploy Preview for develop-devlovers ready!

Name Link
🔨 Latest commit 5cf2182
🔍 Latest deploy log https://app.netlify.com/projects/develop-devlovers/deploys/696414d468903b0008bd84de
😎 Deploy Preview https://deploy-preview-127--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
Copy Markdown
Contributor

coderabbitai Bot commented Jan 11, 2026

📝 Walkthrough

Walkthrough

The changes relocate emoji presentation logic from translation message strings into component rendering code. Emoji prefixes are removed from message files and conditionally added in components during render, granting finer control over visual indicators for timer warnings and violations.

Changes

Cohort / File(s) Summary
Component Emoji Rendering
frontend/components/quiz/CountdownTimer.tsx, frontend/components/quiz/QuizResult.tsx
Timer messages now prefix with ⚠️ (≤10% remaining) or ⏰ (11–30%) conditionally within component; violations message prefixed with ⚠️ in rendered output. Login button navigation changed from signup redirect to login redirect in guest flow.
Message Translation Cleanup
frontend/messages/en.json, frontend/messages/pl.json, frontend/messages/uk.json
Emoji prefixes removed from timer.almostDone, timer.hurryUp, and quiz.result.violations strings across all three language files; text reverted to plain labels.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • AM1007
  • ViktorSvertoka

Poem

🐰 With emojis shuffled left and right,
The timer blinks in component light!
No more in strings, but code they play—
A cleaner way to warn the day! 🚀⏰

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
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 (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main changes: correcting the login redirect (in QuizResult.tsx) and improving i18n UX by moving emojis from translation strings into JSX components.

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

✨ Finishing touches
  • 📝 Generate docstrings

📜 Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 75a8c61 and 5cf2182.

📒 Files selected for processing (5)
  • frontend/components/quiz/CountdownTimer.tsx
  • frontend/components/quiz/QuizResult.tsx
  • frontend/messages/en.json
  • frontend/messages/pl.json
  • frontend/messages/uk.json
🧰 Additional context used
🧬 Code graph analysis (2)
frontend/components/quiz/QuizResult.tsx (1)
frontend/db/seed-quiz-types.ts (1)
  • t (42-48)
frontend/components/quiz/CountdownTimer.tsx (1)
frontend/db/seed-quiz-types.ts (1)
  • t (42-48)
🔇 Additional comments (6)
frontend/messages/pl.json (1)

106-107: LGTM! Emoji extraction improves i18n maintainability.

The removal of emoji prefixes from timer and violations messages is well-executed. Moving these visual indicators to JSX (as done in CountdownTimer.tsx and QuizResult.tsx) improves accessibility by allowing proper aria-hidden attributes and keeps translation strings focused on content rather than presentation.

Also applies to: 131-131

frontend/messages/uk.json (1)

106-107: LGTM! Consistent emoji extraction across locales.

The changes mirror those in en.json and pl.json, maintaining consistency across all supported languages. The Ukrainian translations remain natural and grammatically correct without the emoji prefixes.

Also applies to: 131-131

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

102-110: Excellent accessibility implementation!

The emoji prefixes are now properly marked with aria-hidden="true", ensuring screen readers focus on the translated text while sighted users benefit from the visual cues. This approach correctly separates presentational elements from translatable content.

frontend/messages/en.json (1)

106-107: LGTM! Clean emoji extraction with improved grammar.

The emoji removal is consistent with other locale files, and line 106 also includes a minor grammatical improvement ("Time is almost up!" reads more naturally). These changes work well with the JSX rendering in CountdownTimer.tsx.

Also applies to: 131-131

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

112-112: LGTM! Consistent accessibility pattern.

The emoji prefix with aria-hidden="true" matches the implementation in CountdownTimer.tsx, providing visual emphasis for violations while keeping the message screen-reader friendly.


143-146: Login redirect fix looks correct!

The button now properly navigates to the login page instead of signup, fixing the issue described in the PR objectives. The returnTo parameter correctly preserves the quiz context for post-login redirect.

The login page at /{locale}/login exists and properly handles the returnTo parameter, redirecting users back to /quiz/{quizSlug} after successful login. The signup button (lines 150-154) also correctly includes the returnTo parameter 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.

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.

2 participants