Skip to content

(app) add iframe page for debugging [DA-401]#327

Merged
Mr-Quin merged 1 commit intomasterfrom
DA-401_Add-iframe-player-to-app-for-debugging
Mar 17, 2026
Merged

(app) add iframe page for debugging [DA-401]#327
Mr-Quin merged 1 commit intomasterfrom
DA-401_Add-iframe-player-to-app-for-debugging

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 01:28
@Mr-Quin
Copy link
Owner Author

Mr-Quin commented Mar 17, 2026

@cloudflare-workers-and-pages
Copy link

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 9390120 Commit Preview URL

Branch Preview URL
Mar 17 2026, 01:28 AM

@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 1:28am

@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 introduces a dedicated iframe debug page to the application, enhancing development and testing capabilities. It establishes a new route and component for this feature, along with a corresponding sidebar navigation link. Additionally, minor layout adjustments were made to ensure proper height rendering for content within the KazumiLayout.

Highlights

  • New Debug Route: A new route /debug/iframe was added to the application, accessible only in development mode, to host an iframe for debugging purposes.
  • Iframe Debug Component: A new Angular component, IframeDebugPageComponent, was introduced to display an iframe that loads the application's origin URL, utilizing DomSanitizer for security.
  • Layout Adjustments: The KazumiLayout component was modified to ensure its main content area and host element occupy the full available height, improving layout consistency.
  • Sidebar Navigation: A new "iframe Debug" link was added to the debug section of the sidebar, providing easy navigation to the newly created iframe debug page.
Changelog
  • app/web/src/app/app.routes.ts
    • Added a new route definition for /debug/iframe that lazily loads the IframeDebugPageComponent.
  • app/web/src/app/features/debug/iframe-debug-page.component.ts
    • Created a new component IframeDebugPageComponent which includes an iframe element.
    • Implemented DomSanitizer to safely bypass security for the iframe's src attribute, setting it to window.location.origin.
  • app/web/src/app/features/kazumi/layout/kazumi-layout.ts
    • Modified the template to add h-full class to the main container div.
    • Added a host property to the component decorator to apply block h-full classes to the host element.
  • app/web/src/app/layout/components/sidebar/sidebar.component.ts
    • Added a new menu item for "iframe Debug" with path /debug/iframe and icon pip to the debug section of the sidebar.
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 adds a new debug page for iframes, which is a helpful addition for development. The related changes to routing, layout, and the sidebar are all appropriate. I've provided one suggestion on the new IframeDebugPageComponent to improve its robustness and platform-agnosticism by safely accessing the window object. Overall, this is a good change.

export class IframeDebugPageComponent {
private readonly domSanitizer = inject(DomSanitizer)
protected readonly iframeSrc =
this.domSanitizer.bypassSecurityTrustResourceUrl(window.location.origin)
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

Directly accessing the global window object is discouraged as it can cause issues with server-side rendering (SSR) where window is not defined. You can use globalThis along with optional chaining (?.) and nullish coalescing (??) to safely access window.location.origin only when it's available, providing an empty string as a fallback. This makes the code more robust and platform-independent.

Suggested change
this.domSanitizer.bypassSecurityTrustResourceUrl(window.location.origin)
this.domSanitizer.bypassSecurityTrustResourceUrl(globalThis.window?.location.origin ?? '')

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

Adds a new development-only “iframe debug” page to the Angular web app and updates layout styling to better support full-height debug views.

Changes:

  • Add /debug/iframe route (guarded by developmentOnly) that lazy-loads a new iframe debug component.
  • Expose the new debug page in the sidebar’s Debug navigation section.
  • Adjust KazumiLayout container/host classes to occupy full height.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

File Description
app/web/src/app/layout/components/sidebar/sidebar.component.ts Adds a new “iframe Debug” entry under the Debug sidebar section.
app/web/src/app/features/kazumi/layout/kazumi-layout.ts Updates layout/host classes to be full-height.
app/web/src/app/features/debug/iframe-debug-page.component.ts Introduces a new debug page component rendering an iframe.
app/web/src/app/app.routes.ts Registers the new /debug/iframe development-only route.

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

Comment on lines +16 to +20
export class IframeDebugPageComponent {
private readonly domSanitizer = inject(DomSanitizer)
protected readonly iframeSrc =
this.domSanitizer.bypassSecurityTrustResourceUrl(window.location.origin)
}
<div class="size-full border-1">
<iframe
[src]="iframeSrc"
class="size-full"
selector: 'da-iframe-debug-page',
changeDetection: ChangeDetectionStrategy.OnPush,
template: `
<div class="size-full border-1">
},
{
path: '/debug/iframe',
label: 'iframe Debug',
(m) => m.IframeDebugPageComponent
),
canActivate: [developmentOnly],
title: `Debug iframe | ${PAGE_TITLE}`,
@Mr-Quin Mr-Quin merged commit 45500dc into master Mar 17, 2026
16 checks passed
@Mr-Quin Mr-Quin deleted the DA-401_Add-iframe-player-to-app-for-debugging branch March 17, 2026 02: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