From da161d49d2617588b6eefbe2dce15b9ed0ae51c8 Mon Sep 17 00:00:00 2001 From: Jakub <106778416+MarekZegare4@users.noreply.github.com> Date: Mon, 15 Jun 2026 21:23:00 +0200 Subject: [PATCH] fix(ui): message-history scrollbar reserve stuck behind alert overlay MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- examples/companion_radio/ui-new/UITask.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/examples/companion_radio/ui-new/UITask.cpp b/examples/companion_radio/ui-new/UITask.cpp index c24801e7..dc7edf33 100644 --- a/examples/companion_radio/ui-new/UITask.cpp +++ b/examples/companion_radio/ui-new/UITask.cpp @@ -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; }