Skip to content

feat(chat): add connectivity warning before model download#36

Merged
using-system merged 11 commits into
mainfrom
feat/connectivity-warning-model-download
Apr 26, 2026
Merged

feat(chat): add connectivity warning before model download#36
using-system merged 11 commits into
mainfrom
feat/connectivity-warning-model-download

Conversation

@using-system
Copy link
Copy Markdown
Owner

Summary

  • Add connectivity_plus to detect network type (WiFi, mobile data, none) before starting the LLM model download
  • Show a blocking dialog when there is no internet connection
  • Show a confirmation dialog when on mobile data, warning the download is large and recommending WiFi
  • Add localized strings for connectivity warnings in all 4 locales (en, es, fr, de)
  • Update SPEC.md with the new dependency

Test plan

  • On WiFi: download starts automatically without any dialog
  • On mobile data: confirmation dialog appears with Cancel/Continue
  • With no connection: blocking dialog appears with OK, then retry button is shown
  • Tapping Retry after connectivity failure re-triggers the connectivity check
  • Verify all 4 locales display correct translated strings

🤖 Generated with Claude Code

using-system and others added 5 commits April 26, 2026 12:47
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings April 26, 2026 10:57
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a preflight connectivity check before initiating the on-device LLM model download, warning users when they’re offline or on mobile data.

Changes:

  • Add connectivity_plus dependency for network type detection.
  • Gate model download behind connectivity-based dialogs (no connection / mobile data warning).
  • Add new localized strings (en/es/fr/de) and document the dependency in SPEC.md (plus design/plan docs).

Reviewed changes

Copilot reviewed 9 out of 10 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
pubspec.yaml Adds connectivity_plus as a direct dependency.
pubspec.lock Locks connectivity_plus and related transitive packages.
lib/l10n/app_en.arb Adds new dialog/button strings with ARB metadata.
lib/l10n/app_es.arb Adds Spanish translations for connectivity warning strings.
lib/l10n/app_fr.arb Adds French translations for connectivity warning strings.
lib/l10n/app_de.arb Adds German translations for connectivity warning strings.
lib/features/chat/presentation/model_download_page.dart Adds connectivity check + dialogs and gates download accordingly.
docs/superpowers/specs/2026-04-26-connectivity-warning-before-model-download-design.md Adds design spec for the connectivity warning behavior.
docs/superpowers/plans/2026-04-26-connectivity-warning-before-model-download.md Adds implementation plan for the feature.
SPEC.md Documents connectivity_plus in a new “Connectivity” section.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lib/features/chat/presentation/model_download_page.dart Outdated
Comment thread lib/features/chat/presentation/model_download_page.dart Outdated
…completed crash

Guard _startDownload() with a _downloading flag to prevent multiple
simultaneous download attempts. Without this, rapid retry taps or page
rebuilds could trigger overlapping flutter_gemma SmartDownloader
instances, completing the same Future twice.

Closes Crashlytics issue 8c0e50240cd828f1c248b2bdc9b57369.
Add app_it.arb with full Italian translations for all keys,
register 'it' in both language name maps, and update SPEC.md
to reflect 5 supported locales.
Copilot AI review requested due to automatic review settings April 26, 2026 11:08
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 12 out of 13 changed files in this pull request and generated 11 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread SPEC.md
Comment thread lib/features/chat/presentation/model_download_page.dart Outdated
Comment thread lib/features/l10n/presentation/language_picker_tile.dart
Comment thread lib/features/chat/presentation/model_download_page.dart Outdated
Comment thread lib/features/chat/presentation/model_download_page.dart
Comment thread lib/features/chat/presentation/model_download_page.dart Outdated
Comment thread lib/features/chat/presentation/model_download_page.dart Outdated
Comment thread lib/features/chat/presentation/model_download_page.dart Outdated
using-system and others added 3 commits April 26, 2026 13:18
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 15 out of 16 changed files in this pull request and generated 6 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lib/features/chat/presentation/model_download_page.dart
Comment thread lib/features/chat/presentation/model_download_page.dart Outdated
Comment thread lib/features/settings/presentation/settings_page.dart Outdated
Comment thread lib/features/settings/presentation/settings_page.dart Outdated
Comment thread lib/features/l10n/presentation/language_picker_tile.dart
Comment thread lib/features/settings/presentation/settings_page.dart
- Add 'it' to LocalePreference.supportedLanguageCodes so Italian is
  selectable in the language picker
- Use Future.microtask for _startDownload in initState to avoid
  showing dialogs before the first frame
- Set barrierDismissible: false on the no-connection dialog
- Check explicitly for ConnectivityResult.mobile instead of !wifi to
  avoid false warnings on ethernet/VPN
- Move _checkConnectivity inside try block so _downloading resets on
  exception
- Use chatModelPreferenceStorageProvider instead of hardcoded key in
  reset logic
- Close database via provider before deleting the file
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 16 out of 17 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@using-system using-system merged commit 4e63f6f into main Apr 26, 2026
7 checks passed
@using-system using-system deleted the feat/connectivity-warning-model-download branch April 26, 2026 11:44
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