Skip to content

Commit

Permalink
Merge branch 'main' into sam/ios-14-cleanup
Browse files Browse the repository at this point in the history
* main:
  Update Xcode version to 15.4 (#3142)
  remove pixels for keyboard toggle (#3135)
  Keep Remote Messages in database if they were shown (#3136)
  • Loading branch information
samsymons committed Jul 25, 2024
2 parents f48e2a6 + dc763bf commit 6532274
Show file tree
Hide file tree
Showing 20 changed files with 97 additions and 103 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
17 changes: 0 additions & 17 deletions Core/PixelEvent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -447,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 @@ -685,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 @@ -792,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 @@ -1165,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
2 changes: 1 addition & 1 deletion DuckDuckGo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -10190,7 +10190,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
3 changes: 2 additions & 1 deletion DuckDuckGo/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,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
22 changes: 11 additions & 11 deletions DuckDuckGo/Debug.storyboard
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="22505" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="fgi-g1-scz">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="fgi-g1-scz">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22504"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22685"/>
<capability name="Named colors" minToolsVersion="9.0"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/>
Expand Down Expand Up @@ -264,7 +264,7 @@
<rect key="frame" x="0.0" y="0.0" width="383.5" height="44.5"/>
<autoresizingMask key="autoresizingMask"/>
</tableViewCellContentView>
<listContentConfiguration key="contentConfiguration" text="Remote Messages" secondaryText=""/>
<listContentConfiguration key="contentConfiguration" text="Remote Messaging Framework" secondaryText=""/>
<connections>
<segue destination="xFp-fx-HYn" kind="show" id="HbW-NY-KFi"/>
</connections>
Expand Down Expand Up @@ -300,7 +300,7 @@
<rect key="frame" x="0.0" y="841" width="414" height="44.5"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="AgK-xW-xB6" id="onY-PV-AQp">
<rect key="frame" x="0.0" y="0.0" width="370" height="44.5"/>
<rect key="frame" x="0.0" y="0.0" width="382" height="44.5"/>
<autoresizingMask key="autoresizingMask"/>
</tableViewCellContentView>
<listContentConfiguration key="contentConfiguration" text="Internal User State" secondaryText=""/>
Expand Down Expand Up @@ -923,17 +923,17 @@
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<prototypes>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" reuseIdentifier="ConfigurationURLTableViewCell" id="i6Y-Di-PX3" customClass="ConfigurationURLTableViewCell" customModule="DuckDuckGo" customModuleProvider="target">
<rect key="frame" x="0.0" y="50" width="414" height="88"/>
<rect key="frame" x="0.0" y="50" width="414" height="88.5"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="i6Y-Di-PX3" id="qn4-gq-5fa">
<rect key="frame" x="0.0" y="0.0" width="414" height="88"/>
<rect key="frame" x="0.0" y="0.0" width="414" height="88.5"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" distribution="equalSpacing" spacing="8" translatesAutoresizingMaskIntoConstraints="NO" id="pKD-Xm-Eu1">
<rect key="frame" x="20" y="11" width="374" height="66"/>
<rect key="frame" x="20" y="11" width="374" height="66.5"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" distribution="fillEqually" translatesAutoresizingMaskIntoConstraints="NO" id="j3A-OZ-DWy">
<rect key="frame" x="0.0" y="0.0" width="44" height="66"/>
<rect key="frame" x="0.0" y="0.0" width="44" height="66.5"/>
<subviews>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" insetsLayoutMarginsFromSafeArea="NO" text="Title" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="gKw-J7-XIW">
<rect key="frame" x="0.0" y="0.0" width="44" height="22"/>
Expand All @@ -943,22 +943,22 @@
<nil key="highlightedColor"/>
</label>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" insetsLayoutMarginsFromSafeArea="NO" text="Subtitle" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="UrI-B0-rWf">
<rect key="frame" x="0.0" y="22" width="44" height="21.5"/>
<rect key="frame" x="0.0" y="22" width="44" height="22"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="12"/>
<color key="textColor" name="accent"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="6RK-ug-mZa">
<rect key="frame" x="0.0" y="44" width="44" height="22"/>
<rect key="frame" x="0.0" y="44.5" width="44" height="22"/>
<fontDescription key="fontDescription" type="system" pointSize="12"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</stackView>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="right" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Nkj-yK-cgm">
<rect key="frame" x="350" y="0.0" width="24" height="66"/>
<rect key="frame" x="350" y="0.0" width="24" height="66.5"/>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
<state key="normal" image="Reload-24"/>
</button>
Expand Down
13 changes: 0 additions & 13 deletions DuckDuckGo/HomeMessageView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ struct HomeMessageView: View {
ZStack(alignment: .topTrailing) {
VStack(spacing: 8) {
Group {
topText

if case .promoSingleAction = viewModel.modelType {
title
.daxTitle3()
Expand Down Expand Up @@ -114,17 +112,6 @@ struct HomeMessageView: View {
.contentShape(Rectangle())
}

private var topText: some View {
Group {
if let topText = viewModel.topText {
Text(topText)
.font(Font(uiFont: Const.Font.topText))
} else {
EmptyView()
}
}
}

private var image: some View {
Group {
if let image = viewModel.image {
Expand Down
5 changes: 0 additions & 5 deletions DuckDuckGo/HomeMessageViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,6 @@ struct HomeMessageViewModel {
}
}

var topText: String? {
// actually unused!
return nil
}

var title: String {
switch modelType {
case .small(let titleText, _):
Expand Down
13 changes: 11 additions & 2 deletions DuckDuckGo/HomeMessageViewSectionRenderer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,16 @@ class HomeMessageViewSectionRenderer: NSObject, HomeViewSectionRenderer {
params
}
case .remoteMessage(let remoteMessage):
let onDidAppear = { [weak self] in
self?.homePageConfiguration.didAppear(message)
}

// call didAppear here to support marking messages as shown when they appear on the new tab page
// as a result of refreshing a config while the user was on a new tab page already.
onDidAppear()

return HomeMessageViewModelBuilder.build(for: remoteMessage, with: privacyProDataReporter) { [weak self] action in

guard let action,
let self else { return }

Expand Down Expand Up @@ -160,8 +169,8 @@ class HomeMessageViewSectionRenderer: NSObject, HomeViewSectionRenderer {
}

}
} onDidAppear: { [weak self] in
self?.homePageConfiguration.didAppear(message)
} onDidAppear: {
onDidAppear()
}
}
}
Expand Down
10 changes: 0 additions & 10 deletions DuckDuckGo/KeyboardSettingsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,20 +45,10 @@ class KeyboardSettingsViewController: UITableViewController {

@IBAction func onNewTabValueChanged(_ sender: Any) {
settings.onNewTab = newTabToggle.isOn
if settings.onNewTab {
Pixel.fire(pixel: .settingsKeyboardOnNewTabOn)
} else {
Pixel.fire(pixel: .settingsKeyboardOnNewTabOff)
}
}

@IBAction func onAppLaunchValueChanged(_ sender: Any) {
settings.onAppLaunch = appLaunchToggle.isOn
if settings.onAppLaunch {
Pixel.fire(pixel: .settingsKeyboardOnAppLaunchOn)
} else {
Pixel.fire(pixel: .settingsKeyboardOnAppLaunchOff)
}
}

}
Expand Down
7 changes: 6 additions & 1 deletion DuckDuckGo/NewTabPageMessagesModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ final class NewTabPageMessagesModel: ObservableObject {
params
}
case .remoteMessage(let remoteMessage):

// call didAppear here to support marking messages as shown when they appear on the new tab page
// as a result of refreshing a config while the user was on a new tab page already.
didAppear(message)

return HomeMessageViewModelBuilder.build(for: remoteMessage, with: privacyProDataReporter) { [weak self] action in
guard let action,
let self else { return }
Expand Down Expand Up @@ -126,7 +131,7 @@ final class NewTabPageMessagesModel: ObservableObject {

}
} onDidAppear: { [weak self] in
self?.homePageMessagesConfiguration.didAppear(message)
self?.didAppear(message)
}
}
}
Expand Down
Loading

0 comments on commit 6532274

Please sign in to comment.