Repository navigation
general: add option to hide home category bar - #4339
imparable2022 wants to merge 1 commit into
Conversation
MoriMomo
left a comment
There was a problem hiding this comment.
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:nonealso 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-rendereris 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
-
The feature CSS lives inside
accessibility.js'spageStyleText(). 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 otherhtml[it-...]toggle rules. -
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
masterso it can stand alone. -
Locale indentation nit. In
_locales/es/messages.jsonthe newhideHomeCategoryBarentry is indented with 2 spaces while the surrounding entries use 4. Minor, but worth aligning. -
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 thehide_home_category_barstorage 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.
2e22c32 to
4046756
Compare
4046756 to
6932ef9
Compare
Standalone optional feature
This feature is now separate from the accessibility work and branches directly from
master. Its CSS rule lives ingeneral.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/hidecontenthides video previews but leaves the category chip bar visible and exposed to screen readers.Feature
Add an independent General switch:
hide_home_category_barhideHomeCategoryBarHide category bar on YouTube home pageWhen enabled, the rule is scoped to the YouTube Home route only:
The route condition avoids hiding filters on Search, Subscriptions, channels and other pages.
display:nonealso 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.