Skip to content

[MOB-4150][MOB-4151] Hide NTP referral row, news section; fix shortcuts width and row cap#1060

Merged
falkorichter merged 10 commits intocopilot/add-background-to-ecosian-ntpfrom
browse-MOB-4150/remove-referrrals
Feb 27, 2026
Merged

[MOB-4150][MOB-4151] Hide NTP referral row, news section; fix shortcuts width and row cap#1060
falkorichter merged 10 commits intocopilot/add-background-to-ecosian-ntpfrom
browse-MOB-4150/remove-referrrals

Conversation

@falkorichter
Copy link
Copy Markdown

@falkorichter falkorichter commented Feb 23, 2026

Summary

Closes MOB-4150 — Remove referrals
Closes MOB-4151 — Remove news
Closes MOB-3999 - Update shortcuts to leverage Firefox implementation

Deactivates the NTP referral row and Ecosia news section by hiding them behind debug toggles (off by default). Also fixes layout inconsistencies: section widths are now consistent across all Ecosia NTP sections, and the shortcuts row is capped at 5 tiles to avoid a cramped layout.

What changed

  • Referral row hidden by defaultNTPImpactCellViewModel.infoItemSections gates the second row (referral) behind ToggleNTPReferralRow.isEnabled (UserDefaults "NTPShowReferralRow", default false)
  • News section hidden by defaultEcosiaHomepageAdapter.shouldShowNews() gates behind ToggleNTPNewsSection.isEnabled (UserDefaults "NTPShowNewsSection", default false); .ecosiaNews also removed from CustomizableNTPSettingConfig.allCases so the user-facing NTP customization toggle disappears
  • Debug toggles — two new entries in the Ecosia Debug settings section (tap version number 5× to reveal): Debug: Toggle - Show NTP Referral Row and Debug: Toggle - Show NTP News Section
  • Settings root fixAppSettingsTableViewController.generateSettings() was only building Firefox sections; now calls getEcosiaSettingsSectionsShowingDebug() so Ecosia debug sections are actually shown
  • Bookmarks — no Ecosia gate applied; controlled by the existing Firefox user setting (Homepage → Bookmarks toggle)
  • Consistent section widths — news and shortcuts (top sites) now use getEcosiaSectionInsets (same as impact/referral/library/header), so all sections share the same horizontal margins on iPad and iPhone landscape
  • Shortcuts row capTopSitesSectionLayoutProvider.UX.maxCards = 5 caps the computed tile count; previously the algorithm filled available width greedily and could produce 7+ icons per row on a wide iPad

Architecture

See docs/ntp-remove-referrals/README.md for full architecture, file-by-file breakdown, and testing plan.

Files changed

File Change Firefox file?
Client/Frontend/Settings/Main/AppSettingsTableViewController.swift Wire generateSettings() to Ecosia sections ⚠️ Yes
Client/Frontend/Home/Homepage/HomepageDimensionImplementation.swift Apply maxCards cap ⚠️ Yes
Client/Frontend/Home/Homepage/Layout/TopSitesSectionLayoutProvider.swift Add maxCards = 5 constant ⚠️ Yes
Client/Ecosia/UI/NTP/Impact/NTPImpactCellViewModel.swift Gate referral row Ecosia
Client/Ecosia/Frontend/Home/EcosiaHomepageAdapter.swift Gate news section Ecosia
Client/Ecosia/UI/NTP/Customization/CustomizableNTPSettingConfig.swift Remove .ecosiaNews from allCases Ecosia
Client/Ecosia/Settings/EcosiaDebugSettings.swift Add ToggleNTPReferralRow, ToggleNTPNewsSection Ecosia
Client/Ecosia/Extensions/AppSettingsTableViewController+Ecosia.swift Register new debug settings Ecosia
Client/Ecosia/Extensions/HomepageSectionLayoutProvider+Ecosia.swift Unify widths for news and shortcuts sections Ecosia

Deferred

  • Dynamic wallpaper text coloursWallpaper already decodes text-color and logo-text-color from the JSON into UIColor? properties. Wiring these into NTPImpactRowView, NTPLogoCell, and the news section header (replacing the current hardcoded .white) was prototyped and reverted pending design sign-off on contrast/accessibility across all wallpapers. Follow-up ticket needed.

Test plan

  • Launch app → NTP → referral row not visible in Impact section (only trees + investment)
  • Launch app → NTP → news section not shown
  • NTP customization row → news toggle not present
  • Settings → tap version 5× → Debug section appears (not DEBUG)
  • Debug: Toggle - Show NTP Referral Row → tap → referral row appears on NTP
  • Debug: Toggle - Show NTP News Section → tap → news section appears on NTP
  • Toggle both back OFF → sections disappear; state persists across app restart
  • iPad: all NTP sections (impact, news, shortcuts, library) have the same horizontal margins
  • Shortcuts row shows at most 5 tiles on any device width

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings February 23, 2026 19:57

This comment was marked as outdated.

@falkorichter falkorichter force-pushed the browse-MOB-4150/remove-referrrals branch 2 times, most recently from e049bb0 to aa8c55f Compare February 24, 2026 09:20
@d4r1091 d4r1091 changed the base branch from main to develop February 24, 2026 09:26
@falkorichter falkorichter changed the base branch from develop to copilot/add-background-to-ecosian-ntp February 24, 2026 11:36
@falkorichter falkorichter self-assigned this Feb 24, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 10 out of 13 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (3)

docs/ntp-remove-referrals/README.md:3

  • The document title says "Remove Referrals, News and Bookmarks Sections (MOB-4150)", but the changes describe hiding referrals (MOB-4150) and news (MOB-4151), plus library shortcuts (not the Firefox bookmarks section). Consider updating the title to reflect the correct tickets and the actual sections being gated so the doc remains a reliable reference.
# NTP: Remove Referrals, News and Bookmarks Sections (MOB-4150)

## Overview

firefox-ios/Client/Ecosia/Frontend/Home/EcosiaHomepageAdapter.swift:199

  • ToggleNTPNewsSection currently only gates whether the .ecosiaNews section is appended, but newsViewModel still subscribes in NTPNewsCellViewModel.init and refreshData(...) is still called unconditionally. This means news can still be fetched/updated even when the section is hidden by default. Consider lazy/conditional initialization of newsViewModel and gating refresh/loading paths behind the same toggle to avoid background work and network usage when the feature is disabled.
    private func shouldShowNews() -> Bool {
        // Ecosia: Hidden by default (MOB-4150); re-enable via debug menu
        guard ToggleNTPNewsSection.isEnabled else { return false }
        return User.shared.showEcosiaNews
    }

firefox-ios/Client/Ecosia/UI/NTP/Customization/CustomizableNTPSettingConfig.swift:16

  • The comment references MOB-4150 for hiding the news setting, but the PR description ties news removal to MOB-4151. Updating the ticket reference here would avoid confusion when tracking why the case is excluded from allCases.
    // Ecosia: ecosiaNews hidden by default (MOB-4150); removed from the customization UI
    case ecosiaNews

    // Ecosia: manually provide allCases so ecosiaNews is excluded from the NTP customization row while
    // the case itself remains for analytics and User.shared.showEcosiaNews persistence
    static var allCases: [CustomizableNTPSettingConfig] { [.topSites, .climateImpact] }

Comment on lines 105 to +109
let minCardsConstant = TopSitesSectionLayoutProvider.UX.minCards
let maxCardsConstant = TopSitesSectionLayoutProvider.UX.maxCards
let tilesPerRowCount = numberOfTiles < minCardsConstant ? minCardsConstant : numberOfTiles

return tilesPerRowCount
// Ecosia: Respect maxCards cap so the row never exceeds 5 tiles (MOB-4150)
return min(tilesPerRowCount, maxCardsConstant)
Copy link

Copilot AI Feb 24, 2026

Choose a reason for hiding this comment

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

This change caps numberOfTopSitesPerRow to 5, but there are existing unit tests (e.g. HomepageDimensionCalculatorTests) that currently assert higher values for iPad / landscape iPhone (7/8/10). Those tests will fail unless updated to reflect the new max-cards behavior (or made conditional if the cap is Ecosia-only).

Copilot generated this review using guidance from repository custom instructions.
@falkorichter falkorichter force-pushed the browse-MOB-4150/remove-referrrals branch 2 times, most recently from 2cc146a to aa239c4 Compare February 24, 2026 15:37
@falkorichter falkorichter requested a review from a team February 27, 2026 10:16
@falkorichter falkorichter force-pushed the browse-MOB-4150/remove-referrrals branch from 9d9f643 to 6afa5eb Compare February 27, 2026 10:49
@falkorichter falkorichter force-pushed the browse-MOB-4150/remove-referrrals branch from 6afa5eb to 88b0313 Compare February 27, 2026 10:51
@falkorichter falkorichter merged commit 223c60c into copilot/add-background-to-ecosian-ntp Feb 27, 2026
@falkorichter falkorichter deleted the browse-MOB-4150/remove-referrrals branch February 27, 2026 11:25
falkorichter added a commit that referenced this pull request Feb 27, 2026
…ts width and row cap (#1060)

homepage updates see #1060 for details
d4r1091 pushed a commit that referenced this pull request Mar 4, 2026
…ts width and row cap (#1060)

homepage updates see #1060 for details
d4r1091 pushed a commit that referenced this pull request Mar 7, 2026
…ts width and row cap (#1060)

homepage updates see #1060 for details
d4r1091 pushed a commit that referenced this pull request Mar 11, 2026
…ts width and row cap (#1060)

homepage updates see #1060 for details
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