v1.0.7 — tighten Shorts detection so YouTube can open#11
Merged
Conversation
v1.0.6 was firing GLOBAL_ACTION_BACK on every YouTube launch — its
loose class-name rule ("any class containing 'shorts' or 'reel'")
matched the bottom-nav Shorts tab button, which is visible on every
YouTube screen. Result: the user's YouTube closed instantly, and our
counter showed phantom dismissals for what were really tab-button
matches on the home feed.
The fix is a strict class rule: a class triggers only when it contains
BOTH a Shorts keyword (`shorts` / `reel`) AND a player-container
keyword (`player` / `pager` / `recycler` / `container`) in the same
name. That separates the active player (e.g. ReelPlayerView) from the
tab indicator (e.g. LegacyShortsTabIndicatorView) — the tab class has
the first keyword but not the second.
Also:
- Loose ID-substring and class-without-player matches are still
counted but no longer trigger; they live on as diagnostic
counters in the in-app debug card so we can still tell whether
they would have fired.
- Debug card now surfaces both STRONG (id, strictCls) and loose
(id, cls) counts on separate lines.
- Dropped typeViewScrolled / typeViewSelected from the a11y
service config — they fired on every minor UI tick inside YT
and made the false-positive problem worse.
Trigger rules in v1.0.7 (all OR'd):
- 1+ exact STRONG view-ID suffix match
- 1+ class containing both a shorts keyword AND a player keyword
- 3+ "shorts" text/contentDescription hits AND a vertical scroller
Bump versionCode 7 → 8, versionName 1.0.6 → 1.0.7.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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.
Why
v1.0.6 closed YouTube on every launch. Its class-name rule ("any class containing 'shorts' or 'reel' triggers") matched the bottom-nav Shorts tab button, which is visible on every YouTube screen. The reported counter of "12 shorts blocked" was 12 attempts to open YouTube, each immediately back-pressed out.
Fix — strict class rule
A class triggers only when it contains BOTH:
…in the same class name. The active Shorts player (e.g. `ReelPlayerView`) has both. The tab indicator (e.g. `LegacyShortsTabIndicatorView`) has only the first. So home-screen YouTube no longer triggers, but the player still does.
Loose substring matches (any view ID containing "shorts", any class containing "shorts" without a player keyword) are still counted for diagnostics but no longer trigger.
Other changes
strongIds,strictCls) from loose (ids,cls) so you can see which detector would have fired.Test plan