Merge branch 'vitorpamplona:main' into kmp-completeness

This commit is contained in:
KotlinGeekDev
2026-03-13 09:20:58 +01:00
committed by GitHub
3 changed files with 40 additions and 7 deletions
+20 -6
View File
@@ -1,8 +1,14 @@
# Amethyst Desktop Fork
# Amethyst
## Project Overview
Fork of [Amethyst](https://github.com/vitorpamplona/amethyst) adding Compose Multiplatform Desktop support. Quartz library converted to full KMP for code sharing between Android and Desktop JVM.
Amethyst is a Nostr Client for Android that was made for Android-only and has been slowly switching
over to a Kotlin Multiplatform project. This project has 4 main modules: `quartz`, `commons`,
`amethyst` and `desktopApp`. Quartz should contain implementations of Nostr specifications and
utilities to help implement them. Commons stores shared code between Amethyst Android (`amethyst`)
and Amethyst Desktop (`desktopApp`). The Desktop App is designed to be mouse first and so uses a
completely different screen and navigation architecture while sharing the back end components with
the android counterpart.
## Architecture
@@ -12,7 +18,8 @@ amethyst/
│ └── src/
│ ├── commonMain/ # Shared Nostr protocol, data models
│ ├── androidMain/ # Android-specific (crypto, storage)
── jvmMain/ # Desktop JVM-specific
── jvmMain/ # Desktop JVM-specific
│ └── iosMain/ # iOS-specific
├── commons/ # Shared UI components (convert to KMP)
│ └── src/
│ ├── commonMain/ # Shared composables, icons, state
@@ -20,12 +27,12 @@ amethyst/
│ └── jvmMain/ # Desktop-specific UI utilities
├── desktopApp/ # Desktop JVM application (layouts, navigation)
├── amethyst/ # Android app (layouts, navigation)
└── ammolite/ # Support module
└── ammolite/ # Support module (unused)
```
**Sharing Philosophy:**
- `quartz/` = Business logic, protocol, data (no UI)
- `commons/` = Shared UI components, icons, composables, **ViewModels**
- `quartz/` = Nostr business logic, protocol, data (no UI)
- `commons/` = Shared UI components, icons, composables, flows and ViewModels
- `amethyst/` & `desktopApp/` = Platform-native layouts and navigation
## Tech Stack
@@ -241,6 +248,13 @@ actual fun openExternalUrl(url: String) {
}
```
## Code Formatting
After completing any task that modifies Kotlin files, always run:
```
./gradlew spotlessApply
```
Do this before considering the task complete.
### Navigation Shell
- **Desktop**: Sidebar + main content area
- **Android**: Bottom navigation
+16
View File
@@ -0,0 +1,16 @@
{
"hooks": {
"Stop": [
{
"matcher": "",
"hooks": [
{
"type": "command",
"command": "./gradlew spotlessApply",
"timeout": 120
}
]
}
]
}
}
@@ -63,6 +63,8 @@ import com.vitorpamplona.amethyst.ui.stringRes
import com.vitorpamplona.amethyst.ui.theme.DividerThickness
import com.vitorpamplona.amethyst.ui.theme.Size10dp
import com.vitorpamplona.amethyst.ui.theme.Size20dp
import com.vitorpamplona.amethyst.ui.theme.SpacedBy10dp
import com.vitorpamplona.amethyst.ui.theme.SpacedBy5dp
import com.vitorpamplona.amethyst.ui.theme.ThemeComparisonRow
import java.util.Locale as JavaLocale
@@ -93,6 +95,7 @@ fun UserSettingsScreen(
.padding(top = Size10dp, start = Size20dp, end = Size20dp)
.verticalScroll(rememberScrollState()),
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = SpacedBy10dp,
) {
DontTranslateFromSetting(accountViewModel)
TranslateToSetting(accountViewModel)
@@ -219,7 +222,7 @@ fun LanguagePreferencesSetting(accountViewModel: AccountViewModel) {
if (languagePreferences.isEmpty()) return
Column {
Column(verticalArrangement = SpacedBy5dp) {
SettingsRow(
name = R.string.language_preferences,
description = R.string.language_preferences_description,