Commit Graph

146 Commits

Author SHA1 Message Date
Vitor Pamplona 48bd284ef1 Update AccountManager.kt 2026-01-07 09:24:40 -05:00
Vitor Pamplona 41cb143e0d Merge branch 'main' into nrobi144/desktop-phase1 2026-01-07 09:23:57 -05:00
nrobi144 a9141763e1 previous PR fixes 2026-01-07 07:12:00 +02:00
Vitor Pamplona e26fb94933 Improvements on NIP-11
- Support for self, privacy_policy, terms_of_service, grasps
- New UI for the Relay Information Screen
- Improvements to the Debug Message
- Compose-stable objects
- Clickable elements for NIPs, external links, grasps, etc
2026-01-06 17:38:47 -05:00
nrobi144 fd83560852 key storage implementation 2026-01-06 17:08:28 +02:00
nrobi144 df9d648988 key storage spotless 2026-01-06 06:50:31 +02:00
nrobi144 4339247815 key storage 2026-01-06 06:49:59 +02:00
nrobi144 2079493fc4 spotless 2026-01-05 13:43:54 +02:00
nrobi144 7d3ac9ec8a add avatars 2026-01-05 13:43:00 +02:00
nrobi144 55d59fcfd2 fix follows not working 2026-01-05 13:12:39 +02:00
nrobi144 115c622dca fix profile not loading 2026-01-05 06:46:19 +02:00
nrobi144 64eec9844b bugfixes 2026-01-03 13:00:02 +02:00
nrobi144 f800e20b05 reuse some filtering logic 2026-01-03 06:15:37 +02:00
nrobi144 36bb89fd36 update desktop with refactored classes 2026-01-02 14:54:24 +02:00
nrobi144 2751855186 extract actions from amethyst 2026-01-02 13:29:55 +02:00
nrobi144 146e4e5533 initial desktop phase1 2026-01-02 07:51:31 +02:00
Vitor Pamplona 45df452a38 Adds stable to the desktop account manager 2026-01-01 12:37:54 -05:00
nrobi144 9b330164a7 use typealiases as references to reduce files changed 2026-01-01 12:41:13 +02:00
nrobi144 4bc7e86448 fixes imports 2026-01-01 07:55:31 +02:00
nrobi144 3750c7e26e fixes 2026-01-01 07:32:44 +02:00
nrobi144 eb47c19172 move models to commons 2026-01-01 07:26:39 +02:00
Vitor Pamplona c5133e98f8 - Fixes Preview Tag
- Fixes Email Pattern
2025-12-29 18:57:56 -05:00
nrobi144 b23ff488ed refactor: Polish shared commons components and fix formatting
- Improve RelayConnectionManager with better connection handling
- Refine UI components (LoginCard, ProfileInfoCard, RelayStatusCard)
- Update KeyInputField with improved layout
- Fix formatting in FeedHeader and AppScreen
- Add proper number formatting utilities
- Remove .claude config from version control

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-28 07:03:57 +02:00
nrobi144 201acc8140 feat: Extract shared UI components to commons for Android/Desktop reuse
Extract reusable components from desktopApp to commons module:

Utilities (commonMain):
- NumberFormatters: countToHumanReadable, countToHumanReadableBytes
- PubKeyFormatter: toShortDisplay, toDisplayHexKey for key formatting

Utilities (jvmAndroid):
- TimeAgoFormatter: Human-readable time formatting for Nostr timestamps
- ZapFormatter: BigDecimal amount formatting with G/M/k suffixes

UI Components (commonMain):
- AppScreen enum for shared navigation
- LoadingState, EmptyState, ErrorState with refresh/retry support
- FeedHeader with relay status indicator
- NoteCard for displaying Nostr notes
- ActionButtons (AddButton, RemoveButton)
- RobohashImage for avatar display
- PlaceholderScreens (Search, Messages, Notifications)
- RelayStatusColors and shared color definitions

UI Components (jvmAndroid):
- LoginCard with key input field
- NewKeyWarningCard for new key backup warnings
- KeyInputField and SelectableKeyText
- ProfileInfoCard for account display
- RelayStatusCard for relay management

Core (jvmAndroid):
- AccountManager with login/logout/key generation
- RelayConnectionManager base class
- RelayStatus and DefaultRelays

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 15:12:04 +02:00
nrobi144 e5a064d0c3 feat: Add expect/actual for blurhash and base64Image in commons
- Create PlatformImage expect/actual abstracting Bitmap/BufferedImage
- Move pure blurhash algorithms (Base83, SRGB, CosineCache, BlurHashEncoder) to commonMain
- Rewrite BlurHashDecoder to return PlatformImage instead of Bitmap
- Add PlatformImage.toBlurhash() extension in commonMain
- Add platform-specific Bitmap.toBlurhash() and BufferedImage.toBlurhash()
- Add base64Image toPlatformImage() for both Android and JVM

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 12:48:32 +02:00
nrobi144 131252f19d feat: Convert commons module to Kotlin Multiplatform
- Rewrite build.gradle.kts for KMP with Android + JVM targets
- Restructure source sets: commonMain, jvmAndroid, androidMain, jvmMain
- Replace android.util.LruCache with androidx.collection.LruCache (KMP-ready)
- Replace android.util.Patterns with local regex constants
- Move shared code to commonMain (icons, hashtags, robohash, compose, etc.)
- Move JVM-shared code to jvmAndroid (richtext, base64Image detection)
- Keep Android-specific code in androidMain (blurhash, bitmap handling)
- Remove @Preview annotations from shared code (Android-only feature)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 07:52:45 +02:00
davotoula 7c374fb586 Parse for video segments and exclude them from image gallery 2025-11-01 16:37:38 +01:00
davotoula 1e12decd36 add VideoSegment and failing tests 2025-11-01 16:23:35 +01:00
davotoula 38d5527b91 revert spotless plugin (need to find a solution for @Composable function names)
Remove unused imports
2025-10-21 12:47:42 +01:00
Vitor Pamplona 3a73de6828 Separates the new GaleryParser from Composables so that later we can cache it and parse it on the Default thread. 2025-10-20 17:12:12 -04:00
Vitor Pamplona 7a280a3cde - Migrates Quartz from Android to CommonMain
- Fully converts OpenTimestamp Java codebase to Kotlin, migrating the sync and async HTTP call interfaces to OkHttp and coroutines
- Redesigns parsing of relay commands, messages and filters for performance in Jackson.
- Starts the use of KotlinX Serialization when speed is not a requirement
- Migrates all Jackson field annotations to Kotlin Serialization
- Migrates Regex use in Quarts to Kotlin's Regex class
- Migrates Base64 from Android to Kotlin
- Migrates UUID from Android/Java to Kotlin
- Migrates LRUCache usage from Android/Java to Kotlin collections
- Migrates all String to bytearray conversions to Kotlin methods
- Migrates all System.arraycopy calls to kotlin native ones.
- Separates parsing code from the data classes Companion objects
- Exposes Rfc3986 normalizations to each platform.
- Exposes URI parsing classes to each platform.
- Exposes URL Encoders to each platform.
- Exposes BigDecimal to each platform.
- Exposes the Url Detector to each platform.
- Exposes MacInstances to each platform
- Exposes Diggest instances to each platform.
- Exposes a BitSet to each platform.
- Exposes GZip to each platform.
- Exposes Secp256k1 to each platform.
- Exposes SecureRandom to each platform.
- Exposes Time in seconds to each platform.
- Exposes the LargeCache to each platform.
- Exposes AES CBC and AES GCM encryption/decryption to each platform
- Migrate test assertions to Kotlin Tests
- Exposes Address class to each platform because of the Parceleable
- Creates our own ByteArrayOutputStream.
- Removes Lock features inside the Bloomfilters because we don't need data consistency/
- Migrates UserMetadata parser from Jackson to Kotlin serialization
- Removes the need for Static methods in each tag.
- Adds an event template serializer
- Adds KotlinX Datetime to migrate some of the date-based logs
- Adds support for LibSodium in the JVM platform
- Creates a shared test build for iOS targets
- Fixes several usages of Reflection when serializing classes
- Fixes a bug on loading RelayDB for the HintBloom filter test
- Increases the Bloom filter space to better use hints in the app.
- Removes support for iOS in x86
- Creates a Jackson mapper just for NIP-55, which stays in the Android build only.
- Keeps the event store in the android build as well.
- Removes @Syncronized tags in favor of Mutexes.
- Improved sendAndWaitForResponse NostrClient method to properly account for returns from each relay.
- Removes the need for GlobalScope and async calls in the downloadFirstEvent method.
- Restructures the parser and serialization of the relay messages and commands for performance with Jackson
- Removes the dependency on Jackson's error classes across the codebase.
- Moves the hint to quote tag extension methods to their own packages.
- Speeds up the generation of Bech32 addresses
- Migrates NIP-6 and Blossom uploads to use Kotlin Serialization
2025-09-22 19:44:51 -04:00
Vitor Pamplona 170b6cfe69 Moves test assets to resources to make it work with kmp 2025-08-27 21:09:21 -04:00
Vitor Pamplona 442f75fc41 - Migrates Quartz to a KMP project
- Converts OpenTimestamps from java to Kotlin
- Moves OTS OkHttp setup to Quartz
2025-08-27 17:32:39 -04:00
Vitor Pamplona 726f9e2f4f Moves target compatibility to java 21 2025-08-06 14:07:51 -04:00
Vitor Pamplona fa53ff2c78 Adds an iMeta cache for Picture and Video kinds and speeds up the procedure to verify if a video or picture is supported. 2025-07-30 12:47:31 -04:00
Vitor Pamplona 25e92666e0 Adjusts the gradle DSL language to the latest deprecations 2025-07-24 09:53:00 -04:00
Vitor Pamplona 58e353fb40 Moves NIP-55 calls to be suspending functions.
Moves NIP-55 calls to include an ID per call, not per event.
Adds error handling facilities to the Signer functions.
Moves the indexing of the decrypted objects to outside the LocalCache
Migrates Signers to become suspending functions.
Migrates Decryption caching systems to outside the Events themselves.
Migrates all NIP-51 lists to the new structure.
Migrates Drafts and NIP-04 and NIP-17 DMs to the new structure
Migrates Bookmarks to the new structure.
Changes the Room route to avoid using hashcode.
2025-07-18 17:17:27 -04:00
Vitor Pamplona 0cfcfaf899 3rd large migration to outbox. 2025-07-01 20:38:18 -04:00
Vitor Pamplona b045d0e122 Migrates lint to the newer default version and copyright to 2025 2025-05-14 11:59:15 -04:00
Vitor Pamplona 38bb39a407 Fixes bug when trying to detect the charset of the first 1024 bytes of the page. Since this is an invalid HTML, it was crashing here. 2025-05-03 16:15:20 -04:00
Vitor Pamplona 63a009f36d - Adds support for Ephemeral Chats from coolr.chat
- Adds support for following ephemeral chats
- Adds support for live events at the top of the feed.
- Adds support for NIP-51, kind:10005 public chat lists
- Adds support for Channel feeds
- Moves following of NIP-28 chats from the Contact List to kind: 10005
- Disables following of events at the Contact list
- Improves gallery display to slightly override profile pictures when in list
- Starts the Account refactoring by moving custom Emoji, EphemeralList and PublicChat lists to their own packages
- Refactors NIP-51 lists to use common classes of private tags instead of general list classes.
- Starts to separate all Public chats into their own database.
- Removes old account upgrades from the local storage
- Refactors url NIP-11 loading and unifies icon
- Reduces the dependency of Relay classes in the LocalCache, Notes and User classes
2025-05-02 21:18:10 -04:00
Vitor Pamplona 067f353e50 Finish the migration from LiveData to Flow
Moves most of the flow updates away from the Main thread.
Removes the need to use the Main thread to access Account.userProfile
2025-04-24 14:35:22 -04:00
Vitor Pamplona a84371a0b3 - Restructures the old static datasource model into dynamic filter assemblers.
- Moves filter assemblers, viewModels and DAL classes to their own packages.
- Creates Composable observers for Users and Notes
- Deletes most of the secondary LiveData objects in the move to Flow
- Manipulates nostr filters depending on the account of the current screen, not a global account.
- Unifies all FilterAssembly lifecycle watchers to a few classes.
- Prepares to separate The Nostr Client as an Engine of Amethyst.
- Moves the pre-caching processor of new events from the datasource to the accountViewModel
- Reorganizes search to be per-screen basis
- Moves authentication to a fixed Coordinator class for all accounts in all relays.
- Moves NOTIFY command to its own coordinator class for all accounts
- Moves the connection between filters and cache to its own class.
- Significantly reduces the dependency on a single ServiceManager class.
2025-04-23 16:24:41 -04:00
Vitor Pamplona 3833f5f822 - Refactoring services to be part of the App Lifecycle,
- Migrated services to Flows that are active while their flows remain subscribed
- Improved OTS Decoupling
- Moved OTS verification procedures from the local cache to the data source
- Migrated the forceProxy options to lambdas that return an OkHttpClient
- Isolated Connectivity services, from Compose to Flow
- Isolated Tor services, from Compose to Tor (only starts if the Tor option is marked as internal)
- Isolated Memory trimming services, from Compose to Flow
- Isolated Image Caching services, from Compose to Flow
- Isolated Video Caching services
- Isolated Logging services
- Isolated NIP-95 Caching services
- Isolated Pokey receiver services
- Improved support for Tor in push notifications
- Isolated OkHttpClient services as flows
- Reduced the coupling of Context objects with singleton objects.
- Migrated UserFeedStates, StringFeedStates and ZapFeedStates to MutableStateFlow, avoiding feed updates on Main
- Forces a reconnect into relays that lost connection if any tor, connectivity or account changes
- Speeds up Base64 parser
2025-04-09 18:51:17 -04:00
Vitor Pamplona ec25ef3f82 Adds flowerstr 2025-04-03 09:02:31 -04:00
Vitor Pamplona 9cd73c2663 Adding secret emojis to reactions 2025-03-05 18:24:03 -05:00
Vitor Pamplona 2b2b219536 no message 2025-03-05 15:29:16 -05:00
Vitor Pamplona 7e2724ea31 adds support for secret emojis 2025-03-05 13:40:51 -05:00
Vitor Pamplona 0580aef4a2 - Migrates NIP-17 DM new message model to its own model and disable some of the generic behavior from new posts.
- Fixes a bug on edits showing a previous edit.
- Refactors user suggestions and lastword procedures
- Adds a DM inline reply from other parts of the app, like on notification.
- Hides Retweet button from DMs on Notifications
- Fixes colors for drafts in chats.
- Adds a nav function that computes the destination only after the user clicks on it and on a coroutine.
2025-03-04 17:57:47 -05:00
Vitor Pamplona a2d9f31a8a Assigning hints to NIPs until NIP-53
Speeding up Bech32 and Hex processing
Updating Boosts and Reposts to the new way of declaring tags
Renaming the SHA256 hash tag from NIP94 to not confuse with # hashtags
2025-02-24 17:09:08 -05:00