-
Notifications
You must be signed in to change notification settings - Fork 129
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
RUM-4883 Tabbar Icon Default Tint Color #1906
Conversation
528961e
to
3f7c67e
Compare
Datadog ReportBranch report: ✅ 0 Failed, 254 Passed, 0 Skipped, 24.75s Total Time |
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 considered different options for this:
...
To make a decision between the last 2 options, I did a small benchmark on real devices. Results show that cgImage is much more efficient (24x faster on iPhone 13 mini, 12x faster on iPhone SE 2nd gen.).
Excellent approach 🏅! We need more benchmark driven decisions in SR, well done 💪
...rces/Recorder/ViewTreeSnapshotProducer/ViewTreeSnapshot/NodeRecorders/UITabBarRecorder.swift
Outdated
Show resolved
Hide resolved
...rces/Recorder/ViewTreeSnapshotProducer/ViewTreeSnapshot/NodeRecorders/UITabBarRecorder.swift
Show resolved
Hide resolved
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.
Very nice work, I really appreciate the performance driven solution and the level of comments 👏
I have left a minor change request on releasing the UITabBar
in the recorder.
...rces/Recorder/ViewTreeSnapshotProducer/ViewTreeSnapshot/NodeRecorders/UITabBarRecorder.swift
Outdated
Show resolved
Hide resolved
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.
Very nice work, I really appreciate the performance driven solution and the level of comments 👏
I have left a minor change request on releasing the UITabBar
in the recorder.
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.
Thanks, well done!
What and why?
This PR introduces changes to the Session Replay feature to handle the default color of tab bar icons when no unselectedItemTintColor is set. This enhances the visual consistency and clarity in the session replays.
How?
This PR updates the
UITabBarRecorder
to handle the default color for unselected tab bar items. It introduces a logic that sets the tab bar's icon color to gray when theunselectedItemTintColor
is not provided. TheUITabBarRecorder
now includes its ownUIImageViewRecorder
to handle icons properly.Here's a SR example with
unselectedTintColor
not set on tab bar: Session Replay Example 1.Notes on Image Comparison
This PR uses image comparison to identify the selected item in the tab bar. I considered different options for this:
srIdentifier
: provides a unique string, and while cached, still not ideal for performancecgImage
properties: generates a unique identifier, still theoretically possible for collisions, but highly unlikelyTo make a decision between the last 2 options, I did a small benchmark on real devices. Results show that
cgImage
is much more efficient (24x faster on iPhone 13 mini, 12x faster on iPhone SE 2nd gen.).Screenshots
Updated screenshots from snapshot tests.
Review checklist
Custom CI job configuration (optional)
tools/