Add pixel-art animations to weather popup - #12982
dmitry-solomadin wants to merge 1 commit into
Conversation
The weather popup gets an animated pixel-art scene behind the forecast that follows the current conditions: a sun with rays, glow, a light beam and bokeh; a haloed crescent with twinkling stars and a shooting star at night; partly cloudy, overcast and fog; rain, snow and sleet at three intensities; thunderstorms whose lightning lights up the clouds, with hail for WMO 96/99; and wind streaks from 30 km/h. The scene comes from the Open-Meteo weather code and day flag the widget already fetches, through a table of named WMO codes in Model.js, and falls back to matching the bar glyph against iconForCode when only wttr.in data is present. Drawing is kept cheap: a static canvas repainted only on open or scene change, cloud and fog strips painted once from horizontally periodic noise and slid sideways, and a 30 Hz canvas for the parts that move, which stays under 2 ms a frame and stops when the popup closes. Colours are the theme accent and background plus an ink that is white on dark themes and the theme foreground on light ones. A boolean "fx" widget setting, shown as "Animated weather effects", turns it off. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Automated AI review
Verified: the scene mapping, day/night and wind handling, the Cloud and fog strips are regenerated on every popup openThe description gives about 100 ms per strip, paid once per scene change. The per-strip cost matches, but it is paid on each open. On Wayland, Quickshell's Measured in an offscreen Qt 6.11.2 harness that runs the PR's sky block verbatim and repeats the Qt part of this detach/reattach sequence, heavy intensity with wind:
A reopen during the 140 ms fade-out reuses the existing window and skips the repaint. Impact: each open of the weather popup in a cloudy, foggy, rainy, snowy or stormy scene blocks the shell's GUI thread (bar, other popups, notifications) for roughly 65 to 210 ms before the popup appears, more on slower CPUs or a larger Suggested change: keep the computed field outside the Canvas (keyed by spec and size) so a new window only replays draw calls, or compute it in a Default location setup never uses the Open-Meteo code or day flag
Running the PR's Impact: on the out-of-box setup, intensity grading, hail, sleet and the night palette for overcast, rain, snow and storm scenes never appear. Suggested change: - readonly property var fxResolved: Model.resolveSkyScene(current, label)
+ readonly property var fxResolved: Model.resolveSkyScene(openMeteoCurrent || current, label)
Optional: the sky derives its light-theme check and blends from Verified:
Review informationTest scope: Source review of head AI process: Opus 5.5 Medium coordination and synthesis, independent Opus 5.5 Xhigh and GPT 6 Sol Xhigh technical assessments with targeted cross-checks of each finding, Opus 5.5 Medium editorial check. Opt out: To stop receiving these reviews, reply to this comment saying so. |
What
Adds an animated scene to weather widget popup, like the Apple Weather backgrounds but drawn as low-res pixel art in the theme's own colours.
How it is drawn
The scene comes from the Open-Meteo weather code and
is_dayflag the widget already fetches, falling back to the bar glyph when only wttr.in data is present.The popup only animates while it is open, and the per-frame work is kept to what actually moves.
Measured on a 600×190 popup at heavy intensity with wind:
Colours are the theme accent, background and an ink that is white on dark themes and the theme foreground on light ones, which also get stronger opacity.
Configuration
"fx"on the widget'sshell.jsonentry, shown as "Animated weather effects" in the widget settings. On by default;falseturns it off.Test plan
bash test/shell.d/weather-test.sh: WMO and glyph mapping, thefxtoggle, panel wiring./test/shell: only the environment-dependent files fail (noomarchy-pkgscheckout, noomasnap, two kernel migrations), same as onquattro🤖 Generated with Claude Code