Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR restores and enhances desktop system tray functionality while simplifying VPN server-location state handling by refactoring serverLocationProvider from async to synchronous state.
Changes:
- Refactored
serverLocationProviderto a synchronousNotifier, updating consumers to removeAsyncValuehandling. - Enhanced the desktop system tray menu with current location display, smart location selection, and routing mode toggles.
- Added
isTagAvailable()toLanternCoreServiceand used it to fall back to auto VPN when a selected server tag is unavailable.
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| lib/lantern/lantern_service_notifier.g.dart | Regenerated provider hash after service API changes. |
| lib/lantern/lantern_service.dart | Routes new isTagAvailable() call to FFI vs platform implementation. |
| lib/lantern/lantern_platform_service.dart | Implements method-channel isTagAvailable() for non-FFI platforms. |
| lib/lantern/lantern_generated_bindings.dart | Adds generated FFI binding symbol for isTagAvailable. |
| lib/lantern/lantern_ffi_service.dart | Implements FFI-based isTagAvailable() used by VPN start flow. |
| lib/lantern/lantern_core_service.dart | Extends core service interface with isTagAvailable(). |
| lib/features/vpn/server_selection.dart | Updates UI to consume synchronous serverLocationProvider. |
| lib/features/vpn/provider/vpn_notifier.g.dart | Regenerated provider hash after notifier changes. |
| lib/features/vpn/provider/vpn_notifier.dart | Uses synchronous server location and checks tag availability before connecting. |
| lib/features/vpn/provider/server_location_notifier.g.dart | Regenerated provider as synchronous NotifierProvider. |
| lib/features/vpn/provider/server_location_notifier.dart | Makes server location state synchronous and updates mutation logic accordingly. |
| lib/features/vpn/location_setting.dart | Simplifies settings tile by removing async when branches. |
| lib/features/system_tray/provider/system_tray_notifier.g.dart | Regenerated provider hash after tray logic changes. |
| lib/features/system_tray/provider/system_tray_notifier.dart | Adds richer tray menu + listeners for server location and routing mode, plus flag emoji utility. |
| lib/features/home/provider/home_notifier.dart | Simplifies reset logic using synchronous serverLocationProvider. |
| lib/features/home/home.dart | Simplifies body rendering by consuming synchronous server location directly. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
atavism
approved these changes
Mar 24, 2026
atavism
added a commit
that referenced
this pull request
Mar 24, 2026
* Update radiance + lantern-box for bandit distributed tracing (#8566) - radiance: picks up lantern-box v0.0.51 - lantern-box v0.0.51: propagates traceparent from bandit callback URLs, enabling contiguous distributed tracing across the feedback loop Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * System tray changes (#8568) * added back sys tray changes * server location changes * add flags only on desktop versions. * code review updates (#8569) * Update lantern_platform_service.dart --------- Co-authored-by: atavism <atavism@users.noreply.github.com> * Update radiance with bandit callback fixes (#8570) Picks up: - Pre-test uses live network config (not stale disk config) - updateGroup fires SetURLOverrides + CheckOutbounds on repeat configs - Pre-test timeout 5s → 15s for proxy callback tests Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * code review updates --------- Co-authored-by: Myles Horton <afisk@getlantern.org> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Co-authored-by: jigar-f <132374182+jigar-f@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added back the sys tray changes that got removed on #8447
This pull request refactors how server location state is managed and consumed across the application. The main change is converting the
serverLocationProviderfrom an asynchronous provider to a synchronous notifier, simplifying how server location data is accessed and updated. The system tray logic is also significantly improved, adding richer menu options and better state handling for location and routing mode.Key changes include:
State Management Refactor:
serverLocationProviderfrom anAsyncNotifierto a synchronousNotifier, removing the need for.when,.value, and handling of loading/error states throughout the codebase. This impacts how server location is read and updated in all consumers. [1] [2] [3]home.dart,home_notifier.dart, andlocation_setting.dartto directly use the synchronous value fromserverLocationProviderinstead of handling async states. [1] [2] [3] [4]VpnNotifierto read the server location synchronously, removing null checks and async handling.System Tray Enhancements:
Code Cleanup and Consistency:
These changes make the codebase simpler, more predictable, and enhance the user experience in the system tray.