feat(ui): pending DM marker shows one dot per send (resend count)

The awaiting-ACK marker now draws a row of dots equal to how many times the
DM has been transmitted (1 = first send, +1 per auto-resend), so the user can
see retry progress before it resolves to checkmark/cross.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
MarekZegare4
2026-06-14 15:20:37 +02:00
parent aa4bb490d0
commit 606fbbe243

View File

@@ -284,14 +284,16 @@ class QuickMsgScreen : public UIScreen {
} }
// Small font-independent delivery marker, drawn with the current ink colour // Small font-independent delivery marker, drawn with the current ink colour
// in a ~5x5 box. No font has a usable check/cross glyph, so draw them. // in a ~5px box. No font has a usable check/cross glyph, so draw them.
static void drawAckGlyph(DisplayDriver& d, int x, int top_y, AckState s) { // `sends` (pending only) = how many times the DM has been transmitted: one dot
// per send, so the row grows by a dot with each auto-resend.
static void drawAckGlyph(DisplayDriver& d, int x, int top_y, AckState s, int sends = 1) {
int lh = d.getLineHeight(); int lh = d.getLineHeight();
int y = top_y + (lh - 5) / 2; int y = top_y + (lh - 5) / 2;
if (y < top_y) y = top_y; if (y < top_y) y = top_y;
switch (s) { switch (s) {
case ACK_PENDING: // "·" awaiting ACK case ACK_PENDING: // "·· …" awaiting ACK, one dot per send
d.fillRect(x + 1, y + 3, 2, 2); for (int i = 0; i < sends; i++) d.fillRect(x + i * 3, y + 3, 2, 2);
break; break;
case ACK_OK: // "✓" delivered / relayed case ACK_OK: // "✓" delivered / relayed
d.fillRect(x, y + 2, 1, 1); d.fillRect(x, y + 2, 1, 1);
@@ -962,7 +964,7 @@ public:
if (e.outgoing) { // delivery marker in the (inverted) header bar if (e.outgoing) { // delivery marker in the (inverted) header bar
display.setColor(DisplayDriver::DARK); display.setColor(DisplayDriver::DARK);
drawAckGlyph(display, 2 + display.getTextWidth(sender) + 3, 1, drawAckGlyph(display, 2 + display.getTextWidth(sender) + 3, 1,
dmEffectiveStatus(e)); dmEffectiveStatus(e), e.attempt + 1);
display.setColor(DisplayDriver::LIGHT); display.setColor(DisplayDriver::LIGHT);
} }
if (_ctx_menu.active) _ctx_menu.render(display); if (_ctx_menu.active) _ctx_menu.render(display);
@@ -1038,7 +1040,7 @@ public:
display.drawTextEllipsized(3, y + 1, display.width() - cw - 2 - age_w, sender); display.drawTextEllipsized(3, y + 1, display.width() - cw - 2 - age_w, sender);
if (e.outgoing) { // delivery marker after "Me" if (e.outgoing) { // delivery marker after "Me"
int gx = 3 + display.getTextWidth(sender) + 3; int gx = 3 + display.getTextWidth(sender) + 3;
drawAckGlyph(display, gx, y + 1, dmEffectiveStatus(e)); drawAckGlyph(display, gx, y + 1, dmEffectiveStatus(e), e.attempt + 1);
} }
if (age[0]) { display.setCursor(display.width() - age_w, y + 1); display.print(age); } if (age[0]) { display.setCursor(display.width() - age_w, y + 1); display.print(age); }
if (!sel) display.setColor(DisplayDriver::LIGHT); if (!sel) display.setColor(DisplayDriver::LIGHT);