daily-wallpaper: add bar widget, panel, and desktop widget for the caption - #409
daily-wallpaper: add bar widget, panel, and desktop widget for the caption#409jstehn wants to merge 1 commit into
Conversation
…ption Bing and NASA both ship a caption with their photo of the day, but the service only ever used it to build the wallpaper filename before now, discarding the actual text. Captures it at the point each source resolves and publishes it as plugin state, then adds three pure-view surfaces to show it: a bar glyph (click opens the panel), a panel with the full caption/credit/"learn more" link, and a matching desktop widget card. - Bing's `copyright` field is split into a title and a "(© ...)" credit. - NASA's gallery-item caption has no separate credit line; its own article link is used as "learn more" instead of the Bing quiz link. - Metadata is fetched even when the day's image is already cached (e.g. after a process restart), independent of the download step.
|
This pull request was automatically closed because its description no longer contains Missing:
Please add the items listed above back to the description, keeping their exact wording, then |
|
CC @nzlov |
|
This PR was auto-closed by the template-enforcement bot (I'd paraphrased a few checklist lines instead of keeping their exact wording). GitHub's reopen API is refusing this one for some reason without a specific error, so continuing here instead: #410 |
Plugin
nzlov/daily-wallpaperplugin.toml)What it does
Bing and NASA both ship a caption alongside their photo of the day, but the
service only ever used it to build the wallpaper's cache filename — the text
itself was discarded. This adds three pure-view surfaces that show it: a bar
widget (glyph + optional short caption; click opens the panel), a panel with
the full caption, credit, and a "learn more" link, and a matching desktop
widget card. The background service is unchanged in what it fetches; it now
additionally captures and publishes the caption at the point each source
resolves.
copyrightfield (e.g. "Caption text (© Photographer/Source)") issplit into a title and a credit.
empty; its own article link is used as "learn more" instead of Bing's quiz
link.
after a process restart before this session ever resolved a source), so
the caption doesn't stay blank until the next day's fetch.
Also fixes a real bug found while testing the NASA path, unrelated to the
caption feature itself: the pre-existing primary-image regex scanned the
whole page with a lazy
.-span, and intermittently exceeded Noctalia'sper-callback CPU budget against the real nasa.gov page (confirmed live —
same line, unmodified from
main, before I touched it). All three NASAextractions (image, caption, link) are now bounded to a small substring
around the first gallery item instead.
Smaller fix: panel
height320 → 250, closer to the actual content size.External dependencies
Adds
xdg-open(fromxdg-utils) for the panel's "Learn more" button, openingthe caption's source link. Already declared in
dependenciesinplugin.toml.Testing
Tested live via a
pathplugin source pointing at this branch, on bothsource = "bing"(the default) andsource = "nasa":noctalia plugins lintand the repo's ownvalidate-plugins.pyboth pass; the existingwallpaper-download/apply behavior is unaffected for either source
(
Daily Wallpaper applied: ...logs and the wallpaper is actually set,confirmed by screenshot for both); the
todaystate publishes the correcttitle/credit for both sources on a fresh resolve and on a forced refresh
via
noctalia msg plugin nzlov/daily-wallpaper:service all refresh; thepanel opens/closes with no runtime errors for either source; the NASA
CPU-budget fix was confirmed by reproducing the original error live, then
confirming it's gone after the fix, across several repeated refreshes.
Screenshots / Videos
Not yet included — opening as Draft for that reason. I have real
screenshots from live testing (bar widget + desktop widget on Bing, panel
open on both Bing and NASA), but I'd rather have a person look at what's in
frame before anything from a live desktop goes into a public PR. Will add
before this comes out of Draft.
Checklist
idafter the/inplugin.tomlexactly.plugin.toml,README.md,thumbnail.webp, andtranslations/en.json.README.mdfollows the README template, documents every entry id and dependency, and includes exact panel IPC commands and launcher prefixes where applicable.thumbnail.webpwith the thumbnail generator. (Unchanged from the existing plugin — happy to update if maintainers want the new surfaces reflected.)versionfollows semver and is bumped in this PR;plugin_apiis the oldest API level this plugin requires.catalog.toml; CI generates it.Code review attestation
licensedeclared inplugin.toml.