Skip to content

Conversation

@joaoantoniocardoso
Copy link
Member

@joaoantoniocardoso joaoantoniocardoso commented Jan 28, 2026

This is a backport of #3748 into 1.4

Following the same behavior as for Fake Sources: we only show when there's a configured stream or the user is in Pirate Mode.

Closes #3746

Summary by Sourcery

Bug Fixes:

  • Prevent the RadCam secondary stream entry from appearing when it has no active stream unless the user is in Pirate Mode.

@sourcery-ai
Copy link

sourcery-ai bot commented Jan 28, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Adds conditional visibility logic in VideoManager to hide the RadCam secondary stream unless it has an active stream or the user is in Pirate Mode, mirroring the existing behavior for Fake source devices.

Flow diagram for VideoManager device visibility logic

flowchart TD
  A[Start device visibility check] --> B{Is device name Fake_source}
  B -->|Yes| C{Has_active_stream OR is_pirate_mode}
  C -->|True| Z1[Show device]
  C -->|False| Z2[Hide device]
  B -->|No| D{Is device name UnderwaterCam_IPCamera_UnderwaterCam}
  D -->|Yes| E{Does device_source_end_with_stream_1}
  E -->|Yes| F{Has_active_stream OR is_pirate_mode}
  F -->|True| Z1
  F -->|False| Z2
  E -->|No| Z1
  D -->|No| Z1
  Z1 --> G[End visibility check]
  Z2 --> G
Loading

File-Level Changes

Change Details Files
Restrict visibility of RadCam secondary stream entries in the video manager device list.
  • Extend the device visibility guard in VideoManager to special-case RadCam’s secondary stream by device name and source URL suffix
  • For RadCam secondary stream devices, require either an active stream or Pirate Mode to return visible from the filter predicate
  • Preserve existing Fake source visibility behavior and the default true visibility for other devices
core/frontend/src/components/video-manager/VideoManager.vue

Possibly linked issues

  • #[Video] BlueOS must hide RadCam secondary streams from Video Streams page: PR changes visibility logic to hide RadCam secondary stream unless active or in Pirate Mode, matching issue request.

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:

  • The RadCam condition hardcodes both device.name and the /stream_1 suffix; consider moving these identifiers into a configuration or constants module so they can be maintained without changing component logic.
  • The visibility logic for Fake source and RadCam secondary streams is now duplicated; you could extract a shared helper (e.g. shouldShowDevice(device, settings)) to centralize the has_active_stream || is_pirate_mode rule and make future additions easier.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The RadCam condition hardcodes both `device.name` and the `/stream_1` suffix; consider moving these identifiers into a configuration or constants module so they can be maintained without changing component logic.
- The visibility logic for Fake source and RadCam secondary streams is now duplicated; you could extract a shared helper (e.g. `shouldShowDevice(device, settings)`) to centralize the `has_active_stream || is_pirate_mode` rule and make future additions easier.

## Individual Comments

### Comment 1
<location> `core/frontend/src/components/video-manager/VideoManager.vue:140-137` </location>
<code_context>
           return has_active_stream(device) || settings.is_pirate_mode
         }
+
+        // Do not show RadCam's secondary stream
+        if (device.name === 'UnderwaterCam - IPCamera (UnderwaterCam)' && device.source.endsWith('/stream_1')) {
+          return has_active_stream(device) || settings.is_pirate_mode
+        }
         return true
</code_context>

<issue_to_address>
**issue (bug_risk):** The condition and return value seem to contradict the comment about not showing RadCam's secondary stream.

This returns `has_active_stream(device) || settings.is_pirate_mode`, matching the "Fake source" behavior and still allowing the secondary stream to be shown when active or in pirate mode. If the goal is to always hide this secondary stream, this should return `false` (or similar) instead of delegating to `has_active_stream`. Otherwise, please adjust the comment to describe the intended nuanced behavior so it doesn’t mislead future readers.
</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.

@@ -136,6 +136,11 @@ export default Vue.extend({
if (device.name === 'Fake source') {
return has_active_stream(device) || settings.is_pirate_mode
Copy link

Choose a reason for hiding this comment

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

issue (bug_risk): The condition and return value seem to contradict the comment about not showing RadCam's secondary stream.

This returns has_active_stream(device) || settings.is_pirate_mode, matching the "Fake source" behavior and still allowing the secondary stream to be shown when active or in pirate mode. If the goal is to always hide this secondary stream, this should return false (or similar) instead of delegating to has_active_stream. Otherwise, please adjust the comment to describe the intended nuanced behavior so it doesn’t mislead future readers.

@joaoantoniocardoso joaoantoniocardoso merged commit 6c8f443 into bluerobotics:1.4 Jan 28, 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