aboutsummaryrefslogtreecommitdiffstats
path: root/docs/superpowers/plans/2026-09-17-weather-widget.md
AgeCommit message (Collapse)AuthorFilesLines
2026-09-17docs: explain the Beaufort index arithmetic and why compass existsDanilo M.1-0/+9
Two comments, no behaviour change. `force - 1` reads as an off-by-one until you know the scale starts at 0 while ipairs starts at 1, so the loop index is already force + 1. Said plainly now, along with why the fall-through returns 12. compass() has no caller: the card draws arrow(). It is kept because it shares arrow()'s binning exactly, so testing both pins that shared logic from two angles, and switching the card to "S 9 km/h" becomes a one-word change. Without this note the next reader finds an unused function and has to reconstruct the reasoning. Raised by code review as the only two points worth acting on; no Critical or Important issues were found. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-17fix: guard a nil timestamp in the icon lookupDanilo M.1-1/+5
icon(800, nil, 1500, 1900) compared nil against a number and raised, which in this project is a blank dashboard with no message. The module's own header promises nothing raises, and is_day() already guards the same case, so the inconsistency was the bug. Not reachable from the widget as written: it passes os.time(), and parse() refuses a response without sunrise and sunset, so no caller can currently produce the failing combination. Fixed anyway, because the contract is what future callers will rely on and the fix is one word. The test file also now says why the codepoint VALUES carry no assertion: comparing M.ICON.snow against a literal would only prove the escape was typed twice. Whether E31A draws a snow cloud is what the glyph sheet is for, and mutation testing confirms the assertions cannot see it. Found by code review. The same fix is applied to the plan, so Tasks 2-5 inherit the guarded version. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-17fix: correct the day/night constants in Task 1's testDanilo M.1-1/+4
DAY was 1000 against a sunrise of 1500, so every timestamp in the test evaluated as night and the first day assertion could never pass. The implementation was right; the test constants were not. DAY is now 1700, inside the 1500..1900 window, with a comment saying why the value has to be checked against the window rather than just named. Caught by the Task 1 implementer, which stopped rather than quietly inverting the day/night comparison to make the assertions pass. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-17docs: add the weather widget implementation planDanilo M.1-0/+1186
Nine tasks, TDD throughout: the domain tables and parser get tests, the card gets a screenshot. The icon codepoints in the plan were each rendered and inspected rather than derived. That caught U+E30A, which is present in the font and draws a sun-with-rain, standing in for snow; the correct glyph is U+E31A. A wrong-but-present codepoint fails this way, plausibly, which is why the plan tells the implementer to look at the rendered sheet instead of trusting a fontconfig query. Task 6 and Task 8 both state which outcomes are acceptable when the OWM key is still activating, so an inactive key blocks neither. Paths are relative to the repo root rather than absolute: the first version of this file hardcoded a home directory in eighteen places and the pre-commit hook rejected it, correctly. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>