-
Notifications
You must be signed in to change notification settings - Fork 406
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
Updated settings #2603
Updated settings #2603
Conversation
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.
Mostly looking good just a couple of comments to discuss before I approve.
Also:
1/ "About", "Share Feedback", "DuckDuckGo on other platforms" items don't fire pixels - is that intended? (Looks like it is)
2/ Email protection has a pixel in the new settings, but not the old settings?
Core/PixelExperiment.swift
Outdated
|
||
func fireEnrollmentPixel() { | ||
Pixel.fire(pixel: .pixelExperimentEnrollment, | ||
withAdditionalParameters: PixelExperiment.parameters) |
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.
Was the idea to call the fire function passed in? In the original macOS code (which I see no longer has this) the idea was to be able to mock calls to pixels so that we could test it.
Talking of which - I don't see any unit tests? I think we should because now it's in the code base there's a good chance this will end up being the defacto standard approach moving forward.
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.
Since the experiment uses existing pixels and it adds many pixels on top, the current approach made more sense to me.
- Mocking would create approximately 2x30 methods which would be hard to maintain.
- Adding existing pixels to the experiment or removal of a pixel from the experiment would require to swap the standard Pixel.fire call with the specific method.
Do you think wrapper calls are that important? I don't have a strong opinion and can generate them (uncle GPT can help with that)
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.
I agree with your approach to firing pixels elsewhere, but regarding this class specifically there's a function passed into this class which you can use rather than calling it directly. If it's not needed then please remove it.
But I assume point of that function was that it makes it "easy" to this logic from a unit test as you can do something like:
func testPixelFiredOnEnrolment() {
// create expectation
let logic = PixelExperimentLogic() { pixel in
// assert the expected pixel is fired
// fulfil expectation
}
logic.install()
XCTAssertNotNil(logic.cohort)
// wait for expectations
}
And I don't see those kind of tests here?
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.
I see, thanks for clarification! 👍 I missed this part. I have modified it slightly and added couple of tests to ensure pixel is fired when a cohort is allocated. Also, there is a verification the experiment logic returns appropriate pixel parameters.
Thank you for the review, @brindy! We're close to the finish line with the design and copy approvals. As soon as the new copy is translated, I'll reach out to you for the final review. 1/ Correct, no pixels are planned for those sections |
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.
These don't fire pixels on the old version (which might be correct):
- unprotected
- fireproof sites
- application lock
- keyboard
- long press previews
- open links in associated apps
- mac
- windows
- about
- share feedback
I think we maybe had a miscommunication about the firePixel in the PixelExperiment class. Let me know if the latest comment doesn't make sense.
And also one comment about using a quick link instead of raw URL.
Otherwise all looks good - will approve once we iron those out.
Core/PixelExperiment.swift
Outdated
|
||
func fireEnrollmentPixel() { | ||
Pixel.fire(pixel: .pixelExperimentEnrollment, | ||
withAdditionalParameters: PixelExperiment.parameters) |
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.
I agree with your approach to firing pixels elsewhere, but regarding this class specifically there's a function passed into this class which you can use rather than calling it directly. If it's not needed then please remove it.
But I assume point of that function was that it makes it "easy" to this logic from a unit test as you can do something like:
func testPixelFiredOnEnrolment() {
// create expectation
let logic = PixelExperimentLogic() { pixel in
// assert the expected pixel is fired
// fulfil expectation
}
logic.install()
XCTAssertNotNil(logic.cohort)
// wait for expectations
}
And I don't see those kind of tests here?
} | ||
|
||
func openOtherPlatforms() { | ||
UIApplication.shared.open(URL.apps, |
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.
This opens the default browser, should it just open in a tab instead via quickLink?
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.
Good catch! 👍 I was not aware of this. Corrected ✅
@brindy, thanks for clarification, everything is clear now 👍 1) Pixels 2) Unit Tests 3) Quick Links The PR is ready for another review. Thanks for patience with this |
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!
# By Mariusz Śpiewak (4) and others # Via Chris Brind (1) and others * main: Reverting accidental push to main (#2718) Add SubscriptionContainerViewModel and Manually hide loader + Pixel (#2687) Release 7.115.0-2 (#2712) soft revert history suggestions (#2711) Bring back accessibility identifiers for onboarding buttons (#2709) BSK release 133.1.0 (#2708) Password Manager widget and app shortcut (#2619) Release 7.115.0-1 (#2707) Update set-as-default onboarding illustration for dark mode (#2694) update app store prompt logic (#2678) Fix status bar color on regular width size class (#2705) Updated settings (#2603) Update BSK with autofill 11.0.1 (#2704) # Conflicts: # DuckDuckGo.xcodeproj/project.pbxproj # DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
Task/Issue URL: https://app.asana.com/0/0/1206668965195606/f
Description:
New Settings layout with Privacy Protections, Main Settings, Next Steps and others. It also includes the implementation of pixel experiment for monitoring the usage of old and new Settings to make sure we don't harm the experience.
ℹ️ The experiment will be activated in a follow-up PR after running experiments on iOS are over.
Steps to test this PR:
Test the old Settings
Test the new Settings
Verify pixels
Copy Testing:
’
rather than'
Orientation Testing:
Device Testing:
OS Testing:
Theme Testing:
Internal references:
Software Engineering Expectations
Technical Design Template