diff --git a/AGENTS.md b/AGENTS.md index ea321454..9b37324f 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -165,6 +165,8 @@ src/ - Only add comments for really weird stuff - Do not call functions in components unless a parameter is reactive. Instead, use a svelte store or rune to make it reactive. - Do not use `any`. If there are type errors related to `unknown`, they are likely because the upstream definition of the data is incorrect. +- When dynamically building classes, use `cx` from `classnames` rather than embedded ternaries or svelte 4's old `class:` syntax. +- When creating forms, use `FieldInline` or `Field` instead of custom elements/tailwindcss ## Common Tasks diff --git a/src/app/components/ProfileCircles.svelte b/src/app/components/ProfileCircles.svelte index 655aadc0..687c30bb 100644 --- a/src/app/components/ProfileCircles.svelte +++ b/src/app/components/ProfileCircles.svelte @@ -9,7 +9,7 @@ } const {pubkeys, size = 7}: Props = $props() - const limit = isMobile ? 7 : 15 + const limit = isMobile ? 7 : 10 for (const pubkey of pubkeys) { loadProfile(pubkey) diff --git a/src/app/components/RoomDetail.svelte b/src/app/components/RoomDetail.svelte index f3ef1b9b..078098d1 100644 --- a/src/app/components/RoomDetail.svelte +++ b/src/app/components/RoomDetail.svelte @@ -1,4 +1,5 @@ @@ -67,7 +64,7 @@ {#snippet input()} {/snippet} diff --git a/src/app/components/SpaceAuthError.svelte b/src/app/components/SpaceAuthError.svelte index 8a75cdca..d9d115fc 100644 --- a/src/app/components/SpaceAuthError.svelte +++ b/src/app/components/SpaceAuthError.svelte @@ -11,14 +11,14 @@ import ModalHeader from "@lib/components/ModalHeader.svelte" import ModalFooter from "@lib/components/ModalFooter.svelte" import SpaceAccessRequest from "@app/components/SpaceAccessRequest.svelte" - import {pushModal} from "@app/util/modal" + import {pushModal, clearModals} from "@app/util/modal" import {removeSpaceMembership, publishLeaveRequest, removeTrustedRelay} from "@app/core/commands" const {url, error} = $props() const back = () => goto("/home") - const requestAccess = () => pushModal(SpaceAccessRequest, {url}) + const requestAccess = () => pushModal(SpaceAccessRequest, {url, callback: clearModals}) const leaveSpace = async () => { loading = true diff --git a/src/app/components/SpaceCheck.svelte b/src/app/components/SpaceCheck.svelte deleted file mode 100644 index fc5ca2b5..00000000 --- a/src/app/components/SpaceCheck.svelte +++ /dev/null @@ -1,88 +0,0 @@ - - -
- - {#snippet title()} -
Checking Space...
- {/snippet} - {#snippet info()} -
- Connecting you to to {displayRelayUrl(url)} -
- {/snippet} -
-
- {#if loading} -

- - Hold tight, we're checking your connection. -

- {:else if error} -

Oops! We ran into some problems:

-

{error}

-

- If you're not sure what the error message means, you may need to contact the space - administrator to get more information. -

- {:else} -

- Looking good, we were able to connect you to this space! Click below to continue when you're - ready. -

- {/if} -
- - - - -
diff --git a/src/app/components/SpaceInviteAccept.svelte b/src/app/components/SpaceInviteAccept.svelte index 31576570..3eea66e8 100644 --- a/src/app/components/SpaceInviteAccept.svelte +++ b/src/app/components/SpaceInviteAccept.svelte @@ -1,6 +1,8 @@
- - {#snippet title()} -
- Joining {displayRelayUrl(url)} + +
+
+
+ Enable notifications for this space +

+ Get notified about new activity in this space. You can change this later in settings. +

- {/snippet} - {#snippet info()} -
Are you sure you'd like to join this space?
- {/snippet} - + +
+
+
+
+ Connection Status + {#if error} + Error + {:else} + + {/if} +
+ {#if error} +
+ +

{error}

+
+ {/if} +
- diff --git a/src/app/components/SpaceJoinConfirm.svelte b/src/app/components/SpaceJoinConfirm.svelte deleted file mode 100644 index 475085bf..00000000 --- a/src/app/components/SpaceJoinConfirm.svelte +++ /dev/null @@ -1,33 +0,0 @@ - - - - - diff --git a/src/app/components/SpaceMenu.svelte b/src/app/components/SpaceMenu.svelte index 9f687957..0ad6fd4b 100644 --- a/src/app/components/SpaceMenu.svelte +++ b/src/app/components/SpaceMenu.svelte @@ -18,6 +18,8 @@ import CalendarMinimalistic from "@assets/icons/calendar-minimalistic.svg?dataurl" import AddCircle from "@assets/icons/add-circle.svg?dataurl" import ChatRound from "@assets/icons/chat-round.svg?dataurl" + import VolumeLoud from "@assets/icons/volume-loud.svg?dataurl" + import VolumeCross from "@assets/icons/volume-cross.svg?dataurl" import Icon from "@lib/components/Icon.svelte" import Link from "@lib/components/Link.svelte" import Button from "@lib/components/Button.svelte" @@ -46,7 +48,11 @@ deriveUserCanCreateRoom, deriveUserIsSpaceAdmin, deriveEventsForUrl, + userSettingsValues, + notificationSettings, + deriveIsMuted, } from "@app/core/state" + import {setSpaceNotifications} from "@app/core/commands" import {notifications} from "@app/util/notifications" import {pushModal} from "@app/util/modal" import {makeSpacePath, makeChatPath} from "@app/util/routes" @@ -93,6 +99,12 @@ const addRoom = () => pushModal(RoomCreate, {url}, {replaceState}) + const isMuted = deriveIsMuted(url) + + const toggleSpaceNotifications = () => { + setSpaceNotifications(url, !isMuted) + } + let showMenu = $state(false) let replaceState = $state(false) let element: Element | undefined = $state() @@ -111,6 +123,9 @@
+ {#if isMuted} + + {/if}
@@ -155,6 +170,19 @@ {/if} +
  • + {#if $notificationSettings.push} + + {:else} + + + Enable notifications + + {/if} +
  • {#if $userSpaceUrls.includes(url)}
  • -
    - Muted Rooms - {#each muted_rooms as id (id)} - {@const [url, h] = splitRoomId(id)} -
    - - Room "" on {displayRelayUrl(url)} -
    - {:else} -

    No muted rooms found.

    - {/each} -
    - {:else} - - {/if} - {#if isFavorite} - - {:else} - - {/if}