Skip to content

[backport/1.4] core:frontend:views:MainView: Fix check internet #3896

Open
patrickelectric wants to merge 1 commit intobluerobotics:1.4-devfrom
joaoantoniocardoso:backports/1.4/fix-main-view-banner-issue-1705
Open

[backport/1.4] core:frontend:views:MainView: Fix check internet #3896
patrickelectric wants to merge 1 commit intobluerobotics:1.4-devfrom
joaoantoniocardoso:backports/1.4/fix-main-view-banner-issue-1705

Conversation

@patrickelectric
Copy link
Copy Markdown
Member

@patrickelectric patrickelectric commented Apr 24, 2026

This is a backport from #3619 into 1.4

  • Make sure the connect to internet banner only appears when no internet connection is available instead of WiFi network

Summary by Sourcery

Bug Fixes:

  • Correct the internet connection banner condition so it only appears when there is no internet connectivity instead of when no Wi‑Fi network is selected.

* Make sure the connect to internet banner only appears when no internet
  connection is available instead of WiFi network
@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented Apr 24, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Backports a fix to ensure the 'connect to internet' banner is driven by actual internet connectivity state instead of Wi‑Fi association state in MainView, wiring it to the helper store’s internet connection status.

Sequence diagram for MainView rendering internet banner

sequenceDiagram
  actor User
  participant Browser
  participant VueApp
  participant MainView
  participant HelperStore
  participant InternetConnectionState

  User->>Browser: Navigate_to_MainView
  Browser->>VueApp: Load_MainView_component
  VueApp->>MainView: Create_instance
  MainView->>HelperStore: Read_has_internet
  HelperStore->>InternetConnectionState: Get_current_state
  InternetConnectionState-->>HelperStore: state
  HelperStore-->>MainView: has_internet_state
  MainView->>MainView: Compute_has_internet(has_internet_state != OFFLINE)
  MainView-->>VueApp: has_internet_value
  VueApp->>Browser: Render_v_alert_v_if_!has_internet
  Browser-->>User: Show_or_hide_connect_to_internet_banner
Loading

Class diagram for MainView internet connectivity check

classDiagram
  class MainView {
    +computed menu_items : menuItem[]
    +computed has_internet : boolean
  }

  class HelperStore {
    +has_internet : InternetConnectionState
  }

  class InternetConnectionState {
    <<enumeration>>
    ONLINE
    OFFLINE
    CAPTIVE_PORTAL
    UNKNOWN
  }

  MainView --> HelperStore : reads_has_internet
  HelperStore --> InternetConnectionState : uses_state
Loading

File-Level Changes

Change Details Files
Drive the internet connection banner visibility from the helper store’s internet connectivity state rather than the Wi‑Fi current network state.
  • Change the v-alert condition from checking absence of a current Wi‑Fi network to checking lack of internet connectivity.
  • Replace wifi store import and Network type usage with helper store import and InternetConnectionState enum.
  • Introduce a has_internet computed property that maps helper.has_internet state to a boolean used by the template.
core/frontend/src/views/MainView.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
Copy Markdown

@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 left some high level feedback:

  • The computed has_internet value currently treats any state other than OFFLINE as online; if InternetConnectionState has intermediate/unknown states (e.g. UNKNOWN or CHECKING), consider explicitly checking for ONLINE to avoid hiding the banner during ambiguous connectivity.
  • Consider renaming the computed property from has_internet to something like isOnline or internetStatusOk to more clearly distinguish it from the underlying helper.has_internet state and reduce confusion between the raw store value and the derived boolean.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The computed `has_internet` value currently treats any state other than `OFFLINE` as online; if `InternetConnectionState` has intermediate/unknown states (e.g. `UNKNOWN` or `CHECKING`), consider explicitly checking for `ONLINE` to avoid hiding the banner during ambiguous connectivity.
- Consider renaming the computed property from `has_internet` to something like `isOnline` or `internetStatusOk` to more clearly distinguish it from the underlying `helper.has_internet` state and reduce confusion between the raw store value and the derived boolean.

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.

@patrickelectric
Copy link
Copy Markdown
Member Author

I would hold this PR until we do the stable release for RadCam.

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