network-dns-slice (part 2/2): Setup DNS UI in Usage#27
Merged
luisguzman-adfa merged 5 commits intoJun 23, 2026
Merged
Conversation
… (PR B, part 2/2) Presentation + connectivity layer for the Usage 'Setup DNS' panel (UI wiring in a follow-up commit on this branch): - domain: DnsConnectivityProbe port + ConfigureDnsUseCase (validate -> netplan-try probe -> save custom, or revert to defaults). Unit-tested (ConfigureDnsUseCaseTest: applied / invalid / unreachable-reverts / secondary-fallback). - data: UdpDnsConnectivityProbe (tiny UDP DNS A-query to the server:53, IPv4/IPv6, never throws — timeout/unreachable = not reachable). - presentation: DnsSettingsUiState (IDLE/TESTING/APPLIED/INVALID/UNREACHABLE), DnsSettingsViewModel (off-main-thread orchestration; uncheck reverts + clears to defaults), DnsSettingsViewModelFactory (manual DI, mirrors RootfsViewModelFactory). Builds on PR A (part1). UI (UsageFragment + fragment_usage.xml) is the next commit.
…t 2/2) Replace the two vestigial VPN-era DNS fields (dns_ipv4/dns_ipv6, a dead UI<->prefs loop) with the real Setup DNS UI in the existing 'advanced' collapsible: - fragment_usage.xml: 'Setup DNS' checkbox + a hidden dns_setup_fields block (Primary/Secondary inputs, Accept button, result line). Uses existing theme tokens. - UsageFragment: bind the views, obtain DnsSettingsViewModel via its factory, observe state, wire the checkbox (onSetupToggled — unchecking reverts + clears to defaults) and Accept (onAccept — validate + netplan-try probe + save/revert). renderDnsState reflects IDLE/TESTING/APPLIED/INVALID/UNREACHABLE. - strings: setup_dns, dns_primary, dns_secondary, dns_accept, dns_status_testing/ok. Removes only the two DNS fields (the direct fake predecessor of this feature). The broader VPN/SOCKS vestige (Preferences DNS keys, socks fields, dns_ipv4/ipv6 strings) stays for the cleanup PR. Builds on PR A + the PR B logic commit.
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.
Tip: disable this comment in your organization's Code Review settings.
…ection The panel was placed inside the VPN-era config_layout, whose header (config_label) is visibility=gone and never shown (and is biometric-gated + full of dead SOCKS UI), so Setup DNS was unreachable. Per the clean-architecture direction (do NOT reuse the obsolete VPN scaffolding), move it OUT into a NEW, independent, visible collapsible: a 'dns_settings_label' header (mirrors the visible Connection-log header pattern) + 'dns_settings_section' container holding the Setup DNS checkbox + fields. No reuse of config_layout; the VPN block stays untouched (removed wholesale in the cleanup PR).
Strangler cleanup of what THIS feature orphaned by replacing the fake DNS fields: - delete dns_ipv4/dns_ipv6 string resources across all 6 locales (would trip lint UnusedResources and fail the build); - delete Preferences.DNS_IPV4/DNS_IPV6 constants + getDnsIpv4/setDnsIpv4/ getDnsIpv6/setDnsIpv6 (no longer referenced anywhere). Verified zero remaining references in the module. getMappedDns() and the wider VPN/SOCKS vestige were already orphaned independently (not caused here) and stay for the dedicated cleanup PR. Also merges part1 (DnsValidator loopback fix).
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.
Part 2 of 2 (UX). Stacked on part1 (PR #26) — base is
feat/network-dns-slice-part1, so the diff here is the part-2 delta only.What
The real Setup DNS panel in Usage -> the existing advanced collapsible, wired to the part-1
networkslice.dns_ipv4/dns_ipv6, a dead UI<->prefs loop) with: aSetup DNScheckbox -> Primary / Secondary inputs (single value each, IPv4 OR IPv6) -> Accept.UdpDnsConnectivityProbe, a UDP DNS query) -> save custom, or revert to defaults + notify. Unchecking reverts and clears the fields back to defaults.ConfigureDnsUseCase,DnsConnectivityProbe+UdpDnsConnectivityProbe,DnsSettingsViewModel(+UiState/Factory). Unit-tested:ConfigureDnsUseCaseTest(applied / invalid / unreachable-reverts / secondary-fallback).Layering / revert note
Reverting part 2 alone leaves the part-1 backend working on defaults with no UI. Sequence, not independent toggles.
Cleanup deferred
Only the two fake DNS fields are removed here (the direct predecessor of this feature). The broader VPN/SOCKS vestige (Preferences
DnsIpv4/6keys, socks fields,dns_ipv4/ipv6strings, label rename) stays for the cleanup PR.Device test
Pull this branch (it contains part 1 + part 2), build, install. Usage -> advanced -> Setup DNS: set values, Accept (works -> saved; bad -> reverts), uncheck -> back to defaults; confirm the guest resolves.