Skip to content

Commit

Permalink
Update BSK with AI Chat deeplink feature flag (#3786)
Browse files Browse the repository at this point in the history
Task/Issue URL:
https://app.asana.com/0/1204167627774280/1209108545833453/f

**Description**:
Update BSK with AI Chat deeplink feature flag
  • Loading branch information
Bunn authored Jan 10, 2025
1 parent bac8c86 commit 482dc58
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
3 changes: 3 additions & 0 deletions Core/FeatureFlag.swift
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public enum FeatureFlag: String {
case textZoom
case adAttributionReporting
case aiChat
case aiChatDeepLink

/// https://app.asana.com/0/72649045549333/1208231259093710/f
case networkProtectionUserTips
Expand Down Expand Up @@ -140,6 +141,8 @@ extension FeatureFlag: FeatureFlagDescribing {
return .remoteDevelopment(.subfeature(PrivacyProSubfeature.privacyProFreeTrialJan25))
case .aiChat:
return .remoteReleasable(.feature(.aiChat))
case .aiChatDeepLink:
return .remoteReleasable(.subfeature(AIChatSubfeature.deepLink))
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion DuckDuckGo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -11901,7 +11901,7 @@
repositoryURL = "https://github.com/DuckDuckGo/BrowserServicesKit";
requirement = {
kind = exactVersion;
version = 224.5.0;
version = 224.6.0;
};
};
9F8FE9472BAE50E50071E372 /* XCRemoteSwiftPackageReference "lottie-spm" */ = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/DuckDuckGo/BrowserServicesKit",
"state" : {
"revision" : "1700c54067b6676974676ca9a81d654317a093f1",
"version" : "224.5.0"
"revision" : "20316b105d8874e10cf544a9c97e97237441ae01",
"version" : "224.6.0"
}
},
{
Expand Down
4 changes: 2 additions & 2 deletions DuckDuckGo/TabURLInterceptor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ final class TabURLInterceptorDefault: TabURLInterceptor {
]

func allowsNavigatingTo(url: URL) -> Bool {
if url.isDuckAIURL {
if featureFlagger.isFeatureOn(.aiChatDeepLink), url.isDuckAIURL {
return handleURLInterception(interceptedURL: .aiChat, queryItems: nil)
}

Expand Down Expand Up @@ -102,7 +102,7 @@ extension TabURLInterceptorDefault {
return false
}
case .aiChat:
if featureFlagger.isFeatureOn(.aiChat) {
if featureFlagger.isFeatureOn(.aiChatDeepLink) {
NotificationCenter.default.post(
name: .urlInterceptAIChat,
object: nil,
Expand Down
2 changes: 1 addition & 1 deletion DuckDuckGoTests/TabURLInterceptorTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class TabURLInterceptorDefaultTests: XCTestCase {
}

func testNotificationForInterceptedAIChatPathWhenFeatureFlagIsOn() {
urlInterceptor = TabURLInterceptorDefault(featureFlagger: MockFeatureFlagger(enabledFeatureFlags: [.aiChat]), canPurchase: { true })
urlInterceptor = TabURLInterceptorDefault(featureFlagger: MockFeatureFlagger(enabledFeatureFlags: [.aiChatDeepLink]), canPurchase: { true })

_ = self.expectation(forNotification: .urlInterceptAIChat, object: nil, handler: nil)

Expand Down

0 comments on commit 482dc58

Please sign in to comment.