[MOB-4105] Add background image to Ecosia NTP#1032
Conversation
|
checking out https://stackoverflow.com/questions/79853172/what-is-floatingbarhostingviewfloatingbarcontainer-in-debugger
|
| func getNTPBackgroundConfiguration() -> WallpaperConfiguration { | ||
| let backgroundImage = UIImage(named: "ntpBackground") | ||
|
|
||
| return WallpaperConfiguration( |
There was a problem hiding this comment.
@copilot can you show me some details on WallpaperConfiguration, is this ever used with all the options, are landscapeImage and portraitImage ever set somewhere?
There was a problem hiding this comment.
Yes, WallpaperConfiguration is actively used with all its properties in the existing Firefox wallpaper system:
How it's used:
init(wallpaper: Wallpaper)constructor (line 72-82) populates ALL properties from aWallpapermodelWallpaperMiddlewareuses this constructor to create configurations from user-selected wallpapers- The
Wallpapermodel fetches separate portrait/landscape images from storage based on device type (iPad vs iPhone)
Image selection:
WallpaperBackgroundView.currentWallpaperImage() (line 61-66) picks the appropriate image:
let isLandscape = UIDevice.current.orientation.isLandscape
return isLandscape ?
wallpaperConfiguration.landscapeImage :
wallpaperConfiguration.portraitImageOther properties:
textColor,cardColor,logoTextColorare used to theme UI elements on top of the wallpaperhasImageindicates whether a wallpaper is selected (vs default/none)
For Ecosia NTP:
I'm using the same image for both orientations since the background is a simple gradient that scales well. Firefox's wallpaper feature uses different images per orientation to optimize for specific aspect ratios.
| textColor: .green, | ||
| cardColor: .purple, | ||
| logoTextColor: .purple) | ||
| logoTextColor: .purple, |
There was a problem hiding this comment.
note to self: what is this file?
| } | ||
|
|
||
| // Hop to the MainActor for the actual handler logic | ||
| // Hop to the MainActor for the actual handler logic. |
There was a problem hiding this comment.
this had nothing to do with the feature
68d46c6 to
e2ed030
Compare
PR Dependency UpdateThis PR now depends on #1035 (WebServer Swift concurrency fixes). Merge order:
The WebServer changes were originally part of this branch but have been separated for independent review since they're unrelated to the wallpaper feature. 🤖 Updated with Claude Code |
1fbc019 to
9c980eb
Compare
Refactor imageURLWith to use dynamic URL scheme instead of hardcoded base URL.
0039f9a to
f56f1f9
Compare
|
Closing the following as per a reworked solution. |
Pull request was closed




MOB-4105 Add NTP Background with Ecosia Default Wallpaper
🎯 Summary
Implements NTP (New Tab Page) background feature for Ecosia iOS with a hybrid approach: bundled default wallpaper for offline-first experience + downloadable wallpaper collection for customization.
🔗 Jira Ticket
https://ecosia.atlassian.net/browse/MOB-4105
📝 What Changed
Core Implementation
bundledAssetNameproperty toWallpapermodel for offline assetsWallpaper.ecosiaDefaultwith bundledntpBackgroundassetWallpaperStorageUtility.fetchCurrentWallpaper()to return Ecosia default on first launchbundledAssetNamefieldMOZ_WALLPAPER_ASSET_URLto build configs pointing to hosted wallpaper metadataWallpaper Collection
docs/cdn/metadata/v1/wallpapers.jsonwith 2 collections:docs/WALLPAPER-IMAGE-GENERATION.mdConfiguration
MOZ_WALLPAPER_ASSET_URLconfigurationMOZ_WALLPAPER_ASSET_URLconfigurationMozWallpaperURLSchemeto$(MOZ_WALLPAPER_ASSET_URL)Debug Tools
Added comprehensive debug settings for testing and evaluation:
Firefox Debug Menu (Settings → Debug):
Ecosia Debug Menu (Settings → Debug):
All wallpaper debug tools are grouped together in the Firefox debug section for easy access during development.
Documentation
docs/ntp-backgrounds/WALLPAPER-METADATA-REFRESH.md: How to clear wallpaper cachedocs/WALLPAPER-IMAGE-GENERATION.md: Image sourcing and generation processdocs/ntp-backgrounds/WALLPAPER-ONBOARDING.md: Complete reverse-engineering of wallpaper onboarding system🔮 Future Considerations
Wallpaper Onboarding
Firefox had a wallpaper onboarding bottom sheet that appeared once for new users to help them discover the wallpaper feature. This was removed from Firefox's homepage rebuild in December 2024, but the infrastructure remains functional.
Current Status: Available for evaluation via debug menu ("Show wallpaper onboarding")
Decision needed: Should Ecosia implement this for production users?
docs/ntp-backgrounds/WALLPAPER-ONBOARDING.mdfor complete detailsOptions if implementing:
🧪 Testing Plan
📸 Screenshots
To be added
📋 Checklist
MOZ_WALLPAPER_ASSET_URLbuild configuration (hardcoded temporarily)🔍 Review Notes
The wallpaper feature is now fully functional with comprehensive debug tools! Users can:
Wallpaper Onboarding Evaluation
The onboarding bottom sheet can now be tested via Settings → Debug → Show wallpaper onboarding. This allows the team to evaluate whether this feature would benefit Ecosia users before making a production decision.
Temporary Workarounds
WallpaperURLProvider.swiftbecause theMOZ_WALLPAPER_ASSET_URLbuild config isn't being read correctly from Info.plist. This should be fixed when build config expertise is available (Monday).📚 Related Documentation
docs/ntp-backgrounds/WALLPAPER-METADATA-REFRESH.md- Cache managementdocs/WALLPAPER-IMAGE-GENERATION.md- Image sourcing guidedocs/ntp-backgrounds/WALLPAPER-ONBOARDING.md- Complete onboarding system analysis🎨 Production Wallpapers
Ecosia's desktop extension has beautiful nature wallpapers that should be used for production:
Note: This PR includes AI assistant configuration using symbolic links (
CLAUDE.mdand.github/copilot-instructions.mdboth link toAGENTS.md) to ensure consistent behavior across different AI coding assistants.