Repository navigation
Add responsive theme background support - #9312
acrogenesis wants to merge 42 commits into
Conversation
|
Pairs well with #8720 |
|
Really impressive work here. I like the shared resolver approach, the backward compatibility, and the care given to security and multi-monitor behavior. My only hesitation is the amount of custom machinery being introduced around metadata parsing, SVG processing, caching, and transition state. The AWK parser appears to support a restricted subset of TOML, while the responsive SVG handling rewrites XML attributes using sed. I wonder whether those boundaries should be documented more explicitly, or whether any of that could use existing parsers to reduce long-term maintenance risk. I’m also curious about cache invalidation for SVGs that reference sibling assets, since the raster-cache key appears to include the SVG’s mtime but not the mtimes of its dependencies. A cache size limit might also be worth considering alongside the existing age-based cleanup. None of these look like obvious blockers, and I may be missing some context. They’re mainly areas where I’d be interested in the maintainers’ perspective on complexity and long-term maintenance. Overall, this looks like a thoughtful and valuable improvement. Pi x GPT on behalf of OldJobobo. |
|
Thanks for the careful read — all four points are fair, and I've pushed changes for the concrete ones (a61e4ad, ce3ccf8):
On replacing the hand-rolled parsing with real parsers to cut long-term maintenance: that's genuinely a maintainers' call on the complexity-vs-dependency tradeoff, so I'll defer to their preference rather than pull a new runtime dependency into the base image. Appreciate the thoughtful review. |
ce3ccf8 to
558c39a
Compare
Fold a digest of sibling files (name and mtime) into the SVG raster cache key so a render is invalidated when a relative sibling asset the SVG may reference changes, not only when the SVG's own mtime moves. Bound both the render and sampled-edge caches by entry count alongside the existing age prune, skipping in-flight temp files, so neither can grow without limit.
Spell out that backgrounds.toml is read by a small awk parser covering a deliberate subset of TOML, and that the SVG render cache keys on sibling mtimes and is bounded by count as well as age.
83b5d9a to
cbdad80
Compare
|
Seconding this — it solves a real ultrawide pain point. I'm on a 3440x1440 display, and the Giants theme ships 3:2 photographic portraits. Today they get hard-cropped to cover, which loses most of each composition. As a stopgap I hand-re-encoded every background to 3440x1440 with the portrait fitted to screen height and the sidebars filled with the average color sampled from the image's own edges — which is essentially the Having this as a first-party, per-theme (and eventually per-image) preference is exactly the right fix. The sampled-edge backdrop in particular produced seamless results on textured photographic images, so I can confirm the approach works well in practice. Happy to test on ultrawide once this lands. |
[High impact] The PR appears safe to merge, with a non-blocking bar-text contrast issue for centered responsive SVGs on HiDPI displays. Findings
SummaryAdds per-screen background variants, render settings, SVG templates, and shared desktop and lock-screen resolution.
|
| fillColor = parseFillColor(meta.fill_color) | ||
| focalX = isFinite(Number(meta.focal_x)) ? Util.clamp(meta.focal_x, 0, 1) : 0.5 | ||
| focalY = isFinite(Number(meta.focal_y)) ? Util.clamp(meta.focal_y, 0, 1) : 0.5 | ||
| rasterScale = meta.responsive_raster === true ? Math.max(1, devicePixelRatio) : 1 |
There was a problem hiding this comment.
With a responsive SVG using fill = "center" on a scale-2 display, the desktop now draws the cached PNG at the correct size, but the bar sampler still enlarges it by 2. The sampler reads --fields, which omits responsive_raster, and applies scale * sample_scale to every centered image. It can therefore sample the middle of the artwork instead of the pixels behind the bar and choose hard-to-read text.
Pass the responsive-raster flag to the sampler and adjust its native-size calculation too.
Summary
backdrop = "edge"/"blur"; existing themes keep the historical solid behavior by defaultSecurity review
backgrounds.tomlas untrusted data; no theme value is reconstructed as shell source or crosses a privilege boundaryVerification
agent-usage-update-test.shmissing itsgood.jsonfixture./test/clibash test/shell.d/background-resolve-test.shbash test/shell.d/background-test.sh./test/shellexercised all 223 files; the changed background and runtime coverage passed. Unrelated aggregate failures were limited to sibling-checkout packaging coverage (omarchy-pkgs/ absentomarchy-iso, plus an existingomarchy-crash-watch.servicePKGBUILD mismatch) and the session's globalNO_COLOR=1;launch-about-test.shpassed when rerun without that variable.#181826perimeter instead of a deliberately incorrect fallback color0-winding-road.webp, workspace 1, and the normal checkout shell after verification