From a356546fc706b2ade758e7f42069e6d669330421 Mon Sep 17 00:00:00 2001
From: Owen Jacobson <owen@grimoire.ca>
Date: Wed, 30 Oct 2024 18:50:01 -0400
Subject: Coalesce adjacent messages by the same author into runs, to
 consolidate message display.

---
 ui/lib/components/MessageRun.svelte | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
 create mode 100644 ui/lib/components/MessageRun.svelte

(limited to 'ui/lib/components/MessageRun.svelte')

diff --git a/ui/lib/components/MessageRun.svelte b/ui/lib/components/MessageRun.svelte
new file mode 100644
index 0000000..b998a8b
--- /dev/null
+++ b/ui/lib/components/MessageRun.svelte
@@ -0,0 +1,20 @@
+<script>
+	import { logins } from '$lib/store';
+	import Message from '$lib/components/Message.svelte';
+
+	export let sender;
+	export let messages;
+
+	let name;
+	$: name = $logins.get(sender);
+</script>
+
+<div class="card card-hover m-4 relative">
+	<span class="chip variant-soft sticky top-o left-0">
+		<!-- TODO: should this show up for only the first of a run? -->
+		@{name}:
+	</span>
+	{#each messages as { at, body }}
+		<Message {at} {body} />
+	{/each}
+</div>
-- 
cgit v1.2.3

