Repository navigation
Conversation
Themes may carry an optional wallpaper: a small embedded data: image ghosted into the window chrome at a chosen opacity. Pure theme-JSON feature: no editor UI, import/export round-trips it, themes without the field are untouched, and the image cap (192 KB) keeps any wallpapered file inside the existing 256 KB import budget. Co-Authored-By: Claude Fable 5 <[email protected]>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
The image pattern now requires canonical padded base64 (full quads, correct final-group padding) so accepted wallpapers always decode. applyThemeColorPreview takes the wallpaper the save would keep — merges the target's, edits the edited theme's, new drafts none — and clears a lingering one from the previously applied theme. Co-Authored-By: Claude Fable 5 <[email protected]>
ApprovabilityVerdict: Needs human review This PR adds a new feature (optional wallpaper support for themes) introducing new user-facing visual behavior through CSS rendering changes and type definitions. New capabilities from external contributors warrant human review. You can customize Macroscope's approvability policy. Learn more. |
|
Closing this from my side. I built it for a wallpapered theme setup I've since retired, so I'm not going to keep carrying the branch. If wallpaper support lands on ThemeFile some other way, great, and anyone is welcome to pick this diff up. |
Implements #5661 as the minimal slice offered there — a pure theme-JSON feature with no editor UI.
What it does
A theme file may carry an optional
wallpaper:{ "version": 1, "name": "Misty", "appearance": "light", "colors": { "...": "..." }, "wallpaper": { "image": "data:image/jpeg;base64,...", "opacity": 0.15 } }When the active theme carries one,
applyThemePalettesetsdata-wallpaperplus two CSS variables on the root, andindex.csspaints the image into the body's chrome as a background-image stack — a scrim of--app-chrome-backgroundon top ghosts it down to the chosen opacity, so there is no extra element and no z-index juggling. The only other CSS is standing down the canvas's duplicatebg-backgroundcoats (scoped underhtml[data-wallpaper], so nothing changes for themes without the field). Theme authors control how much the wallpaper reads through the sidebar and other surfaces with the 8-digit hex roles the palette already supports.Design choices
sidebarArtworkpattern: an optionalThemeFilefield, threaded throughparseThemeFile, the tolerant localStorage parse, andserializeThemeFile. No new UI — import/export already round-trips the JSON. The theme editor preserves an imported wallpaper across saves (it rebuilds themes throughparseThemeFileliterals, which would otherwise drop it).MAX_THEME_FILE_BYTES(256 KB) import limit with room for the palette. No limits change.data:image/*URIs only — themes stay one portable file; no network fetches, and the validated charset can't escape theurl().fit/positionknobs (cover/center); easy to add later if wanted.Testing
vp test run --project unitinapps/web: 220 files, 1998 tests green;tsgo --noEmitandvp lintclean.Happy to adjust scope or drop it if this isn't wanted (#5661 has the original request). Both findings from the Macroscope review round are addressed and confirmed resolved.
🤖 Generated with Claude Code
Note
Add optional wallpaper support to theme files
ThemeWallpapertype (base64 data URI + opacity) and adds it as an optional field onThemeDefinitionandThemeFilein themePalette.ts.applyThemeWallpaperto set/clear adata-wallpaperattribute and CSS variables (--theme-wallpaper-image,--theme-wallpaper-opacity) on the document root;applyThemePaletteandapplyThemeColorPreviewnow call it.data-wallpaperis present, with sidebar-inset backgrounds made transparent to reveal it.Macroscope summarized 0377846.
Note
Low Risk
Additive theme JSON and presentation-only DOM/CSS changes; images are embedded data URIs with validation and no network fetch. Main risk is visual regressions when
data-wallpaperis active, not security or data integrity.Overview
Adds an optional
wallpaperfield to theme JSON (data:image/*base64 + optional opacity), wired through parse/serialize and tolerant localStorage reads with strict import validation (≤192 KB, allowed formats, opacity 0–1).When a theme has a wallpaper,
applyThemePaletteandapplyThemeColorPreviewsetdata-wallpaperand CSS variables;index.csspaints a fixed cover image on the body with a chrome-color scrim and makes the main sidebar inset transparent so the wallpaper shows through.ThemeEditorPanelkeeps imported wallpapers on save/merge (no editor controls) and previews the wallpaper that would be kept after save. New unit tests cover round-trip, rejection cases, and apply/clear behavior.Reviewed by Cursor Bugbot for commit 0377846. Bugbot is set up for automated code reviews on this repo. Configure here.