Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e2b7b67937
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| overlay.addEventListener('click', (e) => { | ||
| e.preventDefault(); | ||
| overlayRevealed = true; | ||
| video.play(); | ||
| overlay.remove(); |
There was a problem hiding this comment.
Stop overlay click from bubbling to page handlers
The click handler no longer calls stopPropagation(), so the overlay click now bubbles up to ancestor handlers. On pages like X/Twitter where the tweet container uses click handlers to open the tweet detail view, this means “click to play” can also navigate/open the tweet instead of just starting playback. This regression happens whenever the host page registers click handlers on ancestors of the video container, so consider restoring stopPropagation() (or otherwise preventing host clicks) to keep overlay clicks from triggering page-level navigation.
Useful? React with 👍 / 👎.
Motivation
Description
attachOverlayhelper that creates a.be-video-overlayonly when absent and returns it for later control.overlayRevealedflag to track whether the overlay has been revealed and should no longer block playback interactions.video.play(), setsoverlayRevealed = true, and removes the overlay withoverlay.remove()instead of callingstopPropagation()or leaving a hidden element.pauselistener that resetsoverlayRevealedand re-attaches the overlay viaattachOverlay()(unless the video ended), and update theplayhandler to use theoverlayRevealedflag to prevent unwanted autoplay.Testing
Codex Task