Skip to content

Commit

Permalink
Merge branch 'main' into sam/remove-network-protection-compilation-flag
Browse files Browse the repository at this point in the history
# By Dominik Kapusta (2) and others
# Via GitHub
* main:
  Add favorites empty state tooltip (#3119)
  Bump submodules/privacy-reference-tests from `a603ff9` to `afb4f61` (#3113)
  iOS 14 deprecation cleanup (#3098)
  Update Xcode version to 15.4 (#3142)
  remove pixels for keyboard toggle (#3135)
  Keep Remote Messages in database if they were shown (#3136)

# Conflicts:
#	DuckDuckGo/SettingsViewModel.swift
  • Loading branch information
samsymons committed Jul 26, 2024
2 parents db1345b + 0e1366d commit abae6e0
Show file tree
Hide file tree
Showing 116 changed files with 448 additions and 739 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/adhoc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ on:

jobs:
make-adhoc:
runs-on: macos-13-xlarge
runs-on: macos-14-xlarge
name: Make ad-hoc build

steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/alpha.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ on:

jobs:
make-alpha:
runs-on: macos-13-xlarge
runs-on: macos-14-xlarge
name: Make TestFlight Alpha Build
timeout-minutes: 30

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/end-to-end.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
jobs:
end-to-end-tests:
name: End to end Tests
runs-on: macos-13-xlarge
runs-on: macos-14-xlarge

steps:
- name: Check out the code
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
jobs:
atb-ui-tests:
name: ATB UI Tests
runs-on: macos-13-xlarge
runs-on: macos-14-xlarge
timeout-minutes: 30

steps:
Expand Down Expand Up @@ -68,7 +68,7 @@ jobs:

fingerprinting-ui-tests:
name: Fingerprinting UI Tests
runs-on: macos-13-xlarge
runs-on: macos-14-xlarge
timeout-minutes: 30

steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:

name: Unit Tests

runs-on: macos-13-xlarge
runs-on: macos-14-xlarge
timeout-minutes: 15

outputs:
Expand Down Expand Up @@ -132,7 +132,7 @@ jobs:
# Dependabot doesn't have access to all secrets, so we skip this job
if: github.actor != 'dependabot[bot]'

runs-on: macos-13-xlarge
runs-on: macos-14-xlarge
timeout-minutes: 30

steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ on:
jobs:
make-release:
if: github.event.action == 0 || (github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'Merge triggers release')) # empty string returns 0; for case when workflow is triggered manually
runs-on: macos-13-xlarge
runs-on: macos-14-xlarge
name: Make App Store Connect Release

steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/sync-end-to-end.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
jobs:
build-for-sync-end-to-end-tests:
name: Build for Sync End To End Tests
runs-on: macos-13-xlarge
runs-on: macos-14-xlarge
timeout-minutes: 30

steps:
Expand Down Expand Up @@ -68,7 +68,7 @@ jobs:
sync-end-to-end-tests:
name: Sync End To End Tests
needs: build-for-sync-end-to-end-tests
runs-on: macos-13-xlarge
runs-on: macos-14-xlarge
timeout-minutes: 90
strategy:
matrix:
Expand Down
2 changes: 1 addition & 1 deletion .xcode-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
15.2
15.4
7 changes: 0 additions & 7 deletions Core/DefaultVariantManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,6 @@ public struct VariantIOS: Variant {
.contains(where: { Locale.current.regionCode == $0 }) }

static let inEnglish = { return Locale.current.languageCode == "en" }

static let iOS15 = { () -> Bool in
if #available(iOS 15, *) {
return true
}
return false
}
}

/// This variant is used for returning users to separate them from really new users.
Expand Down
21 changes: 0 additions & 21 deletions Core/PixelEvent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,6 @@ extension Pixel {

case downloadsSharingPredownloadedLocalFile

case downloadAttemptToOpenBLOBviaJS

case jsAlertShown

case featureFlaggingInternalUserAuthenticated
Expand Down Expand Up @@ -449,11 +447,8 @@ extension Pixel {
case dbSaveExcludedHTTPSDomainsError
case dbSaveBloomFilterError
case dbRemoteMessagingSaveConfigError
case dbRemoteMessagingInvalidateConfigError
case dbRemoteMessagingSaveMessageError
case dbRemoteMessagingUpdateMessageShownError
case dbRemoteMessagingUpdateMessageStatusError
case dbRemoteMessagingDeleteScheduledMessageError
case dbLocalAuthenticationError

case configurationFetchInfo
Expand Down Expand Up @@ -687,12 +682,6 @@ extension Pixel {
case settingsAccessibilityOpen
case settingsAccessiblityTextSize

// Other settings
case settingsKeyboardOnNewTabOn
case settingsKeyboardOnNewTabOff
case settingsKeyboardOnAppLaunchOn
case settingsKeyboardOnAppLaunchOff

// Web pixels
case privacyProOfferMonthlyPriceClick
case privacyProOfferYearlyPriceClick
Expand Down Expand Up @@ -794,11 +783,6 @@ extension Pixel.Event {
case .settingsAutoconsentOn: return "m_settings_autoconsent_on"
case .settingsAutoconsentOff: return "m_settings_autoconsent_off"

case .settingsKeyboardOnNewTabOn: return "m_settings_keyboard_on-new-tab_on"
case .settingsKeyboardOnNewTabOff: return "m_settings_keyboard_on-new-tab_off"
case .settingsKeyboardOnAppLaunchOn: return "m_settings_keyboard_on-app-launch_on"
case .settingsKeyboardOnAppLaunchOff: return "m_settings_keyboard_on-app-launch_off"

case .browsingMenuOpened: return "mb"
case .browsingMenuNewTab: return "mb_tb"
case .browsingMenuAddToBookmarks: return "mb_abk"
Expand Down Expand Up @@ -934,8 +918,6 @@ extension Pixel.Event {

case .downloadsSharingPredownloadedLocalFile: return "m_downloads_sharing_predownloaded_local_file"

case .downloadAttemptToOpenBLOBviaJS: return "m_download_attempt_to_open_blob_js"

case .jsAlertShown: return "m_js_alert_shown"

case .featureFlaggingInternalUserAuthenticated: return "m_internal-user_authenticated"
Expand Down Expand Up @@ -1169,11 +1151,8 @@ extension Pixel.Event {
case .dbSaveExcludedHTTPSDomainsError: return "m_d_dbsw"
case .dbSaveBloomFilterError: return "m_d_dbsb"
case .dbRemoteMessagingSaveConfigError: return "m_d_db_rm_save_config"
case .dbRemoteMessagingInvalidateConfigError: return "m_d_db_rm_invalidate_config"
case .dbRemoteMessagingSaveMessageError: return "m_d_db_rm_save_message"
case .dbRemoteMessagingUpdateMessageShownError: return "m_d_db_rm_update_message_shown"
case .dbRemoteMessagingUpdateMessageStatusError: return "m_d_db_rm_update_message_status"
case .dbRemoteMessagingDeleteScheduledMessageError: return "m_d_db_rm_delete_scheduled_message"
case .dbLocalAuthenticationError: return "m_d_local_auth_error"

case .debugBookmarksMigratedMoreThanOnce: return "m_debug_bookmarks_migrated-more-than-once"
Expand Down
18 changes: 13 additions & 5 deletions DuckDuckGo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@
6F64AA5D2C4920D200CF4489 /* ShortcutAccessoryView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F64AA5C2C4920D200CF4489 /* ShortcutAccessoryView.swift */; };
6F64AA5F2C49463C00CF4489 /* ShortcutsModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F64AA5E2C49463C00CF4489 /* ShortcutsModel.swift */; };
6F655BE22BAB289E00AC3597 /* DefaultTheme.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F655BE12BAB289E00AC3597 /* DefaultTheme.swift */; };
6F691CCA2C4979EC002E9553 /* FavoritesTooltip.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F691CC92C4979EC002E9553 /* FavoritesTooltip.swift */; };
6F8496412BC3D8EE00ADA54E /* OnboardingButtonsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F8496402BC3D8EE00ADA54E /* OnboardingButtonsView.swift */; };
6F96FF102C2B128500162692 /* NewTabPageCustomizeButtonView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F96FF0F2C2B128500162692 /* NewTabPageCustomizeButtonView.swift */; };
6FA3438F2C3D3BC300470677 /* Favorite.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6FA3438E2C3D3BC300470677 /* Favorite.swift */; };
Expand Down Expand Up @@ -950,7 +951,6 @@
F15531962BF215F60029ED04 /* SubscriptionTestingUtilities in Frameworks */ = {isa = PBXBuildFile; productRef = F15531952BF215F60029ED04 /* SubscriptionTestingUtilities */; };
F1564F032B7B915F00D454A6 /* AppDelegate+SKAD4.swift in Sources */ = {isa = PBXBuildFile; fileRef = F1564F022B7B915F00D454A6 /* AppDelegate+SKAD4.swift */; };
F15D43201E706CC500BF2CDC /* AutocompleteViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F15D431F1E706CC500BF2CDC /* AutocompleteViewController.swift */; };
F15E9F3E2BEE128200DEFDDE /* SubscriptionManageriOS14.swift in Sources */ = {isa = PBXBuildFile; fileRef = F15E9F3D2BEE128200DEFDDE /* SubscriptionManageriOS14.swift */; };
F1617C131E572E0300DEDCAF /* TabSwitcherViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F1617C121E572E0300DEDCAF /* TabSwitcherViewController.swift */; };
F1617C151E57336D00DEDCAF /* TabManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = F1617C141E57336D00DEDCAF /* TabManager.swift */; };
F1617C191E573EA800DEDCAF /* TabSwitcherDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = F1617C181E573EA800DEDCAF /* TabSwitcherDelegate.swift */; };
Expand Down Expand Up @@ -1417,6 +1417,7 @@
6F64AA5C2C4920D200CF4489 /* ShortcutAccessoryView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShortcutAccessoryView.swift; sourceTree = "<group>"; };
6F64AA5E2C49463C00CF4489 /* ShortcutsModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShortcutsModel.swift; sourceTree = "<group>"; };
6F655BE12BAB289E00AC3597 /* DefaultTheme.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DefaultTheme.swift; sourceTree = "<group>"; };
6F691CC92C4979EC002E9553 /* FavoritesTooltip.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FavoritesTooltip.swift; sourceTree = "<group>"; };
6F8496402BC3D8EE00ADA54E /* OnboardingButtonsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OnboardingButtonsView.swift; sourceTree = "<group>"; };
6F96FF0F2C2B128500162692 /* NewTabPageCustomizeButtonView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NewTabPageCustomizeButtonView.swift; sourceTree = "<group>"; };
6FA3438E2C3D3BC300470677 /* Favorite.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Favorite.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -2665,7 +2666,6 @@
F1564F022B7B915F00D454A6 /* AppDelegate+SKAD4.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "AppDelegate+SKAD4.swift"; sourceTree = "<group>"; };
F159BDA31F0BDB5A00B4A01D /* TabViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TabViewController.swift; sourceTree = "<group>"; };
F15D431F1E706CC500BF2CDC /* AutocompleteViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AutocompleteViewController.swift; sourceTree = "<group>"; };
F15E9F3D2BEE128200DEFDDE /* SubscriptionManageriOS14.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SubscriptionManageriOS14.swift; sourceTree = "<group>"; };
F1617C121E572E0300DEDCAF /* TabSwitcherViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TabSwitcherViewController.swift; sourceTree = "<group>"; };
F1617C141E57336D00DEDCAF /* TabManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TabManager.swift; sourceTree = "<group>"; };
F1617C181E573EA800DEDCAF /* TabSwitcherDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TabSwitcherDelegate.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -3490,6 +3490,14 @@
name = NewTabPage;
sourceTree = "<group>";
};
6F691CC82C4979DD002E9553 /* Tooltip */ = {
isa = PBXGroup;
children = (
6F691CC92C4979EC002E9553 /* FavoritesTooltip.swift */,
);
name = Tooltip;
sourceTree = "<group>";
};
6FA3438D2C3D3BB800470677 /* Model */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -3568,6 +3576,7 @@
6FE127412C204DE900EB5724 /* Favorites */ = {
isa = PBXGroup;
children = (
6F691CC82C4979DD002E9553 /* Tooltip */,
6FA343902C3D3C2500470677 /* Item */,
6FA3438D2C3D3BB800470677 /* Model */,
6FB2A6782C2C5B9E004D20C8 /* EmptyState */,
Expand Down Expand Up @@ -4747,7 +4756,6 @@
children = (
F1FDC92F2BF4E0B3006B1435 /* SubscriptionEnvironment+Default.swift */,
D60170BB2BA32DD6001911B5 /* Subscription.swift */,
F15E9F3D2BEE128200DEFDDE /* SubscriptionManageriOS14.swift */,
D6D95CE42B6DA3F200960317 /* AsyncHeadlessWebview */,
D664C7952B289AA000CBFA76 /* Subscription.storekit */,
D664C7932B289AA000CBFA76 /* ViewModel */,
Expand Down Expand Up @@ -6696,7 +6704,6 @@
3132FA2627A0784600DD7A12 /* FilePreviewHelper.swift in Sources */,
9820FF502244FECC008D4782 /* UIScrollViewExtension.swift in Sources */,
8540BD5423D8D5080057FDD2 /* PreserveLoginsAlert.swift in Sources */,
F15E9F3E2BEE128200DEFDDE /* SubscriptionManageriOS14.swift in Sources */,
1E87615928A1517200C7C5CE /* PrivacyDashboardViewController.swift in Sources */,
6F03CAFE2C32DD08004179A8 /* HomePageMessagesConfiguration.swift in Sources */,
EE9D68D12AE00CF300B55EF4 /* NetworkProtectionVPNSettingsView.swift in Sources */,
Expand Down Expand Up @@ -6803,6 +6810,7 @@
9FE08BD62C2A60CD001D5EBC /* MetricBuilder.swift in Sources */,
1E1626072968413B0004127F /* ViewExtension.swift in Sources */,
31A42566285A0A6300049386 /* FaviconViewModel.swift in Sources */,
6F691CCA2C4979EC002E9553 /* FavoritesTooltip.swift in Sources */,
D65625952C22D382006EF297 /* TabViewController.swift in Sources */,
8C4838B5221C8F7F008A6739 /* GestureToolbarButton.swift in Sources */,
EE276BEA2A77F823009167B6 /* NetworkProtectionRootViewController.swift in Sources */,
Expand Down Expand Up @@ -10190,7 +10198,7 @@
repositoryURL = "https://github.com/DuckDuckGo/BrowserServicesKit";
requirement = {
kind = exactVersion;
version = 175.0.1;
version = 176.0.0;
};
};
9F8FE9472BAE50E50071E372 /* XCRemoteSwiftPackageReference "lottie-spm" */ = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,17 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/DuckDuckGo/BrowserServicesKit",
"state" : {
"revision" : "6c095d0c62dc00cf848ee100912b12767c92683b",
"version" : "175.0.1"
"revision" : "fc03a7c3bf6cd25cf286f8f5a6cfe9ec3d35305a",
"version" : "176.0.0"
}
},
{
"identity" : "content-scope-scripts",
"kind" : "remoteSourceControl",
"location" : "https://github.com/duckduckgo/content-scope-scripts",
"state" : {
"revision" : "dc26bfc6e33ad9c79a719b7f21d5ca0564db1859",
"version" : "6.3.0"
"revision" : "097e545c737db78cb1d253a87a9acd6dd8ad8497",
"version" : "6.4.0"
}
},
{
Expand Down Expand Up @@ -138,7 +138,7 @@
{
"identity" : "swift-argument-parser",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-argument-parser",
"location" : "https://github.com/apple/swift-argument-parser.git",
"state" : {
"revision" : "0fbc8848e389af3bb55c182bc19ca9d5dc2f255b",
"version" : "1.4.0"
Expand Down
2 changes: 1 addition & 1 deletion DuckDuckGo/ActionMessageView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ class ActionMessageView: UIView {
presentationLocation: PresentationLocation = .withBottomBar(andAddressBarBottom: false),
onAction: @escaping () -> Void = {},
onDidDismiss: @escaping () -> Void = {}) {
guard let window = UIApplication.shared.windows.filter({ $0.isKeyWindow }).first else { return }
guard let window = UIApplication.shared.firstKeyWindow else { return }

dismissAllMessages()

Expand Down
10 changes: 1 addition & 9 deletions DuckDuckGo/AdAttribution/AdAttributionFetcher.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,6 @@ struct DefaultAdAttributionFetcher: AdAttributionFetcher {
}

func fetch() async -> AdServicesAttributionResponse? {
guard #available(iOS 14.3, *) else {
return nil
}

var lastToken: String?

for _ in 0..<Constant.maxRetries {
Expand Down Expand Up @@ -123,11 +119,7 @@ struct DefaultAdAttributionFetcher: AdAttributionFetcher {

extension AdAttributionFetcher {
static func fetchAttributionToken() throws -> String {
if #available(iOS 14.3, *) {
return try AAAttribution.attributionToken()
} else {
throw AdAttributionFetcherError.attributionUnsupported
}
return try AAAttribution.attributionToken()
}
}

Expand Down
13 changes: 2 additions & 11 deletions DuckDuckGo/AnimatableTypingText.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,8 @@ struct AnimatableTypingText: View {
.frame(maxWidth: .infinity, alignment: .leading)
.visibility(.invisible)

if #available(iOS 15, *) {
Text(AttributedString(model.typedAttributedText))
.frame(maxWidth: .infinity, alignment: .leading)
} else {
Text(model.typedAttributedText.string)
.frame(maxWidth: .infinity, alignment: .leading)
}
Text(AttributedString(model.typedAttributedText))
.frame(maxWidth: .infinity, alignment: .leading)
}
.onChange(of: startAnimating.wrappedValue, perform: { shouldAnimate in
if shouldAnimate {
Expand Down Expand Up @@ -128,10 +123,6 @@ final class AnimatableTypingTextModel: ObservableObject {
private func showCharacter() {

func attributedTypedString(forTypedChars typedChars: [String.Element]) -> NSAttributedString {
guard #available(iOS 15, *) else {
return NSAttributedString(string: String(typedChars))
}

let chars = Array(text)
let untypedChars = chars[typedChars.count ..< chars.count]
let combined = NSMutableAttributedString(string: String(typedChars))
Expand Down
11 changes: 5 additions & 6 deletions DuckDuckGo/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,8 @@ import WebKit
UILabel.appearance(whenContainedInInstancesOf: [UIAlertController.self]).numberOfLines = 0
}

private func refreshRemoteMessages() {
/// It's public in order to allow refreshing on demand via Debug menu. Otherwise it shouldn't be called from outside.
func refreshRemoteMessages() {
Task {
try? await remoteMessagingClient.fetchAndProcess(using: remoteMessagingClient.store)
}
Expand Down Expand Up @@ -787,7 +788,7 @@ import WebKit
}

private func tryToObtainOverlayWindow() {
for window in UIApplication.shared.windows where window.rootViewController is BlankSnapshotViewController {
for window in UIApplication.shared.foregroundSceneWindows where window.rootViewController is BlankSnapshotViewController {
overlayWindow = window
return
}
Expand Down Expand Up @@ -985,10 +986,8 @@ extension AppDelegate: UNUserNotificationCenterDelegate {
Task {
if case .success(let hasEntitlements) = await accountManager.hasEntitlement(forProductName: .networkProtection),
hasEntitlements {
if #available(iOS 15, *) {
let networkProtectionRoot = NetworkProtectionRootViewController()
presentSettings(with: networkProtectionRoot)
}
let networkProtectionRoot = NetworkProtectionRootViewController()
presentSettings(with: networkProtectionRoot)
} else {
(window?.rootViewController as? MainViewController)?.segueToPrivacyPro()
}
Expand Down
Loading

0 comments on commit abae6e0

Please sign in to comment.