Skip to content

(extension) make controls interactive in full screen video in main frame [DA-402]#328

Merged
Mr-Quin merged 2 commits intomasterfrom
DA-402_Main-frame-case
Mar 17, 2026
Merged

(extension) make controls interactive in full screen video in main frame [DA-402]#328
Mr-Quin merged 2 commits intomasterfrom
DA-402_Main-frame-case

Conversation

@Mr-Quin
Copy link
Owner

@Mr-Quin Mr-Quin commented Mar 17, 2026

No description provided.

@Mr-Quin Mr-Quin self-assigned this Mar 17, 2026
Copilot AI review requested due to automatic review settings March 17, 2026 03:52
@Mr-Quin
Copy link
Owner Author

Mr-Quin commented Mar 17, 2026

Task linked: DA-402 Main frame case

@vercel
Copy link

vercel bot commented Mar 17, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
danmaku-anywhere-web-dvay Ready Ready Preview, Comment Mar 17, 2026 4:02am

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Mar 17, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
danmaku-anywhere-web f4d5724 Commit Preview URL

Branch Preview URL
Mar 17 2026, 04:02 AM

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses an issue where extension controls become non-interactive when a video enters fullscreen mode. It introduces a new user-configurable option to enable or disable this interaction. By dynamically adjusting the DOM hierarchy of the extension's popover, the changes ensure that users can continue to interact with the extension's features even when watching videos in fullscreen, significantly improving the user experience for those who prefer interactive controls in this mode.

Highlights

  • New Configuration Option: Introduced a new configuration option, enableFullscreenInteraction, allowing users to control whether extension popovers remain interactive during fullscreen video playback.
  • Popover Interactivity in Fullscreen: Implemented logic to dynamically re-parent extension popovers into the fullscreen element, ensuring continued interactivity when the new option is enabled.
  • Localization and Defaults: Added localized strings for the new setting in both English and Chinese, and set its default value to true.
  • Version Upgrade: Included a version upgrade mechanism (v23) to automatically enable the new enableFullscreenInteraction setting for existing users.
Changelog
  • packages/danmaku-anywhere/src/common/localization/locales/en/translation.json
    • Added enableFullscreenInteraction translation key.
  • packages/danmaku-anywhere/src/common/localization/locales/zh/translation.json
    • Added enableFullscreenInteraction translation key with Chinese translation.
  • packages/danmaku-anywhere/src/common/options/extensionOptions/constant.ts
    • Set enableFullscreenInteraction to true by default in player options.
  • packages/danmaku-anywhere/src/common/options/extensionOptions/schema.ts
    • Added enableFullscreenInteraction as a boolean to the player options schema.
  • packages/danmaku-anywhere/src/common/options/extensionOptions/service.ts
    • Initialized enableFullscreenInteraction in the default player options.
    • Added a version upgrade (v23) to set enableFullscreenInteraction to true.
  • packages/danmaku-anywhere/src/common/settings/settingConfigs.ts
    • Added a new toggle setting for enableFullscreenInteraction to the advanced settings.
  • packages/danmaku-anywhere/src/content/common/reparentPopover.ts
    • Created a new utility function reparentPopover to handle moving a popover element into a target element, or back to the body.
  • packages/danmaku-anywhere/src/content/controller/danmaku/frame/FrameManager.tsx
    • Imported useExtensionOptions and reparentPopover.
    • Integrated enableFullscreenInteraction option to conditionally call reparentPopover when the popover needs to be shown.
  • packages/danmaku-anywhere/src/content/player/index.ts
    • Imported reparentPopover.
    • Updated the fullscreenchange event listener to use reparentPopover based on the enableFullscreenInteraction setting.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new setting enableFullscreenInteraction to allow users to interact with extension controls while in fullscreen mode. The changes include adding the new option to schemas, constants, and UI settings, along with a data migration for existing users. The core logic is implemented in a new reparentPopover utility function, which is then used in the player and controller content scripts to manage the popover's DOM position during fullscreen changes.

My review focuses on improving code robustness and maintainability. I've suggested making the data migration safer, refactoring the new reparentPopover function to reduce duplication, and consolidating duplicated option-handling logic in the player content script.

Comment on lines +190 to +197
extensionOptionsService.get().then((options) => {
enableFullscreenInteraction =
options.playerOptions.enableFullscreenInteraction
})
extensionOptionsService.onChange((options) => {
enableFullscreenInteraction =
options.playerOptions.enableFullscreenInteraction
})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

You're adding new get().then() and onChange() handlers, but similar handlers already exist for other player options on lines 159-183. This introduces code duplication and multiple subscriptions to the same service. To improve maintainability, you should consolidate this logic into the existing handlers.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the browser extension’s content-script popover handling so the extension UI remains interactive when a main-frame video enters fullscreen, and introduces a new user option to enable/disable this behavior.

Changes:

  • Add reparentPopover() helper to move the popover into the current document.fullscreenElement (or back to document.body) to preserve pointer interactivity.
  • Wire fullscreen handling in both the player content script and controller frame manager, gated by a new playerOptions.enableFullscreenInteraction option.
  • Add the new option to defaults, schema, storage migration, settings UI config, and i18n strings.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/danmaku-anywhere/src/content/player/index.ts Reparents the player popover on fullscreenchange, controlled by the new option.
packages/danmaku-anywhere/src/content/controller/danmaku/frame/FrameManager.tsx Reparents the controller popover when instructed by the player, controlled by the new option.
packages/danmaku-anywhere/src/content/common/reparentPopover.ts New shared helper implementing the reparent + popover re-show logic.
packages/danmaku-anywhere/src/common/settings/settingConfigs.ts Adds an Advanced toggle for fullscreen interactivity.
packages/danmaku-anywhere/src/common/options/extensionOptions/service.ts Adds default value and a storage migration (version 23).
packages/danmaku-anywhere/src/common/options/extensionOptions/schema.ts Extends playerOptionsSchema with enableFullscreenInteraction.
packages/danmaku-anywhere/src/common/options/extensionOptions/constant.ts Adds the new option to defaultExtensionOptions.
packages/danmaku-anywhere/src/common/localization/locales/zh/translation.json Adds zh translation for the new toggle label.
packages/danmaku-anywhere/src/common/localization/locales/en/translation.json Adds en translation for the new toggle label.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Mr-Quin Mr-Quin merged commit fb31cd7 into master Mar 17, 2026
11 of 14 checks passed
@Mr-Quin Mr-Quin deleted the DA-402_Main-frame-case branch March 17, 2026 04:02
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