Skip to content

Conversation

@BornToBeRoot
Copy link
Owner

Changes proposed in this pull request

  • Add input to dns server combobox

Related issue(s)

Copilot generated summary

Provide a Copilot generated summary of the changes in this pull request.

Copilot summary

This pull request refactors the DNS server selection logic in the DNS Lookup feature, improving usability and code maintainability. The main changes include replacing the custom value converter with a more direct approach to displaying DNS server names, supporting editable ComboBox input for custom DNS server entries, and updating model and viewmodel logic for clearer separation of concerns and easier custom profile handling.

UI and Usability Improvements

  • The DNS server ComboBox in DNSLookupView.xaml is now editable, allowing users to enter custom DNS server IPs directly. The selection logic was updated to bind to a new SelectedListProfile property and support custom input via DNSServerQuickInput, removing the need for a value converter. [1] [2]

ViewModel and Data Handling

  • The DNSLookupViewModel now distinguishes between selected list profiles and direct text input. When a user types an IP address, a custom profile is created and used for DNS queries. The DNSServer property is now private set, and a new SelectedListProfile property manages selection from the ComboBox. [1] [2]
  • Initialization logic in the viewmodel ensures the selected DNS server and input field are synchronized with settings and user selection, and custom profiles are handled gracefully.

Model and Data Structure Updates

  • The DNSServerConnectionInfoProfile constructor now sets a default name for the Windows DNS profile, and the Servers property uses collection initializers for brevity and clarity. [1] [2] [3]
  • The default selected DNS server in settings and viewmodels is now initialized to null instead of a new profile instance, preventing unintended default selections and improving state management. [1] [2]

Codebase Simplification

  • The obsolete DNSServerConnectionInfoProfileToString value converter was removed as its functionality is now handled by the model's ToString() override and direct binding.

References:
[1] [2] [3] [4] [5] [6] [7] [8] [9] [10]

To-Do

  • Migrate DNS Server dialog
  • Add validation to input (ip:port; ip:port)
  • Select first dns server in settings (on startup)
  • Review the PoC code again...
  • Update documentation to reflect this changes
  • Update changelog to reflect this changes

Contributing

By submitting this pull request, I confirm the following:

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DNS Lookup - Custom DNS Server

2 participants