Remove close (×) button from controller overlay#1460
Merged
Conversation
## What changed
The × button that appeared at the right edge of the five-button
controller overlay (« − + » ×) has been removed. The overlay now
shows four buttons: rewind, slower, faster, advance.
Only two things were deleted from src/ui/shadow-dom.js:
1. The button entry { action: 'display', text: '×', class: 'hideButton' }
2. The .hideButton CSS rule (opacity + margin)
Nothing else was touched. The 'display' action in action-handler.js,
the V keybinding in key-maps.js, and the "Show/hide controller" row
in the options page all remain intact — the keyboard path is unchanged.
## Why
The button's only job was to hide the controller, but it sat right
next to the advance (») button with no spacing or confirmation.
Mouse-only users would accidentally dismiss the controller and then
have no on-screen affordance to bring it back; recovery required
knowing the V shortcut. Issue #1431 is a representative report.
The button is also no longer the only non-keyboard path to control
visibility. Three other mechanisms now exist:
1. Keyboard shortcut (default V) — toggle per-tab, instant.
Fires the 'display' action in action-handler.js, which toggles
vsc-hidden and sets vsc-manual on the host element.
2. "Hide controller by default" (options → startHidden checkbox) —
persistent, all sites. When true, video-controller.js adds
vsc-hidden at construction time. The V shortcut still toggles.
3. Per-site disable via site rules (options → siteRules[]) —
persistent, pattern-matched. When a rule matches with
enabled: false, content-entry.js skips initialization entirely;
no controller is created. Patterns support plain domains
(youtube.com) and regex (/\.edu$/i).
4. Global power toggle (popup → enabled flag) — persistent, all
sites. When false, content-entry.js early-exits and the
extension icon turns red.
Mechanisms 2-4 are surfaced in the popup and options UI; mechanism 1
is always available via keyboard. Together they cover every use case
the × button served, without the mis-click risk.
## Visibility class cascade (unchanged, for reference)
The controller host element (<vsc-controller>) uses four CSS classes
to manage visibility, applied to the shadow host:
vsc-hidden — hard hide (display:none). Set by 'display' action
toggle or startHidden. Wins unless overridden.
vsc-manual — latches on first user toggle, never cleared.
Prevents YouTube autohide and flash from overriding
explicit user intent.
vsc-autohide — YouTube player-controls fade integration.
Ignored when vsc-manual is set.
vsc-show — temporary override used by flashController() for
speed-change feedback. Skipped when vsc-manual +
vsc-hidden (user explicitly hid).
CSS specificity order (shadow-dom.js):
:host(.vsc-show) > :host(.vsc-manual:not(.vsc-hidden)) >
:host(.vsc-hidden) / :host(.vsc-autohide)
igrigorik
force-pushed
the
claude/audit-1431-pm-review-Oyv0v
branch
from
March 28, 2026 00:56
fb9d655 to
7d4d775
Compare
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.
The close button is an accidental-click magnet for mouse-only users
(#1431) and redundant now that hide/show is available via keyboard
shortcut (V) and the extension popup/options can disable the
controller globally or per-site.
The 'display' action and its keybinding are intentionally kept intact.