[Light Switch] Add 10s timeout and pre-check for location detection (#45887)

<!-- Enter a brief description/summary of your PR here. What does it
fix/what does it change/how was it tested (even manually, if necessary)?
-->
- Add 10-second timeout to GetGeopositionAsync to prevent infinite
spinner
- Pre-check location services availability when dialog opens; disable
Detect Location button with message if unavailable
- Show user-friendly error messages for timeout and unavailable
scenarios
- Add LocationErrorText UI element and localized string resources

<!-- Please review the items on the PR checklist before submitting-->
## PR Checklist

- [x] Closes: #45860
- [x] Closes: #42852

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Jaylyn Barbee
2026-03-02 15:26:31 -05:00
committed by GitHub
parent fd399045f7
commit 22b4dda3aa
3 changed files with 52 additions and 9 deletions

View File

@@ -5150,6 +5150,12 @@ The break timer font matches the text font.</value>
<data name="LightSwitch_SunsetTooltip.Text" xml:space="preserve">
<value>Sunset</value>
</data>
<data name="LightSwitch_LocationError_Timeout" xml:space="preserve">
<value>Unable to connect to location services. Please try again or enter your coordinates manually.</value>
</data>
<data name="LightSwitch_LocationError_Unavailable" xml:space="preserve">
<value>Location services unavailable. Please enter your coordinates manually.</value>
</data>
<data name="Close_NavViewItem.Content" xml:space="preserve">
<value>Close PowerToys</value>
<comment>Don't loc "PowerToys"</comment>