From 497b9ea2735726c3137c755df461ef779222d6d3 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 28 Sep 2026 03:53:19 +0000 Subject: [PATCH] refactor(desktop): Desktop's own NIP-65 and Blossom list states move to desktopApp commons had a Nip65RelayListState, a Nip65RelayListRepository and a BlossomServerListState that only the current Desktop app used: lighter forks of the Android app's classes of the same names. The app's versions are about to move into commons under those names (Account's group), and the current Desktop app is being replaced by the shared UI, so its forks go with it into desktopApp/model rather than blocking the canonical names. Only package lines and imports change; nine Desktop files are repointed. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01S7FuNBSKiyVecARSoE4B9P --- .../vitorpamplona/amethyst/desktop/cache/DesktopLocalCache.kt | 2 +- .../amethyst/desktop/model}/BlossomServerListState.kt | 2 +- .../com/vitorpamplona/amethyst/desktop/model/BlossomServers.kt | 2 +- .../vitorpamplona/amethyst/desktop/model/DesktopIAccount.kt | 3 --- .../amethyst/desktop/model/DesktopRelayCategories.kt | 1 - .../amethyst/desktop/model/DesktopRelayListMutator.kt | 1 - .../amethyst/desktop/model}/Nip65RelayListRepository.kt | 2 +- .../amethyst/desktop/model}/Nip65RelayListState.kt | 2 +- .../amethyst/desktop/ui/relay/Nip65RelayEditor.kt | 2 +- .../vitorpamplona/amethyst/desktop/ui/relay/RelayConfigTab.kt | 2 +- .../amethyst/desktop/ui/relay/RelayDashboardScreen.kt | 2 +- .../amethyst/desktop/cache/DesktopBlossomServerListTest.kt | 2 +- 12 files changed, 9 insertions(+), 14 deletions(-) rename {commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/nipB7Blossom => desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/model}/BlossomServerListState.kt (98%) rename {commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/nip65RelayList => desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/model}/Nip65RelayListRepository.kt (96%) rename {commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/nip65RelayList => desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/model}/Nip65RelayListState.kt (99%) diff --git a/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/cache/DesktopLocalCache.kt b/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/cache/DesktopLocalCache.kt index 40736a1fa6..fb83c375e4 100644 --- a/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/cache/DesktopLocalCache.kt +++ b/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/cache/DesktopLocalCache.kt @@ -386,7 +386,7 @@ class DesktopLocalCache : ICacheProvider { /** * Consumes a kind 10063 (NIP-B7) Blossom media server list event. Stores * the newest per-author copy in [addressableNotes] so state holders like - * [com.vitorpamplona.amethyst.commons.model.nipB7Blossom.BlossomServerListState] + * [com.vitorpamplona.amethyst.desktop.model.BlossomServerListState] * observe it via their flows. This is the same event the Amethyst mobile * app uses for the media server list. Emits nothing to the event stream — * the UI doesn't render kind 10063s directly. diff --git a/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/nipB7Blossom/BlossomServerListState.kt b/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/model/BlossomServerListState.kt similarity index 98% rename from commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/nipB7Blossom/BlossomServerListState.kt rename to desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/model/BlossomServerListState.kt index 4bec8035ec..c40bb61949 100644 --- a/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/nipB7Blossom/BlossomServerListState.kt +++ b/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/model/BlossomServerListState.kt @@ -18,7 +18,7 @@ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package com.vitorpamplona.amethyst.commons.model.nipB7Blossom +package com.vitorpamplona.amethyst.desktop.model import com.vitorpamplona.amethyst.commons.model.Note import com.vitorpamplona.amethyst.commons.model.NoteState diff --git a/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/model/BlossomServers.kt b/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/model/BlossomServers.kt index d3a319be66..9e0892f1a4 100644 --- a/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/model/BlossomServers.kt +++ b/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/model/BlossomServers.kt @@ -23,7 +23,7 @@ package com.vitorpamplona.amethyst.desktop.model /** * Fallback media server used when the account has published no kind-10063 * Blossom server list yet. The list itself is read reactively from the account's - * [com.vitorpamplona.amethyst.commons.model.nipB7Blossom.BlossomServerListState] + * [com.vitorpamplona.amethyst.desktop.model.BlossomServerListState] * (`iAccount.blossomServerList.flow`); this is only the empty-list default. */ const val DEFAULT_BLOSSOM_SERVER = "https://blossom.primal.net" diff --git a/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/model/DesktopIAccount.kt b/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/model/DesktopIAccount.kt index b1c29e32ee..ae60470f1d 100644 --- a/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/model/DesktopIAccount.kt +++ b/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/model/DesktopIAccount.kt @@ -29,9 +29,6 @@ import com.vitorpamplona.amethyst.commons.model.nip02FollowList.Kind3FollowListR import com.vitorpamplona.amethyst.commons.model.nip02FollowList.Kind3FollowListState import com.vitorpamplona.amethyst.commons.model.nip51Lists.BookmarkListState import com.vitorpamplona.amethyst.commons.model.nip51Lists.OldBookmarkListState -import com.vitorpamplona.amethyst.commons.model.nip65RelayList.Nip65RelayListRepository -import com.vitorpamplona.amethyst.commons.model.nip65RelayList.Nip65RelayListState -import com.vitorpamplona.amethyst.commons.model.nipB7Blossom.BlossomServerListState import com.vitorpamplona.amethyst.commons.model.privateChats.ChatroomList import com.vitorpamplona.amethyst.commons.moderation.PreferencesSensitiveContentSettings import com.vitorpamplona.amethyst.commons.relayClient.nip17Dm.DmInboxRelayResolver diff --git a/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/model/DesktopRelayCategories.kt b/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/model/DesktopRelayCategories.kt index 586c7b1922..c4f86b7ad9 100644 --- a/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/model/DesktopRelayCategories.kt +++ b/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/model/DesktopRelayCategories.kt @@ -21,7 +21,6 @@ package com.vitorpamplona.amethyst.desktop.model import com.vitorpamplona.amethyst.commons.defaults.DefaultSearchRelayList -import com.vitorpamplona.amethyst.commons.model.nip65RelayList.Nip65RelayListState import com.vitorpamplona.amethyst.commons.relays.index.PreferencesIndexRelays import com.vitorpamplona.amethyst.desktop.network.DefaultRelays import com.vitorpamplona.quartz.nip01Core.relay.normalizer.NormalizedRelayUrl diff --git a/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/model/DesktopRelayListMutator.kt b/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/model/DesktopRelayListMutator.kt index 07dfb77539..56b70999a8 100644 --- a/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/model/DesktopRelayListMutator.kt +++ b/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/model/DesktopRelayListMutator.kt @@ -20,7 +20,6 @@ */ package com.vitorpamplona.amethyst.desktop.model -import com.vitorpamplona.amethyst.commons.model.nip65RelayList.Nip65RelayListState import com.vitorpamplona.amethyst.commons.relays.health.RelayListKind import com.vitorpamplona.amethyst.commons.relays.health.RelayListMutator import com.vitorpamplona.amethyst.commons.relays.health.RelayRemovalResult diff --git a/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/nip65RelayList/Nip65RelayListRepository.kt b/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/model/Nip65RelayListRepository.kt similarity index 96% rename from commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/nip65RelayList/Nip65RelayListRepository.kt rename to desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/model/Nip65RelayListRepository.kt index 6b58890747..3b27f79c79 100644 --- a/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/nip65RelayList/Nip65RelayListRepository.kt +++ b/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/model/Nip65RelayListRepository.kt @@ -18,7 +18,7 @@ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package com.vitorpamplona.amethyst.commons.model.nip65RelayList +package com.vitorpamplona.amethyst.desktop.model import com.vitorpamplona.quartz.nip01Core.relay.normalizer.NormalizedRelayUrl import com.vitorpamplona.quartz.nip65RelayList.AdvertisedRelayListEvent diff --git a/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/nip65RelayList/Nip65RelayListState.kt b/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/model/Nip65RelayListState.kt similarity index 99% rename from commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/nip65RelayList/Nip65RelayListState.kt rename to desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/model/Nip65RelayListState.kt index 557e3fd0f2..a4a53693dc 100644 --- a/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/nip65RelayList/Nip65RelayListState.kt +++ b/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/model/Nip65RelayListState.kt @@ -18,7 +18,7 @@ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package com.vitorpamplona.amethyst.commons.model.nip65RelayList +package com.vitorpamplona.amethyst.desktop.model import com.vitorpamplona.amethyst.commons.model.Note import com.vitorpamplona.amethyst.commons.model.NoteState diff --git a/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/ui/relay/Nip65RelayEditor.kt b/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/ui/relay/Nip65RelayEditor.kt index 1f3e2798d6..08428cddd3 100644 --- a/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/ui/relay/Nip65RelayEditor.kt +++ b/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/ui/relay/Nip65RelayEditor.kt @@ -55,7 +55,7 @@ import androidx.compose.ui.input.key.type import androidx.compose.ui.unit.dp import com.vitorpamplona.amethyst.commons.icons.symbols.Icon import com.vitorpamplona.amethyst.commons.icons.symbols.MaterialSymbols -import com.vitorpamplona.amethyst.commons.model.nip65RelayList.Nip65RelayListState +import com.vitorpamplona.amethyst.desktop.model.Nip65RelayListState import com.vitorpamplona.amethyst.desktop.network.DefaultRelays import com.vitorpamplona.quartz.nip01Core.core.Event import com.vitorpamplona.quartz.nip01Core.relay.normalizer.RelayUrlNormalizer diff --git a/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/ui/relay/RelayConfigTab.kt b/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/ui/relay/RelayConfigTab.kt index 7865f991be..744237d35b 100644 --- a/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/ui/relay/RelayConfigTab.kt +++ b/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/ui/relay/RelayConfigTab.kt @@ -45,8 +45,8 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.unit.dp import com.vitorpamplona.amethyst.commons.icons.symbols.Icon import com.vitorpamplona.amethyst.commons.icons.symbols.MaterialSymbols -import com.vitorpamplona.amethyst.commons.model.nip65RelayList.Nip65RelayListState import com.vitorpamplona.amethyst.desktop.model.DesktopAccountRelays +import com.vitorpamplona.amethyst.desktop.model.Nip65RelayListState import com.vitorpamplona.amethyst.desktop.network.DesktopRelayConnectionManager import com.vitorpamplona.quartz.nip01Core.core.Event import com.vitorpamplona.quartz.nip01Core.relay.normalizer.NormalizedRelayUrl diff --git a/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/ui/relay/RelayDashboardScreen.kt b/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/ui/relay/RelayDashboardScreen.kt index f2d6163f49..d46996abe4 100644 --- a/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/ui/relay/RelayDashboardScreen.kt +++ b/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/ui/relay/RelayDashboardScreen.kt @@ -39,8 +39,8 @@ import androidx.compose.runtime.setValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.unit.dp -import com.vitorpamplona.amethyst.commons.model.nip65RelayList.Nip65RelayListState import com.vitorpamplona.amethyst.desktop.model.DesktopAccountRelays +import com.vitorpamplona.amethyst.desktop.model.Nip65RelayListState import com.vitorpamplona.amethyst.desktop.network.DesktopRelayConnectionManager import com.vitorpamplona.amethyst.desktop.network.Nip11Fetcher import com.vitorpamplona.quartz.nip01Core.core.Event diff --git a/desktopApp/src/jvmTest/kotlin/com/vitorpamplona/amethyst/desktop/cache/DesktopBlossomServerListTest.kt b/desktopApp/src/jvmTest/kotlin/com/vitorpamplona/amethyst/desktop/cache/DesktopBlossomServerListTest.kt index 5816e4e085..e526531018 100644 --- a/desktopApp/src/jvmTest/kotlin/com/vitorpamplona/amethyst/desktop/cache/DesktopBlossomServerListTest.kt +++ b/desktopApp/src/jvmTest/kotlin/com/vitorpamplona/amethyst/desktop/cache/DesktopBlossomServerListTest.kt @@ -20,7 +20,7 @@ */ package com.vitorpamplona.amethyst.desktop.cache -import com.vitorpamplona.amethyst.commons.model.nipB7Blossom.BlossomServerListState +import com.vitorpamplona.amethyst.desktop.model.BlossomServerListState import com.vitorpamplona.quartz.nip01Core.crypto.KeyPair import com.vitorpamplona.quartz.nip01Core.relay.normalizer.NormalizedRelayUrl import com.vitorpamplona.quartz.nip01Core.signers.NostrSignerInternal