-
Notifications
You must be signed in to change notification settings - Fork 432
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
AI Chat handoff #3785
AI Chat handoff #3785
Conversation
# Conflicts: # DuckDuckGo/MainViewController.swift
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work. Please fix the dependency injection but otherwise looks good.
private var payloadHandler = AIChatPayloadHandler() | ||
|
||
@MainActor | ||
lazy var aiChatViewController: AIChatViewController = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: indentation
/// Default rule for DuckDuckGo AI Chat | ||
if let ddgDomain = URL.ddg.host { | ||
rules.append(.exact(hostname: ddgDomain)) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just acknowledging we discussed this. No action required.
let settings = AIChatSettings(privacyConfigurationManager: ContentBlocking.shared.privacyConfigurationManager, | ||
internalUserDecider: AppDependencyProvider.shared.internalUserDecider) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we inject these instead? Since this is lazy they should be available by this point.
DuckDuckGo/UserScripts.swift
Outdated
@@ -66,6 +67,8 @@ final class UserScripts: UserScriptsProvider { | |||
properties: sourceProvider.contentScopeProperties, | |||
isIsolated: true) | |||
autoconsentUserScript = AutoconsentUserScript(config: sourceProvider.privacyConfigurationManager.privacyConfig) | |||
aiChatUserScript = AIChatUserScript(handler: AIChatUserScriptHandler(featureFlagger: AppDependencyProvider.shared.featureFlagger)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please inject :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Task/Issue URL: https://app.asana.com/0/1204167627774280/1209119202522826/f
Description:
Add handoff support using the C-S-S communication layer
Steps to test this PR:
This feature depends on some FE changes in the SERP, so to test it you'll need to do a bit of initial setup: