Skip to content

feat: system tray improvements (routing preset selector, grouped server list, active route title fix)#1577

Merged
Mahdi-zarei merged 3 commits into
throneproj:devfrom
renkagod:feature/tray-routing-presets
Jun 25, 2026
Merged

feat: system tray improvements (routing preset selector, grouped server list, active route title fix)#1577
Mahdi-zarei merged 3 commits into
throneproj:devfrom
renkagod:feature/tray-routing-presets

Conversation

@renkagod

@renkagod renkagod commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

This Pull Request introduces several UI/UX enhancements and bugfixes to the system tray context menu and main window title/tooltip display:

1. Routing Presets Selector in Tray Menu

Adds a new dynamic «Select Routing» sub-menu directly in the system tray context menu, positioned underneath the "System Proxy Mode" menu item.

  • Dynamically displays all configured routing profiles.
  • Marks the active routing profile with a checkmark.
  • Updates configuration, saves settings, and automatically restarts the active proxy core when a profile is changed.

2. Group/Subscription Server Clustering in Tray Menu

Previously, having multiple subscriptions resulted in a flat, paginated list of all profiles in the tray, which was difficult to navigate.

  • Restructured the «Select Server» tray menu to dynamically list active, non-archived groups/subscriptions as submenus.
  • Prepend a checkmark () to the group containing the active connection.
  • Dynamically populates the profiles of each group on hover for optimal performance.

3. Bugfix: Active Route Name in Window Title & Tray Tooltip

  • Fixes a bug where the window title and tray tooltip only showed Default or empty because they relied on an obsolete active_routing setting field.
  • Updates make_title to resolve the routing profile name dynamically from the active current_route_id.

Copilot AI review requested due to automatic review settings June 23, 2026 10:46

Copilot AI 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.

Pull request overview

Adds a “Select Routing” submenu to the system tray context menu so users can switch routing profiles directly from the tray, updating current_route_id, persisting it, and (if a profile is running) restarting the currently-started profile to apply the change.

Changes:

  • Add a tray submenu that is dynamically populated with routing profiles on open.
  • Persist selected routing profile (current_route_id) and re-apply it to the running session by restarting the started profile.

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

@renkagod renkagod changed the title feat: Add routing presets switching to system tray menu feat: system tray improvements (routing preset selector, grouped server list, active route title fix) Jun 23, 2026
@renkagod renkagod requested a review from Copilot June 23, 2026 11:00

Copilot AI 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.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

Comment thread src/ui/mainwindow.cpp Outdated
Comment on lines +2005 to +2008
if (!isTray) tt << QString(NKR_VERSION);
if (!Configs::dataManager->settingsRepo->active_routing.isEmpty() && Configs::dataManager->settingsRepo->active_routing != "Default") {
tt << "[" + Configs::dataManager->settingsRepo->active_routing + "]";
auto route = Configs::dataManager->routesRepo->GetRouteProfile(Configs::dataManager->settingsRepo->current_route_id);
if (route && route->name != "Default") {
tt << "[" + route->name + "]";

Copilot AI 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.

Pull request overview

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

Comments suppressed due to low confidence (1)

src/ui/mainwindow.cpp:639

  • trayServerMenu->clear() removes/deletes actions, but it does not reliably delete previously created child QMenu submenus. Since this aboutToShow handler creates new QMenu(groupTitle, trayServerMenu) instances on every open, the old submenus can accumulate (memory growth + stale signal connections). Delete existing direct-child submenus before clearing/rebuilding the menu.
    connect(trayServerMenu, &QMenu::aboutToShow, this, [=, this]() {
        trayServerMenu->clear();
        // Stop action if a profile is running

@Mahdi-zarei Mahdi-zarei merged commit 688d1cb into throneproj:dev Jun 25, 2026
@renkagod renkagod deleted the feature/tray-routing-presets branch June 27, 2026 06:23
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