-
Notifications
You must be signed in to change notification settings - Fork 0
feat: ignore masking #80
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
Conversation
|
|
||
|
|
||
| func shouldIgnore(_ view: UIView) -> Bool { | ||
| let viewType = type(of: view) |
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 is a little bit expensive cpu-wise, just a notice, since you are now relying on ObjectIdentifier as the main approach to identify the views, it is not a good idea to change the approch this 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 use ObjectIdentifier from the type not from the instance. That's why I need viewType
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 understand, just a small notice, not asking for a change, we are good
| return true | ||
| } | ||
|
|
||
| if SessionReplayAssociatedObjects.shouldMaskUIView(view) ?? false { |
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.
return SessionReplayAssociatedObjects.shouldMaskUIView(view) == true
| let effectiveFrame = rPresenation.convert(layer.frame, from: layer.superlayer) | ||
|
|
||
| let shouldIgnore = settings.shouldIgnore(view) | ||
| guard !shouldIgnore else { return } |
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.
better, if you don't need the result from settings.shouldIgnore(view) down below
guard !settings.shouldIgnore(view) else { return }
| // let corner0 = CGPoint.zero | ||
| // let corner1 = CGPoint(x: lBounds.width, y: 0) | ||
|
|
||
| // let corner0 = CGPoint.zero |
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.
delete commented-out code
* main: fix: touch throttle (#81)
…-launchdarkly-observability into andrey/ignore-masking * 'andrey/ignore-masking' of github.com:launchdarkly/swift-launchdarkly-observability:
| @objcMembers | ||
| public class ObjcLDMasking: NSObject { | ||
| // Use explicit selectors so we control the Obj-C names. | ||
| @objc(maskView:) |
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.
if you are using @objcMembers annotation this is redundant, remove it please
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 already but it also not as it assigns the name exported method
| view.ldMask() | ||
| } | ||
|
|
||
| @objc(unmaskView:) |
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.
if you are using @objcMembers annotation this is redundant, remove it please
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 use for naming as well
| view.ldUnmask() | ||
| } | ||
|
|
||
| @objc(ignoreView:) |
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.
if you are using @objcMembers annotation this is redundant, remove it please
| // let corner1 = CGPoint(x: lBounds.width, y: 0) | ||
|
|
||
| } else { | ||
| // TODO: finish 3D animations |
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.
remove else if you are not implementing/handling 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.
I will
Sources/LaunchDarklySessionReplay/ScreenCapture/MaskCollector.swift
Outdated
Show resolved
Hide resolved
* main: feat: ignore masking (#80)
🤖 I have created a release *beep* *boop* --- ## [0.10.0](0.9.2...0.10.0) (2025-11-15) ### Features * ignore masking ([#80](#80)) ([1372064](1372064)) * options refactor ([#75](#75)) ([b442cbc](b442cbc)) * refactor instrumentation options ([#77](#77)) ([ebc2e24](ebc2e24)) ### Bug Fixes * touch throttle ([#81](#81)) ([6d1cd15](6d1cd15)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Bumps SDK to 0.10.0 and updates the changelog with new features and a bug fix. > > - **Release**: bump version to `0.10.0` > - Update `.` version in `.release-please-manifest.json` > - Update `sdkVersion` in `Sources/LaunchDarklyObservability/Version.swift` > - **Docs**: refresh `CHANGELOG.md` with features (ignore masking, options refactor, instrumentation options refactor) and a bug fix (touch throttle) > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 1bf72a3. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
Note
Adds ldIgnore and explicit unmask controls (including Obj-C bridge), extends privacy options, and updates the mask collector to honor new ignore/unmask rules; demo app applies ldIgnore and updates identifiers.
ldIgnore()for SwiftUI andUIView, plusldMask()convenience.ObjcLDMaskingwithmaskView:,unmaskView:,ignoreView:.SessionReplayModifierto support optionalisEnabledandisIgnored.SessionReplayOptions.PrivacyOptionswithunmaskUIViews,unmaskAccessibilityIdentifiers, andignoreUIViews.MaskCollector.Settingsnow tracksmaskUIViews,unmaskUIViews,ignoreUIViews, and corresponding accessibility identifiers.shouldIgnoreand updateshouldMaskto respect explicit unmask/ignore via associated objects, class lists, and accessibility identifiers.shouldMaskUIViewwhen applicable..ldIgnore()to smoothie list rows; add "10" to masked accessibility identifiers.Written by Cursor Bugbot for commit c6c149d. This will update automatically on new commits. Configure here.