Skip to content

feat(download): add offline network indicator #636

Open
prince-0408 wants to merge 1 commit intoscribe-org:mainfrom
prince-0408:feature/offline-network-indicator
Open

feat(download): add offline network indicator #636
prince-0408 wants to merge 1 commit intoscribe-org:mainfrom
prince-0408:feature/offline-network-indicator

Conversation

@prince-0408
Copy link
Copy Markdown
Contributor

@prince-0408 prince-0408 commented Mar 31, 2026

Closes #637

Summary

Prevents silent failures on the download screen by detecting offline state before any network action is attempted, and surfacing a clear toast to the user.

Problem & Solution

Area Before After
Download button (offline) Fails silently or generic error Toast: "No internet connection"
"Check for new data" spinner (offline) Hangs or fails silently Toast: "No internet connection"
Network detection None NWPathMonitor singleton, passive background tracking

Changes

File Type Description
NetworkMonitor.swift New Lightweight NWPathMonitor singleton
DownloadStateManager.swift Modified Offline guards in handleDownloadAction & checkAllForUpdates

Notes

  • Purely additive — zero existing logic changed or removed
  • Reuses existing ToastView / ToastModifier infrastructure
  • NWPathMonitor is Apple-native — no new dependencies

Screenshot

Toast shown when tapping "Update all", "Download data", or "Check for new data" while offline.

Screenshot 2026-04-01 at 1 39 01 AM Screenshot 2026-04-01 at 1 51 56 AM

- Add NetworkMonitor singleton (NWPathMonitor) that passively tracks
  network reachability on a background utility queue
- Guard handleDownloadAction in DownloadStateManager to block downloads
  when offline and show a toast: 'No internet connection. Please connect
  and try again.'
- Guard checkAllForUpdates to block the 'check for new data' spinner
  when offline with the same toast feedback
- No existing logic removed — guards are purely additive early-returns
- Reuses the existing ToastView/ToastModifier infrastructure

Closes: offline silent failure on download screen
@github-actions
Copy link
Copy Markdown

Thank you for the pull request! 💙🩵

The Scribe-iOS team will do our best to address your contribution as soon as we can. The following are some important points:

  • Those interested in developing their skills and expanding their role in the community should read the mentorship and growth section of the contribution guide
  • If you're not already a member of our public Matrix community, please consider joining!
    • We'd suggest that you use the Element client as well as Element X for a mobile app
    • Join the General and iOS rooms once you're in
  • Also consider attending our bi-weekly Saturday developer syncs!
    • Details are shared in the General room on Matrix each Wednesday before the sync
    • It would be great to meet you 😊

Note

Scribe uses Conventional Comments in reviews to make sure that communication is as clear as possible.

@github-actions
Copy link
Copy Markdown

Maintainer Checklist

The following is a checklist for maintainers to make sure this process goes as well as possible. Feel free to address the points below yourself in further commits if you realize that actions are needed :)

  • Tests for changes have been written and the CI unit test, linting and formatting workflows within the PR checks do not indicate new errors in the files changed

  • The CHANGELOG has been updated with a description of the changes for the upcoming release and the corresponding issue (if necessary)

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.

feat: add offline network indicator on download screen

1 participant