Skip to content

Keep Wi-Fi indicator online when AP object is missing - #6918

Open
patrickrodrigues-aa wants to merge 10 commits into
omacom:quattrofrom
patrickrodrigues-aa:fix-network-device-connected-icon
Open

patrickrodrigues-aa wants to merge 10 commits into
omacom:quattrofrom
patrickrodrigues-aa:fix-network-device-connected-icon

Conversation

@patrickrodrigues-aa

@patrickrodrigues-aa patrickrodrigues-aa commented Aug 15, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • keep the network bar widget in Wi-Fi state when NetworkManager reports the Wi-Fi device as connected but Quickshell has no connected access-point object
  • preserve wired-over-wifi precedence
  • add regression coverage for the device-connected/AP-missing state

Reproduction

On an upgraded Quattro install, the machine is online through Wi-Fi:

nmcli device status
# wlp0s20f3  wifi  connected  ExampleWifi

nmcli networking connectivity check
# full

omarchy-network-status
# wifi ExampleWifi 67 6135.0

A small Quickshell probe showed the native NetworkManager backend had the device connected while its AP list was empty:

backend=1 wifiEnabled=true deviceCount=1
device[0] name=wlp0s20f3 type=1 connected=true state=2
device[0].networkCount=0

The panel previously derived kind === "wifi" only from connectedWifiNetwork, so this state rendered the disconnected icon even though the network was online.

Tests

  • bash test/shell.d/network-test.sh
  • bash test/shell.d/plugin-validate-test.sh

I also ran bash test/shell.d/runtime-smoke-test.sh; it reached the shell IPC checks and then failed an existing handler-count assertion in this live session: each widget registers its IPC handler once per screen (saw 6 for 3 screen(s)).

Copilot AI balanced review requested due to automatic review settings August 15, 2026 03:29

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

Note

Copilot was unable to run its full agentic suite in this review.

This PR improves the network panel “bar pill” state derivation so Wi‑Fi can be treated as connected even when NetworkManager hasn’t yet surfaced the active access point, preventing the bar from briefly showing as offline.

Changes:

  • Extracted connection-kind and signal-strength derivation into reusable Model helpers.
  • Updated the QML panel to consider Wi‑Fi device connection state when the active access point isn’t available yet.
  • Added test coverage for the new connection-kind and signal-strength logic.

Reviewed changes

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

File Description
test/shell.d/network-test.sh Adds assertions covering connectionKind and connectionSignalStrength behavior.
shell/plugins/panels/network/Panel.qml Switches bar state logic to new model helpers and keeps Wi‑Fi “online” from device state.
shell/plugins/panels/network/Model.js Introduces and exports connectionKind / connectionSignalStrength helpers.

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

@patrickrodrigues-aa
patrickrodrigues-aa force-pushed the fix-network-device-connected-icon branch from a848cc0 to 8e7a44f Compare August 15, 2026 03:35
@omarchybot omarchybot added the bug Something isn't working label Sep 27, 2026
omarchybot and others added 2 commits September 28, 2026 04:18
Resolves the Model.js export list, where this branch's connectionKind and connectionSignalStrength sat beside quattro's connectivityState and captivePortalUrl.
…-less Wi-Fi

A Wi-Fi card running a hotspot reports connected with no network object, the same shape as the missing-AP state, so the device fallback showed a machine sharing its card as online over Wi-Fi. Fall back on device state only in station mode.

connectionKey also required the network object, so Wi-Fi coming up without one never prompted a connectivity check. Key it on the device, with the SSID when known.

The new source assertions fail when Panel.qml goes back to deriving kind without the device state, which the helper tests alone did not.

Co-Authored-By: Codex Medium <noreply@openai.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@omarchybot

Copy link
Copy Markdown
Collaborator

Thanks for this, Patrick. Reviewed by Claude Opus 5.5 with Codex Medium as the second opinion. The change reads correctly, and I pushed two commits to your branch.

Pushed

  • baa14866 merges quattro into the branch. The only conflict was the export list in Model.js, where your two helpers now sit beside quattro's connectivityState and captivePortalUrl.
  • 2a704ed4 fixes two things the device-state fallback got wrong:
    • Hotspots. A Wi-Fi card running a hotspot also reports itself connected with no network object. On a machine whose only uplink isn't Wi-Fi, the bar then showed it as online over Wi-Fi. The fallback now applies only when wifiDevice.mode is WifiDeviceMode.Station.
    • Connectivity checks. connectionKey still required the network object, so Wi-Fi coming up without one never triggered a connectivity check. It is now keyed on the device, plus the SSID when known.
    • It also adds source assertions on the Panel.qml wiring. The helper tests alone kept passing with the old derivation restored.

Checked on a worker VM (Omarchy ISO, Quickshell 0.3.1, the shell running from this branch):

  • network-test.sh (114 passed), plugin-validate-test.sh and runtime-smoke-test.sh pass.
  • ./test/cli has one failure, vscode generated theme references current theme file, which fails the same way on quattro.
  • With Panel.qml restored to how it was before 2a704ed4, the new assertions fail.
  • Simulated Wi-Fi (mac80211_hwsim) with a NetworkManager hotspot and Ethernet unmanaged:
    • The bar drew a Wi-Fi icon at baa14866 and draws the disconnected icon at 2a704ed4.
    • Quickshell reported that device as connected, mode AccessPoint, with zero networks.

Not reproduced: the state this pull request is about, a station connection with no network object. On the worker, a normal WPA2 association, a hidden SSID and a fresh Quickshell start while already connected all exposed the connected network. So the only evidence for that state so far is the probe in your description, and it can't be marked verified from the author's own machine.

Two things would settle it. Either you tell me how to trigger the state, or a maintainer confirms the fix at 2a704ed40bd7627ad9d562cc47189709ebf425a5 on a machine that shows it. For the first, please send the output of nmcli -f GENERAL.DRIVER,GENERAL.STATE,WIFI-PROPERTIES device show wlp0s20f3. Also say whether /etc/NetworkManager/conf.d sets wifi.backend, and whether the state lasts across a reboot or only showed up right after the Quattro upgrade, when iwd may still hold the connection.

Codex found the hotspot case, the missed connectivity check and the test gap. On its second pass over 2a704ed4 it found nothing left. Waiting on the maintainer.

@patrickrodrigues-aa

Copy link
Copy Markdown
Contributor Author

I can’t reproduce the bad state anymore either.

It appeared during/after the Quattro upgrade and has cleared after subsequent reconnects/restarts/updates. Current state on the same machine is normal station Wi-Fi:

wlp0s20f3: wifi connected
NetworkManager connectivity: full
driver: iwlwifi
mode: managed / infrastructure
wifi.backend: not set in /etc/NetworkManager/conf.d

The original failure was observed while the packaged widget still depended only on connectedWifiNetwork: NetworkManager reported the Wi-Fi device connected and the machine had working internet, but the bar showed the disconnected icon because Quickshell did not expose a connected network/AP object at that moment.

So I don’t have a live repro anymore. The PR is defensive for that state rather than a currently reproducible steady-state issue on my machine.

omarchybot and others added 2 commits October 1, 2026 13:34
The state the device fallback covers is Quickshell 0.3.1 dropping any NetworkManager profile whose 802-11-wireless.mode is unset: it never attaches that profile to a network, so the active connection matches nothing while the station is up. Upstream accepts an omitted mode after 0.3.1 (quickshell 052059f). Saying so tells a later reader when the fallback can go.

Co-Authored-By: Codex Medium <noreply@openai.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The assertion stopped at the ternary's condition, so blanking the Wi-Fi key kept all 114 passing while Wi-Fi coming up without a network object no longer changed the key and never prompted a connectivity check. Match the key it builds as well.

Co-Authored-By: Codex Medium <noreply@openai.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@omarchybot omarchybot added the verified Omarchy Triage has verified that this issue is ready for final review label Oct 1, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Thanks for checking, Patrick. Your report led to the cause, and I could reproduce the bug this time. Reviewed by Claude Opus 5.5, with Codex Medium as the second opinion.

Cause. Quickshell 0.3.1, which Omarchy ships, only links a NetworkManager profile to a network when the profile's 802-11-wireless.mode is set to infrastructure (onSettingsLoaded in src/network/nm/wireless.cpp). A profile that leaves the mode unset is valid, and NetworkManager treats it as infrastructure, but Quickshell ignores it. The station connects, no network reports itself connected, connectedWifiNetwork is null, and on quattro the bar shows the disconnected icon. Upstream Quickshell accepts an unset mode since 052059f, which landed after 0.3.1. A profile created during or after the upgrade without an explicit mode fits what you saw, and reconnecting through the panel or nmcli writes the mode, which would explain why it went away.

Reproduced on a worker VM (Omarchy ISO, Quickshell 0.3.1, NetworkManager 1.58.1, simulated Wi-Fi via mac80211_hwsim, wlan0 connected as a station to a WPA2 access point on wlan1, Ethernet unmanaged):

  • Station profile with no mode: on quattro the bar is disconnected with the disconnected icon, while wlan0 is connected in Station mode. At this head it is wifi.
  • The same profile with mode=infrastructure: quattro and this head both show Wi-Fi on network omabot6918 at signal 90, so the unset mode is the cause.
  • network-test.sh (114 passed), plugin-validate-test.sh and runtime-smoke-test.sh pass. ./test/cli stops at vscode generated theme references current theme file, and seven shell test files fail (ascii, branding-about-animation, kernel-headers-migration, network-captive-portal, omarchy-kernel-migration, passwordless-grant-lifecycle, video-background). All of these fail the same way on quattro.

Pushed

  • 22551cdb rewrites the comment above wiredDevice in Panel.qml to name this cause, so a reader can tell when the fallback can go.
  • 682998df tightens the connectionKey assertion in network-test.sh. It checked only the condition, so blanking the Wi-Fi key still passed all 114 tests. It now fails if the key stops changing when Wi-Fi comes up without a network object.

Limits. In this state the bar shows the lowest Wi-Fi signal, because no signal strength is known. The panel body still treats the network as not connected (no Disconnect button), because only the bar falls back to the device state. Updating Quickshell past 052059f would fix both.

Competing pull requests. #13738 and #13662 also change how the bar decides kind. Codex was asked separately, without my answer, which fix is best, and chose this one. #13738 counts a Wi-Fi card running a hotspot as online, and it trusts info.type, which the panel stops refreshing once it closes. #13662 is aimed at #13489 and prefers the default route over a connected Ethernet device. Both leave connectionKey empty for Wi-Fi without a network object, so no connectivity check fires.

Codex found the test gap and the outdated comment. On its second pass over 682998df it found nothing left. This is waiting on the maintainer: on whether to take this alongside a Quickshell update, and on the test failures quattro already has.

@greptile-apps

greptile-apps Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no new blocking issue was found.

Summary

The PR excludes hotspot radios from the device-connected Wi-Fi fallback and prefers a station radio when several radios exist.

  • The network bar treats station radios as uplinks, not hotspots.

Previous unnumbered threads: patrickrodrigues-aa accepted the unknown-signal display compromise because the fallback was temporary. They also accepted source-level coverage because modeling the native state was difficult and a worker-VM reproduction covered it; Greptile agreed. The current fixture now exercises the missing-network state.

Reviews (4) · Last reviewed commit: "Fall back to an idle station radio befor..." · Reviewed by Greptile

Comment thread shell/plugins/panels/network/Model.js Resolved
Comment thread test/shell.d/network-test.sh Resolved
@omarchybot omarchybot removed the verified Omarchy Triage has verified that this issue is ready for final review label Oct 4, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

#14133 has merged into quattro and includes the connected-device fallback when there is no connected Wi-Fi network object, preserving wired precedence and polling the active AP strength. This PR also limits its fallback to WifiDeviceMode.Station; that explicit station-only guard is absent from the merged fix. Keep this open for that remaining distinction and rebase away the already-landed fallback.

Scope checked by GPT-6 in Codex and Codex Medium against the reports and landed source; independence is not guaranteed. No runtime tests were rerun for this reconciliation.

@patrickrodrigues-aa

Copy link
Copy Markdown
Contributor Author

Rebased after #14133 landed. The already-merged fallback and active-AP strength polling are now coming from quattro; this PR is reduced to the remaining hotspot distinction: only trust the Wi-Fi device fallback when the device is in WifiDeviceMode.Station.

I updated the OWE fixture to mock station mode and kept the source assertion that rejects the broader wifiDevice.connected fallback.

Checked:

  • bash test/shell.d/network-test.sh
  • bash test/shell.d/network-owe-transition-test.sh
  • bash test/shell.d/plugin-validate-test.sh

Requiring station mode also dropped ad-hoc and mesh links, which Quickshell 0.3.1 never gives a network object either, back to the disconnected icon. Only a hotspot is connected without an uplink.

Co-Authored-By: Codex Medium <noreply@openai.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@omarchybot omarchybot added the verified Omarchy Triage has verified that this issue is ready for final review label Oct 7, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Thanks for the rebase, Patrick. I reviewed the reduced change at 3991411f and pushed one commit to your branch. Reviewed by Claude Opus 5.5, with Codex Medium as the second opinion.

Pushed: 985e950b changes the guard from wifiDevice.mode === WifiDeviceMode.Station to wifiDevice.mode !== WifiDeviceMode.AccessPoint and updates the matching assertions in network-test.sh. Quickshell 0.3.1 builds a network object only from an infrastructure profile (wireless.cpp:127), so ad-hoc and mesh links also rely on the device fallback #14133 added. Requiring station mode put them back on the disconnected icon. A hotspot is the only connected mode with no uplink, so that is the only mode the fallback now excludes.

Checked on a worker VM (Omarchy ISO, Quickshell 0.3.1, NetworkManager 1.58.1, simulated Wi-Fi via mac80211_hwsim, Ethernet unmanaged so the bar sees no wired link). The bar's state was read through a probe IPC function added only on the worker:

  • A NetworkManager hotspot on wlan0 (AccessPoint mode, no network object): quattro shows Wi-Fi, and 985e950b shows disconnected.
  • A station on a profile with no 802-11-wireless.mode (no network object, Station mode): Wi-Fi at 985e950b, so the Keep the Wi-Fi icon steady on OWE transition-mode networks #14133 fallback still holds.
  • An ad-hoc link (no network object): disconnected with the station-only guard, Wi-Fi at 985e950b.
  • network-test.sh (116 passed), network-owe-transition-test.sh, network-captive-portal-test.sh and plugin-validate-test.sh pass. Restoring either the unguarded line or the station-only guard fails network-test.sh.
  • ./test/cli passes. The full shell suite fails in ascii-test.sh, branding-about-animation-test.sh and passwordless-grant-lifecycle-test.sh, which fail the same way on quattro.

Codex found the ad-hoc and mesh regression. On its second pass over 985e950b it found nothing wrong with the change. It did point out that the ordering assertion at network-test.sh:106 would still pass if the connectedWifiNetwork line were deleted. That assertion came in with #14133 and is unchanged here, so I left it alone.

This is waiting on the maintainer, and on the shell test failures quattro already has.

@omarchybot omarchybot removed the verified Omarchy Triage has verified that this issue is ready for final review label Oct 31, 2026
omarchybot and others added 3 commits October 31, 2026 20:22
quattro removed the source-text assertions in network-test.sh and moved the OWE runtime test into network-panel-runtime-test.sh with shared fixtures. Take quattro's network-test.sh, drop the deleted network-owe-transition-test.sh, and check the hotspot case at runtime instead: the mock Wi-Fi device gains a Station mode, and the OWE fixture ends by bringing the device up in AccessPoint mode with no network listed and expects the bar to show disconnected.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With a hotspot on one radio and a station on another, findDevice returned whichever connected radio came first. When that was the hotspot, the AccessPoint guard in kind turned the bar to disconnected while the second radio was online. Skip a hotspot radio when choosing the connected device, so the station is the uplink the bar reads; a hotspot alone is still only the fallback and still shows disconnected.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With a hotspot running on the first radio and the second idle, findDevice still fell back to the hotspot, so the panel's network list, scanning and connect actions drove a radio that cannot join a network. Prefer any station radio as the fallback, and keep a hotspot only when it is the sole Wi-Fi device.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: muse-wonder via pi, thinking high <noreply@openrouter.ai>
@omarchybot omarchybot added the verified Omarchy Triage has verified that this issue is ready for final review label Oct 31, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Patrick, quattro moved on and this stopped merging, so I merged quattro into your branch and pushed two fixes on top. Reviewed by Claude Opus 5.5, with Codex Medium and muse-wonder (via pi, thinking high) as second opinions.

The merge, bb6e4fae. quattro removed the source-text assertions in network-test.sh and folded network-owe-transition-test.sh into network-panel-runtime-test.sh. The merge takes quattro's versions of both. The hotspot check now runs against the real Panel.qml in the OWE fixture: the mock Wi-Fi device has a mode, and the fixture expects a connected hotspot to show disconnected.

a617fe44: a station radio wins over a hotspot radio. Your guard in kind was right, but findDevice returned the first connected Wi-Fi radio. With a hotspot on the first radio and a station on the second, the bar now showed disconnected while the second radio was online. quattro showed Wi-Fi there, so this was a regression. findDevice now skips a hotspot radio when picking the connected device.

1d3902ca: an idle station radio wins too. muse-wonder found that with a hotspot on the first radio and the second idle, findDevice still fell back to the hotspot, so the panel's network list, scanning and connect actions drove a radio that can't join a network. The fallback now prefers any station radio, and keeps a hotspot only when it is the only Wi-Fi device.

Checked on a worker VM (Omarchy ISO, Quickshell 0.3.2, two simulated radios via mac80211_hwsim, Ethernet unmanaged). The real Panel.qml was loaded against the live NetworkManager service:

  • A hotspot alone: quattro shows Wi-Fi, 1d3902ca shows disconnected.
  • Hotspot on wlan0 with a station on wlan1: Wi-Fi at 1d3902ca. Without the findDevice change it shows disconnected.
  • Hotspot on wlan0 with wlan1 idle: the panel drives wlan1 at 1d3902ca, and the hotspot without the fallback change.
  • A station alone: Wi-Fi.
  • network-panel-runtime-test.sh and network-test.sh pass. The new fixture checks fail on quattro and with each findDevice change reverted.
  • ./test/cli passes. The full shell suite fails in agent-account-exec, ascii, branding-about-animation, first-run and runtime-smoke, which fail the same way on quattro.

Codex Medium found nothing wrong in either round. muse-wonder raised the idle-station fallback in the first round, and both reviewers found nothing wrong at 1d3902ca. One case is left as quattro has it: with a hotspot as the only Wi-Fi device, the panel still shows the radio toggle and Wi-Fi section for that radio. Whether a hotspot-only machine should show them is the maintainer's call.

Waiting on you: the title and description still describe the device fallback that #14133 already merged. Could you update them to say what this PR now does: a connected hotspot no longer shows as online, and a station radio is preferred over a hotspot radio?

@omarchybot

Copy link
Copy Markdown
Collaborator

The failed Tests run reports only i18n-startup-test.sh. That test starts a separate Quickshell configuration containing Commons and its translation fixture; it does not load the network panel or fixtures changed here. The saved worker results at 1d3902cab237903335b9e2c1f0ccd610c970e4af passed that test. This points to an intermittent or environmental failure outside this change; the job log omits the failed assertion, so its exact cause remains unknown.

GPT-6 in Codex (effort not exposed) checked the CI log, test setup and diff. Opus 5.5 High agreed from the supplied diff and earlier worker evidence; independence is not guaranteed. No runtime tests were rerun because worker preflight did not pass, and no branch changes were made. This remains waiting on the maintainer with CI red.

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

Labels

bug Something isn't working verified Omarchy Triage has verified that this issue is ready for final review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants