Skip to content

Commit

Permalink
Fix AI Chat address bar pixel
Browse files Browse the repository at this point in the history
  • Loading branch information
Bunn committed Dec 12, 2024
1 parent 7273be8 commit 26f3023
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Core/PixelEvent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -916,6 +916,7 @@ extension Pixel {
case openAIChatBefore10min
case openAIChatAfter10min
case aiChatNoRemoteSettingsFound(settings: String)
case openAIChatFromAddressBar

// MARK: Lifecycle
case appDidTransitionToUnexpectedState
Expand Down Expand Up @@ -1833,6 +1834,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
2 changes: 2 additions & 0 deletions DuckDuckGo/MainViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2089,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

0 comments on commit 26f3023

Please sign in to comment.