Repository navigation
feat: show each network's kind in the network interface settings - #551
Merged
Merged
Conversation
Wi-Fi, mobile data, Ethernet and VPN chips all used the same icon, as the app did not know what kind of network an interface is. NetworkInterfaceInfo now carries a NetworkKind (unknown values decode as OTHER, so older and newer peers interoperate). Android passes the kind it already read from the transport. The JVM engine guesses it from macOS hardware ports (networksetup), interface names and Windows adapter descriptions, counting virtual adapters as OTHER. The chips show a glyph per kind (new Cellular, Ethernet, Vpn, Bluetooth and Globe icons) and keep it while selected (KetchChip's checkWhenSelected).
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Settings → Network showed the same icon for every interface, so on a phone Wi-Fi and mobile data (and on desktop Wi-Fi, Ethernet and VPNs) looked alike. Each chip now shows a glyph for its kind of network.
library:api):NetworkInterfaceInfo.kind(NetworkKind:WIFI,CELLULAR,ETHERNET,VPN,BLUETOOTH,OTHER), sent as lowercase text. It defaults toOTHER, and unknown values decode asOTHER, so older and newer servers and apps work together. ABI dump updated.library:ktor):networkKind()now returns the enum it already read from the transport. Names stay "Wi-Fi", "Mobile data" and so on, built from the kind.library:ktor): the kind is guessed.networksetup -listallhardwareports, 2 s timeout), becauseen0is Wi-Fi on some Macs and Ethernet on others.wlp2s0,enp3s0,wwan0,wg0,utun3) and Windows adapter descriptions.OTHER, and iPhone USB tethering counts asCELLULAR.KetchIconsCellular(solid signal bars),Ethernet(RJ45 port),Vpn(lock),BluetoothandGlobe(other). Wi-Fi keepsNetwork.KetchChip: newcheckWhenSelectedoption. Selected chips used to replace their icon with a check, which hid the kind; the network chips turn it off and show selection through the accent fill.Snapshots
The sample device has Wi-Fi, Ethernet and a VPN, so the mobile-data glyph isn't in these.
Notes for reviewers
NetworkInterfacesTest(how the kind is sent and read back),InterfaceKindTest(macOS, Linux and Windows guesses), updatedAndroidNetworkNamesTest.KetchIconTest,SettingsPageTest,DesignTokenUsageTestandHardcodedTextTestpass.