summaryrefslogtreecommitdiff
path: root/ui/lib/components/MessageRun.svelte
diff options
context:
space:
mode:
authorOwen Jacobson <owen@grimoire.ca>2024-10-30 18:50:01 -0400
committerOwen Jacobson <owen@grimoire.ca>2024-10-30 18:50:01 -0400
commita356546fc706b2ade758e7f42069e6d669330421 (patch)
tree1da521415b6fe99eddbbb395a95f4b5a154de18c /ui/lib/components/MessageRun.svelte
parent1eec6338e1146439b1dbc6207843fbc44dd13088 (diff)
Coalesce adjacent messages by the same author into runs, to consolidate message display.
Diffstat (limited to 'ui/lib/components/MessageRun.svelte')
-rw-r--r--ui/lib/components/MessageRun.svelte20
1 files changed, 20 insertions, 0 deletions
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>