Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add feature flag for improved New Tab Page #2980

Merged
merged 8 commits into from
Jun 25, 2024
Merged

Add feature flag for improved New Tab Page #2980

merged 8 commits into from
Jun 25, 2024

Conversation

dus7
Copy link
Contributor

@dus7 dus7 commented Jun 21, 2024

Task/Issue URL: https://app.asana.com/0/1206226850447395/1207630604691910/f
Tech Design URL:
CC:

Description:

Defines an internal flag to keep existing implementation and make new one possible to enable via debug menu. This allows to do incremental development changes into main branch.

Steps to test this PR:

  1. Make sure there are no changes to Home Screen with and without internal user flag set.
  2. Setting local flag via debug menu should display a new home tab controller with "Empty" text in a new tab.

Internal references:

Software Engineering Expectations
Technical Design Template

@dus7 dus7 changed the base branch from main to mariusz/ntp-sections June 21, 2024 11:03
@github-actions github-actions bot added bot: not in app board Added by automation for pull requests with tasks not added to iOS App Board Asana project and removed bot: not in app board Added by automation for pull requests with tasks not added to iOS App Board Asana project labels Jun 21, 2024
@dus7 dus7 marked this pull request as ready for review June 21, 2024 12:31
@dus7 dus7 changed the base branch from mariusz/ntp-sections to main June 21, 2024 14:46
@dus7 dus7 requested a review from brindy June 21, 2024 14:46
@@ -0,0 +1,56 @@
//
// ImprovedHomeViewController.swift
Copy link
Contributor

Choose a reason for hiding this comment

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

SwiftLint - presume you renamed the file or something during dev


import SwiftUI

final class HomeTabViewController: UIHostingController<HomeTabView>, HomeViewControllerProtocol {
Copy link
Contributor

Choose a reason for hiding this comment

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

Wonder if we should just go all in on calling it 'new tab page' ? e.g.

NewTabPageViewController

?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, probably. I was hesitating and left one similar to what's now, but maybe it's better to keep consistency with internal names.

Copy link
Contributor

@brindy brindy left a comment

Choose a reason for hiding this comment

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

Hey, looks good and works. Needs some renaming, SwiftLint, and resolve conflicts. Give me a ping for a follow up review.


import UIKit

protocol HomeViewControllerProtocol: UIViewController {
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's avoid calling protocols "Protocol" - I know we have some in the code base already, but imo they need refactored. From the API Design Guidelines:

  • Protocols that describe what something is should read as nouns (e.g. Collection).

  • Protocols that describe a capability should be named using the suffixes able, ible, or ing (e.g. Equatable, ProgressReporting).

I think the protocol here is simply NewTabPage but open to suggestion.

@@ -41,6 +42,7 @@ class RootDebugViewController: UITableViewController {
case openVanillaBrowser = 670
case resetSendCrashLogs = 671
case refreshConfig = 672
case homeTabImprovements = 674
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not overly keen on this. Would be better to capture the cell as an outlet and check that. However, looks like we're invested in this approach. We should probably refactor this debug view controller at some point. :)

(No action required)

var homeController: HomeViewControllerProtocol? {
homeViewController ?? homeTabViewController
var newTabPageViewController: NewTabPageViewController?
var homeController: NewTabPage? {
Copy link
Contributor Author

@dus7 dus7 Jun 24, 2024

Choose a reason for hiding this comment

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

I left homeController here deliberately to avoid extensive renaming. It'll be straighten out after the old code is cleaned up.

@dus7 dus7 requested a review from brindy June 24, 2024 18:06
Copy link
Contributor

@brindy brindy left a comment

Choose a reason for hiding this comment

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

FYI I pushed a swiftlint fix

LGTM!

@dus7 dus7 merged commit fd14256 into main Jun 25, 2024
14 checks passed
@dus7 dus7 deleted the mariusz/ntp-flag branch June 25, 2024 10:23
samsymons added a commit that referenced this pull request Jul 4, 2024
* main:
  Update VPN metadata to include entitlement (#3002)
  Remove noise from wake pixel (#2986)
  Release 7.126.0-1 (#2998)
  [DuckPlayer] - 2. Overlay Views (#2989)
  update translations for autocomplete settings changes (#2995)
  Fixes goBack() behavior (#2996)
  Re-add the autocomplete settings toggle pixels (#2991)
  Update BSK with autofill 12.0.1 (#2983)
  Final batch of new autofill pixels (#2977)
  don't attach a new home screen if autoclear is in progress (#2988)
  Custom DNS for VPN (#2971)
  Duck Player settings page (#2990)
  Add feature flag for improved New Tab Page  (#2980)
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.

None yet

2 participants