Repository navigation
refactor(replay): share one mask classifier between the mask walk and the discard check - #913
Open
turnipdabeets wants to merge 3 commits into
Open
turnipdabeets wants to merge 3 commits into
turnipdabeets wants to merge 3 commits into
Conversation
… the discard check
6 tasks done
…r parity test Drops the refactor changeset: an internal refactor has no user-facing changelog entry.
This branch has not been deployed
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.
Note
Stacked on #910. Merges into
fix/replay-flag-secure.💡 Motivation and Context
#910 added
hasMaskableContent, which repeats the mask rules fromfindMaskableWidgetsso the legacy capture can tell an animating sensitive view from a harmless one. Two copies with a "keep in sync" comment can drift: a new mask rule added only to the walk would let legacy capture record that view type unmasked again.Both now use one classifier,
View.maskRule(), which returns aMaskRuleenum. Thewhenover it is exhaustive, so a new rule won't compile until both callers handle it.No behaviour change: I compared every branch and the two copies classified every view the same way, so nothing needed the stricter result. Child iteration still differs on purpose (the walk uses its geometry-aware visibility check; the discard check counts any
VISIBLEchild, the stricter side) and is unchanged. No per-frame allocations:MaskRuleis an enum.💚 How did you test it?
the discard check treats everything the mask walk masks as maskable: covers plain, ph-no-capture, ph-no-mask, empty and non-empty text, image, nested, hidden-child and Compose views. The discard check counts Compose as maskable even when the walk finds nothing to mask, since it can't judge Compose content without geometry (unchanged behaviour). It fails if the discard check ignores masked text, treats Compose as non-maskable, or stops skipping hidden children../gradlew spotlessCheck apiCheck :posthog-android:testDebugUnitTestpasses.📝 Checklist
If releasing new changes
pnpm changesetto generate a changeset file (internal refactor, no user-facing change)🤖 Agent context
Autonomy: Human-driven (agent-assisted)
🤖 Generated with Claude Code