Skip to content

fix: font fallback for deploy, localized og:tags#150

Merged
Hugo0 merged 1 commit intomainfrom
fix/font-fallback-og-tags
Mar 14, 2026
Merged

fix: font fallback for deploy, localized og:tags#150
Hugo0 merged 1 commit intomainfrom
fix/font-fallback-og-tags

Conversation

@Hugo0
Copy link
Owner

@Hugo0 Hugo0 commented Mar 14, 2026

Summary

  • Graceful font fallback: generate_share_images.py now tries multiple font paths (Ubuntu/Fedora/Arch) and never crashes on missing fonts
  • Localized og:title/og:description: uses native-language challenge text from language configs (e.g. "Wordle Deutsch — 5/6") instead of hardcoded English
  • Lint cleanup: fix unused variable and ternary lint warnings

Test plan

  • pnpm test — all 81 tests pass
  • ruff format + ruff check — clean
  • Verify share images generate correctly on deploy (font fallback)
  • Check og:tags render correctly for non-English languages (view page source)

Summary by CodeRabbit

  • Bug Fixes

    • Enhanced font resolution system with robust fallback handling and improved platform compatibility. Fonts now gracefully fall back to default options when unavailable, with better error reporting.
  • New Features

    • Customized share metadata that reflects individual game outcomes. Share messages now include outcome-specific titles and descriptions.

- Graceful font fallback: tries multiple paths (Ubuntu/Fedora/Arch), never crashes on missing fonts
- Localized og:title/og:description: uses native-language challenge text from language configs
- og:title kept short (e.g. 'Wordle Deutsch — 5/6'), og:description has the full native CTA
- Fix unused variable and ternary lint warnings
@coderabbitai
Copy link

coderabbitai bot commented Mar 14, 2026

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

This PR enhances font handling in image generation with a platform-aware resolution mechanism and fallbacks, while updating share metadata in the game template with outcome-specific titles, descriptions, and improved logging.

Changes

Cohort / File(s) Summary
Font Resolution & Image Generation
scripts/generate_share_images.py
Introduces _resolve_font() helper for cross-platform font discovery, replaces hard-coded font paths with candidate lists, adds module-level logging, dynamically resolves font constants at import time with fallbacks, enhances get_font() to gracefully default to Pillow's built-in font on failure, simplifies command-line argument parsing for target languages.
Share Metadata & UI Logging
webapp/templates/game.html
Updates share metadata logic to generate outcome-specific titles and descriptions (win/loss/challenge states), adds language initialization logging (name, word list sizes, character set, daily word), updates issue tracker links from /new/choose to root issues endpoint.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐰 Fonts hop cross platforms with grace,
No hard-coded paths to chase,
Share results bloom with custom words,
Each outcome sung by logs we've heard, 🌟

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 75.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 summarizes the two main changes: font fallback handling for deployment and localized og:tags for social sharing.

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

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/font-fallback-og-tags
📝 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.

@Hugo0 Hugo0 merged commit aafd645 into main Mar 14, 2026
4 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