fix(ui): message-history scrollbar reserve stuck behind alert overlay

The DM/channel history views size the scroll-column reserve from the previous
frame's visible count. A new message bumps the count so the reserve briefly
appears until the next frame settles it — normally invisible, but the alert
overlay froze the screen (_next_refresh = _alert_expiry) for the alert's whole
duration, leaving the content shifted as if a scrollbar were needed. Keep the
underlying screen refreshing at its own cadence (capped at the alert expiry);
the display CRC skips unchanged frames so e-ink isn't thrashed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Jakub
2026-06-15 21:23:00 +02:00
parent 9da730e3b6
commit da161d49d2

View File

@@ -1825,7 +1825,12 @@ void UITask::loop() {
_display->setColor(DisplayDriver::LIGHT);
_display->drawRect(box_x, box_y, box_w, box_h);
_display->drawTextCentered(_display->width() / 2, box_y + pad, _alert);
_next_refresh = _alert_expiry; // will need refresh when alert is dismissed
// Keep refreshing the underlying screen at its own cadence (capped at the
// alert's expiry) so layouts that settle over a frame — e.g. the message-
// history scrollbar reserve — don't stay stuck behind the alert. Unchanged
// frames are skipped by the display CRC, so e-ink isn't thrashed.
_next_refresh = millis() + delay_millis;
if (_next_refresh > _alert_expiry) _next_refresh = _alert_expiry;
} else {
_next_refresh = millis() + delay_millis;
}