Skip to content

feat(desktop): add categorized wallpaper sections with theme-default first - #1882

Merged
jaylfc merged 1 commit into
jaylfc:devfrom
hognek:feat/wallpaper-picker-categorized-sections
Jul 17, 2026
Merged

feat(desktop): add categorized wallpaper sections with theme-default first#1882
jaylfc merged 1 commit into
jaylfc:devfrom
hognek:feat/wallpaper-picker-categorized-sections

Conversation

@hognek

@hognek hognek commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Summary

Refactors the WallpaperPicker to show categorized sections, with the active theme's default wallpaper pre-selected and shown first.

Changes

  • theme-store.ts: Added WallpaperSection type, exported Wallpaper interface, added themeDefaultWallpaperId store field (populated in keepTheme/restoreActiveTheme), added getWallpapersBySection() returning four sections: Theme default, Built-in, Your wallpapers (placeholder), Browse online (placeholder)
  • WallpaperPicker.tsx: Rebuilt with sectioned layout — each section has a heading, theme-default shows a badge when it matches the current wallpaper, built-in grid preserved, empty states for user/online sections. Animated slider controls and overlay toggle unchanged.
  • Tests: 36 tests pass (12 theme-store + 7 wallpaper + 17 picker) covering sections, deduplication, theme-default pre-selection, fallback behavior, and empty states.

Fixes #864 C1
Tasks: t_0d30f061 (kanban)
Tests: 36/36 pass (npx vitest run)

…first

- Add WallpaperSection type and export Wallpaper interface from theme-store
- Add themeDefaultWallpaperId store field, populated in keepTheme/restoreActiveTheme
- Add getWallpapersBySection() returning Theme default / Built-in / Your wallpapers / Browse online
- Rebuild WallpaperPicker with sectioned layout, badge for theme-default, empty states
- Add theme-default pre-selection when current wallpaper matches theme's declared default
- Keep animated slider controls and overlay toggle unchanged

Refs: jaylfc#864
@hognek
hognek marked this pull request as ready for review July 17, 2026 16:24
@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@hognek, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 51 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: b5d5221a-7f3e-494b-8444-261a98f20c04

📥 Commits

Reviewing files that changed from the base of the PR and between 336e34a and b8385af.

📒 Files selected for processing (5)
  • desktop/src/components/WallpaperPicker.test.tsx
  • desktop/src/components/WallpaperPicker.tsx
  • desktop/src/stores/__tests__/wallpaper.test.ts
  • desktop/src/stores/theme-store.test.ts
  • desktop/src/stores/theme-store.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@gitar-bot

gitar-bot Bot commented Jul 17, 2026

Copy link
Copy Markdown

Important

You are using the Gitar free plan. Upgrade to unlock code review, CI analysis, auto-apply, custom automations, and more.

Gitar

} = useThemeStore();
const wallpapers = getWallpapers();
const sections = getWallpapersBySection();
const themeDefaultId = themeDefaultWallpaperId[activeThemeId] || "graphite";

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

WARNING: Duplicated themeDefaultId derivation can disagree with the store

This re-derives the theme-default id (themeDefaultWallpaperId[activeThemeId] || "graphite") independently of getWallpapersBySection, which already computes it (theme-store.ts:309-312). The two can diverge: the store resolves an unknown/missing themeDefaultId back to graphite for the section items (line 311-312 fallback), but isThemeDefault here keeps the raw string. If a theme's defaultWallpaperId is a non-existent id, the section silently shows graphite while the "Theme default" badge (line 157-159) can never appear because wallpaperId === themeDefaultId is compared against the invalid string. Prefer exposing the resolved theme-default id from getWallpapersBySection (e.g. as a field on the section, or a small getThemeDefaultWallpaperId() helper) so the badge and the section contents share one source of truth.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

const state = useThemeStore.getState();
// The theme's declared default wallpaper id, or the global fallback.
const themeDefaultId =
state.themeDefaultWallpaperId[state.activeThemeId] || "graphite";

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

SUGGESTION: Consider validating defaultWallpaperId against WALLPAPERS

themeDefaultId falls back to "graphite" only if the active theme has no declared default. If a theme declares a defaultWallpaperId that is not in WALLPAPERS (e.g. a typo in a custom/agent theme), themeDefaultWp silently falls back to graphite (line 311-312), but themeDefaultId still holds the invalid value. The component then compares the active wallpaperId against that invalid string, so the badge logic never matches. Either guard defaultWallpaperId when it is set (fall back to graphite only when the id is missing or unknown), or have the component consume the resolved id rather than re-deriving it.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

@kilo-code-bot

kilo-code-bot Bot commented Jul 17, 2026

Copy link
Copy Markdown

Code Review Summary

Status: 2 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 1
Issue Details (click to expand)

WARNING

File Line Issue
desktop/src/components/WallpaperPicker.tsx 106 themeDefaultId re-derived in the component independently of getWallpapersBySection; the two can disagree on an unknown defaultWallpaperId, silently showing graphite in the section while the "Theme default" badge never appears.

SUGGESTION

File Line Issue
desktop/src/stores/theme-store.ts 309 defaultWallpaperId is not validated against WALLPAPERS; an invalid id falls back to graphite for the section contents but keeps the raw string for the component's badge check.
Files Reviewed (5 files)
  • desktop/src/components/WallpaperPicker.tsx - 1 issue
  • desktop/src/components/WallpaperPicker.test.tsx - 0 issues
  • desktop/src/stores/theme-store.ts - 1 issue
  • desktop/src/stores/theme-store.test.ts - 0 issues
  • desktop/src/stores/__tests__/wallpaper.test.ts - 0 issues

Fix these issues in Kilo Cloud


Reviewed by hy3:free · Input: 77.3K · Output: 5.7K · Cached: 179.1K

@jaylfc
jaylfc merged commit 45e7f1b into jaylfc:dev Jul 17, 2026
5 checks passed
@hognek
hognek deleted the feat/wallpaper-picker-categorized-sections branch July 17, 2026 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants