Skip to content

Remove close (×) button from controller overlay#1460

Merged
igrigorik merged 1 commit into
masterfrom
claude/audit-1431-pm-review-Oyv0v
Mar 28, 2026
Merged

Remove close (×) button from controller overlay#1460
igrigorik merged 1 commit into
masterfrom
claude/audit-1431-pm-review-Oyv0v

Conversation

@igrigorik

@igrigorik igrigorik commented Mar 28, 2026

Copy link
Copy Markdown
Owner

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.

## 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
igrigorik force-pushed the claude/audit-1431-pm-review-Oyv0v branch from fb9d655 to 7d4d775 Compare March 28, 2026 00:56
@igrigorik
igrigorik merged commit 30917cf into master Mar 28, 2026
2 checks passed
@igrigorik
igrigorik deleted the claude/audit-1431-pm-review-Oyv0v branch March 28, 2026 00:57
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