morethanwords/tweb/master • 1271882 • 1 files, +8/-8
Stop a read receipt from leaving two check marks on one message
An outgoing message in a group could end up rendering its sent and its read
status side by side — "18:11 ✓✓ ✓" — with the thread reply counter that used to
sit next to them gone.
setBubbleSendingStatus asked whether a status was already there with a
descendant query (`element.querySelector('.time-sending-status')`) but then
wrote over `element.firstElementChild`, which is only the same node while
nothing has been prepended in front of it. setBubbleRepliesCount prepends
exactly there: a message that gains its first thread reply after its bubble was
rendered gets `.time-replies` pushed ahead of the status. The next status change
— the read receipt — then replaced the counter instead of the old icon, and the
old icon stayed. Both carry `order: 5` against the time's `0`, so they line up
after the time in DOM order, newest first. The `!status` branch had the mirror
of the same bug: it removed the first child and left the status alone.
The two lookups now name the node they intend to touch, so a status replaces a
status and a missing one is prepended. setBubbleRepliesCount gets the same
direct-child scope: once the status bug had eaten the outer `.time`'s counter,
its descendant query found the copy inside `.time-inner`, concluded the counter
was already mounted and never restored it — leaving the hidden spacer that
reserves the footer's width one element short of what is drawn.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
morethanwords/tweb/master • a5a90e7 • 4 files, +64/-2
Keep tag search input focused
#webk
Post #20927
90
- 🫡 3