Skip to content
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

Add search and sort observability metrics #3007

Conversation

jotaemepereira
Copy link
Collaborator

@jotaemepereira jotaemepereira commented Jul 23, 2024

Task/Issue URL: https://app.asana.com/0/1199230911884351/1207704569751027/f
Tech Design URL:
CC:

Description

Adds pixels to observe interactions with search and sort.

Steps to test this PR

Sort button clicked

  1. Open the bookmarks panel
  2. Press the sort button to see the list of options of sort options.
  3. A pixel called sort_bookmarks_button_clicked should be fired

Sort button dismissed

  1. Open the bookmarks panel
  2. Press the sort button to see the list of options of sort options.
  3. Then, do not select any option from the menu
  4. A pixel called sort_bookmarks_button_dismissed should be fired.

Sort mode by name

  1. Open the bookmarks panel
  2. Press the sort button to see the list of options of sort options.
  3. Then select the Name option. Repeat from 2, and select Ascending and Descending
  4. A pixel called sort_bookmarks_by_name should be fired.

Search executed

  1. Open the bookmarks panel
  2. Press the search button
  3. Start a search
  4. A pixel called search_bookmarks_executed should be fired. This pixel is fired daily.

Search result clicked

  1. Open the bookmarks panel
  2. Press the search button
  3. Start a search
  4. Tap a bookmark or folder on the search results
  5. A pixel called search_result_clicked should be fired when the bookmark an folder are tapped.

Definition of Done

Internal references:

Pull Request Review Checklist
Software Engineering Expectations
Technical Design Template
Pull Request Documentation

@jotaemepereira jotaemepereira requested review from a team and THISISDINOSAUR and removed request for a team July 23, 2024 16:00
}
}

class SortBookmarksViewModelTests: XCTestCase {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, really glad to see how thoroughly tested this is!

DuckDuckGo/Bookmarks/Model/BookmarksMetrics.swift Outdated Show resolved Hide resolved
@jotaemepereira jotaemepereira force-pushed the juan/sort-bookmarks-in-panel branch 2 times, most recently from d240c73 to fc01a2f Compare July 24, 2024 11:54
Base automatically changed from juan/sort-bookmarks-in-panel to feature/search-and-sort-bookmarks-panel July 24, 2024 12:25
Copy link
Contributor

@THISISDINOSAUR THISISDINOSAUR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just have one comment, but otherwise testing looks good

case manager
}

struct BookmarksSearchAndSortMetrics {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the motivation behind this versus using PixelKit directly?
In general I'd say we use PixelKit directly, and I'd rather keep things consistent unless there's a good reason for it

Copy link
Collaborator Author

@jotaemepereira jotaemepereira Jul 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer to encapsulate this kind of logic; if you have multiple fires to the same pixel and need to change something (for example, the frequency), you have only one place to do it.

Finding the pixels related to a specific feature is easier. Now, you need to navigate through the large pixel list in the GeneralPixel enum.

Do you think it’s a blocker for this PR?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nah it's not a blocker. I think your reasoning makes sense, but I would rather do it or not do it universally, and think the consistency is more valuable than the benefits of either approach.

@jotaemepereira jotaemepereira merged commit aadfa2b into feature/search-and-sort-bookmarks-panel Jul 24, 2024
23 checks passed
@jotaemepereira jotaemepereira deleted the juan/search-and-sort-metrics branch July 24, 2024 19:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants