From a2e6f3f828c788364824d1d3cf390d203ef0bd78 Mon Sep 17 00:00:00 2001 From: rambros Date: Wed, 4 Mar 2026 00:22:43 +0530 Subject: [PATCH] show first and previous message previews --- src/ui/shuttle_ops.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/ui/shuttle_ops.py b/src/ui/shuttle_ops.py index d4625a1..2b24546 100644 --- a/src/ui/shuttle_ops.py +++ b/src/ui/shuttle_ops.py @@ -747,6 +747,28 @@ class ShuttlePane(Container): i_status = f"[bold]{stats_analysis['messages']}[/bold] New Messages, [bold]{stats_analysis['threads']}[/bold] Threads." modal.show_info(m_status, i_status) + # Fetch and display message previews + try: + first_msg = await self.engine.discord_reader.get_first_message(source_channel.id) + if first_msg: + content = first_msg.content or (f"[dim]({len(first_msg.attachments)} attachments)[/dim]" if first_msg.attachments else "[dim](no content)[/dim]") + modal.write("[bold cyan]Start from first message:[/bold cyan]") + modal.write(f"[bold]{first_msg.author.display_name}:[/bold] {content[:200]}") + modal.write("") + + if has_previous and last_migrated: + try: + prev_msg = await self.engine.discord_reader.get_message(source_channel.id, int(last_migrated)) + if prev_msg: + content = prev_msg.content or (f"[dim]({len(prev_msg.attachments)} attachments)[/dim]" if prev_msg.attachments else "[dim](no content)[/dim]") + modal.write("[bold yellow]Continue from previous migration:[/bold yellow]") + modal.write(f"[bold]{prev_msg.author.display_name}:[/bold] {content[:200]}") + modal.write("") + except Exception as e: + logger.warning(f"Could not fetch previous message {last_migrated}: {e}") + except Exception as e: + logger.warning(f"Error fetching message previews: {e}") + modal.set_status(f"Awaiting Confirmation to migrate Discord [cyan]#{source_channel.name}[/cyan] → {platform_name} [green]#{target_channel.get('name')}[/green]") # Phase 2: Confirmation