-
Notifications
You must be signed in to change notification settings - Fork 7.5k
[Light Switch] Enter latitude and longitude manually in Sunrise to sunset mode #43276
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
| private async Task GetGeoLocation() | ||
| private async void GetGeoLocation_Click(object sender, RoutedEventArgs e) | ||
| { | ||
| SyncButton.IsEnabled = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the lat/lon textboxes be disabled too?
| ViewModel.Latitude = lat.ToString(CultureInfo.InvariantCulture); | ||
| ViewModel.Longitude = lon.ToString(CultureInfo.InvariantCulture); | ||
|
|
||
| LocationResultPanel.Visibility = Visibility.Visible; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do run this method too when manually entering values?
Should the save button be disabled ubtil we checked if the entered values are actual numbers?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR updates the Light Switch location dialog to improve user experience by allowing manual latitude/longitude entry alongside automatic location detection. The primary button changes from "Select" to "Save" and the UI is reorganized to present input fields and a detect button together.
- Adds manual latitude/longitude number boxes for direct user input
- Replaces auto-trigger geolocation on dialog open with an explicit "Detect location" button
- Restructures location result panel to display sunrise/sunset times more clearly
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| Resources.resw | Updates button labels and resource strings, adds new latitude/longitude headers and detection button text |
| LightSwitchPage.xaml.cs | Refactors geolocation from auto-trigger to button click handler, adds value change handler for manual coordinate entry |
| LightSwitchPage.xaml | Restructures location dialog UI with number input boxes, repositions detect button, and adjusts result panel layout |
Comments suppressed due to low confidence (3)
src/settings-ui/Settings.UI/SettingsXAML/Views/LightSwitchPage.xaml:1
- Inconsistent indentation: this line uses a tab character while surrounding lines use spaces. The file should maintain consistent indentation throughout.
<?xml version="1.0" encoding="utf-8" ?>
src/settings-ui/Settings.UI/SettingsXAML/Views/LightSwitchPage.xaml:1
- Inconsistent indentation: this line uses a tab character while surrounding lines use spaces. The file should maintain consistent indentation throughout.
<?xml version="1.0" encoding="utf-8" ?>
src/settings-ui/Settings.UI/SettingsXAML/Views/LightSwitchPage.xaml:1
- Inconsistent indentation: this line uses a tab character while surrounding lines use spaces. The file should maintain consistent indentation throughout.
<?xml version="1.0" encoding="utf-8" ?>
| ViewModel.Latitude = lat.ToString(CultureInfo.InvariantCulture); | ||
| ViewModel.Longitude = lon.ToString(CultureInfo.InvariantCulture); | ||
|
|
||
| LocationResultPanel.Visibility = Visibility.Visible; |
Copilot
AI
Nov 5, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The LatLonBox_ValueChanged handler does not enable the primary button when valid coordinates are entered. The GetGeoLocation_Click handler sets LocationDialog.IsPrimaryButtonEnabled = true on line 138, but this handler does not. Users who manually enter valid coordinates cannot save them because the primary button remains disabled (initialized to False on line 203 of the XAML).
| LocationResultPanel.Visibility = Visibility.Visible; | |
| LocationResultPanel.Visibility = Visibility.Visible; | |
| // Enable the primary button when valid coordinates are entered | |
| if (LocationDialog != null) | |
| { | |
| LocationDialog.IsPrimaryButtonEnabled = true; | |
| } |
Summary of the Pull Request
This PR introduces new UI to allow the users to manually enter their lat/long.
PR Checklist