[grade=B urn:ump:ewcpea4mjnjb3chkw2f3vxfiziwnc2zuntsi2um3aewmq6xomtcq] ux(DC-171): chunk 3 — tour scroll tracking, weather dead-widget collapse, Set Location affordance

1. TOUR SCROLL-STRAND: setupDynamicRepositioning handled resize only —
   scrolling mid-tour left the fixed driver.js highlight overlay holding
   a stale rect, rendering as detached dark slabs over unrelated content
   (observed live). Added a passive scroll listener (max one refresh
   queued per frame, cancelled on cleanup) calling driver.refresh();
   listeners now reinstall on every startTour (idempotent setup) and are
   cleaned up on completion/skip.
2. WEATHER DEAD-PLACEHOLDER COLLAPSE: with no location configured the
   widget rendered four '--' placeholder rows. Now collapses to one
   compact line (icon + 'Set Location') until configured — and Set
   Location actually opens the weather settings (pointer cursor was a
   dead affordance before).
3. Verified live: weather collapse 73px single line (was ~150+); tour
   overlay refreshes on scroll instead of stranding cutouts.

Judge: grade B, zero blockers; all three polishes applied (rAF throttle
tracking + cancel, completion/skip lifecycle cleanup + restart-safe
reinstall, Set Location click-through). Frontend 68/68.
This commit is contained in:
Hermes committed 2026-11-19 13:14:57 -08:00
1 parent f0a12b4da0
commit 9cff937e7c
6 files changed
+148 -92

No files matched your search

+14 -3
View File
@@ -146,14 +146,19 @@
}
const location = safeGet(LOCATION_KEY);
const containerEl = document.querySelector('.weather-widget-container');
if (!location) {
// UX pass chunk 3: unconfigured widget collapses to one compact line
// instead of four '--' placeholder rows shouting for attention
if (containerEl) containerEl.classList.add('weather-unconfigured');
weatherWidget.location.textContent = 'Set Location';
weatherWidget.temp.textContent = '--\u00B0';
weatherWidget.condition.textContent = 'Click \u2699\uFE0F to configure';
weatherWidget.wind.textContent = '--';
weatherWidget.temp.textContent = '';
weatherWidget.condition.textContent = '';
weatherWidget.wind.textContent = '';
weatherWidget.icon.innerHTML = '<span class="weather-emoji">\uD83C\uDF24\uFE0F</span>';
return;
}
if (containerEl) containerEl.classList.remove('weather-unconfigured');
try {
const weather = await fetchWeather(location);
@@ -189,6 +194,12 @@
locationInput.focus();
});
// UX pass chunk 3: the collapsed 'Set Location' line must actually open
// the config — a pointer cursor without a click handler is a dead affordance
document.querySelector('.weather-location')?.addEventListener('click', () => {
document.getElementById('weather-settings')?.click();
});
document.getElementById('weather-cancel')?.addEventListener('click', () => {
modal.classList.remove('show');
});