feat(settings): unify backgrounds and menu card controls - #480
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe change replaces in-memory wallpaper caching with resolved-target Glide disk caching. It also adds a shared editor for game-menu card visibility and exposes the selector in Android settings with localized summaries. ChangesWallpaper caching
Game-menu card visibility
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant PcView
participant BackgroundSource
participant Glide
participant Storage
PcView->>BackgroundSource: Resolve current wallpaper target
BackgroundSource-->>PcView: Return cache key and target
PcView->>Glide: Load using disk-cache signature
Glide-->>PcView: Return decoded bitmap
PcView->>Glide: Retrieve cached wallpaper for saving
Glide-->>PcView: Return cached bitmap data
PcView->>Storage: Encode and write wallpaper
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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 `@app/src/main/java/com/limelight/preferences/BackgroundSource.kt`:
- Around line 131-150: Update the legacy URL handling in StreamSettings around
the migration/load flow to persist through BackgroundSource.KEY_API_URL rather
than writing legacy keys directly. For a nonblank URL, call
setActivePreservingExtras with BackgroundSource.Api; for a blank URL, call
setActive with BackgroundSource.Auto, ensuring KEY_SOURCE and resolved-target
cache state are updated.
🪄 Autofix
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: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 5aacdc48-9b8e-4ed1-8916-f1fb4463ad24
📒 Files selected for processing (9)
app/src/main/java/com/limelight/PcView.ktapp/src/main/java/com/limelight/gamemenu/GameMenu.ktapp/src/main/java/com/limelight/gamemenu/GameMenuCardVisibilityEditor.ktapp/src/main/java/com/limelight/preferences/BackgroundSource.ktapp/src/main/java/com/limelight/preferences/GameMenuCardsPreference.ktapp/src/main/java/com/limelight/preferences/StreamSettings.ktapp/src/main/res/values-zh-rCN/strings.xmlapp/src/main/res/values/strings.xmlapp/src/main/res/xml/preferences.xml
改了啥呀
BackgroundSource.ResolvedTarget,主页、设置页和保存原图共享同一目标与 UUID 缓存键。LruCache,PNG 编码移到 IO 线程,减少大图内存占用和主线程卡顿。GameMenuCardVisibilityEditor供设置页和串流内菜单共同使用。为啥要改
随机图片 API 对同一个 URL 的多次请求可能返回不同图片。原先主页、设置页、下载链路各自请求,导致设置背景或保存结果偶尔和主页不一样——这种会分身的杂鱼缓存状态该收拾掉啦。
另外,游戏菜单的卡片展示配置只藏在串流中的菜单里,不容易发现。现在可以在进入串流前直接配置,同时仍保留串流内即时调整。
用户影响
验证
git diff --check.\gradlew.bat :app:compileNonRootDebugKotlin :app:assembleNonRootDebugapp-nonRoot-debug.apkSummary by CodeRabbit
New Features
Bug Fixes