-
Notifications
You must be signed in to change notification settings - Fork 133
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-4151 [SR] Support background color for Tab Bars #1890
Conversation
…mariedm/feat/RUM-4151
…mariedm/feat/RUM-4151
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.
Looks great 🎯. I appreciate the level of details in PR description and snapshot tests - all clear 🚀!
Minor comment on conventions: we usually mention the JIRA ref (RUM-4151 in this case) as part of every commit (prefix) and in the PR title. This way we establish automatic link between GH and JIRA, which helps tracking decisions later. For this PR, let's mention it in the title at least 🙂.
@@ -25,7 +25,6 @@ internal struct UITabBarRecorder: NodeRecorder { | |||
} | |||
|
|||
private func inferOccupiedFrame(of tabBar: UITabBar, in context: ViewTreeRecordingContext) -> CGRect { | |||
// TODO: RUMM-2791 Enhance appearance of `UITabBar` and `UINavigationBar` in SR |
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.
🎯👌
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.
Nice!
I would only suggest defaulting the icon image tint to gray whenever we deal with unselectedItemTintColor == nil
.
Also - we probably can drop the bottom border. Seems like native component has only a gray line on top.
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.
Looks great! nice work on the snapshot tests 👏
...Replay/SRSnapshotTests/SRFixtures/Sources/SRFixtures/ViewControllers/TabbarControllers.swift
Outdated
Show resolved
Hide resolved
Got it! I will follow this pattern next time. In the meantime, I added it to the PR title. |
@maciejburda I can remove the bottom border color. 👍 However, how do you suggest we default the icon to gray when |
@maciejburda Actually, the current implementation in |
Datadog ReportBranch report: ✅ 0 Failed, 253 Passed, 0 Skipped, 14.05s Total Time |
@maciejburda as discussed in the Daily today, I can merge this PR once I have the required approvals to unblock @ncreated's work. I created a follow-up ticket from your comment. |
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!
As discussed - we can try to tackle white tint images in a separate PR
What and why?
Session Replay currently does not support custom background colors for tab bars, defaulting to white or black based on the user's trait collection.
How?
This PR:
This work is similar to a previous PR that added support for custom background colors on navigation bars. For more context, see PR #1864.
Notes on deselected items’ Tint Color
TLDR: if no
unselectedTintColor
is set, icons will be rendered in white.tintColor
andunselectedItemTintColor
.unselectedItemTintColor
is not set, the default is gray, though it appears white in the view debugger and is not accessible via code.UIImageViewRecorder
. The correct tint color for a selected item is obtained through thetintColorProvider
.image
orimageView
level within theUIImageViewRecorder
.image.isTinted
always returnstrue
if atintColor
is set, regardless of selection status.withTintColor(_:)
effect applied to it does not work.UITabBarButton
, a private API, preventing state checks to determine selection status and appropriate tint color.Snapshot tests screenshots
Static Tab Bar
Embedded Tab Bar
Review checklist
Custom CI job configuration (optional)
tools/