feat(ui): DM delivery status marker (pending / delivered / failed)

Outgoing direct messages now show a small delivery glyph after "Me" in the DM
history, driven by MeshCore's existing end-to-end ACK (no protocol change):
- · pending (awaiting ACK)
- ✓ delivered (ACK matched)
- ✗ failed (no ACK by the deadline)

Plumbing:
- DmHistEntry gains ack_status / ack_tag / ack_deadline_ms (RAM only).
- sendText() captures expected_ack + est_timeout; afterSend() stores them.
- AbstractUITask::onMsgAck() virtual; MyMesh::onAckRecv routes ours-only ACKs
  to UITask -> QuickMsgScreen::markDmDelivered().
- Status evaluated lazily (pending past deadline reads as failed); no timer.
- Glyphs hand-drawn (no font has a usable check/cross), font-independent.

Sends with no path (expected_ack == 0) show no marker (can't be confirmed).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
MarekZegare4
2026-06-14 14:07:15 +02:00
parent 8545454f5b
commit 219a2bba5c
5 changed files with 100 additions and 7 deletions

View File

@@ -1160,9 +1160,10 @@ void MyMesh::onAckRecv(mesh::Packet* packet, uint32_t ack_crc) {
// onAckRecv also fires for ACKs we merely route or overhear (see Mesh.cpp), whose
// SNR belongs to an unrelated link — only feed APC for ACKs to our own sends.
// Capture the match before the base handler's processAck() clears the entry.
bool ours = _prefs.tx_apc && isAckPending(ack_crc);
bool mine = isAckPending(ack_crc);
BaseChatMesh::onAckRecv(packet, ack_crc);
if (ours) apcSampleSnr(radio_driver.getLastSNR());
if (mine && _prefs.tx_apc) apcSampleSnr(radio_driver.getLastSNR());
if (mine && _ui) _ui->onMsgAck(ack_crc); // drive DM delivery-status marker
}
MyMesh::MyMesh(mesh::Radio &radio, mesh::RNG &rng, mesh::RTCClock &rtc, SimpleMeshTables &tables, DataStore& store, AbstractUITask* ui)