Commit-Queue | +1 |
Hi folks,
Thanks!
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
bool IsSafetyCheckModuleHiddenWithoutIssues();
Nit: the method name is confusing. When reading it in the code I was expecting this to return whether the module is currently hidden or not, not a bool.
Did you consider replacing "Is" by "Should" (and adapting the rest) or something similar?
// LINT.ThenChange(/tools/metrics/histograms/metadata/ios/enums.xml:IOSSafetyCheckHiddenReason)
If the linter error expected? Should the path starts with a `/`?
UMA_HISTOGRAM_ENUMERATION(
HEre and below, why using a macro and not a function?
(previousIssuesCount == 0) && (previousIssuesCount == issuesCount);
I am not sure to understand the logic. The module is hidden if there was 0 issues previously and there is currently 0 issues (and it is not the default value)?
So, if we used to have issues and now we don't, the module is shown?
And why checking the default value of the pref?
- (void)logIssuesCount:(NSUInteger)issuesCount
Nit, optional: "log" is associated with UMA in my mind. I would rather have something like `updateIssueCountPref: withCount:` or something like that.
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Nit: the method name is confusing. When reading it in the code I was expecting this to return whether the module is currently hidden or not, not a bool.
Did you consider replacing "Is" by "Should" (and adapting the rest) or something similar?
Great point. Done.
// LINT.ThenChange(/tools/metrics/histograms/metadata/ios/enums.xml:IOSSafetyCheckHiddenReason)
If the linter error expected? Should the path starts with a `/`?
Done
HEre and below, why using a macro and not a function?
Thanks for catching that! I was initially following the file's existing use of macros for histograms. I've now updated everything to `base::UmaHistogramEnumeration()`.
(previousIssuesCount == 0) && (previousIssuesCount == issuesCount);
I am not sure to understand the logic. The module is hidden if there was 0 issues previously and there is currently 0 issues (and it is not the default value)?
So, if we used to have issues and now we don't, the module is shown?
And why checking the default value of the pref?
Overall, yes, that's correct! This is new business logic from Product. The Safety Check module will now only be visible in the Magic Stack if there are issues to display. If both the previous and current state is 'All Safe' (i.e. zero issues), the module will be hidden.
"So, if we used to have issues and now we don't, the module is shown?"
>> Yes, that's right, because Product wants users to see the 'All Safe' state maximally once.
"And why checking the default value of the pref?"
>> Because the Pref being zero typically means the 'All Safe' state. However, not when it's the default value, that just means it hasn't been set before.
If my answers are satisfactory, please feel free to mark this thread as complete. Thanks Gauthier for raising this!
Also, I've updated the CL description, and added some new comments, to make this business logic more clear.
Nit, optional: "log" is associated with UMA in my mind. I would rather have something like `updateIssueCountPref: withCount:` or something like that.
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
// LINT.ThenChange(/tools/metrics/histograms/metadata/ios/enums.xml:IOSSafetyCheckHiddenReason)
Benjamin WilliamsIf the linter error expected? Should the path starts with a `/`?
Done
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Code-Review | +1 |
// LINT.ThenChange(//tools/metrics/histograms/metadata/ios/enums.xml:IOSSafetyCheckHiddenReason)
Sorry I wasn't clear, my suggestion was to remove the leading "/". (Feel free to land if it doesn't work)
(previousIssuesCount == 0) && (previousIssuesCount == issuesCount);
Benjamin WilliamsI am not sure to understand the logic. The module is hidden if there was 0 issues previously and there is currently 0 issues (and it is not the default value)?
So, if we used to have issues and now we don't, the module is shown?
And why checking the default value of the pref?
Overall, yes, that's correct! This is new business logic from Product. The Safety Check module will now only be visible in the Magic Stack if there are issues to display. If both the previous and current state is 'All Safe' (i.e. zero issues), the module will be hidden.
"So, if we used to have issues and now we don't, the module is shown?"
>> Yes, that's right, because Product wants users to see the 'All Safe' state maximally once."And why checking the default value of the pref?"
>> Because the Pref being zero typically means the 'All Safe' state. However, not when it's the default value, that just means it hasn't been set before.If my answers are satisfactory, please feel free to mark this thread as complete. Thanks Gauthier for raising this!
Also, I've updated the CL description, and added some new comments, to make this business logic more clear.
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Commit-Queue | +2 |
// LINT.ThenChange(//tools/metrics/histograms/metadata/ios/enums.xml:IOSSafetyCheckHiddenReason)
Sorry I wasn't clear, my suggestion was to remove the leading "/". (Feel free to land if it doesn't work)
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
I think we need to now update the EGTest to ensure the safety check card is added to the MagicStack
if (!IsSafetyCheckMagicStackEnabled() ||
as an aside, can we do feature flag cleanup?
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Commit-Queue | +2 |
if (!IsSafetyCheckMagicStackEnabled() ||
as an aside, can we do feature flag cleanup?
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
if (!IsSafetyCheckMagicStackEnabled() ||
Benjamin Williamsas an aside, can we do feature flag cleanup?
Done
This will be handled in a separate CL.
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Hi team, please ignore this latest patchset. SafetyCheckView EG Test is failing on ios-simulator-full-configs. I'm investigating why the module isn't showing up (which causes the test to fail). Added some temporary logs to help with this. Will update once resolved.
Hi everyone, thanks for your patience while I resolved the module visibility issue. The problem was that the new code was checking if the `kHomeCustomizationMagicStackSafetyCheckIssuesCount` Pref was set to its default value, initially aimed at distinguishing between intentional and default zero values. However, this check proved fragile and unnecessary. The fix is to hide the module only if both previous and current issue counts are zero; any change will unhide it. I've removed the default value check, and all tests should pass, with submission working as expected. Thanks again for your patience!
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Commit-Queue | +2 |
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Commit-Queue | +2 |
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Removed Commit-Queue+2 by Benjamin Williams <bwwil...@google.com>
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Commit-Queue | +2 |
Fingers crossed this fixes the module visibility issue for SafetyCheckView EG test.
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
12 is the latest approved patch-set.
The change was submitted with unreviewed changes in the following files:
```
The name of the file: ios/chrome/browser/ui/content_suggestions/magic_stack/magic_stack_ranking_model.mm
Insertions: 3, Deletions: 7.
The diff is too large to show. Please review the diff.
```
```
The name of the file: ios/chrome/browser/ui/content_suggestions/safety_check/safety_check_view_egtest.mm
Insertions: 12, Deletions: 8.
The diff is too large to show. Please review the diff.
```
```
The name of the file: ios/chrome/browser/ui/content_suggestions/content_suggestions_metrics_constants.h
Insertions: 2, Deletions: 2.
The diff is too large to show. Please review the diff.
```
[iOS] Conditionally hide Safety Check module in Magic Stack
This change optimizes the visibility of the Safety Check module within
the Magic Stack by dynamically displaying it only when new issues arise.
This approach prevents unnecessary visual clutter and ensures users are
promptly informed about potential safety concerns without bloating the
Magic Stack. The module will be hidden if the user currently has no
Safety Check issues and the previous Safety Check state also displayed
no issues. As soon as new issues are detected, the module will be
unhidden and re-included in the Magic Stack.
This CL introduces a new local-state Pref to store the previous issues
count, adds logging to a new histogram to better understand why the
Safety Check module may not be displayed in the Magic Stack, and places
all of this functionality behind a Finch killswitch for enhanced safety
and control.
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |