feat(weather): restore full moon-phase names on the almanac page - #159
feat(weather): restore full moon-phase names on the almanac page#159rpierce99 wants to merge 1 commit into
Conversation
|
Warning Review limit reached
More reviews will be available in 55 minutes. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the 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 include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (4)
📒 Files selected for processing (6)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 9 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
The v2.4.0 almanac redesign (capped moon icon + adaptive title font) freed up horizontal room that the old fixed layout didn't have, so the phase names no longer need to be abbreviated to fit. _get_moon_phase_name now returns the full "Waxing/Waning Crescent" and "Waxing/Waning Gibbous" names instead of the clipped "Wax/Wan" forms. _almanac_layout shows the full name where it fits and falls back to the abbreviation before trimming characters, so wide panels (128x32, 256x32, 128x64) show the full name and the cramped 64x32 panel degrades to a clean abbreviation rather than a mid-word cut. Adds a deterministic harness fixture (real Open-Meteo + astral data, frozen instant) and golden images for the almanac page at every supported size so the rendered text is guarded against future drift. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
5854cf8 to
1abfd0b
Compare
…mes (2.5.1) (#163) Combines the two open almanac (moon) page PRs into a single 2.5.1 release so they don't both claim the same version. Supersedes #157 and #159. - Recover missing moonset: astral only searches a single calendar day, so once a month the event straddles midnight and it raises "Moon never sets on this date" (sffjunkie/astral #88, #105). Fall back to scanning the moon's elevation across the day and bisecting the horizon crossing. Same fallback covers moonrise. - Show true illumination: the "%" next to the phase name showed cycle progress (so a waning crescent read 86% instead of ~13% lit); it now converts phase to the true illuminated fraction. - Restore full moon-phase names ("Waxing/Waning Crescent", "Waxing/Waning Gibbous") now that the redesigned layout has room: full name where it fits, abbreviation when tight, character trim only as a last resort. Tests: test_almanac_moon_data.py, extended test_almanac_layout.py (incl. the full-name assertions), and test_geocode_cache.py all pass. Almanac golden images regenerated for the combined output and the plugin safety harness passes at every supported size. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
What
The almanac page abbreviated four of the eight moon-phase names ("Wax Crescent", "Wax Gibbous", "Wan Gibbous", "Wan Crescent") to survive the old fixed layout. The v2.4.0 redesign (capped moon icon + adaptive title font) freed up the horizontal room those abbreviations were working around, so this restores the full names:
_get_moon_phase_namenow returns Waxing/Waning Crescent and Waxing/Waning Gibbous._almanac_layoutshows the full name where it fits, falls back to the abbreviation when the column is tight, and only trims characters as a last resort — so no panel ever shows a mid-word cut where a whole word would fit.Screenshots
Rendered from the committed golden fixture (Dallas, 2026-06-14 — a day astral resolves cleanly, so the page shows a real moonrise/moonset; moon phase 0.97 → "Waning Crescent", the longest restored name). Upscaled 6× for legibility.
The three roomy panels show the full "Waning Crescent"; the cramped 64×32 panel degrades to a clean "Wan" rather than a mid-word trim.
Tests
test_almanac_layout.py: asserts the full names are returned, that they render intact on a wide panel, and that the fitted title is always a clean variant (full or abbreviation) whenever the abbreviation fits — never a mid-word trim.test/harness.json+ real cached Open-Meteo/astral data) and golden images for the almanac page at every supported size to guard against future drift.Version bumped to 2.5.1.