Skip to content

feat: support mixing API anime wallpapers with local backgrounds - #31

Open
XRYua wants to merge 2 commits into
masterfrom
codex/add-background-customization-options
Open

feat: support mixing API anime wallpapers with local backgrounds#31
XRYua wants to merge 2 commits into
masterfrom
codex/add-background-customization-options

Conversation

@XRYua

@XRYua XRYua commented Apr 4, 2026

Copy link
Copy Markdown
Owner

Motivation

  • Allow the wallpaper system to randomly use high-quality online images (e.g. anime-related image API) while still including local backgrounds in the same random pool.
  • Provide a config toggle so users can choose between using only remote images or mixing remote images with local images for banner and fullscreen wallpapers.

Description

  • Added mixWithLocal?: boolean to banner.imageApi in src/types/config.ts to control whether API images are mixed with local images.
  • Updated src/config.ts example to show an anime-oriented text API endpoint and enabled mixWithLocal in the example comment to illustrate usage.
  • Extended banner loading in src/layouts/MainGridLayout.astro to fetch the API text response, validate lines, and merge remote URLs with local desktop/mobile image arrays when mixWithLocal is true, preserving per-device (desktop/mobile) logic.
  • Updated fullscreen wallpaper loading in src/components/misc/FullscreenWallpaper.astro to use the same merge behavior so fullscreen mode gains parity with banner mode.

Testing

  • Ran pnpm -s exec astro check; the check executed and types were regenerated, but the repository still reports pre-existing TypeScript errors unrelated to this change (duplicate identifier in src/pages/[...page].astro), and a warning about an inline script in src/layouts/Layout.astro (the warning is informational about is:inline).
  • The changes themselves did not introduce new type errors beyond the pre-existing ones detected by astro check.

Codex Task

@vercel

vercel Bot commented Apr 4, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
mizuki Ready Ready Preview, Comment Apr 4, 2026 2:58pm

@gemini-code-assist

Copy link
Copy Markdown

Important

Installation incomplete: to start using Gemini Code Assist, please ask the organization owner(s) to visit the Gemini Code Assist Admin Console and sign the Terms of Services.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1a3649df93

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +78 to +82
const localDesktop = toArray(localSrc.desktop);
const localMobile = toArray(localSrc.mobile);
return {
desktop: [...normalizedApiImages, ...localDesktop],
mobile: [...normalizedApiImages, ...localMobile],

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve cross-device fallback in banner image merging

When mixWithLocal is enabled and banner.src provides only one side (desktop or mobile), this merge branch appends local images only from the explicitly defined side and leaves the other side with API images only. The banner source handling otherwise supports cross-device fallback (mobile falling back to desktop and vice versa), so mixed mode now drops local images for one device class in valid single-side configs.

Useful? React with 👍 / 👎.

Comment on lines +32 to +36
const localDesktop = toArray(localSrc.desktop);
const localMobile = toArray(localSrc.mobile);
return {
desktop: [...normalizedApiImages, ...localDesktop],
mobile: [...normalizedApiImages, ...localMobile],

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve cross-device fallback in fullscreen image merging

The fullscreen merge path has the same regression: with mixWithLocal enabled and config.src defining only one side, the undefined side gets no local fallback and ends up using API images only. This diverges from the component’s normal fallback behavior for asymmetric desktop/mobile configs, so mixed mode can silently exclude intended local wallpapers on one device type.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant