feat: Add wallpaper download option and photographer source attribution#221
feat: Add wallpaper download option and photographer source attribution#221mian196 wants to merge 11 commits into
Conversation
…apher attribution
…rdu translation details
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (10)
💤 Files with no reviewable changes (10)
📝 WalkthroughWalkthroughThis PR adds wallpaper download functionality with Unsplash attribution. A new Download button appears in the wallpaper controls; it downloads only from random Picsum wallpapers and links to Unsplash photos via a new attribution pill. The implementation persists photo metadata in IndexedDB, refactors the background-type state machine, and includes localization and styling for the new UI elements. ChangesWallpaper Download with Unsplash Attribution
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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 |
There was a problem hiding this comment.
Actionable comments posted: 13
🧹 Nitpick comments (3)
scripts/wallpaper.js (1)
131-141: ⚡ Quick winAdd response status check before parsing JSON.
If the Picsum info endpoint returns a non-2xx response (e.g., 404), calling
.json()may fail or return unexpected content. While the outer try-catch catches exceptions, checkinginfoResponse.okprovides clearer error handling.Suggested improvement
if (match) { const photoId = match[1]; const infoResponse = await fetch(`https://picsum.photos/id/${photoId}/info`); - infoData = await infoResponse.json(); + if (infoResponse.ok) { + infoData = await infoResponse.json(); + } }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@scripts/wallpaper.js` around lines 131 - 141, The fetch of Picsum metadata should check the HTTP status before calling .json(): after creating infoResponse (in the block that extracts redirectedUrl, match, and photoId inside the try), test infoResponse.ok (or check status) and handle non-2xx responses by logging or throwing a descriptive error instead of directly calling infoResponse.json(); then only assign infoData from infoResponse.json() when ok. Update the logic around redirectedUrl/match/photoId/infoResponse/infoData to include this status guard and clear error handling for 404s or other non-success responses.scripts/languages.js (1)
343-355: ⚡ Quick winKeep the wallpaper buttons' accessible names in sync with the localized tooltips.
Line 347 and Line 354 only update
title. If these remain icon-only controls, screen readers can keep a stale or missing name while the visual tooltip is localized. Mirror thearia-labelupdate used for#downloadWallpaperhere too.Suggested patch
const randomBtn = document.getElementById("randomImageTrigger"); if (randomBtn) { const hoverText = translations[lang]?.randomWallpaperText || translations["en"].randomWallpaperText; randomBtn.setAttribute("title", hoverText); + randomBtn.setAttribute("aria-label", hoverText); } // Update title/tooltip for `#clearImage` const clearBtn = document.getElementById("clearImage"); if (clearBtn) { const hoverText = translations[lang]?.clearWallpaperText || translations["en"].clearWallpaperText; clearBtn.setAttribute("title", hoverText); + clearBtn.setAttribute("aria-label", hoverText); }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@scripts/languages.js` around lines 343 - 355, The code updates only the title attribute for the wallpaper buttons (`#randomImageTrigger` and `#clearImage`), but their accessible names (aria-label) must also be kept in sync so screen readers reflect localization; update both elements in the same blocks where hoverText is computed to also setAttribute("aria-label", hoverText) (mirror the behavior used for `#downloadWallpaper`) so both title and aria-label use translations[lang]?.randomWallpaperText / clearWallpaperText with fallback to translations["en"].style.css (1)
5773-5775: ⚡ Quick winHide the attribution pill for every non-random wallpaper mode.
Line 5774 only hides
#wallpaperSourcefordata-bg="color", butscripts/wallpaper.jsalready publishes the exactdata-bg-typestate and this pill is only valid for random Unsplash wallpapers. Using the broaderdata-bgcheck leaves upload mode dependent on JS clearing the pill on every path.Suggested patch
-/* Hide when color mode is active */ -body[data-bg="color"] `#wallpaperSource` { +/* Hide unless the active wallpaper came from the random flow */ +body:not([data-bg-type="random"]) `#wallpaperSource` { display: none !important; }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@style.css` around lines 5773 - 5775, The current rule hides `#wallpaperSource` only for body[data-bg="color"], which is fragile; instead use the published data-bg-type state from scripts/wallpaper.js and make the pill visible only for Unsplash random mode. Replace the data-bg-based logic with rules that default `#wallpaperSource` to hidden and explicitly reveal it only when body[data-bg-type="unsplash-random"] so upload/other modes don't rely on JS to clear the pill.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@CHANGELOG.md`:
- Line 23: Update the CHANGELOG entry text to accurately state the download
source and behavior: replace the phrase 'uncompressed from Unsplash CDN' with
wording that clarifies the feature downloads the original Unsplash image after
resolving the image's source/metadata (for example: "downloads the original
Unsplash image after resolving source metadata"), and ensure the sentence about
the "Download Wallpaper" button mentions it saves the original/high-resolution
Unsplash image rather than implying direct uncompressed CDN delivery.
In `@locales/ar_SA.js`:
- Around line 219-220: The localization key downloadOnlyRandomWallpaper must use
a placeholder token instead of an English substring; update the Arabic (and
other) translations for downloadOnlyRandomWallpaper to include a token like
"{randomWallpaper}" (not the English phrase), then change the replacement logic
in scripts/wallpaper.js (where baseAlertMsg.replace("a random wallpaper",
randomText) is used) to replace the "{randomWallpaper}" token with randomText
(e.g., baseAlertMsg.replace("{randomWallpaper}", randomText)), so the
substitution works regardless of language.
In `@locales/en.js`:
- Around line 175-177: The locale string currently embeds the English phrase "a
random wallpaper" which breaks when translated; update the locale entries (e.g.,
the base alert string(s) such as the one referenced by
downloadOnlyRandomWallpaper and any similar keys around lines 213–215 and
262–269) to use a token like {wallpaperType} instead of the hard-coded English
substring, then change the code in scripts/wallpaper.js (where baseAlertMsg is
composed) to perform a token substitution (e.g.,
baseAlertMsg.replace("{wallpaperType}", randomText)) so localized grammar stays
intact; apply the same token approach for the other affected compositions
mentioned in the comment.
In `@locales/sv.js`:
- Around line 164-166: The Swedish locale file defines UI keys
("downloadWallpaperText", "randomWallpaperText", "clearWallpaperText" and the
other two at the bottom) as empty strings which causes unlabeled controls;
update locales/sv.js by replacing the empty values with proper Swedish
translations for those keys (or remove those key entries so the i18n fallback to
English is used) — locate the keys "downloadWallpaperText",
"randomWallpaperText", "clearWallpaperText" (and the two additional empty
entries around the later block) and either supply Swedish text or delete the
entries to allow fallback.
In `@locales/ta.js`:
- Around line 157-159: The three Tamil localization keys downloadWallpaperText,
randomWallpaperText, and clearWallpaperText must not be set to empty strings;
either provide proper Tamil translations for these values or remove these keys
so the English fallback is used; update the same pattern for the other
occurrence (the keys at the later block referenced) to ensure the wallpaper
button labels, accessibility text, and attribution/dialog copy are available to
Tamil users instead of blank strings.
In `@locales/th.js`:
- Around line 156-158: These three localization entries
("downloadWallpaperText", "randomWallpaperText", "clearWallpaperText") in
locales/th.js are empty strings causing blank labels and ARIA/title text; either
supply proper Thai translations for each key used by the download/random/clear
controls and wallpaper attribution/dialog UI, or remove these keys so the
fallback locale is used; repeat the same fix for the other empty trio at lines
mentioned (the duplicate keys around 190-192) to ensure no blank UI text
remains.
In `@locales/tr.js`:
- Around line 128-130: The three i18n keys downloadWallpaperText,
randomWallpaperText, and clearWallpaperText in locales/tr.js were set to empty
strings, removing visible/help text and screen reader labels; restore proper
Turkish translations for these keys (and the same set at the second occurrence
around lines 139-141) or remove those empty entries so the default/fallback
translations are used instead; locate the entries by the exact key names
downloadWallpaperText, randomWallpaperText, clearWallpaperText and replace the
empty values with concise Turkish strings matching the intent of the original
English text.
In `@locales/uk.js`:
- Around line 167-169: The three Ukrainian locale keys "downloadWallpaperText",
"randomWallpaperText", and "clearWallpaperText" must not be empty strings;
either provide proper Ukrainian translations for these button/ARIA/attribution
labels or remove these keys so the English fallback is used; update both
occurrences (the block with those keys and the similar keys at the later
occurrence) to contain valid Ukrainian text or be omitted to preserve fallback.
In `@locales/ur.js`:
- Line 119: The Urdu localization key "photoBy" currently uses the incorrect
phrase "تصویر بہ مہر"; update the string value for the "photoBy" key to a proper
byline phrase such as "تصویر از" (or another native attribution equivalent) so
that "photoBy" reflects a correct attribution wording in locales/ur.js.
In `@locales/uz.js`:
- Around line 167-169: The three Uzbek wallpaper localization keys
downloadWallpaperText, randomWallpaperText, and clearWallpaperText are set to
empty strings, which overrides the fallback and leaves the UI unlabeled; either
provide Uzbek translations for these keys (e.g., appropriate short action labels
and accessible text) or remove these keys so the fallback locale is used
instead, and do the same for the duplicate empty entries later in the file (the
second set of downloadWallpaperText/randomWallpaperText/clearWallpaperText).
In `@locales/vi.js`:
- Around line 121-123: The three wallpaper localization keys
"downloadWallpaperText", "randomWallpaperText", and "clearWallpaperText" (and
the corresponding empty keys at lines 132-134) are empty and remove UI labels;
replace the empty string values with proper Vietnamese translations (e.g., brief
UI/button text and ARIA/title equivalents) for those keys, or remove the keys so
the code falls back to English—update the entries for the exact symbols
"downloadWallpaperText", "randomWallpaperText", "clearWallpaperText" (and the
duplicate keys at 132-134) in locales/vi.js accordingly.
In `@scripts/wallpaper.js`:
- Around line 266-269: The current logic building alertMsg uses a literal
English substring replacement which breaks non-English locales; update locale
entries (downloadOnlyRandomWallpaper) to include a placeholder like
{randomWallpaper} in every locale and change the code that computes alertMsg
(using variables translations, baseAlertMsg, randomText, alertMsg) to replace
that placeholder token with randomText (with a fallback to the English message
if the locale key is missing) instead of .replace("a random wallpaper", ...),
then pass the resulting alertMsg to alertPrompt.
- Around line 285-288: The if-branch checking imageType === "upload" and using
blob.name is dead/unreachable and should be removed: delete the block that sets
fileName = blob.name (references to imageType, blob, fileName) because imageType
is guaranteed "random" at this point and IndexedDB-stored Blobs do not preserve
a name property; if you actually need to retain original filenames instead,
modify the upload/save flow to store filename metadata alongside the Blob and
read that metadata where filenames are required (do not rely on blob.name).
---
Nitpick comments:
In `@scripts/languages.js`:
- Around line 343-355: The code updates only the title attribute for the
wallpaper buttons (`#randomImageTrigger` and `#clearImage`), but their accessible
names (aria-label) must also be kept in sync so screen readers reflect
localization; update both elements in the same blocks where hoverText is
computed to also setAttribute("aria-label", hoverText) (mirror the behavior used
for `#downloadWallpaper`) so both title and aria-label use
translations[lang]?.randomWallpaperText / clearWallpaperText with fallback to
translations["en"].
In `@scripts/wallpaper.js`:
- Around line 131-141: The fetch of Picsum metadata should check the HTTP status
before calling .json(): after creating infoResponse (in the block that extracts
redirectedUrl, match, and photoId inside the try), test infoResponse.ok (or
check status) and handle non-2xx responses by logging or throwing a descriptive
error instead of directly calling infoResponse.json(); then only assign infoData
from infoResponse.json() when ok. Update the logic around
redirectedUrl/match/photoId/infoResponse/infoData to include this status guard
and clear error handling for 404s or other non-success responses.
In `@style.css`:
- Around line 5773-5775: The current rule hides `#wallpaperSource` only for
body[data-bg="color"], which is fragile; instead use the published data-bg-type
state from scripts/wallpaper.js and make the pill visible only for Unsplash
random mode. Replace the data-bg-based logic with rules that default
`#wallpaperSource` to hidden and explicitly reveal it only when
body[data-bg-type="unsplash-random"] so upload/other modes don't rely on JS to
clear the pill.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 511b82b9-6e8a-488c-bc9f-bdad43eb5614
📒 Files selected for processing (37)
CHANGELOG.mdindex.htmllocales/ar_SA.jslocales/az.jslocales/bn.jslocales/cs.jslocales/de.jslocales/el.jslocales/en.jslocales/es.jslocales/fa.jslocales/fr.jslocales/hi.jslocales/hu.jslocales/idn.jslocales/it.jslocales/ja.jslocales/ko.jslocales/mr.jslocales/ne.jslocales/pl.jslocales/pt.jslocales/ru.jslocales/sl.jslocales/sv.jslocales/ta.jslocales/th.jslocales/tr.jslocales/uk.jslocales/ur.jslocales/uz.jslocales/vi.jslocales/zh.jslocales/zh_TW.jsscripts/languages.jsscripts/wallpaper.jsstyle.css
Replace misleading 'uncompressed from Unsplash CDN' phrasing with accurate description: feature downloads the original high-resolution Unsplash image after resolving the wallpaper's source metadata.
Replace the English substring match 'a random wallpaper' with a
language-agnostic placeholder token {randomWallpaper}. The old approach
broke as soon as any locale provided a real translation, since the
English substring would no longer be present to match.
- locales/en.js: token added to base string
- locales/ur.js: Urdu translation updated to use token
- scripts/wallpaper.js: .replace() targets token instead of English text
Update 'photoBy' from 'تصویر بہ مہر' to 'تصویر از' for more natural Urdu phrasing of the photographer attribution prefix.
imageType is guaranteed 'random' past the early-return guard on line 265, so the 'imageType === upload' branch was unreachable. Additionally, IndexedDB stores Blobs, not Files, so blob.name is always undefined. - Remove dead if/else-if block and let fileName declaration - Simplify to a direct if check on infoData/isValidUnsplashUrl - Convert fileName to const since it is now always date-derived
prem-k-r
left a comment
There was a problem hiding this comment.
I am thinking of updating the UI of the wallpaper option section. Seems like it's a good time now 🙂
Also I have plan to add option to choose source: Bing wallpaper or Lorem Picsum, choosing wallpaper quality, etc
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (5)
locales/sl.js (1)
119-121:⚠️ Potential issue | 🟠 Major | ⚡ Quick winRemove these empty placeholder keys.
Per the maintainer's instruction and PR removal commit objective, delete these three Slovenian entries. The i18n fallback will correctly use English when these keys are absent.
🔧 Proposed fix
"uploadWallpaperText": "Naloži ozadje", -"downloadWallpaperText": "", -"randomWallpaperText": "", -"clearWallpaperText": "", "backupText": "Varnostna kopija",Based on learnings: the maintainer explicitly requested "please don't put the entry in the file for other languages" and the PR description states "subsequent commit removed empty placeholder keys from non-en/ur locales."
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@locales/sl.js` around lines 119 - 121, Remove the three empty Slovenian i18n keys "downloadWallpaperText", "randomWallpaperText", and "clearWallpaperText" from locales/sl.js; locate these exact keys in the file and delete the key-value lines so the fallback to English is used instead.locales/az.js (1)
119-121:⚠️ Potential issue | 🟠 Major | ⚡ Quick winRemove these empty placeholder keys.
Per the maintainer's request and the PR's stated objective to remove empty placeholder keys from non-en/ur locales, these three entries should be deleted entirely rather than left as empty strings. When these keys are absent,
applyLanguageinscripts/languages.jswill correctly fall back to English via the||operator.🔧 Proposed fix
"uploadWallpaperText": "Divar kağızı yükləyin", -"downloadWallpaperText": "", -"randomWallpaperText": "", -"clearWallpaperText": "", "backupText": "Yedək",Based on learnings: the maintainer explicitly requested "please don't put the entry in the file for other languages" and the PR description states "subsequent commit removed empty placeholder keys from non-en/ur locales."
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@locales/az.js` around lines 119 - 121, Remove the three empty placeholder localization entries "downloadWallpaperText", "randomWallpaperText", and "clearWallpaperText" from the az locale object (they currently have empty string values); locate them in locales/az.js and delete those key/value pairs entirely so applyLanguage in scripts/languages.js can fall back to English via the existing || operator.locales/cs.js (1)
176-178:⚠️ Potential issue | 🟠 Major | ⚡ Quick winRemove these empty placeholder keys.
Following the maintainer's instruction and PR objective, delete these three entries entirely from the Czech locale. The English fallback will apply automatically when the keys are missing.
🔧 Proposed fix
"uploadWallpaperText": "Nahrát tapetu", -"downloadWallpaperText": "", -"randomWallpaperText": "", -"clearWallpaperText": "", "rangColor": "Vybrat barvu",Based on learnings: the maintainer explicitly requested "please don't put the entry in the file for other languages" and the PR description states "subsequent commit removed empty placeholder keys from non-en/ur locales."
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@locales/cs.js` around lines 176 - 178, Remove the three empty placeholder translation keys "downloadWallpaperText", "randomWallpaperText", and "clearWallpaperText" from the Czech locale file (delete those entries entirely); do not replace them with empty strings so the English fallback will apply automatically, and ensure no trailing commas or formatting issues remain after removal.locales/it.js (1)
150-152:⚠️ Potential issue | 🟠 Major | ⚡ Quick winRemove these empty placeholder keys.
Per the maintainer's guidance and the PR's removal objective, delete these three Italian locale entries. The fallback to English will work correctly when these keys are absent.
🔧 Proposed fix
"uploadWallpaperText": "Carica immagine", -"downloadWallpaperText": "", -"randomWallpaperText": "", -"clearWallpaperText": "", "backupText": "Backup",Based on learnings: the maintainer explicitly requested "please don't put the entry in the file for other languages" and the PR description states "subsequent commit removed empty placeholder keys from non-en/ur locales."
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@locales/it.js` around lines 150 - 152, Remove the three empty Italian locale keys "downloadWallpaperText", "randomWallpaperText", and "clearWallpaperText" from the locale object so the build falls back to English; delete those key/value lines and adjust surrounding commas to keep the JS object syntax valid (no dangling commas or missing separators).locales/pt.js (1)
157-159:⚠️ Potential issue | 🟠 Major | ⚡ Quick winRemove these empty placeholder keys.
Consistent with the maintainer's request and the stated PR goal, remove these three Portuguese entries entirely. English fallback will apply when the keys are omitted.
🔧 Proposed fix
"uploadWallpaperText": "Enviar Papel de Parede", -"downloadWallpaperText": "", -"randomWallpaperText": "", -"clearWallpaperText": "", "rangColor": "Escolher cor",Based on learnings: the maintainer explicitly requested "please don't put the entry in the file for other languages" and the PR description states "subsequent commit removed empty placeholder keys from non-en/ur locales."
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@locales/pt.js` around lines 157 - 159, Remove the three empty placeholder keys "downloadWallpaperText", "randomWallpaperText", and "clearWallpaperText" from the Portuguese locale object so English fallback is used; update the enclosing object so commas and trailing syntax remain valid after deletion and run a quick lint/parse to confirm locales/pt.js still exports a well-formed object.
♻️ Duplicate comments (3)
locales/ta.js (1)
157-159:⚠️ Potential issue | 🟠 Major | ⚡ Quick winRemove these empty placeholder keys.
Following the maintainer's guidance and PR objective, delete these three Tamil entries. The English fallback mechanism will apply when the keys are missing.
🔧 Proposed fix
"uploadWallpaperText": "பின்படத்தை பதிவேற்று", -"downloadWallpaperText": "", -"randomWallpaperText": "", -"clearWallpaperText": "", "rangColor": "நிறம் எடு",Based on learnings: the maintainer explicitly requested "please don't put the entry in the file for other languages" and the PR description states "subsequent commit removed empty placeholder keys from non-en/ur locales."
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@locales/ta.js` around lines 157 - 159, Remove the three empty Tamil localization keys "downloadWallpaperText", "randomWallpaperText", and "clearWallpaperText" from the locales/ta.js file so the English fallback is used; locate the object containing these keys (the Tamil export/locale object) and delete those key-value pairs entirely rather than leaving empty strings.locales/tr.js (1)
128-130:⚠️ Potential issue | 🟠 Major | ⚡ Quick winRemove these empty placeholder keys.
Per the maintainer's request and PR removal commit goal, delete these three Turkish entries. English fallback will correctly apply when these keys are absent.
🔧 Proposed fix
"uploadWallpaperText": "Duvar Kağıdı Yükle", -"downloadWallpaperText": "", -"randomWallpaperText": "", -"clearWallpaperText": "", "backupText": "Yedekleme",Based on learnings: the maintainer explicitly requested "please don't put the entry in the file for other languages" and the PR description states "subsequent commit removed empty placeholder keys from non-en/ur locales."
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@locales/tr.js` around lines 128 - 130, Remove the three empty Turkish localization keys "downloadWallpaperText", "randomWallpaperText", and "clearWallpaperText" from the locales object in tr.js so the English fallback is used; ensure you delete the entire key-value lines and verify the surrounding object still has valid JSON/JS object syntax (commas adjusted) after removal.locales/sv.js (1)
164-166:⚠️ Potential issue | 🟠 Major | ⚡ Quick winRemove these empty placeholder keys.
The maintainer explicitly requested on this file: "please don't put the entry in the file for other languages." Delete these three Swedish entries entirely so the English fallback applies.
🔧 Proposed fix
"uploadWallpaperText": "Ladda upp bakgrund", -"downloadWallpaperText": "", -"randomWallpaperText": "", -"clearWallpaperText": "", "rangColor": "Välj färg",Based on learnings: the maintainer explicitly requested "please don't put the entry in the file for other languages" and the PR description states "subsequent commit removed empty placeholder keys from non-en/ur locales."
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@locales/sv.js` around lines 164 - 166, Delete the three empty Swedish localization keys "downloadWallpaperText", "randomWallpaperText", and "clearWallpaperText" from the sv.js locale object so they no longer appear in the file; removing these placeholder entries will allow the English fallback to be used as requested by the maintainer.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@locales/az.js`:
- Around line 119-121: Remove the three empty placeholder localization entries
"downloadWallpaperText", "randomWallpaperText", and "clearWallpaperText" from
the az locale object (they currently have empty string values); locate them in
locales/az.js and delete those key/value pairs entirely so applyLanguage in
scripts/languages.js can fall back to English via the existing || operator.
In `@locales/cs.js`:
- Around line 176-178: Remove the three empty placeholder translation keys
"downloadWallpaperText", "randomWallpaperText", and "clearWallpaperText" from
the Czech locale file (delete those entries entirely); do not replace them with
empty strings so the English fallback will apply automatically, and ensure no
trailing commas or formatting issues remain after removal.
In `@locales/it.js`:
- Around line 150-152: Remove the three empty Italian locale keys
"downloadWallpaperText", "randomWallpaperText", and "clearWallpaperText" from
the locale object so the build falls back to English; delete those key/value
lines and adjust surrounding commas to keep the JS object syntax valid (no
dangling commas or missing separators).
In `@locales/pt.js`:
- Around line 157-159: Remove the three empty placeholder keys
"downloadWallpaperText", "randomWallpaperText", and "clearWallpaperText" from
the Portuguese locale object so English fallback is used; update the enclosing
object so commas and trailing syntax remain valid after deletion and run a quick
lint/parse to confirm locales/pt.js still exports a well-formed object.
In `@locales/sl.js`:
- Around line 119-121: Remove the three empty Slovenian i18n keys
"downloadWallpaperText", "randomWallpaperText", and "clearWallpaperText" from
locales/sl.js; locate these exact keys in the file and delete the key-value
lines so the fallback to English is used instead.
---
Duplicate comments:
In `@locales/sv.js`:
- Around line 164-166: Delete the three empty Swedish localization keys
"downloadWallpaperText", "randomWallpaperText", and "clearWallpaperText" from
the sv.js locale object so they no longer appear in the file; removing these
placeholder entries will allow the English fallback to be used as requested by
the maintainer.
In `@locales/ta.js`:
- Around line 157-159: Remove the three empty Tamil localization keys
"downloadWallpaperText", "randomWallpaperText", and "clearWallpaperText" from
the locales/ta.js file so the English fallback is used; locate the object
containing these keys (the Tamil export/locale object) and delete those
key-value pairs entirely rather than leaving empty strings.
In `@locales/tr.js`:
- Around line 128-130: Remove the three empty Turkish localization keys
"downloadWallpaperText", "randomWallpaperText", and "clearWallpaperText" from
the locales object in tr.js so the English fallback is used; ensure you delete
the entire key-value lines and verify the surrounding object still has valid
JSON/JS object syntax (commas adjusted) after removal.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 0fdab932-86a9-4837-92e6-4bfd1777da1e
📒 Files selected for processing (30)
locales/ar_SA.jslocales/az.jslocales/bn.jslocales/cs.jslocales/de.jslocales/el.jslocales/es.jslocales/fa.jslocales/fr.jslocales/hi.jslocales/hu.jslocales/idn.jslocales/it.jslocales/ja.jslocales/ko.jslocales/mr.jslocales/ne.jslocales/pl.jslocales/pt.jslocales/ru.jslocales/sl.jslocales/sv.jslocales/ta.jslocales/th.jslocales/tr.jslocales/uk.jslocales/uz.jslocales/vi.jslocales/zh.jslocales/zh_TW.js
💤 Files with no reviewable changes (19)
- locales/fr.js
- locales/zh.js
- locales/th.js
- locales/ne.js
- locales/ja.js
- locales/ko.js
- locales/hu.js
- locales/el.js
- locales/de.js
- locales/bn.js
- locales/hi.js
- locales/pl.js
- locales/ar_SA.js
- locales/mr.js
- locales/fa.js
- locales/ru.js
- locales/idn.js
- locales/uk.js
- locales/uz.js
✅ Files skipped from review due to trivial changes (1)
- locales/es.js
Aren't both Bing Wallpaper and Lorem Picsum backed by Unsplash? Just to clarify, this PR doesn't change how the background is rendered or set by the extension, it only ensures that when a user clicks download, they get the original, uncompressed quality. |
📌 Description
This PR introduces a premium Wallpaper Download Option and a floating Unsplash Photographer Attribution Pill for random backgrounds.
🌟 Key Changes
opacity: 0.4,cursor: not-allowed) and disables the download button on solid colors/uploads.rel="noopener noreferrer"protection to external links and temporary programmatically triggered downloads.aria-labelandaria-disabledtracking for screen readers."") in all 31 non-English locales for structural safety.ur.js) translations for all new wallpaper features.🎨 Visual Changes (Screenshots / Videos)
output_10mb.mp4
✅ Checklist
🤖 AI Assistance (Coding)
Summary
This PR adds a wallpaper download feature for Unsplash-backed random backgrounds and introduces a photographer attribution pill to credit the image source.
Key Changes
Core Wallpaper Download Functionality
downloadWallpaper()function that retrieves original, uncompressed Unsplash images by resolving Picsum metadata and validating Unsplash URLs/infoendpoint and persisted in IndexedDB asimageInfoisValidUnsplashUrl) ensures security by verifying photographer attribution linksState Management & Background Type Tracking
setBackground()to accept an optional background type parameter ("random","upload", or"color")updateBackgroundType()to replace the removedtoggleBackgroundType()data-bg-typeattribute on the body element to control UI stateloadImageAndDetails()to return photographer metadata alongside images and images/metadata are properly restored on page reloadUI Components
#wallpaperSource) in the bottom-right displaying photographer name and linking to their Unsplash profileLocalization
scripts/languages.jsto apply tooltips and aria-labels to the download button, random image trigger, and clear image buttonsStyling
Technical Details
rel="noopener noreferrer"for securityinfoDataparameter; metadata is cleared when not provided"upload"and clears attribution UI