Skip to content

Conversation

@patrickelectric
Copy link
Member

@patrickelectric patrickelectric commented Jan 9, 2026

Instead of hiding the iframe with v-show (which sets display: none and gives zero dimensions), the iframe is now always visible but layered behind the loading animation using z-index positioning.

Summary by Sourcery

Enhancements:

  • Update BrIframe layout to use relative/absolute positioning with z-index to layer the iframe beneath the loading spinner or WebGL canvas instead of hiding it.

@sourcery-ai
Copy link

sourcery-ai bot commented Jan 9, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

BrIframe now keeps the iframe always present and uses absolute positioning with z-index to layer the loading indicators above it instead of conditionally hiding the iframe with v-show.

State diagram for BrIframe iframe loading lifecycle

stateDiagram-v2
  [*] --> Initializing

  Initializing: iframe_loaded = false
  Initializing: iframe rendered behind overlay

  Initializing --> LoadingOverlayVisible: gl_compatible = false
  Initializing --> WebGLOvelayVisible: gl_compatible = true

  LoadingOverlayVisible: spinning_logo visible at z-index 2
  WebGLOvelayVisible: webglCanvas visible at z-index 2

  LoadingOverlayVisible --> IframeReady: iframe loadFinished()
  WebGLOvelayVisible --> IframeReady: iframe loadFinished()

  IframeReady: iframe_loaded = true
  IframeReady: iframe remains at z-index 1
  IframeReady: overlays not rendered

  IframeReady --> [*]
Loading

File-Level Changes

Change Details Files
Switch from conditional visibility (v-show) to z-index-based layering to keep the iframe always rendered while overlaying loading indicators.
  • Add position: relative to the v-sheet container to serve as a positioning context for absolutely positioned children.
  • Position the spinning-logo overlay absolutely, stretching it to cover the container and placing it above other content via z-index.
  • Position the WebGL canvas overlay absolutely over the container content when used, with a higher z-index than the iframe.
  • Always render the iframe (remove v-show binding) and position it absolutely behind overlays using a lower z-index.
core/frontend/src/components/utils/BrIframe.vue

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey - I've found 1 issue, and left some high level feedback:

  • Consider moving the new inline positioning/z-index styles into CSS classes to keep the template more readable and avoid scattering layout logic across inline style attributes.
  • With the iframe now always visible but layered underneath, ensure that the overlay elements (spinner/WebGL canvas) are removed or made non-interactive (pointer-events: none) as soon as possible so they don't inadvertently block user interaction or accessibility tooling that expects to reach the iframe.
  • The absolute positioning on the canvas and spinning-logo elements sets top/left but not width/height for the canvas, which may lead to inconsistent sizing compared to the spinner and iframe; consider explicitly sizing the canvas to fill the container as you do with the spinner.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Consider moving the new inline positioning/z-index styles into CSS classes to keep the template more readable and avoid scattering layout logic across inline style attributes.
- With the iframe now always visible but layered underneath, ensure that the overlay elements (spinner/WebGL canvas) are removed or made non-interactive (`pointer-events: none`) as soon as possible so they don't inadvertently block user interaction or accessibility tooling that expects to reach the iframe.
- The absolute positioning on the `canvas` and `spinning-logo` elements sets top/left but not width/height for the canvas, which may lead to inconsistent sizing compared to the spinner and iframe; consider explicitly sizing the canvas to fill the container as you do with the spinner.

## Individual Comments

### Comment 1
<location> `core/frontend/src/components/utils/BrIframe.vue:13-17` </location>
<code_context>
       subtitle="Loading external application..."
+      style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 2;"
     />
     <canvas
       v-if="gl_compatible && !iframe_loaded"
       ref="webglCanvas"
+      style="position: absolute; top: 0; left: 0; z-index: 2;"
     />
     <iframe
</code_context>

<issue_to_address>
**suggestion (bug_risk):** Canvas overlay might not cover the full iframe area as intended.

The iframe sets `width: 100%; height: 100%`, but the canvas overlay only sets position and z-index. To ensure the overlay matches the iframe area in all layouts, add `width: 100%; height: 100%` to the canvas style or an appropriate class.

```suggestion
    <canvas
      v-if="gl_compatible && !iframe_loaded"
      ref="webglCanvas"
      style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 2;"
    />
```
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Instead of hiding the iframe with v-show (which sets display: none and gives zero dimensions), the iframe is now always visible but layered behind the loading animation using z-index positioning.

Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
@joaomariolago joaomariolago merged commit 5441dd4 into bluerobotics:master Jan 12, 2026
7 checks passed
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