Skip to content

[MOB-4105] Add background image to Ecosia NTP#1032

Closed
Copilot wants to merge 33 commits intodevelopfrom
copilot/add-background-to-ecosian-ntp
Closed

[MOB-4105] Add background image to Ecosia NTP#1032
Copilot wants to merge 33 commits intodevelopfrom
copilot/add-background-to-ecosian-ntp

Conversation

Copy link
Copy Markdown

Copilot AI commented Feb 10, 2026

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

  • Added bundled wallpaper support: New bundledAssetName property to Wallpaper model for offline assets
  • Ecosia default wallpaper: Created Wallpaper.ecosiaDefault with bundled ntpBackground asset
  • First launch experience: Modified WallpaperStorageUtility.fetchCurrentWallpaper() to return Ecosia default on first launch
  • Codable support: Updated encoding/decoding to handle optional bundledAssetName field
  • Wallpaper configuration: Added MOZ_WALLPAPER_ASSET_URL to build configs pointing to hosted wallpaper metadata

Wallpaper Collection

  • Created docs/cdn/metadata/v1/wallpapers.json with 2 collections:
    • Ecosia Nature: 3 wallpapers (forest, ocean, mountains)
    • Ecosia Seasonal: 2 wallpapers (spring bloom, autumn leaves)
  • Downloaded placeholder cat images from cataas.com for testing
  • Documented image generation process in docs/WALLPAPER-IMAGE-GENERATION.md

Configuration

  • EcosiaDebug.xcconfig: Added MOZ_WALLPAPER_ASSET_URL configuration
  • Ecosia.xcconfig: Added MOZ_WALLPAPER_ASSET_URL configuration
  • Info.plist: Already maps MozWallpaperURLScheme to $(MOZ_WALLPAPER_ASSET_URL)

Debug Tools

Added comprehensive debug settings for testing and evaluation:

Firefox Debug Menu (Settings → Debug):

  • Show wallpaper onboarding - Presents the onboarding bottom sheet for evaluation
  • Reset wallpaper onboarding sheet - Resets the "seen" flag to test onboarding multiple times
  • Force wallpaper refresh - Clears cache & fetches latest metadata from network

Ecosia Debug Menu (Settings → Debug):

  • Debug: Force Wallpaper Refresh - Ecosia-specific version for Ecosia debug section

All wallpaper debug tools are grouped together in the Firefox debug section for easy access during development.

Documentation

  • Created comprehensive wallpaper system documentation:
    • docs/ntp-backgrounds/WALLPAPER-METADATA-REFRESH.md: How to clear wallpaper cache
    • docs/WALLPAPER-IMAGE-GENERATION.md: Image sourcing and generation process
    • docs/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?

  • Pros: Helps users discover feature, showcases Ecosia's nature themes, increases engagement
  • Cons: Firefox removed it (possibly low engagement), adds first-run complexity, may interrupt user flow
  • 📄 Full Analysis: See docs/ntp-backgrounds/WALLPAPER-ONBOARDING.md for complete details

Options if implementing:

  1. Recreate Firefox's original bottom sheet approach
  2. Integrate into Ecosia's existing onboarding flow (Welcome.swift)
  3. Show simpler settings icon hint/tooltip
  4. Delay until 2nd or 3rd app launch

🧪 Testing Plan

  • Verify Ecosia default wallpaper shows on first launch
  • Test wallpaper customization appears in Settings → Homepage
  • Verify downloadable wallpapers can be selected
  • Test offline behavior with bundled default
  • Verify proper fallback when network unavailable
  • Test wallpaper onboarding via debug menu
  • Verify force refresh debug setting works
  • Test on iOS 15+ devices
  • Evaluate onboarding UX with team

📸 Screenshots

To be added

📋 Checklist

  • Code follows project style guidelines
  • Added debug tools for testing and evaluation
  • Manual testing completed
  • Wallpaper onboarding documented and accessible via debug menu
  • UI tested on multiple device sizes
  • Offline functionality verified
  • Debug logs will be removed before merge
  • Comprehensive documentation created
  • Replace placeholder cat images with production wallpapers from Ecosia Desktop wallpapers
  • Team decision on wallpaper onboarding for production
  • Fix MOZ_WALLPAPER_ASSET_URL build configuration (hardcoded temporarily)
  • Ready for code review

🔍 Review Notes

The wallpaper feature is now fully functional with comprehensive debug tools! Users can:

  • See Ecosia default wallpaper on first launch
  • Access wallpaper settings in Settings → Homepage → Wallpaper
  • Select from 2 collections with 5 total wallpapers
  • Download and apply wallpapers
  • NEW: Preview and evaluate wallpaper onboarding via debug menu
  • Force refresh metadata via debug settings (available in both Firefox and Ecosia debug sections)

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

  • Hardcoded URLs: Both metadata and image URLs are currently hardcoded in WallpaperURLProvider.swift because the MOZ_WALLPAPER_ASSET_URL build config isn't being read correctly from Info.plist. This should be fixed when build config expertise is available (Monday).
  • Placeholder Images: Currently using cat images from cataas.com for testing. These should be replaced with actual Ecosia nature wallpapers from the desktop extension.

📚 Related Documentation

  • docs/ntp-backgrounds/WALLPAPER-METADATA-REFRESH.md - Cache management
  • docs/WALLPAPER-IMAGE-GENERATION.md - Image sourcing guide
  • docs/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.md and .github/copilot-instructions.md both link to AGENTS.md) to ensure consistent behavior across different AI coding assistants.

Copilot AI changed the title [WIP] Add background to ecosia NTP [NOTICKET] Add background image to Ecosia NTP Feb 10, 2026
Copilot AI requested a review from falkorichter February 10, 2026 13:13
@falkorichter
Copy link
Copy Markdown

falkorichter commented Feb 10, 2026

got the background to render
Screenshot 2026-02-10 at 15 26 05
iPad 13"is not rendered correctly:
Screenshot 2026-02-10 at 15 31 02
but this is a regression, all of homepage is not rendering correctly:
Screenshot 2026-02-10 at 15 31 59
also in iPad A16 sim
Screenshot 2026-02-10 at 15 36 52

@falkorichter
Copy link
Copy Markdown

checking out https://stackoverflow.com/questions/79853172/what-is-floatingbarhostingviewfloatingbarcontainer-in-debugger

Temporary you can use UIDesignRequiresCompatibility on YES added on your info.plist, this will ignore, for now, the liquid glass behavior –
Sergio Quintero
CommentedFeb 3 at 14:21

func getNTPBackgroundConfiguration() -> WallpaperConfiguration {
let backgroundImage = UIImage(named: "ntpBackground")

return WallpaperConfiguration(
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@copilot can you show me some details on WallpaperConfiguration, is this ever used with all the options, are landscapeImage and portraitImage ever set somewhere?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

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 a Wallpaper model
  • WallpaperMiddleware uses this constructor to create configurations from user-selected wallpapers
  • The Wallpaper model 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.portraitImage

Other properties:

  • textColor, cardColor, logoTextColor are used to theme UI elements on top of the wallpaper
  • hasImage indicates 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,
Copy link
Copy Markdown

@falkorichter falkorichter Feb 12, 2026

Choose a reason for hiding this comment

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

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.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

this had nothing to do with the feature

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I might merge this to develop

@falkorichter falkorichter force-pushed the copilot/add-background-to-ecosian-ntp branch from 68d46c6 to e2ed030 Compare February 12, 2026 13:45
@falkorichter falkorichter changed the base branch from develop to fix/webserver-swift-concurrency February 12, 2026 13:45
@falkorichter
Copy link
Copy Markdown

PR Dependency Update

This PR now depends on #1035 (WebServer Swift concurrency fixes).

Merge order:

  1. First merge [NOTICKET] Fix WebServer Swift concurrency warnings #1035 (WebServer fixes)
  2. Then rebase this PR onto main
  3. Finally merge this PR

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

@falkorichter falkorichter changed the base branch from fix/webserver-swift-concurrency to develop February 12, 2026 13:59
Comment thread firefox-ios/Client/Ecosia/BuildSettingsConfigurations/Ecosia.xcconfig Outdated
@falkorichter falkorichter force-pushed the copilot/add-background-to-ecosian-ntp branch 3 times, most recently from 1fbc019 to 9c980eb Compare February 13, 2026 13:33
@falkorichter falkorichter changed the title [NOTICKET] Add background image to Ecosia NTP [MOB-4105] Add background image to Ecosia NTP Feb 17, 2026
@falkorichter falkorichter marked this pull request as ready for review February 24, 2026 11:32
@falkorichter falkorichter requested review from a team and d4r1091 February 24, 2026 15:33
@falkorichter falkorichter enabled auto-merge (squash) February 27, 2026 11:29
@d4r1091 d4r1091 force-pushed the copilot/add-background-to-ecosian-ntp branch from 0039f9a to f56f1f9 Compare March 11, 2026 23:07
@d4r1091
Copy link
Copy Markdown
Member

d4r1091 commented Mar 23, 2026

Closing the following as per a reworked solution.
Thanks for your input and progress on this @falkorichter !

@d4r1091 d4r1091 closed this Mar 23, 2026
auto-merge was automatically disabled March 23, 2026 13:46

Pull request was closed

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.

4 participants