diff --git a/src/app.css b/src/app.css index 7b86798..910af7e 100644 --- a/src/app.css +++ b/src/app.css @@ -338,18 +338,14 @@ progress[value]::-webkit-progress-value { @apply w-full md:w-[calc(100%-18.5rem)]; } +.cb { + @apply saib bottom-14 md:bottom-0; +} + /* chat view */ -.chat__page-bar { - @apply sait cw !fixed top-2; -} - -.chat__messages { - @apply saib cw fixed top-12 flex h-[calc(100%-6.5rem)] flex-col-reverse overflow-y-auto overflow-x-hidden md:h-[calc(100%-3rem)]; -} - .chat__compose { - @apply saib cw fixed bottom-14 md:bottom-0; + @apply cb cw fixed; } .chat__scroll-down { diff --git a/src/app/components/CalendarEventForm.svelte b/src/app/components/CalendarEventForm.svelte index 87545f1..6ad412a 100644 --- a/src/app/components/CalendarEventForm.svelte +++ b/src/app/components/CalendarEventForm.svelte @@ -83,8 +83,8 @@ const content = initialValues?.content || "" const editor = makeEditor({submit, uploading, content}) - let title = $state(initialValues?.title) - let location = $state(initialValues?.location) + let title = $state(initialValues?.title || "") + let location = $state(initialValues?.location || "") let start: number | undefined = $state(initialValues?.start) let end: number | undefined = $state(initialValues?.end) let endDirty = Boolean(initialValues?.end) diff --git a/src/app/components/Chat.svelte b/src/app/components/Chat.svelte index 56cf933..d8b676b 100644 --- a/src/app/components/Chat.svelte +++ b/src/app/components/Chat.svelte @@ -15,6 +15,7 @@ import Link from "@lib/components/Link.svelte" import Spinner from "@lib/components/Spinner.svelte" import PageBar from "@lib/components/PageBar.svelte" + import PageContent from "@lib/components/PageContent.svelte" import Divider from "@lib/components/Divider.svelte" import Button from "@lib/components/Button.svelte" import ProfileName from "@app/components/ProfileName.svelte" @@ -124,7 +125,7 @@ {#if others.length > 0} - + {#snippet title()}
{#if others.length === 1} @@ -172,7 +173,7 @@ {/if} -
+
{#if missingInboxes.includes($pubkey!)}
@@ -223,7 +224,7 @@ {@render info?.()}

-
+
diff --git a/src/app/components/EventReply.svelte b/src/app/components/EventReply.svelte index a9c31ed..f0be23b 100644 --- a/src/app/components/EventReply.svelte +++ b/src/app/components/EventReply.svelte @@ -1,7 +1,8 @@ +
-
-
- + class="cb cw fixed z-feature -mx-2 pt-3"> +
+
+
+ +
+
- + + + +
- - - - diff --git a/src/lib/components/PageBar.svelte b/src/lib/components/PageBar.svelte index 305f0d2..9cd9781 100644 --- a/src/lib/components/PageBar.svelte +++ b/src/lib/components/PageBar.svelte @@ -1,15 +1,17 @@ -
+
diff --git a/src/lib/components/PageContent.svelte b/src/lib/components/PageContent.svelte new file mode 100644 index 0000000..7a2c791 --- /dev/null +++ b/src/lib/components/PageContent.svelte @@ -0,0 +1,18 @@ + + +
+ {@render children?.()} +
diff --git a/src/routes/spaces/[relay]/+page.svelte b/src/routes/spaces/[relay]/+page.svelte index 73e6b62..62da87b 100644 --- a/src/routes/spaces/[relay]/+page.svelte +++ b/src/routes/spaces/[relay]/+page.svelte @@ -9,6 +9,7 @@ import Button from "@lib/components/Button.svelte" import Divider from "@lib/components/Divider.svelte" import PageBar from "@lib/components/PageBar.svelte" + import PageContent from "@lib/components/PageContent.svelte" import MenuSpaceButton from "@app/components/MenuSpaceButton.svelte" import ProfileFeed from "@app/components/ProfileFeed.svelte" import ChannelName from "@app/components/ChannelName.svelte" @@ -45,154 +46,152 @@ const pubkey = $derived($relay?.profile?.pubkey) -
- - {#snippet icon()} -
- -
- {/snippet} - {#snippet title()} - Home - {/snippet} - {#snippet action()} -
- {#if !$userRoomsByUrl.has(url)} - - {:else if pubkey} - - - Contact Owner - - {/if} - -
- {/snippet} -
-
-
-
-
-
-
- {#if $relay?.profile?.icon} - - {:else} - - {/if} -
-
-
-
-

- -

-

{displayRelayUrl(url)}

-
-
- - {#if $relay?.profile} - {@const {software, version, supported_nips, limitation} = $relay.profile} -
- {#if limitation?.auth_required} -

- Authentication Required -

- {/if} - {#if limitation?.payment_required} -

Payment Required

- {/if} - {#if limitation?.min_pow_difficulty} -

- Requires PoW {limitation?.min_pow_difficulty} -

- {/if} - {#if supported_nips} -

- NIPs: {supported_nips.join(", ")} -

- {/if} - {#if software} -

Software: {software}

- {/if} - {#if version} -

Version: {version}

- {/if} -
+ + {#snippet icon()} +
+ +
+ {/snippet} + {#snippet title()} + Home + {/snippet} + {#snippet action()} +
+ {#if !$userRoomsByUrl.has(url)} + + {:else if pubkey} + + + Contact Owner + {/if} +
- Your Rooms -
- -
- - Threads - {#if $notifications.has(threadsPath)} -
-
- {/if} -
- - -
- - Calendar - {#if $notifications.has(calendarPath)} -
-
- {/if} -
- - {#each $userRooms as room (room)} - {@const roomPath = makeRoomPath(url, room)} - -
- {#if channelIsLocked($channelsById.get(makeChannelId(url, room)))} - + {/snippet} + + + +
+
+
+
+
+ {#if $relay?.profile?.icon} + {:else} - + {/if} -
- {#if $notifications.has(roomPath)} -
-
- {/if} - - {/each} +
+
+
+

+ +

+

{displayRelayUrl(url)}

+
- Other Rooms -
- {#each $otherRooms as room (room)} - -
- {#if channelIsLocked($channelsById.get(makeChannelId(url, room)))} - - {:else} - - {/if} - -
- - {/each} - -
- {#if pubkey} - -
+ Your Rooms +
+ +
+ + Threads + {#if $notifications.has(threadsPath)} +
+
+ {/if} +
+ + +
+ + Calendar + {#if $notifications.has(calendarPath)} +
+
+ {/if} +
+ + {#each $userRooms as room (room)} + {@const roomPath = makeRoomPath(url, room)} + +
+ {#if channelIsLocked($channelsById.get(makeChannelId(url, room)))} + + {:else} + + {/if} + +
+ {#if $notifications.has(roomPath)} +
+ {/if} + + {/each} +
+ Other Rooms +
+ {#each $otherRooms as room (room)} + +
+ {#if channelIsLocked($channelsById.get(makeChannelId(url, room)))} + + {:else} + + {/if} + +
+ + {/each} + +
+ {#if pubkey} + + {/if} +
diff --git a/src/routes/spaces/[relay]/[room]/+page.svelte b/src/routes/spaces/[relay]/[room]/+page.svelte index 85d4024..002ada7 100644 --- a/src/routes/spaces/[relay]/[room]/+page.svelte +++ b/src/routes/spaces/[relay]/[room]/+page.svelte @@ -12,6 +12,7 @@ import Button from "@lib/components/Button.svelte" import Spinner from "@lib/components/Spinner.svelte" import PageBar from "@lib/components/PageBar.svelte" + import PageContent from "@lib/components/PageContent.svelte" import Divider from "@lib/components/Divider.svelte" import MenuSpaceButton from "@app/components/MenuSpaceButton.svelte" import ChannelName from "@app/components/ChannelName.svelte" @@ -232,7 +233,7 @@ }) - + {#snippet icon()}
@@ -267,7 +268,7 @@ {/snippet} -
+
{#each elements as { type, id, value, showPubkey } (id)} {#if type === "new-messages"} @@ -299,7 +300,7 @@ End of message history {/if}

-
+
diff --git a/src/routes/spaces/[relay]/calendar/+page.svelte b/src/routes/spaces/[relay]/calendar/+page.svelte index 53289cb..e2077a3 100644 --- a/src/routes/spaces/[relay]/calendar/+page.svelte +++ b/src/routes/spaces/[relay]/calendar/+page.svelte @@ -12,6 +12,7 @@ import Button from "@lib/components/Button.svelte" import Spinner from "@lib/components/Spinner.svelte" import PageBar from "@lib/components/PageBar.svelte" + import PageContent from "@lib/components/PageContent.svelte" import Divider from "@lib/components/Divider.svelte" import MenuSpaceButton from "@app/components/MenuSpaceButton.svelte" import CalendarEventItem from "@app/components/CalendarEventItem.svelte" @@ -27,7 +28,7 @@ const getStart = (event: TrustedEvent) => parseInt(getTagValue("start", event.tags) || "") - let element: HTMLElement + let element: HTMLElement | undefined = $state() let loading = $state(true) let cleanup: () => void let events: Readable = $state(readable([])) @@ -69,11 +70,11 @@ if (initialScrollDone) { // If new events are prepended, adjust the scroll position so that the viewport content remains anchored if (prevFirstEventId && items[0].event.id !== prevFirstEventId) { - const newScrollHeight = element.scrollHeight + const newScrollHeight = element!.scrollHeight const delta = newScrollHeight - previousScrollHeight if (delta > 0) { - element.scrollTop += delta + element!.scrollTop += delta } } } else { @@ -83,11 +84,11 @@ ) as HTMLElement // On initial load, center the scroll container on today's date (or the next available event) - element.scrollTop = offsetTop - element.clientHeight / 2 + clientHeight / 2 + element!.scrollTop = offsetTop - element!.clientHeight / 2 + clientHeight / 2 initialScrollDone = true } - previousScrollHeight = element.scrollHeight + previousScrollHeight = element!.scrollHeight prevFirstEventId = items[0].event.id }) @@ -98,7 +99,7 @@ ] ;({events, cleanup} = makeCalendarFeed({ - element, + element: element!, relays: [url], feedFilters, subscriptionFilters, @@ -115,50 +116,49 @@ }) -
- - {#snippet icon()} -
- -
- {/snippet} - {#snippet title()} - Calendar - {/snippet} - {#snippet action()} -
- - -
- {/snippet} -
-
- {#each items as { event, dateDisplay, isFirstFutureEvent }, i (event.id)} -
- {#if isFirstFutureEvent} -
-
-

Today

-
-
- {/if} - {#if dateDisplay} - {dateDisplay} - {/if} - -
- {/each} - {#if loading} -

- Looking for events... -

- {:else if items.length === 0} -

No events found.

- {:else} -

That's all!

- {/if} -
-
+ + {#snippet icon()} +
+ +
+ {/snippet} + {#snippet title()} + Calendar + {/snippet} + {#snippet action()} +
+ + +
+ {/snippet} +
+ + + {#each items as { event, dateDisplay, isFirstFutureEvent }, i (event.id)} +
+ {#if isFirstFutureEvent} +
+
+

Today

+
+
+ {/if} + {#if dateDisplay} + {dateDisplay} + {/if} + +
+ {/each} + {#if loading} +

+ Looking for events... +

+ {:else if items.length === 0} +

No events found.

+ {:else} +

That's all!

+ {/if} +
diff --git a/src/routes/spaces/[relay]/calendar/[id]/+page.svelte b/src/routes/spaces/[relay]/calendar/[id]/+page.svelte index a1ee03b..2d626e5 100644 --- a/src/routes/spaces/[relay]/calendar/[id]/+page.svelte +++ b/src/routes/spaces/[relay]/calendar/[id]/+page.svelte @@ -7,6 +7,7 @@ import {deriveEvents} from "@welshman/store" import Icon from "@lib/components/Icon.svelte" import PageBar from "@lib/components/PageBar.svelte" + import PageContent from "@lib/components/PageContent.svelte" import Spinner from "@lib/components/Spinner.svelte" import Button from "@lib/components/Button.svelte" import Content from "@app/components/Content.svelte" @@ -53,33 +54,25 @@ }) -
-
+ + {#snippet icon()} +
+ +
+ {/snippet} + {#snippet title()} +

{getTagValue("title", $event?.tags || []) || ""}

+ {/snippet} + {#snippet action()} + + {/snippet} +
+ + {#if $event} - {#if !showReply} -
- -
- {/if} - {#each sortBy(e => -e.created_at, $replies).slice(0, showAll ? undefined : 4) as reply (reply.id)} - -
- - -
-
- {/each} - {#if !showAll && $replies.length > 4} -
- -
- {/if}
@@ -96,6 +89,32 @@
+ {#if !showAll && $replies.length > 4} +
+ +
+ {/if} + {#each sortBy(e => e.created_at, $replies).slice(0, showAll ? undefined : 4) as reply (reply.id)} + +
+ + +
+
+ {/each} + {#if showReply} + + {:else} +
+ +
+ {/if} {:else} {#await sleep(5000)} Loading comments... @@ -103,23 +122,4 @@

Failed to load comments.

{/await} {/if} - - {#snippet icon()} -
- -
- {/snippet} - {#snippet title()} -

{getTagValue("title", $event?.tags || []) || ""}

- {/snippet} - {#snippet action()} - - {/snippet} -
-
-{#if showReply} - -{/if} + diff --git a/src/routes/spaces/[relay]/threads/+page.svelte b/src/routes/spaces/[relay]/threads/+page.svelte index ac45767..684144d 100644 --- a/src/routes/spaces/[relay]/threads/+page.svelte +++ b/src/routes/spaces/[relay]/threads/+page.svelte @@ -9,6 +9,7 @@ import Icon from "@lib/components/Icon.svelte" import Button from "@lib/components/Button.svelte" import PageBar from "@lib/components/PageBar.svelte" + import PageContent from "@lib/components/PageContent.svelte" import Spinner from "@lib/components/Spinner.svelte" import MenuSpaceButton from "@app/components/MenuSpaceButton.svelte" import ThreadItem from "@app/components/ThreadItem.svelte" @@ -73,42 +74,41 @@ }) -
- - {#snippet icon()} -
+ + {#snippet icon()} +
+ +
+ {/snippet} + {#snippet title()} + Threads + {/snippet} + {#snippet action()} +
+
- {/snippet} - {#snippet title()} - Threads - {/snippet} - {#snippet action()} -
- - -
- {/snippet} -
-
- {#each events as event (event.id)} -
- -
- {/each} -

- - {#if loading} - Looking for threads... - {:else if events.length === 0} - No threads found. - {:else} - That's all! - {/if} - -

-
-
+ Create a Thread + + +
+ {/snippet} + + + + {#each events as event (event.id)} +
+ +
+ {/each} +

+ + {#if loading} + Looking for threads... + {:else if events.length === 0} + No threads found. + {:else} + That's all! + {/if} + +

+
diff --git a/src/routes/spaces/[relay]/threads/[id]/+page.svelte b/src/routes/spaces/[relay]/threads/[id]/+page.svelte index c9b7260..4b895f9 100644 --- a/src/routes/spaces/[relay]/threads/[id]/+page.svelte +++ b/src/routes/spaces/[relay]/threads/[id]/+page.svelte @@ -7,6 +7,7 @@ import {deriveEvents} from "@welshman/store" import Icon from "@lib/components/Icon.svelte" import PageBar from "@lib/components/PageBar.svelte" + import PageContent from "@lib/components/PageContent.svelte" import Spinner from "@lib/components/Spinner.svelte" import Button from "@lib/components/Button.svelte" import Content from "@app/components/Content.svelte" @@ -50,39 +51,61 @@ }) -
-
+ + {#snippet icon()} +
+ +
+ {/snippet} + {#snippet title()} +

{getTagValue("title", $event?.tags || []) || ""}

+ {/snippet} + {#snippet action()} +
+ +
+ {/snippet} +
+ + {#if $event} - {#if !showReply} -
+
+ +
+ + +
+
+ {#if !showAll && $replies.length > 4} +
+ +
+ {/if} + {#each sortBy(e => -e.created_at, $replies).slice(0, showAll ? undefined : 4) as reply (reply.id)} + +
+ + +
+
+ {/each} +
+ {#if showReply} + + {:else} +
{/if} - {#each sortBy(e => -e.created_at, $replies).slice(0, showAll ? undefined : 4) as reply (reply.id)} - -
- - -
-
- {/each} - {#if !showAll && $replies.length > 4} -
- -
- {/if} - -
- - -
-
{:else} {#await sleep(5000)} Loading thread... @@ -90,25 +113,4 @@

Failed to load thread.

{/await} {/if} - - {#snippet icon()} -
- -
- {/snippet} - {#snippet title()} -

{getTagValue("title", $event?.tags || []) || ""}

- {/snippet} - {#snippet action()} -
- -
- {/snippet} -
-
-{#if showReply} - -{/if} +