From 14dc9e1c1581fa04b37e81d76499f705512660b2 Mon Sep 17 00:00:00 2001 From: Owen Jacobson Date: Wed, 6 Nov 2024 18:42:38 -0500 Subject: Split message runs after ten minutes' silence. I've also refactored how runs are processed, to avoid re-splitting runs every time the channel view is rendered. They're generated when messages are ingested into the `$messages` store, instead. --- ui/routes/(app)/ch/[channel]/+page.svelte | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'ui/routes/(app)') diff --git a/ui/routes/(app)/ch/[channel]/+page.svelte b/ui/routes/(app)/ch/[channel]/+page.svelte index 49c1c29..0961665 100644 --- a/ui/routes/(app)/ch/[channel]/+page.svelte +++ b/ui/routes/(app)/ch/[channel]/+page.svelte @@ -2,12 +2,14 @@ import { page } from '$app/stores'; import ActiveChannel from '$lib/components/ActiveChannel.svelte'; import MessageInput from '$lib/components/MessageInput.svelte'; + import { messages } from '$lib/store'; let channel = $derived($page.params.channel); + let messageRuns = $derived($messages.inChannel(channel));
- +
-- cgit v1.2.3 From b89ffe00fbb28fac3daafb1f7adc71be72b59433 Mon Sep 17 00:00:00 2001 From: Owen Jacobson Date: Wed, 6 Nov 2024 17:12:42 -0500 Subject: Be more consistent around margins and padding for the "main" pane --- ui/lib/components/ActiveChannel.svelte | 18 +++++------------- ui/lib/components/MessageRun.svelte | 2 +- ui/routes/(app)/+layout.svelte | 2 +- 3 files changed, 7 insertions(+), 15 deletions(-) (limited to 'ui/routes/(app)') diff --git a/ui/lib/components/ActiveChannel.svelte b/ui/lib/components/ActiveChannel.svelte index f939dbd..ba62d6c 100644 --- a/ui/lib/components/ActiveChannel.svelte +++ b/ui/lib/components/ActiveChannel.svelte @@ -4,16 +4,8 @@ let { messageRuns } = $props(); -
- {#each messageRuns as { sender, messages }} -
- -
- {/each} -
- - +{#each messageRuns as { sender, messages }} +
+ +
+{/each} diff --git a/ui/lib/components/MessageRun.svelte b/ui/lib/components/MessageRun.svelte index b71e972..2e8c613 100644 --- a/ui/lib/components/MessageRun.svelte +++ b/ui/lib/components/MessageRun.svelte @@ -9,7 +9,7 @@
diff --git a/ui/routes/(app)/+layout.svelte b/ui/routes/(app)/+layout.svelte index 0a8c58d..db400c4 100644 --- a/ui/routes/(app)/+layout.svelte +++ b/ui/routes/(app)/+layout.svelte @@ -71,7 +71,7 @@
-
+
{@render children?.()}
-- cgit v1.2.3 From 9f0ba2e243be772a7677f8250893f5da7b2acbfe Mon Sep 17 00:00:00 2001 From: Owen Jacobson Date: Wed, 6 Nov 2024 17:42:02 -0500 Subject: Factor out the elements of the `/me` page, and style them a little. --- ui/lib/components/ChangePassword.svelte | 60 +++++++++++++++++++++++ ui/lib/components/Invite.svelte | 5 +- ui/lib/components/Invites.svelte | 13 ++--- ui/lib/components/LogOut.svelte | 18 +++++++ ui/routes/(app)/me/+page.svelte | 84 +++++---------------------------- 5 files changed, 97 insertions(+), 83 deletions(-) create mode 100644 ui/lib/components/ChangePassword.svelte create mode 100644 ui/lib/components/LogOut.svelte (limited to 'ui/routes/(app)') diff --git a/ui/lib/components/ChangePassword.svelte b/ui/lib/components/ChangePassword.svelte new file mode 100644 index 0000000..1e48bee --- /dev/null +++ b/ui/lib/components/ChangePassword.svelte @@ -0,0 +1,60 @@ + + +
+ + + + + + + +
diff --git a/ui/lib/components/Invite.svelte b/ui/lib/components/Invite.svelte index 35e00b4..381f483 100644 --- a/ui/lib/components/Invite.svelte +++ b/ui/lib/components/Invite.svelte @@ -5,8 +5,5 @@ let inviteUrl = $derived(new URL(`/invite/${id}`, document.location)); - + {inviteUrl} diff --git a/ui/lib/components/Invites.svelte b/ui/lib/components/Invites.svelte index cc14f3b..314782a 100644 --- a/ui/lib/components/Invites.svelte +++ b/ui/lib/components/Invites.svelte @@ -4,7 +4,7 @@ let invites = $state([]); - async function onSubmit(event) { + async function onsubmit(event) { event.preventDefault(); let response = await createInvite(); if (response.status == 200) { @@ -13,11 +13,12 @@ } -