Skip to content

Commit

Permalink
Merge branch 'release/7.149.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
miasma13 committed Dec 12, 2024
2 parents 1560b5e + da81425 commit 1827ce9
Show file tree
Hide file tree
Showing 11 changed files with 138 additions and 52 deletions.
2 changes: 2 additions & 0 deletions Core/PixelEvent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -938,6 +938,7 @@ extension Pixel {
case openAIChatBefore10min
case openAIChatAfter10min
case aiChatNoRemoteSettingsFound(settings: String)
case openAIChatFromAddressBar

// MARK: Lifecycle
case appDidTransitionToUnexpectedState
Expand Down Expand Up @@ -1877,6 +1878,7 @@ extension Pixel.Event {
case .openAIChatBefore10min: return "m_aichat_open_before_10_min"
case .aiChatNoRemoteSettingsFound(let settings):
return "m_aichat_no_remote_settings_found-\(settings.lowercased())"
case .openAIChatFromAddressBar: return "m_aichat_addressbar_icon"

// MARK: Lifecycle
case .appDidTransitionToUnexpectedState: return "m_debug_app-did-transition-to-unexpected-state"
Expand Down
64 changes: 32 additions & 32 deletions DuckDuckGo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -9670,7 +9670,7 @@
CODE_SIGN_ENTITLEMENTS = PacketTunnelProvider/PacketTunnelProvider.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_TEAM = HKE973VLUW;
GCC_C_LANGUAGE_STANDARD = gnu11;
GENERATE_INFOPLIST_FILE = YES;
Expand Down Expand Up @@ -9707,7 +9707,7 @@
CODE_SIGN_IDENTITY = "iPhone Distribution";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = HKE973VLUW;
GCC_C_LANGUAGE_STANDARD = gnu11;
Expand Down Expand Up @@ -9797,7 +9797,7 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 2;
GCC_C_LANGUAGE_STANDARD = gnu11;
INFOPLIST_FILE = ShareExtension/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
Expand All @@ -9824,7 +9824,7 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = HKE973VLUW;
GCC_C_LANGUAGE_STANDARD = gnu11;
Expand Down Expand Up @@ -9972,7 +9972,7 @@
CODE_SIGN_ENTITLEMENTS = DuckDuckGo/DuckDuckGo.entitlements;
CODE_SIGN_IDENTITY = "iPhone Distribution";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 2;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_ASSET_PATHS = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = HKE973VLUW;
Expand All @@ -9998,7 +9998,7 @@
CODE_SIGN_ENTITLEMENTS = DuckDuckGo/DuckDuckGo.entitlements;
CODE_SIGN_IDENTITY = "iPhone Distribution";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 2;
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = HKE973VLUW;
INFOPLIST_FILE = DuckDuckGo/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
Expand Down Expand Up @@ -10065,7 +10065,7 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 2;
DEAD_CODE_STRIPPING = NO;
GCC_C_LANGUAGE_STANDARD = gnu11;
INFOPLIST_FILE = Widgets/Info.plist;
Expand Down Expand Up @@ -10099,7 +10099,7 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 2;
DEAD_CODE_STRIPPING = NO;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = HKE973VLUW;
Expand Down Expand Up @@ -10132,7 +10132,7 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 2;
GCC_C_LANGUAGE_STANDARD = gnu11;
INFOPLIST_FILE = OpenAction/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
Expand Down Expand Up @@ -10162,7 +10162,7 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = HKE973VLUW;
GCC_C_LANGUAGE_STANDARD = gnu11;
Expand Down Expand Up @@ -10493,7 +10493,7 @@
CODE_SIGN_ENTITLEMENTS = AutofillCredentialProvider/AutofillCredentialProvider.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_TEAM = HKE973VLUW;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
GCC_C_LANGUAGE_STANDARD = gnu17;
Expand Down Expand Up @@ -10531,7 +10531,7 @@
CODE_SIGN_ENTITLEMENTS = AutofillCredentialProvider/AutofillCredentialProviderAlpha.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_TEAM = HKE973VLUW;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
GCC_C_LANGUAGE_STANDARD = gnu17;
Expand Down Expand Up @@ -10568,7 +10568,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = HKE973VLUW;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
Expand Down Expand Up @@ -10607,7 +10607,7 @@
CODE_SIGN_IDENTITY = "iPhone Distribution";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = HKE973VLUW;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
Expand Down Expand Up @@ -10705,7 +10705,7 @@
CODE_SIGN_ENTITLEMENTS = DuckDuckGo/DuckDuckGoAlpha.entitlements;
CODE_SIGN_IDENTITY = "iPhone Distribution";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 2;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_ASSET_PATHS = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = HKE973VLUW;
Expand Down Expand Up @@ -10736,7 +10736,7 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 2;
GCC_C_LANGUAGE_STANDARD = gnu11;
INFOPLIST_FILE = ShareExtension/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
Expand Down Expand Up @@ -10764,7 +10764,7 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 2;
GCC_C_LANGUAGE_STANDARD = gnu11;
INFOPLIST_FILE = OpenAction/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
Expand Down Expand Up @@ -10797,7 +10797,7 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 2;
DEAD_CODE_STRIPPING = NO;
GCC_C_LANGUAGE_STANDARD = gnu11;
INFOPLIST_FILE = Widgets/Info.plist;
Expand Down Expand Up @@ -10827,7 +10827,7 @@
CODE_SIGN_ENTITLEMENTS = PacketTunnelProvider/PacketTunnelProviderAlpha.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_TEAM = HKE973VLUW;
GCC_C_LANGUAGE_STANDARD = gnu11;
GENERATE_INFOPLIST_FILE = YES;
Expand Down Expand Up @@ -10860,11 +10860,11 @@
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 2;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_CURRENT_VERSION = 2;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = Core/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
Expand Down Expand Up @@ -11096,7 +11096,7 @@
CODE_SIGN_ENTITLEMENTS = DuckDuckGo/DuckDuckGoAlpha.entitlements;
CODE_SIGN_IDENTITY = "iPhone Distribution";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 2;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_ASSET_PATHS = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = HKE973VLUW;
Expand Down Expand Up @@ -11124,7 +11124,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = HKE973VLUW;
GCC_C_LANGUAGE_STANDARD = gnu11;
Expand Down Expand Up @@ -11156,7 +11156,7 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = HKE973VLUW;
GCC_C_LANGUAGE_STANDARD = gnu11;
Expand Down Expand Up @@ -11193,7 +11193,7 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 2;
DEAD_CODE_STRIPPING = NO;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = HKE973VLUW;
Expand Down Expand Up @@ -11228,7 +11228,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = HKE973VLUW;
GCC_C_LANGUAGE_STANDARD = gnu11;
Expand Down Expand Up @@ -11263,11 +11263,11 @@
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 2;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_CURRENT_VERSION = 2;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = Core/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
Expand Down Expand Up @@ -11439,11 +11439,11 @@
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 2;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_CURRENT_VERSION = 2;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = Core/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
Expand Down Expand Up @@ -11472,10 +11472,10 @@
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 2;
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_CURRENT_VERSION = 2;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = Core/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
Expand Down
5 changes: 4 additions & 1 deletion DuckDuckGo/MainViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1719,7 +1719,8 @@ class MainViewController: UIViewController {
let roundedPageSheet = RoundedPageSheetContainerViewController(
contentViewController: aiChatViewController,
logoImage: logoImage,
title: title)
title: title,
allowedOrientation: .portrait)

present(roundedPageSheet, animated: true, completion: nil)
}
Expand Down Expand Up @@ -2088,7 +2089,9 @@ extension MainViewController: OmniBarDelegate {
switch accessoryType {
case .chat:
openAIChat()
Pixel.fire(pixel: .openAIChatFromAddressBar)
case .share:
Pixel.fire(pixel: .addressBarShare)
currentTab?.onShareAction(forLink: link, fromView: viewCoordinator.omniBar.accessoryButton)
}
}
Expand Down
1 change: 0 additions & 1 deletion DuckDuckGo/OmniBar.swift
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,6 @@ class OmniBar: UIView {
}

@IBAction func onAccessoryPressed(_ sender: Any) {
Pixel.fire(pixel: .addressBarShare)
omniDelegate?.onAccessoryPressed(accessoryType: accessoryType)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ final class RoundedPageSheetContainerViewController: UIViewController {
let contentViewController: UIViewController
private let logoImage: UIImage?
private let titleText: String
private let allowedOrientation: UIInterfaceOrientationMask

private lazy var titleBarView: TitleBarView = {
let titleBarView = TitleBarView(logoImage: logoImage, title: titleText) { [weak self] in
Expand All @@ -31,20 +32,32 @@ final class RoundedPageSheetContainerViewController: UIViewController {
return titleBarView
}()

init(contentViewController: UIViewController, logoImage: UIImage?, title: String) {
init(contentViewController: UIViewController, logoImage: UIImage?, title: String, allowedOrientation: UIInterfaceOrientationMask = .all) {
self.contentViewController = contentViewController
self.logoImage = logoImage
self.titleText = title
self.allowedOrientation = allowedOrientation
super.init(nibName: nil, bundle: nil)
modalPresentationStyle = .custom

transitioningDelegate = self
}

required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}

override var shouldAutorotate: Bool {
return false
}

override var supportedInterfaceOrientations: UIInterfaceOrientationMask {
return allowedOrientation
}

override var preferredInterfaceOrientationForPresentation: UIInterfaceOrientation {
return UIInterfaceOrientation.portrait
}

override func viewDidLoad() {
super.viewDidLoad()
view.backgroundColor = .black
Expand All @@ -53,15 +66,6 @@ final class RoundedPageSheetContainerViewController: UIViewController {
setupContentViewController()
}

override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) {
super.viewWillTransition(to: size, with: coordinator)

coordinator.animate(alongsideTransition: { _ in
// Update layout or constraints here
}, completion: nil)
}


private func setupTitleBar() {
view.addSubview(titleBarView)
titleBarView.translatesAutoresizingMaskIntoConstraints = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,10 +194,14 @@ final class SubscriptionPagesUseSubscriptionFeature: Subfeature, ObservableObjec
// MARK: Broker Methods (Called from WebView via UserScripts)

func getSubscription(params: Any, original: WKScriptMessage) async -> Encodable? {
await appStoreAccountManagementFlow.refreshAuthTokenIfNeeded()
let authToken = accountManager.authToken ?? Constants.empty
guard accountManager.isUserAuthenticated else { return [Constants.token: Constants.empty] }

return [Constants.token: authToken]
switch await appStoreAccountManagementFlow.refreshAuthTokenIfNeeded() {
case .success(let currentAuthToken):
return [Constants.token: currentAuthToken]
case .failure:
return [Constants.token: Constants.empty]
}
}

func getSubscriptionOptions(params: Any, original: WKScriptMessage) async -> Encodable? {
Expand Down
Loading

0 comments on commit 1827ce9

Please sign in to comment.