fix(tray): hide the tray again after keyboard interaction - #64
Open
TUTAMKHAMON wants to merge 1 commit into
Open
fix(tray): hide the tray again after keyboard interaction#64TUTAMKHAMON wants to merge 1 commit into
TUTAMKHAMON wants to merge 1 commit into
Conversation
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>
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.
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
alwaysShowTraysetting totrue. 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 explicitalwaysShowTray=0was 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:
#trayand stays visible while a tray control has focus. The existing 5s hide timer re-arms instead of hiding while focus remains inside the tray.trayShowngetter/setter onPlayer; the Tab handler callsPlayer.set("trayShown", true)instead of touchingalwaysShowTray.alwaysShowTraysetting 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:tray-shownremains,alwaysShowTraystays0tray-shownremovedtray-shownremovedalwaysShowTray=1: tray stays shown permanently🤖 Generated with Claude Code