[PR #3386] feat(ui): add split tunneling toggle to tray menu #3272

Open
opened 2026-11-07 17:58:52 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/amnezia-vpn/amnezia-client/pull/3386
Author: @Broklam
Created: 11/2/2026
Status: 🔄 Open

Base: dev ← Head: feat/tray-split-tunneling-toggle


📝 Commits (1)

  • ab40992 feat(ui): add split tunneling toggle to tray menu

📊 Changes

5 files changed (+47 additions, -1 deletions)

View changed files

📝 client/core/controllers/coreSignalHandlers.cpp (+9 -1)
📝 client/ui/controllers/connectionUiController.cpp (+17 -0)
📝 client/ui/controllers/connectionUiController.h (+2 -0)
📝 client/ui/utils/systemTrayNotificationHandler.cpp (+14 -0)
📝 client/ui/utils/systemTrayNotificationHandler.h (+5 -0)

📄 Description

Problem

Site-based split tunneling can only be switched on the Settings → Split tunneling page, and that page refuses changes during an active connection. Turning it on or off for a moment means opening the window, disconnecting, flipping the switch and connecting again.

Solution

  • The tray menu gets a checkable Split tunneling item under Connect / Disconnect.
  • The item mirrors the site-based setting. It follows changes made on the settings page, by a backup restore or by a settings reset through SecureAppSettingsRepository::sitesSplitTunnelingEnabledChanged. A click goes through IpSplitTunnelingUiController::toggleSplitTunneling, so the Home label and the split tunneling drawer update as well.
  • Split tunneling is written into the VPN configuration when the connection is prepared, so a change made while connected applies only to a new connection. When the item is clicked while connected, the client disconnects and connects again (ConnectionUiController::reconnect()), reusing the tray's existing connect path (openConnection()). VpnConnection::reconnectToVpn() is not used because it restarts the protocol with the configuration that was already prepared.
  • The item is disabled while a connection is being prepared, established or closed, so it cannot be clicked again in the middle of a reconnect.
  • #3104 asks to toggle split tunneling while staying connected. This PR covers the tray; the settings page still blocks changes during an active connection.

Not included

  • The new tray string has no translations yet, so it shows in English.
  • Only the site-based mode is switched. App-based split tunneling on Windows stays on its settings page.
  • The item is not disabled for servers whose container has split tunneling on the server side (isDefaultServerDefaultContainerHasSplitTunneling). There the setting has no effect, as it has none today when changed on the settings page of such a server.

Testing

  • macOS (arm64 + x86_64), Qt 6.10.1: AMNEZIA_BUILD_TESTS=ON deploy/build.sh --generator Ninja builds; ctest passes 31/31.
  • Not built or run on Windows, Linux or MACOS_NE.
    image

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/amnezia-vpn/amnezia-client/pull/3386 **Author:** [@Broklam](https://github.com/Broklam) **Created:** 11/2/2026 **Status:** 🔄 Open **Base:** `dev` ← **Head:** `feat/tray-split-tunneling-toggle` --- ### 📝 Commits (1) - [`ab40992`](https://github.com/amnezia-vpn/amnezia-client/commit/ab409925bd4c9d1a9682b588aa57edd6cb75a9d7) feat(ui): add split tunneling toggle to tray menu ### 📊 Changes **5 files changed** (+47 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `client/core/controllers/coreSignalHandlers.cpp` (+9 -1) 📝 `client/ui/controllers/connectionUiController.cpp` (+17 -0) 📝 `client/ui/controllers/connectionUiController.h` (+2 -0) 📝 `client/ui/utils/systemTrayNotificationHandler.cpp` (+14 -0) 📝 `client/ui/utils/systemTrayNotificationHandler.h` (+5 -0) </details> ### 📄 Description ### Problem Site-based split tunneling can only be switched on the Settings → Split tunneling page, and that page refuses changes during an active connection. Turning it on or off for a moment means opening the window, disconnecting, flipping the switch and connecting again. ### Solution - The tray menu gets a checkable **Split tunneling** item under Connect / Disconnect. - The item mirrors the site-based setting. It follows changes made on the settings page, by a backup restore or by a settings reset through `SecureAppSettingsRepository::sitesSplitTunnelingEnabledChanged`. A click goes through `IpSplitTunnelingUiController::toggleSplitTunneling`, so the Home label and the split tunneling drawer update as well. - Split tunneling is written into the VPN configuration when the connection is prepared, so a change made while connected applies only to a new connection. When the item is clicked while connected, the client disconnects and connects again (`ConnectionUiController::reconnect()`), reusing the tray's existing connect path (`openConnection()`). `VpnConnection::reconnectToVpn()` is not used because it restarts the protocol with the configuration that was already prepared. - The item is disabled while a connection is being prepared, established or closed, so it cannot be clicked again in the middle of a reconnect. ### Related issues - #3104 asks to toggle split tunneling while staying connected. This PR covers the tray; the settings page still blocks changes during an active connection. ### Not included - The new tray string has no translations yet, so it shows in English. - Only the site-based mode is switched. App-based split tunneling on Windows stays on its settings page. - The item is not disabled for servers whose container has split tunneling on the server side (`isDefaultServerDefaultContainerHasSplitTunneling`). There the setting has no effect, as it has none today when changed on the settings page of such a server. ### Testing - macOS (arm64 + x86_64), Qt 6.10.1: `AMNEZIA_BUILD_TESTS=ON deploy/build.sh --generator Ninja` builds; `ctest` passes 31/31. - Not built or run on Windows, Linux or `MACOS_NE`. <img width="193" height="222" alt="image" src="https://github.com/user-attachments/assets/e93c9311-dff5-470b-924d-b1b348fba7bd" /> 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
amnezia-vpn/amnezia-client#3272
No description provided.