Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add metered connection and usability check #4168

Merged
merged 8 commits into from
Sep 21, 2024

Conversation

haslinghuis
Copy link
Member

@haslinghuis haslinghuis commented Sep 17, 2024

@haslinghuis haslinghuis added this to the 11.0 milestone Sep 17, 2024
@haslinghuis haslinghuis self-assigned this Sep 17, 2024
Copy link

netlify bot commented Sep 17, 2024

Deploy Preview for origin-betaflight-app ready!

Name Link
🔨 Latest commit 2045b46
🔍 Latest deploy log https://app.netlify.com/sites/origin-betaflight-app/deploys/66ef39e8f9f6d70008b3f033
😎 Deploy Preview https://deploy-preview-4168.dev.app.betaflight.com
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@haslinghuis haslinghuis force-pushed the metered-connection branch 4 times, most recently from 539650e to 0aebfdd Compare September 17, 2024 15:10
@nerdCopter
Copy link
Member

nerdCopter commented Sep 17, 2024

essentially this PR checks for "slow" connection and switches to a "disconnected-mode", correct?
(ref: src/js/utils/connection.js line 22)

edit: "disconnected-mode" here seemingly only build-options -- looks good. maybe can be expanded in future, unsure what other needs exist.

@haslinghuis
Copy link
Member Author

haslinghuis commented Sep 17, 2024

Correct. build-options come from flight controller directly.

Also

  • thinking about showing status in status bar instead of repeated console.log.
  • Metered option disables the connection too. Would like to use notification dialog if possible to allow connection for flashing.
  • Tuning of the minimal required values for type, downlink and round trip time.

@nerdCopter
Copy link
Member

nerdCopter commented Sep 17, 2024

nice: image
but seemingly inaccurate
image

@haslinghuis
Copy link
Member Author

haslinghuis commented Sep 17, 2024

image

image

image

🤔 About measurement: https://accreditly.io/articles/detecting-a-slow-internet-connection-in-javascript

Also (seemingly available) official documentation still points to

image

The part of PWA where much API's are still in development or experimental is a gray zone.

Okay let's use inverted logic here instead of measuring connection.

@haslinghuis haslinghuis changed the title Add Metered connection and usability check Add metered connection and usability check Sep 19, 2024
@haslinghuis
Copy link
Member Author

@nerdCopter had tried to make it more intelligent, but will add too much code and state tracking. So instead of using inaccurate measurements just let the user decide to disable in app internet communication

@nerdCopter
Copy link
Member

on the taskbar, where you had ISP: Online, can you revert to a online/offline so that is a visible state?

@haslinghuis
Copy link
Member Author

@nerdCopter Moved connection info to setup tab

image

Would like to reserve the taskbar for something else.

@nerdCopter
Copy link
Member

hmmm, okay, but but maybe user should know status when not connected 🤷
for example flash-tab disabled, thus user thinks "why?" with no indicator.

@haslinghuis
Copy link
Member Author

@nerdCopter Would really like a icon as indicator, but struggling finding svg in correct size and putting it in place.

Was playing with

Screencast.from.19-09-24.18.30.00.webm

@nerdCopter
Copy link
Member

i suspect already using some fancy font pack no?
https://fontawesome.com/search?q=online&o=r

@haslinghuis
Copy link
Member Author

haslinghuis commented Sep 19, 2024

Yes tried fontawesome snippets already - not showing up 😕
Also for svg version you need to have a subscription.

image

@haslinghuis
Copy link
Member Author

We already have an indicator 😂
image

@flyasky
Copy link

flyasky commented Sep 20, 2024

translations for RU & UA:
UA: "Не підключатись до інтернет (для платних або повільних з'єднань)"
RU: "Не подключаться к интернет (для платных или медленных подключений)"

Copy link
Member

@nerdCopter nerdCopter left a comment

Choose a reason for hiding this comment

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

LGTM

@nerdCopter
Copy link
Member

there is a SonarCloud however.

@haslinghuis
Copy link
Member Author

@nerdCopter remaining issues are html and css related and just extends existing code which needs overhaul anyway.

Copy link

@haslinghuis haslinghuis merged commit 5ef26ae into betaflight:master Sep 21, 2024
8 checks passed
@haslinghuis haslinghuis deleted the metered-connection branch September 21, 2024 21:28
demvlad pushed a commit to demvlad/betaflight-configurator that referenced this pull request Nov 14, 2024
* Add Metered connection and usability check

* Add network speed to status bar

* Add network type

* Introduce network status

* Rephrase option

* Add network info to setup tab

* Reserve statusbar for something else

* Make sonar happy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

Slow or delayed connection during weak internet connection
4 participants