Skip to content

general: add option to hide home category bar - #4339

Open
imparable2022 wants to merge 1 commit into
code-charity:masterfrom
imparable2022:feature/hide-home-category-bar
Open

imparable2022 wants to merge 1 commit into
code-charity:masterfrom
imparable2022:feature/hide-home-category-bar

Conversation

@imparable2022

@imparable2022 imparable2022 commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

Standalone optional feature

This feature is now separate from the accessibility work and branches directly from master. Its CSS rule lives in general.css, so it no longer depends on #4334. It remains a separate optional product feature so maintainers can accept or reject it independently.

User need

Existing YouTube home page → withoutVideos / hidecontent hides video previews but leaves the category chip bar visible and exposed to screen readers.

Feature

Add an independent General switch:

  • storage key: hide_home_category_bar
  • locale key: hideHomeCategoryBar
  • English: Hide category bar on YouTube home page

When enabled, the rule is scoped to the YouTube Home route only:

html[it-hide-home-category-bar="true"][it-pathname="/"] ytd-feed-filter-chip-bar-renderer {
    display: none !important;
}

The route condition avoids hiding filters on Search, Subscriptions, channels and other pages. display:none also removes that bar from the browser accessibility tree.

Runtime validation

The feature was tested in the unpacked Chromium build with NVDA and worked as intended.

Maintenance note

YouTube can rename ytd-feed-filter-chip-bar-renderer. In the audited revision, ImprovedTube's own category-refresh code already targets the same element, so the selector follows existing upstream knowledge.

@MoriMomo MoriMomo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Review

hi SO . Flagging up front that the diff looks large (+565/-11, 11 files) only because this PR is stacked on #4334, so most of it is that accessibility work. The actual feature here is a single commit (5a58aea): 4 files, +15/-3. My comments are only about that commit.

What works well

  • Small, focused feature that follows the existing General-section switch pattern.
  • The selector is correctly route-scoped with [it-pathname="/"], so filter bars on Search, Subscriptions, and channel pages are left alone. Good call.
  • display:none also removes the bar from the accessibility tree, which matches the stated motivation, and the description notes it was tested with NVDA.
  • Reusing ytd-feed-filter-chip-bar-renderer is reasonable since ImprovedTube's own category-refresh code already targets that element, so the selector follows existing project knowledge rather than a new guess.

Concerns

  1. The feature CSS lives inside accessibility.js's pageStyleText(). This is my main concern. A general "hide category bar" toggle is not accessibility-specific, and placing its rule inside the a11y module couples the feature to #4334 unnecessarily. If #4334 is reworked or rejected, this feature moves or breaks with it. It would be cleaner in the normal appearance/general CSS path alongside the other html[it-...] toggle rules.

  2. Hard dependency on an unmerged draft. This cannot merge until #4334 does, and #4334 is itself a large draft. If maintainers want this feature but not the full a11y bundle, this would need to be rebased onto plain master so it can stand alone.

  3. Locale indentation nit. In _locales/es/messages.json the new hideHomeCategoryBar entry is indented with 2 spaces while the surrounding entries use 4. Minor, but worth aligning.

  4. Please confirm the attribute toggle is wired. The CSS keys off html[it-hide-home-category-bar="true"], but this commit only adds the switch and the CSS rule. If the hide_home_category_bar storage value is not reflected onto the <html it-hide-home-category-bar> attribute, the rule never activates. This is usually automatic in this extension, so it is probably fine, but since the whole feature depends on it, a quick confirmation (or a note that it toggles in-browser) would help.

Summary

The feature itself is sound and genuinely small, with a nicely scoped selector. The issues are structural rather than functional: it is stacked on an unmerged draft, and the feature CSS is placed inside the accessibility module. Moving the CSS into the general appearance path and rebasing onto master so it stands on its own would make this much easier to accept.

@imparable2022
imparable2022 force-pushed the feature/hide-home-category-bar branch 2 times, most recently from 2e22c32 to 4046756 Compare October 26, 2026 16:37
@imparable2022
imparable2022 force-pushed the feature/hide-home-category-bar branch from 4046756 to 6932ef9 Compare October 26, 2026 16:38
@imparable2022
imparable2022 marked this pull request as ready for review October 26, 2026 16:48
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.

2 participants