mirror of
https://github.com/netbymatt/ws4kp.git
synced 2026-11-28 18:28:04 -08:00
The scroll cache in hazards, hourly and travel forecast is invalidated by comparing element identity, but the lines element is persistent - a rebuild only replaces its children - and displayHeight is a fixed value from css. Both conditions stay false after the first measurement, so maxOffset keeps the height of whatever content was measured first. When later content is taller, the scroll clamps at the old offset and sits frozen there for the rest of the screen's timing. Invalidate the cache explicitly when the list is rebuilt, and reset navBaseCount so new content scrolls from the top. Invalidating alone would regress hazards: it refreshes every 60 seconds but a long multi-alert scroll can run for several minutes, so rebuilding on every refresh would restart it from the top and it would never reach the end. Each display now also compares a signature of the content it is about to render and skips the rebuild entirely when nothing changed, leaving an in-progress scroll undisturbed. Hourly's signature includes the starting hour because its row labels are derived from the current time.