sky form: clear timezone field on new place pick so TZ auto-redetects from coords — TDD
selectPlace + geolocation now zero out tzInput.value & tzHint before schedulePreview, so the existing `if (!tzInput.value && data.timezone)` backfill in schedulePreview's success path actually fires when the user changes location after a saved sky exists. Without the clear, the saved/previous TZ stayed pinned & the chart was recomputed against the wrong timezone. Fix mirrored across sky.html (Dashsky), _applet-my-sky.html (My Sky applet entry form), and _sky_overlay.html (PICK SKY in-room overlay). New FT MySkyTimezoneRefreshTest.test_changing_place_refreshes_auto_detected_timezone seeds a user w. saved Baltimore/America/New_York, mocks Nominatim + sky/preview to return Camarillo + America/Los_Angeles, picks the suggestion, and asserts the TZ field updates. Code architected by Disco DeDisco <discodedisco@outlook.com> Git commit message Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -214,6 +214,8 @@
|
||||
placeInput.value = place.display_name;
|
||||
latInput.value = parseFloat(place.lat).toFixed(4);
|
||||
lonInput.value = parseFloat(place.lon).toFixed(4);
|
||||
tzInput.value = '';
|
||||
tzHint.textContent = '';
|
||||
hideSuggestions();
|
||||
_saveForm();
|
||||
schedulePreview();
|
||||
@@ -231,6 +233,8 @@
|
||||
(pos) => {
|
||||
latInput.value = pos.coords.latitude.toFixed(4);
|
||||
lonInput.value = pos.coords.longitude.toFixed(4);
|
||||
tzInput.value = '';
|
||||
tzHint.textContent = '';
|
||||
fetch(
|
||||
`https://nominatim.openstreetmap.org/reverse?format=json&lat=${latInput.value}&lon=${lonInput.value}`,
|
||||
{ headers: { 'User-Agent': USER_AGENT } }
|
||||
|
||||
@@ -184,6 +184,8 @@
|
||||
placeInput.value = place.display_name;
|
||||
latInput.value = parseFloat(place.lat).toFixed(4);
|
||||
lonInput.value = parseFloat(place.lon).toFixed(4);
|
||||
tzInput.value = '';
|
||||
tzHint.textContent = '';
|
||||
hideSuggestions();
|
||||
schedulePreview();
|
||||
}
|
||||
@@ -200,6 +202,8 @@
|
||||
(pos) => {
|
||||
latInput.value = pos.coords.latitude.toFixed(4);
|
||||
lonInput.value = pos.coords.longitude.toFixed(4);
|
||||
tzInput.value = '';
|
||||
tzHint.textContent = '';
|
||||
fetch(`https://nominatim.openstreetmap.org/reverse?format=json&lat=${latInput.value}&lon=${lonInput.value}`, {
|
||||
headers: { 'User-Agent': USER_AGENT },
|
||||
})
|
||||
|
||||
@@ -246,6 +246,8 @@
|
||||
placeInput.value = place.display_name;
|
||||
latInput.value = parseFloat(place.lat).toFixed(4);
|
||||
lonInput.value = parseFloat(place.lon).toFixed(4);
|
||||
tzInput.value = '';
|
||||
tzHint.textContent = '';
|
||||
hideSuggestions();
|
||||
_saveForm();
|
||||
schedulePreview();
|
||||
@@ -263,6 +265,8 @@
|
||||
(pos) => {
|
||||
latInput.value = pos.coords.latitude.toFixed(4);
|
||||
lonInput.value = pos.coords.longitude.toFixed(4);
|
||||
tzInput.value = '';
|
||||
tzHint.textContent = '';
|
||||
fetch(`https://nominatim.openstreetmap.org/reverse?format=json&lat=${latInput.value}&lon=${lonInput.value}`, {
|
||||
headers: { 'User-Agent': USER_AGENT },
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user