Skip to content

Conversation

@joaoantoniocardoso
Copy link
Member

@joaoantoniocardoso joaoantoniocardoso commented Jan 28, 2026

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

New Features:

  • Conditionally hide RadCam’s secondary stream unless it has an active stream or 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

Adjusts VideoManager device visibility rules so RadCam’s secondary stream is only shown when it has an active stream or the user is in Pirate Mode, mirroring the behavior used for Fake source devices.

Sequence diagram for VideoManager device visibility evaluation

sequenceDiagram
  actor User
  participant VideoManager
  participant Device
  participant Settings

  User->>VideoManager: renderDeviceList()
  loop for each device
    VideoManager->>Device: get name
    alt device.name == Fake source
      VideoManager->>Device: has_active_stream(device)
      VideoManager->>Settings: is_pirate_mode
      VideoManager-->>VideoManager: visible = has_active_stream || is_pirate_mode
    else device.name == UnderwaterCam_IPCamera_UnderwaterCam and device.source endsWith /stream_1
      VideoManager->>Device: has_active_stream(device)
      VideoManager->>Settings: is_pirate_mode
      VideoManager-->>VideoManager: visible = has_active_stream || is_pirate_mode
    else other devices
      VideoManager-->>VideoManager: visible = true
    end
    alt visible
      VideoManager-->>User: show device entry
    else
      VideoManager-->>User: hide device entry
    end
  end
Loading

File-Level Changes

Change Details Files
Restrict visibility of RadCam secondary stream in the video manager.
  • Extend device visibility predicate to special-case RadCam secondary stream identified by name and /stream_1 suffix.
  • Apply same visibility rule used for Fake source devices: only show when there is an active stream or Pirate Mode is enabled.
  • Fallback to always showing other devices remains unchanged.
core/frontend/src/components/video-manager/VideoManager.vue

Assessment against linked issues

Issue Objective Addressed Explanation
#3746 Hide RadCam secondary streams from the Video Streams page in normal operation (while still allowing them to appear when they have an active stream or when in Pirate Mode, consistent with existing Fake source behavior).

Possibly linked issues

  • #[Video] BlueOS must hide RadCam secondary streams from Video Streams page: PR implements logic to hide RadCam secondary stream on the Video Streams page, matching the 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 detection relies on hard-coded device.name and a specific source suffix; consider centralizing these identifiers as constants or using a more robust device identifier to avoid brittle string matching.
  • The visibility logic for fake sources and RadCam’s secondary stream is now duplicated; you could extract a shared helper (e.g., shouldShowConditionalDevice(device, settings)) to keep this behavior consistent and easier to extend.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The RadCam detection relies on hard-coded `device.name` and a specific `source` suffix; consider centralizing these identifiers as constants or using a more robust device identifier to avoid brittle string matching.
- The visibility logic for fake sources and RadCam’s secondary stream is now duplicated; you could extract a shared helper (e.g., `shouldShowConditionalDevice(device, settings)`) to keep this behavior consistent and easier to extend.

## Individual Comments

### Comment 1
<location> `core/frontend/src/components/video-manager/VideoManager.vue:140-141` </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
+        }
</code_context>

<issue_to_address>
**issue (bug_risk):** The comment about not showing the secondary stream seems at odds with the visibility logic used here.

The inline comment says "Do not show RadCam's secondary stream", but this condition is identical to the `Fake source` case and will still show the device when it has an active stream or pirate mode is enabled. If the goal is to always hide this secondary stream, this should likely return `false` (or otherwise short-circuit) instead of `has_active_stream(device) || settings.is_pirate_mode`. Please confirm the intended UX and then update either the logic or the comment so they are consistent.
</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.

@joaoantoniocardoso joaoantoniocardoso merged commit 84eea1c into bluerobotics:master 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.

[Video] BlueOS must hide RadCam secondary streams from Video Streams page

2 participants