Add spinner/countdown-bar to stats panel; backfill on widened days_back

Stats panel: a persistent spinner marks whichever target is currently
being scanned/reacted to, and jittered waits show a live-ticking
countdown bar instead of a static "waiting Xs" line. Both the status
line and countdown row are always rendered (blank when idle) so their
appearing/disappearing no longer shifts the table's height.

Backlog: channel_scan_state now tracks oldest_covered_at alongside
newest_id_seen. If days_back is widened after a channel already has a
resume checkpoint, the forward-only diff would never look back far
enough to notice — now the newly-exposed gap gets backfilled first.
This commit is contained in:
2026-08-01 19:24:20 +02:00
parent 7b3c358b05
commit ef90ee6a0b
6 changed files with 159 additions and 31 deletions

View File

@@ -80,6 +80,7 @@ class ReactorClient(discord.Client):
)
for target in targets:
self.display.set_active_target(target.target_id)
if target.target_type in ("group_dm", "dm"):
channel = self.get_channel(target.target_id)
if channel is None:
@@ -98,6 +99,7 @@ class ReactorClient(discord.Client):
cutoff, react_fn, display=self.display,
)
self.display.set_active_target(None)
log.info("Backlog scan complete. Now watching live.")
self.display.set_status("Backlog scan complete — watching live for new messages...")
@@ -110,11 +112,13 @@ class ReactorClient(discord.Client):
if message.author.id != self.cfg.friend_id:
return
chan_label = getattr(message.channel, "name", None) or target.name
self.display.set_active_target(target.target_id)
self.display.set_status(f"New message from friend in {chan_label}...")
await react_to_message(
self.storage, message, target, self.cfg.friend_id, self.cfg.emoji,
source="live", display=self.display,
)
self.display.set_active_target(None)
def parse_args():