Skip to content

[MOB-3548] Fix for Default Browser Promo#1041

Open
TimNowaczynski wants to merge 1 commit intomainfrom
tn-MOB-3548-default-browser-promo-layout-fix
Open

[MOB-3548] Fix for Default Browser Promo#1041
TimNowaczynski wants to merge 1 commit intomainfrom
tn-MOB-3548-default-browser-promo-layout-fix

Conversation

@TimNowaczynski
Copy link
Copy Markdown

@TimNowaczynski TimNowaczynski commented Feb 13, 2026

MOB-3548

Edit: Okay I went over things again and found a solution I'm happy with, this is how it looks now:

Simulator Screenshot - iPad (A16) - 2026-02-25 at 15 36 17

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

This PR attempts to fix the Default Browser Promo display on iPad by removing the fixed preferredContentSize constraint. The change allows the formSheet modal to auto-size its height based on content instead of being constrained to 600 points. However, the PR description indicates the developer is still unhappy with the top spacing, suggesting the change doesn't fully address the intended issue.

Changes:

  • Removed preferredContentSize = .init(width: 544, height: 600) for iPad presentation in DefaultBrowserViewController

@@ -123,7 +123,6 @@ final class DefaultBrowserViewController: UIViewController, Themeable {
self.delegate = delegate
if traitCollection.userInterfaceIdiom == .pad {
modalPresentationStyle = .formSheet
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

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

This UI change lacks snapshot test coverage. The repository has a comprehensive snapshot testing infrastructure (see firefox-ios/EcosiaTests/SnapshotTests/) and similar UI components like NTP have snapshot tests. Consider adding snapshot tests for the DefaultBrowserViewController to verify the visual appearance on both iPhone and iPad, especially since this PR is modifying the iPad presentation behavior.

Copilot uses AI. Check for mistakes.
@@ -123,7 +123,6 @@ final class DefaultBrowserViewController: UIViewController, Themeable {
self.delegate = delegate
if traitCollection.userInterfaceIdiom == .pad {
modalPresentationStyle = .formSheet
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

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

Removing preferredContentSize allows the formSheet to auto-size based on content, but this creates inconsistency with other similar modal presentations in the codebase. EcosiaNavigation.swift uses preferredContentSize = .init(width: 544, height: .max) for similar iPad formSheet presentation, and WhatsNewViewController also sets preferredContentSize for iPad. Consider whether this should use .max for height instead of removing it entirely, which would allow the content to size vertically while maintaining a consistent width with other modals.

Suggested change
modalPresentationStyle = .formSheet
modalPresentationStyle = .formSheet
preferredContentSize = .init(width: 544, height: .max)

Copilot uses AI. Check for mistakes.
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.

So from my perspective I think that is not as important as having a working version in place. But if we wanna have consistency here I think we would have to adjust the design somehow since it would not fit otherwise? 🤔

Comment thread firefox-ios/Client/Ecosia/UI/NTP/DefaultBrowserViewController.swift
@TimNowaczynski TimNowaczynski force-pushed the tn-MOB-3548-default-browser-promo-layout-fix branch from ef045c3 to 26bfd2c Compare February 17, 2026 16:37
@TimNowaczynski
Copy link
Copy Markdown
Author

TimNowaczynski commented Feb 17, 2026

I update the screenshot in the initial post, it looks good now I think. I also restrictedf the change to iPad only so I don't accidentially introduce unwanted side effects.

There is also a lint error, but I don't think that was me:

Linting 'NTPImpactRowView.swift' (2098/2222)
Error: Lines should not have trailing whitespace (trailing_whitespace)

Edit: In fact I found trailing whitespace within my changes and maybe it was never really in NTPImpactRowView.swift 🤔 - Anyways the error is gone :)

@TimNowaczynski TimNowaczynski force-pushed the tn-MOB-3548-default-browser-promo-layout-fix branch from 8e54533 to 680fbed Compare February 25, 2026 14:04
contentView.addSubview(afterView)

if traitCollection.userInterfaceIdiom == .pad {
waves.contentMode = .scaleToFill
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.

Without this the waves don't really align over the width of the dialog, looking a bit off.

@TimNowaczynski TimNowaczynski force-pushed the tn-MOB-3548-default-browser-promo-layout-fix branch 4 times, most recently from 698367d to 56b427e Compare March 6, 2026 10:52
@TimNowaczynski TimNowaczynski force-pushed the tn-MOB-3548-default-browser-promo-layout-fix branch from 56b427e to 083e72c Compare March 17, 2026 11:23
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