Skip to content

Keep Ethernet hero during Wi-Fi connect and follow active route - #20708

Open
emirb wants to merge 1 commit into
quattrofrom
fix/network-panel-dual-interface
Open

emirb wants to merge 1 commit into
quattrofrom
fix/network-panel-dual-interface

Conversation

@emirb

@emirb emirb commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

What changes

On machines with both Ethernet and Wi-Fi connected, the network panel had two dual-interface bugs reproduced live on bare metal (Dell XPS 16 on dual Ethernet + Wi-Fi):

  1. Connecting to a Wi-Fi network while Ethernet was primary set switchingNetwork = true, replacing the Ethernet hero title with the target Wi-Fi SSID and CONNECTING... while Ethernet remained the active link.
  2. kind unconditionally preferred wired whenever wiredDevice.connected was true, so plugging in a local-only Ethernet cable (penalized by NetworkManager at metric 20100) showed Ethernet in the bar and panel while traffic routed over Wi-Fi.

This change gates switchingNetwork on root.kind === "wifi" so connecting secondary Wi-Fi keeps the Ethernet hero untouched. When both Ethernet and Wi-Fi are connected, the panel watches IPv4 main-table default-route events via ip -4 monitor route (filtered to main-table default routes with a 250 ms debounce) and selects the winning physical link from ip -4 route show default (Model.parseDefaultRouteKind), ignoring VPN tunnel routes so NetworkManager's main-table metrics stay authoritative even under a full-tunnel VPN. canShareWifi is gated on kind === "wifi" so QR sharing only targets an active Wi-Fi hero. Relying on Networking.connectivity alone was ruled out because NetworkManager's aggregate connectivity stays Full while one link still has internet access.

Single-interface hosts spawn zero route-monitor processes and stay untouched. Wired upper virtual interfaces (bridge, bond, VLAN, PPPoE) are not enumerated as wired devices by Quickshell.Networking and are documented as a limitation in Model.parseDefaultRouteKind.

Verification

  • bash test/shell.d/network-test.sh: all unit assertions pass, including parseDefaultRouteKind, isDefaultRouteEvent, and connectionKind.
  • shellcheck -S warning -x -P test/shell.d -s bash test/shell.d/network-panel-runtime-test.sh: clean.
  • Live Omarchy 4.5.0 KVM guest: ran all four Quickshell runtime fixtures (captive-portal, owe-transition, live-rows, and new dual-interface) via test/shell.d/network-panel-runtime-test.sh (4/4 ok, zero QML warnings).

Screenshots

Connecting secondary Wi-Fi while Ethernet is active

Before After
Before: connecting Wi-Fi while on Ethernet replaces the Ethernet hero title with OfficeWiFi CONNECTING... After: Ethernet hero stays Ethernet (1gbit) while the OfficeWiFi row shows Connecting...

Local-only Ethernet (metric 20100) with working Wi-Fi (metric 600)

Before After
Before: bar icon and hero icon stay stuck on Ethernet while traffic routes over OfficeWiFi After: bar icon and hero icon follow the active route to OfficeWiFi

@greptile-apps

greptile-apps Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 4/5 · The displayed connection and its details can refer to different interfaces under a VPN; fix that before merging.RetriggerView in GreptileConfidence Score: 4/5

[Medium impact] The changes affect what the network panel shows on dual-connected machines.

The displayed connection and its details can refer to different interfaces under a VPN; fix that before merging.

FindingsFix All in Claude CodeFindings

  1. P1 Details follow another link ▶

Summary

Keeps the Ethernet hero visible while secondary Wi-Fi connects and adds route-based selection when both links are connected.

  • The network panel follows the active link when Ethernet and Wi-Fi are both connected.
  • Connecting to Wi-Fi in the background leaves the Ethernet hero in place.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Both links connected] --> B[Watch default-route changes]
  B --> C[Read physical default routes]
  C --> D[Choose Ethernet or Wi-Fi]
  D --> E[Update hero and bar icon]
  F[Read route to internet probe] --> G[Update details and sharing]
  E -. Choices can differ under VPN .-> G
Loading

Reviews (2) · Last reviewed commit: "Keep Ethernet hero during Wi-Fi connect ..." · Reviewed by Greptile

Comment thread shell/plugins/panels/network/Panel.qml Resolved
Comment thread test/shell.d/network-test.sh Resolved
@omarchybot omarchybot added the enhancement New feature or request label Nov 29, 2026
@emirb
emirb force-pushed the fix/network-panel-dual-interface branch from 44a048f to 987c254 Compare November 29, 2026 01:23

function finishRoute(raw) {
if (routeRequest !== routeGeneration || !dualConnected) return
routeKind = Model.parseDefaultRouteKind(raw, connectedWiredNames, connectedWifiNames)

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.

P1 Details follow another link

With both links connected and a full-tunnel VPN active, finishRoute() selects the physical link, but detailsProc still runs omarchy-network-status --verbose without choosing an interface. That helper follows ip route get 1.1.1.1, so the hero can name Wi-Fi while the address and transfer counts belong to the VPN. The helper also reports the tunnel as Ethernet, which hides Wi-Fi sharing through canShareWifi.

Keep the winning interface from the route lookup and use it for the displayed details.

Knowledge Base Used: Captive portal and network connectivity

Fix in Claude Code

@omarchybot omarchybot added bug Something isn't working and removed enhancement New feature or request labels Nov 29, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

GPT-6 High in Codex, Opus 5.5 High and muse-wonder via pi at high effort reviewed 987c254 against quattro and traced both reported symptoms to the panel logic. We found that with a full-tunnel VPN the new title can name Wi-Fi while the existing status helper still shows the tunnel’s address and traffic counters and keeps Wi-Fi QR sharing hidden. Opus also found that a route switch can briefly pair the new title with the previous link’s speed. The reviewers could read the same session context.

The release branches lack protection, which blocked worker tests and captures. Verification is with the maintainer.

@chessing234

Copy link
Copy Markdown
Contributor

your commit is in #21016. the ethernet hero and the default-route monitor stayed next to the public IP probe from #20738, which conflicted in the same process list. both runtime sections are in network-panel-runtime-test.sh. @dhh @omarchybot if 21016 lands, this can close as superseded.

@omarchybot

Copy link
Copy Markdown
Collaborator

GPT-6.2 Sol High in Codex, Opus 5.5 High and muse-wonder via pi, thinking high compared the diffs. #21016 carries both Ethernet/Wi-Fi fixes and the same dual-interface test. The full-tunnel VPN details mismatch and the brief stale speed after failover are present in both branches. The reviewers could read the same session context.

Both PRs are open for the maintainer’s integration decision. Worker isolation preflight blocked reproduction and screenshots.

@emirb emirb added this to the 4.7.0 milestone Dec 4, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Recommend: Hold — #21016 closed without merging, and this PR still needs worker verification and a fix for inconsistent connection details.

With both links up and a full-tunnel VPN active, the headline can show Wi-Fi while the IP and traffic counters belong to the tunnel. During failover, the headline can also change while an earlier details read is still in flight (Panel.qml:540, :1146).

GitHub checks passed. GPT-6.2 Sol High in Codex, Opus 5.5 High and muse-wonder via pi, thinking high checked the current source and agreed on those findings. The reviewers had access to the same session context. Worker reproduction and screenshots remain pending.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants