Skip to content

v1.0.7 — tighten Shorts detection so YouTube can open#11

Merged
undisputedP merged 1 commit into
mainfrom
claude/v1.0.7-strict-class-detection
May 9, 2026
Merged

v1.0.7 — tighten Shorts detection so YouTube can open#11
undisputedP merged 1 commit into
mainfrom
claude/v1.0.7-strict-class-detection

Conversation

@undisputedP
Copy link
Copy Markdown
Owner

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:

  • a Shorts keyword (`shorts` / `reel`), AND
  • a player-container keyword (`player` / `pager` / `recycler` / `container`)

…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

  • Debug card splits STRONG (strongIds, strictCls) from loose (ids, cls) so you can see which detector would have fired.
  • Dropped `typeViewScrolled` / `typeViewSelected` from the accessibility config — they fired on every minor UI update inside YouTube and amplified the false-positive problem.

Test plan

  • CI green
  • Install `v1.0.7.apk`, re-grant accessibility permission
  • Open YouTube — home feed should load normally, NOT close
  • Browse to a regular video — should play normally
  • Open a Short — should bounce out within ~600ms
  • In the app, tap Refresh on the debug card after each — confirm counts behave as expected (zeros on home feed, non-zero strict on Shorts)

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>
@undisputedP undisputedP merged commit 345afd4 into main May 9, 2026
2 checks 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