Skip to content

Fix definitions for diacritic words, reveal today's word after winning#173

Merged
Hugo0 merged 2 commits intomainfrom
fix/definition-and-archive-bugs
Mar 15, 2026
Merged

Fix definitions for diacritic words, reveal today's word after winning#173
Hugo0 merged 2 commits intomainfrom
fix/definition-and-archive-bugs

Conversation

@Hugo0
Copy link
Owner

@Hugo0 Hugo0 commented Mar 15, 2026

Summary

  • Fix definition & image 404 for words with diacritics (e.g. Portuguese "farão", Spanish "cañón")
    • Root cause: unicode NFC/NFD normalization mismatch in word list validation
    • Now tries both NFC and NFD forms
  • Word archive reveals today's word after game over (was always hidden)
    • Reads game state from localStorage client-side
    • Shows green tiles + links to word detail page
  • Word archive marks completed past words with a green checkmark
    • Reads game_results from localStorage, maps dates to day indices

Test plan

  • Play Portuguese and win — definition + image should appear in win modal
  • Visit /pt/words — today's word should show revealed (green tiles)
  • Past words you've played should have a green checkmark
  • Words with diacritics (ã, ç, ñ, etc.) should show definitions
  • /api/pt/definition/farão should return a definition (not 404)

…winning

Three fixes:

1. Definition & image endpoints rejected valid words with diacritics
   (e.g. Portuguese "farão") due to unicode normalization mismatch.
   Now tries both NFC and NFD forms when validating against word list.

2. Word archive now reveals today's word after the game is over.
   Checks localStorage for game_over state client-side and shows
   the word with green tiles instead of question marks.

3. Word archive marks completed past words with a checkmark.
   Reads game_results from localStorage and maps dates to day
   indices to show which words the player has already played.
@coderabbitai
Copy link

coderabbitai bot commented Mar 15, 2026

Warning

Rate limit exceeded

@Hugo0 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 17 minutes and 31 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 1ee6c378-0be4-4074-8dd4-5edb54008364

📥 Commits

Reviewing files that changed from the base of the PR and between fa68083 and b82e497.

📒 Files selected for processing (4)
  • pages/[lang]/word/[id].vue
  • pages/[lang]/words.vue
  • server/api/[lang]/definition/[word].get.ts
  • server/api/[lang]/word-image/[word].get.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/definition-and-archive-bugs
📝 Coding Plan
  • Generate coding plan for human review comments

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.

Same fix as the archive page — checks localStorage for game_over
state and reveals the word with tiles + definition instead of
showing "Play today's game to reveal this word."
@Hugo0 Hugo0 merged commit edbe9de into main Mar 15, 2026
5 checks passed
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.

1 participant