Skip to content

fix(tray): hide the tray again after keyboard interaction - #64

Open
TUTAMKHAMON wants to merge 1 commit into
masterfrom
claude/player-controls-bar-keyboard-927230
Open

fix(tray): hide the tray again after keyboard interaction#64
TUTAMKHAMON wants to merge 1 commit into
masterfrom
claude/player-controls-bar-keyboard-927230

Conversation

@TUTAMKHAMON

@TUTAMKHAMON TUTAMKHAMON commented Sep 4, 2026

Copy link
Copy Markdown
Member

Summary

Reported: once the player has been controlled via keyboard, the controls tray never auto-hides again, even after clicking inside the player and then moving focus elsewhere.

Root cause. Pressing Tab ran the accessibility module's keydown handler, which set the persisted alwaysShowTray setting to true. Nothing ever reset it, so the first Tab press effectively turned on "always show tray" for the rest of the session. As a side effect, a customer's explicit alwaysShowTray=0 was silently overridden as soon as anyone tabbed into the player.

Fix. Tray visibility is now tied to focus, inside the design module which owns the tray:

  • The tray shows when focus moves into #tray and stays visible while a tray control has focus. The existing 5s hide timer re-arms instead of hiding while focus remains inside the tray.
  • When focus leaves the tray or the window loses focus, the normal 5s countdown runs and the tray hides as it does for mouse users.
  • New trayShown getter/setter on Player; the Tab handler calls Player.set("trayShown", true) instead of touching alwaysShowTray.
  • The real alwaysShowTray setting is no longer mutated by keyboard input.

Behaviour note: if Tab lands on a focusable element outside the tray (e.g. the big play button), the tray now shows for 5s and hides, rather than staying forever.

Test plan

Verified manually in a local build (glue + eingebaut + visualplatform.js), ?domain=video.twentythree.com&autoPlay=0:

  • Play, Tab into the tray, wait 7s: tray-shown remains, alwaysShowTray stays 0
  • Click on the video to move focus out, wait 7s: tray-shown removed
  • Tab back in, blur the focused control, wait 7s: tray-shown removed
  • Load with alwaysShowTray=1: tray stays shown permanently
  • Reviewer: tab from the host page into an embedded iframe player and back out, confirm the tray hides after focus leaves the iframe

🤖 Generated with Claude Code

Pressing Tab flipped the persisted alwaysShowTray setting to true and
nothing ever reset it, so the tray never auto-hid again after keyboard
use (and a customer's alwaysShowTray=0 was silently overridden).

The tray is now kept visible while a control inside it has focus, and
the normal hide countdown resumes when focus leaves the tray or the
window. A trayShown getter/setter is exposed on the Player and the Tab
handler uses that instead of touching alwaysShowTray.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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.

1 participant