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

RUMM-2972 [SR] Support UISegmentedControl elements in session replay #1169

Merged
merged 2 commits into from
Feb 21, 2023

Conversation

ncreated
Copy link
Member

What and why?

📦 With this PR we're adding support to UISegmentedControl elements in session replay.

segment-light

How?

  • added UISegmentRecorder with UISegmentWireframesBuilder
  • added "Segments" fixture and snapshot tests

The slider is constructed with 1 to many wireframes:

  • one shape wireframe for drawing the background of entire control
  • separate text wireframes for drawing segment labels
  • one more shape wireframe to highlight selected segment.

If privacy mode .maskAll is enabled, we obfuscate text and do not build selection wireframe:

segment-mask

I also enhanced the way we deal with system colors by introducing SystemColors construct. It acts as a collection of system colors, which are UI mode dependant (return different values for light- and dark-mode on iOS 13+).

Here, an example of segments in dark mode:

segment-dark

Review checklist

  • Feature or bugfix MUST have appropriate tests (unit, integration)
  • Make sure each commit and the PR mention the Issue number or JIRA reference
  • Add CHANGELOG entry for user facing changes

Custom CI job configuration (optional)

  • Run unit tests
  • Run integration tests
  • Run smoke tests

@ncreated ncreated self-assigned this Feb 20, 2023
branch = framer;
branch = "ship-framer";
Copy link
Member Author

@ncreated ncreated Feb 20, 2023

Choose a reason for hiding this comment

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

Pointing to stable branch in https://github.com/ncreated/Framing/tree/ship-framer - I added basic text alignment options in there, so we can preview SRTextPosition in snapshot tests.

@ncreated ncreated marked this pull request as ready for review February 20, 2023 17:36
@ncreated ncreated requested a review from a team as a code owner February 20, 2023 17:36
Copy link
Member

@maxep maxep left a comment

Choose a reason for hiding this comment

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

Nice, looks great!

Comment on lines +47 to +48
if #available(iOS 15.0, *) {
return UIColor.tintColor.cgColor
Copy link
Member

Choose a reason for hiding this comment

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

Why 15? this one is available since iOS7

Copy link
Member Author

Choose a reason for hiding this comment

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

Indeed, the Apple doc says iOS7, but this seems to not be true:

Screenshot 2023-02-21 at 15 20 37

Screenshot 2023-02-21 at 15 20 05

🤷

@ncreated ncreated merged commit 690fb8d into develop Feb 21, 2023
@ncreated ncreated deleted the ncreated/RUMM-2972-sr-support-segments branch February 21, 2023 14:54
@ncreated ncreated mentioned this pull request Feb 23, 2023
6 tasks
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