diff --git a/.gitignore b/.gitignore
index 9e7642de..6dc1c723 100644
--- a/.gitignore
+++ b/.gitignore
@@ -73,6 +73,7 @@ GoogleService-Info.plist
.idea/
.vscode/
.claude/
+.local/
# OS generated
.DS_Store
diff --git a/src/app/util/analytics.ts b/src/app/analytics.ts
similarity index 100%
rename from src/app/util/analytics.ts
rename to src/app/analytics.ts
diff --git a/src/app/call/video.ts b/src/app/call/video.ts
index eccd4397..96e735c3 100644
--- a/src/app/call/video.ts
+++ b/src/app/call/video.ts
@@ -2,7 +2,7 @@ import {Track} from "livekit-client"
import {MediaQuery} from "svelte/reactivity"
import {derived, get, writable} from "svelte/store"
import {currentVoiceSession, VoiceState, type VoiceSession, voiceState} from "@app/call/stores"
-import {pushToast} from "@app/util/toast"
+import {pushToast} from "@app/toast"
export enum VideoCallLayout {
Chat = "chat",
diff --git a/src/app/call/voice.ts b/src/app/call/voice.ts
index 145c8168..7eafbe39 100644
--- a/src/app/call/voice.ts
+++ b/src/app/call/voice.ts
@@ -37,7 +37,7 @@ import {
} from "@app/call/stores"
import {resetVideoCallLayout, triggerVideoFeedCount, videoPrimaryTileKey} from "@app/call/video"
import {deriveLatestEventForUrl, deriveRoom, makeRoomId} from "@app/core/state"
-import {pushToast} from "@app/util/toast"
+import {pushToast} from "@app/toast"
export const LIVEKIT_PARTICIPANTS = 39004
diff --git a/src/app/components/AppContainer.svelte b/src/app/components/AppContainer.svelte
index 7956a8cb..6b2992cd 100644
--- a/src/app/components/AppContainer.svelte
+++ b/src/app/components/AppContainer.svelte
@@ -5,7 +5,7 @@
import Landing from "@app/components/Landing.svelte"
import Toast from "@app/components/Toast.svelte"
import PrimaryNav from "@app/components/PrimaryNav.svelte"
- import {modal} from "@app/util/modal"
+ import {modal} from "@app/modal"
interface Props {
children: Snippet
diff --git a/src/app/components/BunkerConnect.svelte b/src/app/components/BunkerConnect.svelte
index 8755c61a..179b3cb5 100644
--- a/src/app/components/BunkerConnect.svelte
+++ b/src/app/components/BunkerConnect.svelte
@@ -1,7 +1,7 @@
diff --git a/src/app/components/SpaceAuthError.svelte b/src/app/components/SpaceAuthError.svelte
index 08954f18..84d01146 100644
--- a/src/app/components/SpaceAuthError.svelte
+++ b/src/app/components/SpaceAuthError.svelte
@@ -15,7 +15,7 @@
import ModalSubtitle from "@lib/components/ModalSubtitle.svelte"
import ModalFooter from "@lib/components/ModalFooter.svelte"
import SpaceAccessRequest from "@app/components/SpaceAccessRequest.svelte"
- import {pushModal, clearModals} from "@app/util/modal"
+ import {pushModal, clearModals} from "@app/modal"
import {removeSpaceMembership, publishLeaveRequest, removeTrustedRelay} from "@app/core/commands"
const {url, error} = $props()
diff --git a/src/app/components/SpaceBar.svelte b/src/app/components/SpaceBar.svelte
index 38861ad5..a1174699 100644
--- a/src/app/components/SpaceBar.svelte
+++ b/src/app/components/SpaceBar.svelte
@@ -9,7 +9,7 @@
import PageBar from "@lib/components/PageBar.svelte"
import RelayIcon from "@app/components/RelayIcon.svelte"
import {decodeRelay} from "@app/core/state"
- import {makeSpacePath} from "@app/util/routes"
+ import {makeSpacePath} from "@app/routes"
interface Props {
back?: () => unknown
diff --git a/src/app/components/SpaceDetail.svelte b/src/app/components/SpaceDetail.svelte
index 7d23f447..bfd06ff3 100644
--- a/src/app/components/SpaceDetail.svelte
+++ b/src/app/components/SpaceDetail.svelte
@@ -19,7 +19,7 @@
import RelayDescription from "@app/components/RelayDescription.svelte"
import ProfileLatest from "@app/components/ProfileLatest.svelte"
import {deriveUserIsSpaceAdmin} from "@app/core/state"
- import {pushModal} from "@app/util/modal"
+ import {pushModal} from "@app/modal"
type Props = {
url: string
diff --git a/src/app/components/SpaceEdit.svelte b/src/app/components/SpaceEdit.svelte
index 8739d470..5173fd21 100644
--- a/src/app/components/SpaceEdit.svelte
+++ b/src/app/components/SpaceEdit.svelte
@@ -19,8 +19,8 @@
import ModalFooter from "@lib/components/ModalFooter.svelte"
import ImageIcon from "@lib/components/ImageIcon.svelte"
import IconPickerButton from "@lib/components/IconPickerButton.svelte"
- import {pushToast} from "@app/util/toast"
- import {clearModals} from "@app/util/modal"
+ import {pushToast} from "@app/toast"
+ import {clearModals} from "@app/modal"
import {uploadFile} from "@app/core/commands"
type Props = {
diff --git a/src/app/components/SpaceInvite.svelte b/src/app/components/SpaceInvite.svelte
index f28c22c7..8f296ab8 100644
--- a/src/app/components/SpaceInvite.svelte
+++ b/src/app/components/SpaceInvite.svelte
@@ -18,7 +18,7 @@
import ModalSubtitle from "@lib/components/ModalSubtitle.svelte"
import ModalFooter from "@lib/components/ModalFooter.svelte"
import QRCode from "@app/components/QRCode.svelte"
- import {clip} from "@app/util/toast"
+ import {clip} from "@app/toast"
import {PLATFORM_URL} from "@app/core/state"
import {deriveRelayAuthError} from "@app/core/commands"
diff --git a/src/app/components/SpaceInviteAccept.svelte b/src/app/components/SpaceInviteAccept.svelte
index 228e2441..16fe5fba 100644
--- a/src/app/components/SpaceInviteAccept.svelte
+++ b/src/app/components/SpaceInviteAccept.svelte
@@ -21,10 +21,10 @@
import ModalFooter from "@lib/components/ModalFooter.svelte"
import RelaySummary from "@app/components/RelaySummary.svelte"
import SpaceJoinSettings from "@app/components/SpaceJoinSettings.svelte"
- import {pushToast} from "@app/util/toast"
- import {makeSpacePath} from "@app/util/routes"
+ import {pushToast} from "@app/toast"
+ import {makeSpacePath} from "@app/routes"
import {relaysMostlyRestricted, notificationSettings, parseInviteLink} from "@app/core/state"
- import {Push} from "@app/util/push"
+ import {Push} from "@app/push"
import {
attemptRelayAccess,
addSpaceMembership,
diff --git a/src/app/components/SpaceJoin.svelte b/src/app/components/SpaceJoin.svelte
index 54e53147..36756365 100644
--- a/src/app/components/SpaceJoin.svelte
+++ b/src/app/components/SpaceJoin.svelte
@@ -21,10 +21,10 @@
setSpaceNotifications,
} from "@app/core/commands"
import {relaysMostlyRestricted, notificationSettings} from "@app/core/state"
- import {pushModal} from "@app/util/modal"
- import {pushToast} from "@app/util/toast"
- import {makeSpacePath} from "@app/util/routes"
- import {Push} from "@app/util/push"
+ import {pushModal} from "@app/modal"
+ import {pushToast} from "@app/toast"
+ import {makeSpacePath} from "@app/routes"
+ import {Push} from "@app/push"
type Props = {
url: string
diff --git a/src/app/components/SpaceMembers.svelte b/src/app/components/SpaceMembers.svelte
index d8b311b6..8ffa26cd 100644
--- a/src/app/components/SpaceMembers.svelte
+++ b/src/app/components/SpaceMembers.svelte
@@ -27,8 +27,8 @@
deriveUserIsSpaceAdmin,
deriveSupportedMethods,
} from "@app/core/state"
- import {pushModal} from "@app/util/modal"
- import {pushToast} from "@app/util/toast"
+ import {pushModal} from "@app/modal"
+ import {pushToast} from "@app/toast"
interface Props {
url: string
diff --git a/src/app/components/SpaceMembersAdd.svelte b/src/app/components/SpaceMembersAdd.svelte
index 4df724c9..9fbc5122 100644
--- a/src/app/components/SpaceMembersAdd.svelte
+++ b/src/app/components/SpaceMembersAdd.svelte
@@ -13,7 +13,7 @@
import ModalFooter from "@lib/components/ModalFooter.svelte"
import ProfileMultiSelect from "@app/components/ProfileMultiSelect.svelte"
import {addSpaceMembers} from "@app/core/commands"
- import {pushToast} from "@app/util/toast"
+ import {pushToast} from "@app/toast"
interface Props {
url: string
diff --git a/src/app/components/SpaceMembersBanned.svelte b/src/app/components/SpaceMembersBanned.svelte
index 135ce86e..843210f4 100644
--- a/src/app/components/SpaceMembersBanned.svelte
+++ b/src/app/components/SpaceMembersBanned.svelte
@@ -18,7 +18,7 @@
import Profile from "@app/components/Profile.svelte"
import {deriveSpaceBannedPubkeyItems, deriveSupportedMethods} from "@app/core/state"
import {addSpaceMembers} from "@app/core/commands"
- import {pushToast} from "@app/util/toast"
+ import {pushToast} from "@app/toast"
interface Props {
url: string
diff --git a/src/app/components/SpaceMenu.svelte b/src/app/components/SpaceMenu.svelte
index 20796ea4..9bdf8e2f 100644
--- a/src/app/components/SpaceMenu.svelte
+++ b/src/app/components/SpaceMenu.svelte
@@ -58,9 +58,9 @@
displayRoom,
} from "@app/core/state"
import {setSpaceNotifications} from "@app/core/commands"
- import {pushModal} from "@app/util/modal"
- import {makeSpacePath, goToChat} from "@app/util/routes"
- import {notifications} from "@app/util/notifications"
+ import {pushModal} from "@app/modal"
+ import {makeSpacePath, goToChat} from "@app/routes"
+ import {notifications} from "@app/notifications"
const {url} = $props()
diff --git a/src/app/components/SpaceMenuRoomItem.svelte b/src/app/components/SpaceMenuRoomItem.svelte
index 96a88c3c..19ab2451 100644
--- a/src/app/components/SpaceMenuRoomItem.svelte
+++ b/src/app/components/SpaceMenuRoomItem.svelte
@@ -6,8 +6,8 @@
import RoomNameWithImage from "@app/components/RoomNameWithImage.svelte"
import VoiceRoomItem from "@app/components/VoiceRoomItem.svelte"
import {deriveRoom, deriveShouldNotify, getRoomType, RoomType} from "@app/core/state"
- import {notifications} from "@app/util/notifications"
- import {makeRoomPath} from "@app/util/routes"
+ import {notifications} from "@app/notifications"
+ import {makeRoomPath} from "@app/routes"
interface Props {
url: any
diff --git a/src/app/components/SpaceSearch.svelte b/src/app/components/SpaceSearch.svelte
index ae32bcee..bf5e7505 100644
--- a/src/app/components/SpaceSearch.svelte
+++ b/src/app/components/SpaceSearch.svelte
@@ -12,7 +12,7 @@
import Button from "@lib/components/Button.svelte"
import Icon from "@lib/components/Icon.svelte"
import {CONTENT_KINDS} from "@app/core/state"
- import {goToEvent} from "@app/util/routes"
+ import {goToEvent} from "@app/routes"
type Props = {
url: string
diff --git a/src/app/components/SpaceTrustRelay.svelte b/src/app/components/SpaceTrustRelay.svelte
index 6b8ec8c5..e01e637d 100644
--- a/src/app/components/SpaceTrustRelay.svelte
+++ b/src/app/components/SpaceTrustRelay.svelte
@@ -17,7 +17,7 @@
import InfoSignatures from "@app/components/InfoSignatures.svelte"
import {relaysPendingTrust} from "@app/core/state"
import {removeSpaceMembership, addTrustedRelay, removeTrustedRelay} from "@app/core/commands"
- import {pushModal} from "@app/util/modal"
+ import {pushModal} from "@app/modal"
type Props = {
url: string
diff --git a/src/app/components/ThreadActions.svelte b/src/app/components/ThreadActions.svelte
index d34dedea..fee30726 100644
--- a/src/app/components/ThreadActions.svelte
+++ b/src/app/components/ThreadActions.svelte
@@ -8,7 +8,7 @@
import EventActivity from "@app/components/EventActivity.svelte"
import EventActions from "@app/components/EventActions.svelte"
import {publishDelete, publishReaction, canEnforceNip70} from "@app/core/commands"
- import {makeThreadPath, makeSpacePath} from "@app/util/routes"
+ import {makeThreadPath, makeSpacePath} from "@app/routes"
interface Props {
url: string
diff --git a/src/app/components/ThreadCreate.svelte b/src/app/components/ThreadCreate.svelte
index fc68a95e..18e4d909 100644
--- a/src/app/components/ThreadCreate.svelte
+++ b/src/app/components/ThreadCreate.svelte
@@ -16,10 +16,10 @@
import Modal from "@lib/components/Modal.svelte"
import ModalBody from "@lib/components/ModalBody.svelte"
import EditorContent from "@app/editor/EditorContent.svelte"
- import {pushToast} from "@app/util/toast"
+ import {pushToast} from "@app/toast"
import {PROTECTED} from "@app/core/state"
import {makeEditor} from "@app/editor"
- import {DraftKey} from "@app/util/drafts"
+ import {DraftKey} from "@app/drafts"
import {canEnforceNip70, publishRoomQuote} from "@app/core/commands"
type Values = {
diff --git a/src/app/components/ThreadItem.svelte b/src/app/components/ThreadItem.svelte
index e1e8cd14..405fdfbe 100644
--- a/src/app/components/ThreadItem.svelte
+++ b/src/app/components/ThreadItem.svelte
@@ -7,7 +7,7 @@
import ProfileLink from "@app/components/ProfileLink.svelte"
import ThreadActions from "@app/components/ThreadActions.svelte"
import RoomLink from "@app/components/RoomLink.svelte"
- import {makeThreadPath} from "@app/util/routes"
+ import {makeThreadPath} from "@app/routes"
type Props = {
url: string
diff --git a/src/app/components/ThunkFailure.svelte b/src/app/components/ThunkFailure.svelte
index cc367242..2e2a744b 100644
--- a/src/app/components/ThunkFailure.svelte
+++ b/src/app/components/ThunkFailure.svelte
@@ -8,7 +8,7 @@
import Tippy from "@lib/components/Tippy.svelte"
import ThunkToast from "@app/components/ThunkToast.svelte"
import ThunkStatusDetail from "@app/components/ThunkStatusDetail.svelte"
- import {pushToast} from "@app/util/toast"
+ import {pushToast} from "@app/toast"
interface Props {
thunk: AbstractThunk
diff --git a/src/app/components/ThunkToast.svelte b/src/app/components/ThunkToast.svelte
index 086f1c6f..d8fd74d9 100644
--- a/src/app/components/ThunkToast.svelte
+++ b/src/app/components/ThunkToast.svelte
@@ -3,8 +3,8 @@
import {thunkHasStatus, thunkIsComplete} from "@welshman/app"
import {PublishStatus} from "@welshman/net"
import ThunkPending from "@app/components/ThunkPending.svelte"
- import type {Toast} from "@app/util/toast"
- import {popToast} from "@app/util/toast"
+ import type {Toast} from "@app/toast"
+ import {popToast} from "@app/toast"
type Props = {
toast: Toast
diff --git a/src/app/components/Toast.svelte b/src/app/components/Toast.svelte
index f7dd6720..e2071732 100644
--- a/src/app/components/Toast.svelte
+++ b/src/app/components/Toast.svelte
@@ -4,7 +4,7 @@
import {fly} from "@lib/transition"
import Icon from "@lib/components/Icon.svelte"
import Button from "@lib/components/Button.svelte"
- import {toast, popToast} from "@app/util/toast"
+ import {toast, popToast} from "@app/toast"
let touchStartY = 0
let touchStartTime = 0
diff --git a/src/app/components/VoiceCallAudioSettingsDialog.svelte b/src/app/components/VoiceCallAudioSettingsDialog.svelte
index a5fab918..2e48a18a 100644
--- a/src/app/components/VoiceCallAudioSettingsDialog.svelte
+++ b/src/app/components/VoiceCallAudioSettingsDialog.svelte
@@ -9,7 +9,7 @@
import ModalTitle from "@lib/components/ModalTitle.svelte"
import {currentVoiceSession, type VoiceSession} from "@app/call/stores"
import {DeviceKind, supportsAudioOutputSelection, switchVoiceActiveDevice} from "@app/call/voice"
- import {popModal} from "@app/util/modal"
+ import {popModal} from "@app/modal"
const selectValueForActiveDevice = (session: VoiceSession, kind: DeviceKind): string => {
const livekitDeviceId = session.room.getActiveDevice(kind)
diff --git a/src/app/components/VoiceRoomItem.svelte b/src/app/components/VoiceRoomItem.svelte
index 6145687a..762ca311 100644
--- a/src/app/components/VoiceRoomItem.svelte
+++ b/src/app/components/VoiceRoomItem.svelte
@@ -7,8 +7,8 @@
import ProfileCircles from "@app/components/ProfileCircles.svelte"
import RoomImage from "@app/components/RoomImage.svelte"
import RoomName from "@app/components/RoomName.svelte"
- import {makeRoomPath} from "@app/util/routes"
- import {pushModal} from "@app/util/modal"
+ import {makeRoomPath} from "@app/routes"
+ import {pushModal} from "@app/modal"
import VoiceRoomJoinDialog from "@app/components/VoiceRoomJoinDialog.svelte"
import VoiceParticipantMediaBadges from "@app/components/VoiceParticipantMediaBadges.svelte"
import {makeRoomId} from "@app/core/state"
diff --git a/src/app/components/VoiceRoomJoinDialog.svelte b/src/app/components/VoiceRoomJoinDialog.svelte
index 35ac5282..d58f8621 100644
--- a/src/app/components/VoiceRoomJoinDialog.svelte
+++ b/src/app/components/VoiceRoomJoinDialog.svelte
@@ -16,8 +16,8 @@
import ProfileCircles from "@app/components/ProfileCircles.svelte"
import {displayRoom} from "@app/core/state"
import {deriveVoiceParticipants, joinVoiceRoom, loadVoiceParticipants} from "@app/call/voice"
- import {popModal} from "@app/util/modal"
- import {pushToast} from "@app/util/toast"
+ import {popModal} from "@app/modal"
+ import {pushToast} from "@app/toast"
type Props = {
url: string
diff --git a/src/app/components/VoiceWidget.svelte b/src/app/components/VoiceWidget.svelte
index 195b36be..2058a1c3 100644
--- a/src/app/components/VoiceWidget.svelte
+++ b/src/app/components/VoiceWidget.svelte
@@ -27,9 +27,9 @@
RoomType,
type Room,
} from "@app/core/state"
- import {pushModal} from "@app/util/modal"
- import {notifications} from "@app/util/notifications"
- import {makeRoomPath} from "@app/util/routes"
+ import {pushModal} from "@app/modal"
+ import {notifications} from "@app/notifications"
+ import {makeRoomPath} from "@app/routes"
import {
VideoCallLayout,
isDesktopLayout,
diff --git a/src/app/components/WalletAsReceivingAddress.svelte b/src/app/components/WalletAsReceivingAddress.svelte
index e85e65c2..f2f9aced 100644
--- a/src/app/components/WalletAsReceivingAddress.svelte
+++ b/src/app/components/WalletAsReceivingAddress.svelte
@@ -11,8 +11,8 @@
import ModalTitle from "@lib/components/ModalTitle.svelte"
import ModalFooter from "@lib/components/ModalFooter.svelte"
import {updateProfile} from "@app/core/commands"
- import {clearModals} from "@app/util/modal"
- import {pushToast} from "@app/util/toast"
+ import {clearModals} from "@app/modal"
+ import {pushToast} from "@app/toast"
const lud16 = getWalletAddress($session!.wallet!)
diff --git a/src/app/components/WalletConnect.svelte b/src/app/components/WalletConnect.svelte
index 99c87201..1beb3883 100644
--- a/src/app/components/WalletConnect.svelte
+++ b/src/app/components/WalletConnect.svelte
@@ -22,8 +22,8 @@
import ModalSubtitle from "@lib/components/ModalSubtitle.svelte"
import ModalFooter from "@lib/components/ModalFooter.svelte"
import {getWebLn} from "@app/core/commands"
- import {pushToast} from "@app/util/toast"
- import {pushModal} from "@app/util/modal"
+ import {pushToast} from "@app/toast"
+ import {pushModal} from "@app/modal"
import WalletAsReceivingAddress from "@app/components/WalletAsReceivingAddress.svelte"
import Divider from "@lib/components/Divider.svelte"
diff --git a/src/app/components/WalletDisconnect.svelte b/src/app/components/WalletDisconnect.svelte
index abbf6772..78fa979d 100644
--- a/src/app/components/WalletDisconnect.svelte
+++ b/src/app/components/WalletDisconnect.svelte
@@ -2,7 +2,7 @@
import {dissoc} from "@welshman/lib"
import {pubkey, updateSession} from "@welshman/app"
import Confirm from "@lib/components/Confirm.svelte"
- import {clearModals} from "@app/util/modal"
+ import {clearModals} from "@app/modal"
const confirm = async () => {
updateSession($pubkey!, dissoc("wallet"))
diff --git a/src/app/components/WalletPay.svelte b/src/app/components/WalletPay.svelte
index 16dc02e4..5ec404f4 100644
--- a/src/app/components/WalletPay.svelte
+++ b/src/app/components/WalletPay.svelte
@@ -16,8 +16,8 @@
import ModalFooter from "@lib/components/ModalFooter.svelte"
import {errorMessage} from "@lib/util"
import {payInvoice} from "@app/core/commands"
- import {pushToast} from "@app/util/toast"
- import {clearModals} from "@app/util/modal"
+ import {pushToast} from "@app/toast"
+ import {clearModals} from "@app/modal"
const back = () => history.back()
diff --git a/src/app/components/WalletReceive.svelte b/src/app/components/WalletReceive.svelte
index db19506d..0533dadd 100644
--- a/src/app/components/WalletReceive.svelte
+++ b/src/app/components/WalletReceive.svelte
@@ -15,7 +15,7 @@
import {errorMessage} from "@lib/util"
import QRCode from "@app/components/QRCode.svelte"
import {createInvoice} from "@app/core/commands"
- import {pushToast} from "@app/util/toast"
+ import {pushToast} from "@app/toast"
const back = () => history.back()
diff --git a/src/app/components/WalletUpdateReceivingAddress.svelte b/src/app/components/WalletUpdateReceivingAddress.svelte
index 2fbde508..dee8e4f6 100644
--- a/src/app/components/WalletUpdateReceivingAddress.svelte
+++ b/src/app/components/WalletUpdateReceivingAddress.svelte
@@ -13,7 +13,7 @@
import Wallet from "@assets/icons/wallet.svg?dataurl"
import CheckCircle from "@assets/icons/check-circle.svg?dataurl"
import {updateProfile} from "@app/core/commands"
- import {pushToast} from "@app/util/toast"
+ import {pushToast} from "@app/toast"
const back = () => history.back()
diff --git a/src/app/components/Zap.svelte b/src/app/components/Zap.svelte
index 700775e1..7d85585f 100644
--- a/src/app/components/Zap.svelte
+++ b/src/app/components/Zap.svelte
@@ -20,7 +20,7 @@
import {errorMessage} from "@lib/util"
import ProfileLink from "@app/components/ProfileLink.svelte"
import {payInvoice} from "@app/core/commands"
- import {pushToast} from "@app/util/toast"
+ import {pushToast} from "@app/toast"
type Props = {
url: string
diff --git a/src/app/components/ZapButton.svelte b/src/app/components/ZapButton.svelte
index d4b1aa9c..03f9cf31 100644
--- a/src/app/components/ZapButton.svelte
+++ b/src/app/components/ZapButton.svelte
@@ -6,7 +6,7 @@
import Zap from "@app/components/Zap.svelte"
import ZapInvoice from "@app/components/ZapInvoice.svelte"
import InfoZapperError from "@app/components/InfoZapperError.svelte"
- import {pushModal} from "@app/util/modal"
+ import {pushModal} from "@app/modal"
type Props = {
url?: string
diff --git a/src/app/components/ZapInvoice.svelte b/src/app/components/ZapInvoice.svelte
index a3f7624f..f11f71c0 100644
--- a/src/app/components/ZapInvoice.svelte
+++ b/src/app/components/ZapInvoice.svelte
@@ -23,8 +23,8 @@
import ProfileLink from "@app/components/ProfileLink.svelte"
import QRCode from "@app/components/QRCode.svelte"
import WalletConnect from "@app/components/WalletConnect.svelte"
- import {pushModal} from "@app/util/modal"
- import {clip, pushToast} from "@app/util/toast"
+ import {pushModal} from "@app/modal"
+ import {clip, pushToast} from "@app/toast"
type Props = {
url: string
diff --git a/src/app/util/drafts.ts b/src/app/drafts.ts
similarity index 100%
rename from src/app/util/drafts.ts
rename to src/app/drafts.ts
diff --git a/src/app/editor/index.ts b/src/app/editor/index.ts
index 9a787c4b..ef068772 100644
--- a/src/app/editor/index.ts
+++ b/src/app/editor/index.ts
@@ -35,7 +35,7 @@ import {
userSpaceUrls,
roomsByUrl,
} from "@app/core/state"
-import {pushToast} from "@app/util/toast"
+import {pushToast} from "@app/toast"
export const makeEditor = async ({
encryptFiles = false,
diff --git a/src/app/util/health.ts b/src/app/healthChecks.ts
similarity index 100%
rename from src/app/util/health.ts
rename to src/app/healthChecks.ts
diff --git a/src/app/util/keyboard.ts b/src/app/keyboard.ts
similarity index 100%
rename from src/app/util/keyboard.ts
rename to src/app/keyboard.ts
diff --git a/src/app/util/modal.ts b/src/app/modal.ts
similarity index 100%
rename from src/app/util/modal.ts
rename to src/app/modal.ts
diff --git a/src/app/util/nip46.ts b/src/app/nip46.ts
similarity index 98%
rename from src/app/util/nip46.ts
rename to src/app/nip46.ts
index 62297f3f..16aa3723 100644
--- a/src/app/util/nip46.ts
+++ b/src/app/nip46.ts
@@ -9,7 +9,7 @@ import {
SIGNER_RELAYS,
NIP46_PERMS,
} from "@app/core/state"
-import {pushToast} from "@app/util/toast"
+import {pushToast} from "@app/toast"
const APP_SCHEME = "social.flotilla"
diff --git a/src/app/util/notifications.ts b/src/app/notifications.ts
similarity index 99%
rename from src/app/util/notifications.ts
rename to src/app/notifications.ts
index ad596ae8..2a61b8b0 100644
--- a/src/app/util/notifications.ts
+++ b/src/app/notifications.ts
@@ -12,7 +12,7 @@ import {
makeHttpAuth,
makeHttpAuthHeader,
} from "@welshman/util"
-import {makeSpacePath, makeRoomPath, makeSpaceChatPath, makeChatPath} from "@app/util/routes"
+import {makeSpacePath, makeRoomPath, makeSpaceChatPath, makeChatPath} from "@app/routes"
import {
CONTENT_KINDS,
notificationSettings,
diff --git a/src/app/util/policies.ts b/src/app/policies.ts
similarity index 100%
rename from src/app/util/policies.ts
rename to src/app/policies.ts
diff --git a/src/app/util/polls.ts b/src/app/polls.ts
similarity index 100%
rename from src/app/util/polls.ts
rename to src/app/polls.ts
diff --git a/src/app/util/pomade.ts b/src/app/pomade.ts
similarity index 86%
rename from src/app/util/pomade.ts
rename to src/app/pomade.ts
index fb4d8a00..3709a60e 100644
--- a/src/app/util/pomade.ts
+++ b/src/app/pomade.ts
@@ -76,3 +76,15 @@ export const deleteDeactivatedPomadeSessions = async () => {
export const loginWithPomade = (clientOptions: ClientOptions, email: string) =>
_loginWithPomade(clientOptions.group.group_pk.slice(2), email, clientOptions)
+
+export const POMADE_INVALID_LOGIN_MESSAGE = "Invalid login information"
+export const POMADE_NETWORK_ERROR_MESSAGE = "Network error, please try again"
+
+type PomadeMessage = {
+ res?: unknown
+}
+
+export const getPomadeLoginFailureMessage = (messages: PomadeMessage[]) =>
+ messages.some(message => message.res !== undefined)
+ ? POMADE_INVALID_LOGIN_MESSAGE
+ : POMADE_NETWORK_ERROR_MESSAGE
diff --git a/src/app/util/push/adapters/android.ts b/src/app/push/adapters/android.ts
similarity index 93%
rename from src/app/util/push/adapters/android.ts
rename to src/app/push/adapters/android.ts
index 60cac12d..e9a310ce 100644
--- a/src/app/util/push/adapters/android.ts
+++ b/src/app/push/adapters/android.ts
@@ -6,8 +6,8 @@ import type {Session} from "@welshman/app"
import {maybe, now} from "@welshman/lib"
import type {Filter} from "@welshman/util"
import {pushState} from "@app/core/state"
-import type {IPushAdapter} from "@app/util/push/adapters/common"
-import {requestPermissions, syncRelaySubscriptions} from "@app/util/push/adapters/common"
+import type {IPushAdapter} from "@app/push/adapters/common"
+import {requestPermissions, syncRelaySubscriptions} from "@app/push/adapters/common"
type AndroidFallbackSubscription = {
relay: string
diff --git a/src/app/util/push/adapters/capacitor.ts b/src/app/push/adapters/capacitor.ts
similarity index 98%
rename from src/app/util/push/adapters/capacitor.ts
rename to src/app/push/adapters/capacitor.ts
index 807c4577..f3950ea6 100644
--- a/src/app/util/push/adapters/capacitor.ts
+++ b/src/app/push/adapters/capacitor.ts
@@ -13,13 +13,13 @@ import type {Filter} from "@welshman/util"
import {DELETE, getRelaysFromList, makeEvent, Address} from "@welshman/util"
import {buildUrl} from "@lib/util"
import {PUSH_BRIDGE, PUSH_SERVER, pushState, userSpaceUrls, device} from "@app/core/state"
-import type {IPushAdapter} from "@app/util/push/adapters/common"
+import type {IPushAdapter} from "@app/push/adapters/common"
import {
onPushNotificationAction,
syncRelaySubscriptions,
requestPermissions,
requestToken,
-} from "@app/util/push/adapters/common"
+} from "@app/push/adapters/common"
export class CapacitorNotifications implements IPushAdapter {
_controller = maybe()
diff --git a/src/app/util/push/adapters/common.ts b/src/app/push/adapters/common.ts
similarity index 98%
rename from src/app/util/push/adapters/common.ts
rename to src/app/push/adapters/common.ts
index c9cfdbbc..5a5ea5d3 100644
--- a/src/app/util/push/adapters/common.ts
+++ b/src/app/push/adapters/common.ts
@@ -31,7 +31,7 @@ import {
userSettingsValues,
makeCommentFilter,
} from "@app/core/state"
-import {makeSpacePath, getEventPath} from "@app/util/routes"
+import {makeSpacePath, getEventPath} from "@app/routes"
export interface IPushAdapter {
request: (prompt?: boolean) => Promise
diff --git a/src/app/util/push/adapters/web.ts b/src/app/push/adapters/web.ts
similarity index 92%
rename from src/app/util/push/adapters/web.ts
rename to src/app/push/adapters/web.ts
index 72926f89..9baadc3e 100644
--- a/src/app/util/push/adapters/web.ts
+++ b/src/app/push/adapters/web.ts
@@ -3,9 +3,9 @@ import {maybe} from "@welshman/lib"
import type {Unsubscriber} from "svelte/store"
import {getPubkeyTagValues, matchFilter, type TrustedEvent} from "@welshman/util"
import {DM_KINDS, notificationSettings} from "@app/core/state"
-import type {IPushAdapter} from "@app/util/push/adapters/common"
-import {onNotification} from "@app/util/push/adapters/common"
-import {goToEvent} from "@app/util/routes"
+import type {IPushAdapter} from "@app/push/adapters/common"
+import {onNotification} from "@app/push/adapters/common"
+import {goToEvent} from "@app/routes"
export class WebNotifications implements IPushAdapter {
_unsubscriber = maybe()
diff --git a/src/app/util/push/index.ts b/src/app/push/index.ts
similarity index 79%
rename from src/app/util/push/index.ts
rename to src/app/push/index.ts
index 0d01e0ef..810bdd98 100644
--- a/src/app/util/push/index.ts
+++ b/src/app/push/index.ts
@@ -1,11 +1,11 @@
import {Capacitor} from "@capacitor/core"
import {notificationSettings, pushState} from "@app/core/state"
-import {WebNotifications} from "@app/util/push/adapters/web"
-import {CapacitorNotifications} from "@app/util/push/adapters/capacitor"
-import {AndroidFallbackNotifications} from "@app/util/push/adapters/android"
-import type {IPushAdapter} from "@app/util/push/adapters/common"
+import {WebNotifications} from "@app/push/adapters/web"
+import {CapacitorNotifications} from "@app/push/adapters/capacitor"
+import {AndroidFallbackNotifications} from "@app/push/adapters/android"
+import type {IPushAdapter} from "@app/push/adapters/common"
-export {onNotification} from "@app/util/push/adapters/common"
+export {onNotification} from "@app/push/adapters/common"
export class Push {
static _adapter: IPushAdapter | undefined
diff --git a/src/app/util/routes.ts b/src/app/routes.ts
similarity index 93%
rename from src/app/util/routes.ts
rename to src/app/routes.ts
index 59756806..1d323b75 100644
--- a/src/app/util/routes.ts
+++ b/src/app/routes.ts
@@ -20,10 +20,26 @@ import {
getRelaysFromList,
} from "@welshman/util"
import {makeChatId, entityLink, encodeRelay, DM_KINDS, ROOM} from "@app/core/state"
-import {pushModal} from "@app/util/modal"
-import {lastPageBySpaceUrl, lastChatUrl} from "@app/util/history"
+import {pushModal} from "@app/modal"
import ChatEnable from "@app/components/ChatEnable.svelte"
+// State
+
+export let lastChatUrl: string | undefined = undefined
+
+export const lastPageBySpaceUrl = new Map()
+
+export const setupHistory = () =>
+ page.subscribe($page => {
+ if ($page.params.relay) {
+ lastPageBySpaceUrl.set($page.params.relay, $page.url.pathname)
+ }
+
+ if ($page.params.chat) {
+ lastChatUrl = $page.url.pathname
+ }
+ })
+
// Chat
export const makeChatPath = (pubkeys: string[]) => `/chat/${makeChatId(pubkeys)}`
diff --git a/src/app/util/logout.ts b/src/app/session.ts
similarity index 72%
rename from src/app/util/logout.ts
rename to src/app/session.ts
index b1548298..4630d81d 100644
--- a/src/app/util/logout.ts
+++ b/src/app/session.ts
@@ -1,6 +1,6 @@
import {db, kv, ss} from "@app/core/storage"
-import {deactivateCurrentPomadeSession} from "@app/util/pomade"
-import {Push} from "@app/util/push"
+import {deactivateCurrentPomadeSession} from "@app/pomade"
+import {Push} from "@app/push"
export const logout = async () => {
await deactivateCurrentPomadeSession()
diff --git a/src/app/util/storage.ts b/src/app/storage.ts
similarity index 100%
rename from src/app/util/storage.ts
rename to src/app/storage.ts
diff --git a/src/app/util/theme.ts b/src/app/theme.ts
similarity index 100%
rename from src/app/util/theme.ts
rename to src/app/theme.ts
diff --git a/src/app/util/title.ts b/src/app/title.ts
similarity index 100%
rename from src/app/util/title.ts
rename to src/app/title.ts
diff --git a/src/app/util/toast.ts b/src/app/toast.ts
similarity index 100%
rename from src/app/util/toast.ts
rename to src/app/toast.ts
diff --git a/src/app/util/history.ts b/src/app/util/history.ts
deleted file mode 100644
index e7ee6f68..00000000
--- a/src/app/util/history.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-import {page} from "$app/stores"
-
-export const lastPageBySpaceUrl = new Map()
-export let lastChatUrl: string | undefined = undefined
-
-export const setupHistory = () =>
- page.subscribe($page => {
- if ($page.params.relay) {
- lastPageBySpaceUrl.set($page.params.relay, $page.url.pathname)
- }
-
- if ($page.params.chat) {
- lastChatUrl = $page.url.pathname
- }
- })
diff --git a/src/app/util/pomadeErrors.ts b/src/app/util/pomadeErrors.ts
deleted file mode 100644
index 595e1b73..00000000
--- a/src/app/util/pomadeErrors.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-export const POMADE_INVALID_LOGIN_MESSAGE = "Invalid login information"
-export const POMADE_NETWORK_ERROR_MESSAGE = "Network error, please try again"
-
-type PomadeMessage = {
- res?: unknown
-}
-
-export const getPomadeLoginFailureMessage = (messages: PomadeMessage[]) =>
- messages.some(message => message.res !== undefined)
- ? POMADE_INVALID_LOGIN_MESSAGE
- : POMADE_NETWORK_ERROR_MESSAGE
diff --git a/src/lib/components/IconPickerButton.svelte b/src/lib/components/IconPickerButton.svelte
index bed538c7..e393ecd9 100644
--- a/src/lib/components/IconPickerButton.svelte
+++ b/src/lib/components/IconPickerButton.svelte
@@ -6,7 +6,7 @@
import Tippy from "@lib/components/Tippy.svelte"
import IconPickerModal from "@app/components/IconPickerModal.svelte"
import IconPickerPopover from "@app/components/IconPickerPopover.svelte"
- import {pushModal, popModal} from "@app/util/modal"
+ import {pushModal, popModal} from "@app/modal"
const {...props} = $props()
diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte
index 9b6150f4..af10ee67 100644
--- a/src/routes/+layout.svelte
+++ b/src/routes/+layout.svelte
@@ -26,23 +26,23 @@
import {maybeInstallRelayMocks} from "@lib/test/relayMocks"
import AppContainer from "@app/components/AppContainer.svelte"
import ModalContainer from "@app/components/ModalContainer.svelte"
- import {setupHistory} from "@app/util/history"
- import {setupAnalytics} from "@app/util/analytics"
- import {authPolicy, blockPolicy, trustPolicy, mostlyRestrictedPolicy} from "@app/util/policies"
+ import {setupHistory} from "@app/routes"
+ import {setupAnalytics} from "@app/analytics"
+ import {authPolicy, blockPolicy, trustPolicy, mostlyRestrictedPolicy} from "@app/policies"
import {db, kv, ss} from "@app/core/storage"
import {device, userSettingsValues, notificationSettings, pushState} from "@app/core/state"
import {syncApplicationData} from "@app/core/sync"
import * as commands from "@app/core/commands"
import * as requests from "@app/core/requests"
import * as appState from "@app/core/state"
- import {theme} from "@app/util/theme"
- import {toast, pushToast} from "@app/util/toast"
- import * as notifications from "@app/util/notifications"
- import {Push} from "@app/util/push"
- import {onPushNotificationAction} from "@app/util/push/adapters/common"
- import * as storage from "@app/util/storage"
- import {syncKeyboard} from "@app/util/keyboard"
- import {getPageTitle} from "@app/util/title"
+ import {theme} from "@app/theme"
+ import {toast, pushToast} from "@app/toast"
+ import * as notifications from "@app/notifications"
+ import {Push} from "@app/push"
+ import {onPushNotificationAction} from "@app/push/adapters/common"
+ import * as storage from "@app/storage"
+ import {syncKeyboard} from "@app/keyboard"
+ import {getPageTitle} from "@app/title"
import NewNotificationSound from "@src/app/components/NewNotificationSound.svelte"
const {children} = $props()
diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte
index e07f6adc..42128a56 100644
--- a/src/routes/+page.svelte
+++ b/src/routes/+page.svelte
@@ -1,7 +1,7 @@