Skip to content

Split tunneling UI changes - #8970

Merged
jigar-f merged 11 commits into
mainfrom
jigar/split-tunneling-ui-changes
Aug 14, 2026
Merged

jigar-f merged 11 commits into
mainfrom
jigar/split-tunneling-ui-changes

Conversation

@jigar-f

@jigar-f jigar-f commented Aug 12, 2026 •

Copy link
Copy Markdown
Contributor

This pull request introduces browser detection and new user warnings for bypassing browsers in split tunneling. The main changes add the ability to identify browsers across Android, Windows, and core data models, and surface appropriate warnings to users when they attempt to bypass browsers or all apps. Additionally, one-time explainer dialogs are implemented for bypassing apps or websites, with persistent tracking to avoid repeat prompts.

Browser detection and flag propagation:

  • Added an isBrowser boolean property to the AppData model across Android (AppData.kt), Dart (app_data.dart), and Go (apps_data.go), enabling the system to flag apps that register as HTTP(S) handlers (browsers). Android detects browsers via intent handlers, and Windows uses a registry scan for browser executables. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16]

User-facing warnings and dialogs:

  • Added new localized strings for browser and bypass warnings, including titles and bodies for dialogs when users attempt to bypass browsers or all apps.
  • Implemented a dedicated browserBypassWarningDialog in app_dialog.dart, which centers the title and shows a warning icon when the user tries to bypass a browser. [1] [2] [3]

One-time explainer dialogs and persistence:

  • Added persistent storage for tracking whether the user has already seen the "Bypass the VPN for this app?" and "Bypass the VPN for this website?" dialogs, preventing repeat prompts using new keys in LocalStorageService. [1] [2]

These changes ensure that browsers are accurately detected and that users receive appropriate warnings and explanations when modifying split tunneling settings, improving both security and user experience.

Summary by CodeRabbit

  • New Features
    • Automatically identifies browser apps across supported platforms.
    • Added browser-specific warnings before bypassing VPN protection for apps.
    • Added first-use explanations when bypassing individual apps or websites.
    • “Select all” now lets you exclude browsers or add every app.
    • Added localized guidance explaining direct connections and potential blocking.
  • Improvements
    • Dialog confirmations are remembered to reduce repeated prompts.
    • Split-tunneling descriptions adapt better to available screen space.
    • Website validation errors are displayed more clearly.

Copilot AI lite review requested due to automatic review settings August 12, 2026 13:33
@coderabbitai

coderabbitai Bot commented Aug 12, 2026 •

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: d82895e7-0ead-4167-84e5-6e81f260d267

📥 Commits

Reviewing files that changed from the base of the PR and between 18fdbca and 812dc5a.

📒 Files selected for processing (1)
  • assets/locales/en.po
💤 Files with no reviewable changes (1)
  • assets/locales/en.po

📝 Walkthrough

Walkthrough

The change detects browser applications on Android, Windows, and macOS, propagates isBrowser through native and Dart models, and adds persistent warnings for browser, app, website, and bulk split-tunneling actions.

Changes

Browser-aware app metadata

Layer / File(s) Summary
Native browser detection and cache updates
android/app/src/main/kotlin/org/getlantern/lantern/apps/*, lantern-core/apps/*, macos/Runner/Handlers/AppStreamHandler.swift
Android detects HTTP(S) handler packages. Windows resolves browser registrations from the registry. macOS uses LaunchServices. Cached and scanned app records include isBrowser.
Dart model and bridge propagation
lib/core/models/app_data.dart, lib/lantern/*
Dart models read, preserve, and serialize isBrowser. Native mappings populate the field. FFI handling releases Go-owned result strings with freeCString.

Bypass warning flows

Layer / File(s) Summary
Dialog state and components
lib/core/services/local_storage_service.dart, lib/core/common/app_dialog.dart, assets/locales/en.po
Storage tracks displayed app and website explanations. Dialogs support centered titles and browser-specific actions. Localization adds warning text and action labels.
App bypass actions
lib/features/split_tunneling/apps_split_tunneling.dart
Browser additions show a browser warning. First-time app additions show confirmation. Select-all supports excluding browsers or adding all apps.
Website bypass submission
lib/features/split_tunneling/website_domain_input.dart
Validated website submission uses first-use confirmation and a shared submission path.
Split-tunneling presentation
lib/features/split_tunneling/split_tunneling.dart
The subtitle supports up to two lines with adaptive font sizing.

Estimated code review effort: 4 (Complex) | ~45 minutes

Mergeability Score: ⚪ Minimal · up to 812dc

The split tunneling UI and browser-detection changes introduce no actionable merge-blocking risk based on the available evidence; the PR is merge-ready after normal checks and review.

Sequence Diagram(s)

sequenceDiagram
  participant NativeAppDiscovery
  participant LanternPlatformService
  participant AppsSplitTunneling
  participant AppDialog
  participant LocalStorageService
  NativeAppDiscovery->>LanternPlatformService: provide app data with isBrowser
  LanternPlatformService->>AppsSplitTunneling: map installed apps
  AppsSplitTunneling->>LocalStorageService: read bypass dialog state
  AppsSplitTunneling->>AppDialog: show app or browser warning
  AppDialog-->>AppsSplitTunneling: return cancel or add-anyway action
  AppsSplitTunneling->>LocalStorageService: persist dialog state
Loading

Possibly related issues

  • engineering#3755 — The change implements browser detection, split-tunneling confirmations, browser warnings, and subtitle wrapping described by the issue.

Suggested reviewers: atavism

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately identifies the split-tunneling UI work, which is a major part of the changes, but it does not mention browser detection or warnings.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch jigar/split-tunneling-ui-changes

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR enhances split tunneling by detecting browser apps across platforms and surfacing clearer, safety-oriented UI warnings when users bypass browsers or bulk-bypass apps/websites. It also adds one-time explainer dialogs for bypass actions, tracked via persistent local storage so users aren’t repeatedly prompted.

Changes:

  • Added isBrowser propagation across platform layers (Android/Kotlin, macOS/Swift, Windows/Go, Dart models + services) to flag browsers in the installed-apps feed.
  • Introduced new split-tunneling dialogs/warnings (browser bypass warning, “select all” warning) plus first-time bypass explainers for apps and websites.
  • Added persistent LocalStorage flags to track “seen” state for the first-time bypass dialogs.

Reviewed changes

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

Show a summary per file
File Description
macos/Runner/Handlers/AppStreamHandler.swift Adds macOS browser detection via LaunchServices/NSWorkspace and annotates streamed app items with isBrowser.
lib/lantern/lantern_platform_service.dart Maps isBrowser from platform raw app snapshots into AppData.
lib/lantern/lantern_ffi_service.dart Maps isBrowser from FFI snapshots; adjusts split-tunnel FFI call result handling.
lib/features/split_tunneling/website_domain_input.dart Adds first-time bypass-website explainer dialog and persistence gate.
lib/features/split_tunneling/split_tunneling.dart Tweaks split tunneling subtitle rendering to use AutoSizeText.
lib/features/split_tunneling/apps_split_tunneling.dart Adds browser bypass warning + first-time bypass-app explainer; adds “select all” browser warning dialog.
lib/core/services/local_storage_service.dart Adds persistent keys and helpers for tracking one-time split-tunneling dialogs.
lib/core/models/app_data.dart Adds isBrowser field to the shared Dart app model + (de)serialization/copyWith.
lib/core/common/app_dialog.dart Adds centeredTitle support and a dedicated browser bypass warning dialog helper.
lantern-core/apps/browsers_windows.go Implements Windows browser detection by scanning modern default-app registration in the registry; marks apps as browsers.
lantern-core/apps/browsers_other.go Adds non-Windows stub for markBrowsers.
lantern-core/apps/apps.go Ensures markBrowsers runs on cached and freshly discovered app lists before caching/return.
lantern-core/apps/apps_data.go Adds isBrowser to the Go AppData JSON model.
assets/locales/en.po Adds new localized strings for browser/all-app warnings and first-time bypass explainers.
android/app/src/main/kotlin/org/getlantern/lantern/apps/AppDataHandler.kt Detects Android browsers via intent handlers and sets isBrowser on emitted app items.
android/app/src/main/kotlin/org/getlantern/lantern/apps/AppData.kt Adds isBrowser to Android AppData model and JSON mapping.
Suppressed comments (1)

lib/features/split_tunneling/apps_split_tunneling.dart:257

  • This dialog is shown via showDialog in AppDialog.customDialog, so it should be dismissed via the dialog's Navigator (Navigator.of(context).pop()). Using appRouter.pop() can pop the wrong route if the dialog isn't on the same navigator as appRouter (and it diverges from AppDialog.show's dismissal behavior).
        onPressed: () {
          appRouter.pop();
          onAddAllExceptBrowsers();
        },
      ),

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread macos/Runner/Handlers/AppStreamHandler.swift Outdated
Comment thread lib/features/split_tunneling/website_domain_input.dart
Comment thread lib/features/split_tunneling/apps_split_tunneling.dart
Comment thread lib/core/models/app_data.dart
Comment thread macos/Runner/Handlers/AppStreamHandler.swift Outdated
Comment thread lib/lantern/lantern_ffi_service.dart Outdated
Comment thread lantern-core/apps/browsers_windows.go

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 5

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@android/app/src/main/kotlin/org/getlantern/lantern/apps/AppDataHandler.kt`:
- Around line 240-245: Update browserPackages to query intent handlers for both
HTTP and HTTPS URLs, combining the resulting package names into one Set<String>.
Preserve the existing ACTION_VIEW, CATEGORY_BROWSABLE, MATCH_ALL, and null-safe
activityInfo handling for each query.

In `@lantern-core/apps/apps.go`:
- Around line 277-282: Update the discovery flow in loadInstalledAppsPlatform so
each newly discovered AppData has IsBrowser set before cb is invoked; move or
reuse the browser-marking logic within that platform callback path rather than
relying on the later markBrowsers(found) call. Preserve the existing callback
streaming behavior and final marking for any records not handled during
discovery.

In `@lantern-core/apps/browsers_windows.go`:
- Around line 171-188: The markBrowsers function should recompute IsBrowser for
each non-nil app by resetting app.IsBrowser to false before path normalization
and registry-index matching, then set it true only when the app matches
idx.paths or idx.basenames.

In `@lib/core/models/app_data.dart`:
- Around line 15-16: Update the documentation comment for isBrowser to state
that the value is populated by Android and desktop discovery, while retaining
that it defaults to false on unsupported platforms.

In `@lib/lantern/lantern_ffi_service.dart`:
- Around line 503-506: Update the addSplitTunnelItem and removeSplitTunnelItem
flows to convert the returned result and then call
_ffiService.freeCString(result) in a finally block, ensuring the pointer is
released on both success and conversion failure while preserving input-pointer
cleanup.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: e5d870fa-ac70-4fa9-9cdb-39e3333b039d

📥 Commits

Reviewing files that changed from the base of the PR and between 663ff59 and 70033a0.

📒 Files selected for processing (16)
  • android/app/src/main/kotlin/org/getlantern/lantern/apps/AppData.kt
  • android/app/src/main/kotlin/org/getlantern/lantern/apps/AppDataHandler.kt
  • assets/locales/en.po
  • lantern-core/apps/apps.go
  • lantern-core/apps/apps_data.go
  • lantern-core/apps/browsers_other.go
  • lantern-core/apps/browsers_windows.go
  • lib/core/common/app_dialog.dart
  • lib/core/models/app_data.dart
  • lib/core/services/local_storage_service.dart
  • lib/features/split_tunneling/apps_split_tunneling.dart
  • lib/features/split_tunneling/split_tunneling.dart
  • lib/features/split_tunneling/website_domain_input.dart
  • lib/lantern/lantern_ffi_service.dart
  • lib/lantern/lantern_platform_service.dart
  • macos/Runner/Handlers/AppStreamHandler.swift

Comment thread lantern-core/apps/apps.go
Comment thread lantern-core/apps/browsers_windows.go
Comment thread lib/core/models/app_data.dart Outdated
Comment thread lib/lantern/lantern_ffi_service.dart Outdated
@atavism

atavism commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

I have a couple fixes here: #8978

👍 LGTM Otherwise!

@jigar-f jigar-f self-assigned this Aug 13, 2026
@jigar-f
jigar-f merged commit c5abb2e into main Aug 14, 2026
12 checks passed
@jigar-f
jigar-f deleted the jigar/split-tunneling-ui-changes branch August 14, 2026 11:20
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.

3 participants