Skip to content

🐛 fix: support new YouTube camelCase class names for lockup view models#11

Merged
Flaflo merged 2 commits into
Flaflo:mainfrom
m0x2A:main
Apr 9, 2026
Merged

🐛 fix: support new YouTube camelCase class names for lockup view models#11
Flaflo merged 2 commits into
Flaflo:mainfrom
m0x2A:main

Conversation

@m0x2A

@m0x2A m0x2A commented Apr 9, 2026

Copy link
Copy Markdown
Contributor

Summary

YouTube recently updated its DOM structure for video elements (lockup view models), switching from BEM-style class names (e.g., .yt-lockup-view-model__content-image) to a new camelCase format (e.g., .ytLockupViewModelContentImage). This caused the list-view layout to break, resulting in oversized thumbnails and broken grid alignment.

This PR introduces "hybrid" support for both naming conventions to ensure the userscript remains functional across different YouTube experiments/rollouts.

Changes

  • Selectors: Updated src/core/selectors.ts to include camelCase classes using CSS :is() pseudo-classes.
  • Styling: Updated src/ui/style/list-view.css to apply list-view transformations to the new class names.
  • Compatibility: Fixed grid template columns and thumbnail sizing for the updated ytLockupViewModelHost structure.

Technical Details

  • Added :is(.yt-lockup-view-model__content-image, .ytLockupViewModelContentImage) and similar patterns to catch the new structure.
  • Ensured metadata, titles, and avatars are correctly targeted for hiding/repositioning within the list layout.

Disclaimer: This Pull Request was prepared with the assistance of an AI Code Agent (opencode).

@Flaflo Flaflo self-assigned this Apr 9, 2026
Comment thread src/ui/style/list-view.css

@Flaflo Flaflo left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much for this contribution, they really seem to eagerly refactor their class names at the moment for whatever reason.

Can you please update this one suggested change? Thanks!

@Flaflo Flaflo merged commit 5eca7d0 into Flaflo:main Apr 9, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

List view broken by YouTube update text missing on the right? Request: Change position of description lines and channel avatar

2 participants