Skip to content

network-dns-slice (part 2/2): Setup DNS UI in Usage#27

Merged
luisguzman-adfa merged 5 commits into
feat/network-dns-slice-part1from
feat/network-dns-slice-part2-ux
Jun 23, 2026
Merged

network-dns-slice (part 2/2): Setup DNS UI in Usage#27
luisguzman-adfa merged 5 commits into
feat/network-dns-slice-part1from
feat/network-dns-slice-part2-ux

Conversation

@luisguzman-adfa

Copy link
Copy Markdown
Collaborator

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 network slice.

  • Replaces the two vestigial VPN-era DNS fields (dns_ipv4/dns_ipv6, a dead UI<->prefs loop) with: a Setup DNS checkbox -> Primary / Secondary inputs (single value each, IPv4 OR IPv6) -> Accept.
  • Accept = validate (fail-closed) -> netplan-try probe (UdpDnsConnectivityProbe, a UDP DNS query) -> save custom, or revert to defaults + notify. Unchecking reverts and clears the fields back to defaults.
  • Logic: 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/6 keys, socks fields, dns_ipv4/ipv6 strings, 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.

… (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.

@claude claude Bot 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.

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.

@luisguzman-adfa luisguzman-adfa changed the title Feat/network dns slice part2 ux network-dns-slice (part 2/2): Setup DNS UI in Usage Jun 22, 2026
…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).
@luisguzman-adfa luisguzman-adfa merged commit 83258f5 into feat/network-dns-slice-part1 Jun 23, 2026
@luisguzman-adfa luisguzman-adfa deleted the feat/network-dns-slice-part2-ux branch June 23, 2026 15:42
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.

1 participant