Skip to content

feat: optimize node matching with clickable ancestor bubbling and composite split-text recognition - #116

Merged
zfdang merged 3 commits into
masterfrom
feat/quick-wins-node-matching
Oct 19, 2026
Merged

zfdang merged 3 commits into
masterfrom
feat/quick-wins-node-matching

Conversation

@zfdang

@zfdang zfdang commented Oct 19, 2026

Copy link
Copy Markdown
Owner

Summary

This PR implements Quick Wins node matching optimizations inspired by GKD:

  1. Clickable Ancestor Bubbling (findClickableAncestor): Traverses up to 5 parent levels when a matched text node is not clickable, invoking performAction(ACTION_CLICK) on the clickable container. This reduces response time from ~350ms (gesture fallback) to <10ms (instant click).
  2. Normalized Separator Text Matching: Normalizes whitespace, newlines, and punctuation like 跳 过, 跳\n过, [跳过], 跳·过, etc.
  3. Composite Split Text Recognition: Identifies button containers with 2-5 child nodes where split text forms a keyword (e.g., TextView('跳') + TextView('过')).
  4. Unit Tests: Full Robolectric test coverage in SkipAdRulesTest and TouchHelperServiceImplTest verifying ancestor bubbling, composite matching, and strict zero-leak node recycling.

…posite split-text recognition

- Implement findClickableAncestor: traverse up to 5 levels to locate an enclosing clickable container when the target text node is unclickable, avoiding slow gesture fallbacks (instant ACTION_CLICK <10ms vs ~350ms gesture).
- Support composite split text: recognize button containers where text is split across sibling/child nodes (e.g. TextView('跳') + TextView('过')).
- Support separated text keywords: normalize whitespace, newlines, and punctuation like '跳 过', '跳\n过', '跳·过', and '[跳过]'.
- Add unit tests in SkipAdRulesTest and TouchHelperServiceImplTest verifying bubbling, composite matching, and zero node leaks.
…gression runner

- Add docs/verified_ad_apps.md recording 11 verified splash ad apps and their trigger modes.
- Add scripts/benchmark_apps.json with structured app configurations.
- Add scripts/run_ad_benchmark.py for one-command automated splash ad regression testing on real devices.
- Add scripts/test_mainstream_apps.py covering 16 consumer apps across social, video, e-commerce, and utility domains.
- Add scripts/test_bank_apps.py covering 12 banking and financial apps for compatibility and splash ad skip testing.
- Add scripts/README.md with usage documentation and environment prerequisites.
@zfdang
zfdang merged commit d896dc1 into master Oct 19, 2026
1 check passed
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.

1 participant