Repository navigation
fix(replay): mask descendants of ph-no-capture containers - #914
Merged
Merged
Conversation
A ph-no-capture view only masked its own rect and stopped the walk, so a child of an unclipped container could draw outside that rect unmasked. Descendants are now walked and masked too; a ComposeView inside the subtree is masked whole. ph-no-mask on a descendant still wins. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
marandaneto
approved these changes
Oct 30, 2026
marandaneto
left a comment
Member
There was a problem hiding this comment.
The code looks good; no qualifying findings. Verdict: correct.
ioannisj
approved these changes
Oct 30, 2026
ioannisj
left a comment
Contributor
There was a problem hiding this comment.
🤖 An AI agent wrote this on behalf of @ioannisj.
Nothing blocks merging here. The descendant walk lines up with the privacy spec and the new test covers the overflow, the verified re-walk and the untagged control. One thing worth a look: a ComposeView that carries the ph-no-capture tag itself still skips the no-capture branch, which predates this PR and could be a follow-up.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
turnipdabeets
added a commit
that referenced
this pull request
Oct 30, 2026
Moves #914's ph-no-capture descendant masking into the shared classifier as a NO_CAPTURE rule. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
6 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
💡 Motivation and Context
In screenshot replay, a
ph-no-captureview masked only its own rect and the mask walk stopped there. A child of an unclipped container (clipChildren = false) can draw outside that rect, and that overflow was recorded unmasked, even overflowing text that defaultmaskAllTextInputswould have masked without the tag. Reported in #908 review. It predates #908, but #908 makes screenshots the only mode, so it should land onmainfirst.The fix follows session-replay-privacy Behavior 4: the wrapper's rect is masked along with its descendants' rects.
ph-no-captureview, and every visible descendant, adds its rect, and the walk keeps descending.ComposeViewinside the subtree is masked whole instead of running the semantics pass. So a ComposepostHogUnmasknode that overflows a tagged View container stays masked. This was already the case inside the container's bounds, and it errs toward privacy.ph-no-maskon a View descendant still takes precedence, as before.💚 How did you test it?
no-capture container masks descendants that overflow its bounds. A tagged, unclipped wrapper has overflowing text, plain, Compose andph-no-maskchildren. The test asserts that the wrapper and the first three are masked and theph-no-maskchild isn't. It also checks that the draw-time verification walk isn't misaligned, and keeps an untagged control where only the text is masked. It fails without the fix../gradlew :posthog-android:testReleaseUnitTest --tests '*replay*'passes;spotlessCheckis clean.📝 Checklist
If releasing new changes
pnpm changesetto generate a changeset file🤖 Agent context
Autonomy: Human-driven (agent-assisted)
clipChildren = falsebecausegetGlobalVisibleRectclips a child to its parent based on the grandparent's flag.🤖 Generated with Claude Code