Commit Graph

9260 Commits

Author SHA1 Message Date
davotoula aec0101769 was this meant to be withContext? 2026-03-06 20:10:35 +01:00
davotoula 7f0b2c500f add names to boolean params 2026-03-06 19:59:20 +01:00
davotoula 582153b193 remove unused imports 2026-03-06 19:59:20 +01:00
davotoula 8868b1b0e6 Explicit type arguments can be inferred 2026-03-06 19:59:20 +01:00
davotoula bd71e9ae8f remove redundant modifiers 2026-03-06 19:59:20 +01:00
davotoula 8329184d99 correct package name 2026-03-06 19:46:48 +01:00
davotoula c8c42b5d70 If-Null return/break/... foldable to '?:' 2026-03-06 19:46:47 +01:00
davotoula 34e1ea92b2 Declaration has type inferred from a platform call, which can lead to unchecked nullability issues. Specify type explicitly as nullable or non-nullable. 2026-03-06 19:46:47 +01:00
davotoula 99e8ffcdeb Declaration has type inferred from a platform call, which can lead to unchecked nullability issues. Specify type explicitly as nullable or non-nullable. 2026-03-06 19:46:47 +01:00
davotoula 7de098063f Specifying : ExoPlayer makes the contract explicit 2026-03-06 19:46:47 +01:00
davotoula 953e8c1749 supress false positive 2026-03-06 19:46:47 +01:00
davotoula 5ac8b9ad62 Prefer mutableLongStateOf instead of mutableStateOf 2026-03-06 19:46:47 +01:00
davotoula 80fb171e0a Unnecessary; SDK_INT is always >= 26 2026-03-06 19:46:47 +01:00
davotoula 8876c3c1d7 use multi-dollar string interpolation
avoid default locale
2026-03-06 19:46:47 +01:00
davotoula ccb5738826 Replace the API-branched calls with ContextCompat.registerReceiver() which handles the flags transparently across all API levels 2026-03-06 19:46:47 +01:00
davotoula 4ee4a00b58 Add a nested comment explaining why this function is empty 2026-03-06 19:46:47 +01:00
Vitor Pamplona f4d401bc56 Switches to our own version of the Url Detector 2026-03-06 10:58:59 -05:00
mstrofnone a817a2cc79 remove dead namecoinNameService declaration from AppModules
The NamecoinNameService.init() singleton was the only consumer of
the companion object removed in the previous commit. The
namecoinNameService val itself was never referenced — namecoinResolver
is what's wired into Nip05Client.
2026-03-07 00:49:05 +11:00
mstrofnone 24a03b5d20 remove unused singleton companion object from NamecoinNameService
The companion object (instance, getInstance, init) was dead code —
nothing outside the class referenced it. Koin handles instantiation
via AppModules.
2026-03-07 00:38:58 +11:00
Vitor Pamplona ddc4daaa28 Merge pull request #1773 from vitorpamplona/l10n_crowdin_translations
New Crowdin Translations
2026-03-06 08:12:46 -05:00
Crowdin Bot 998e6c690b New Crowdin translations by GitHub Action 2026-03-06 13:12:29 +00:00
Vitor Pamplona dd062f6e38 Merge pull request #1772 from greenart7c3/main
perf: optimize state management and clean up styling in ReactionsSettingsScreen
2026-03-06 08:10:13 -05:00
greenart7c3 0320ccf4a0 perf: optimize state management and clean up styling in ReactionsSettingsScreen
- Change `items` state initialization to use `toList()` instead of `toMutableList()` to ensure a fresh immutable snapshot from the flow.
- Reformat chained modifiers in `DraggableItem` for better readability.
2026-03-06 08:15:33 -03:00
M 4ecfbbb844 fix: add missing StateFlow import, merge duplicate KDoc blocks, and fix rebase conflicts
- Add missing 'import kotlinx.coroutines.flow.StateFlow' in SearchBarViewModel.kt
- Merge duplicate KDoc blocks on nameShowWithFallback in ElectrumXClient.kt
- Move NamecoinLookupException to ElectrumXServer.kt (avoid redeclaration)
- Remove duplicate NameShowResult/ElectrumxServer from ElectrumXClient.kt
- Fix ElectrumxClient -> ElectrumXClient renames in NamecoinNameService
- Extract namecoinElectrumxClient in AppModules.kt for NamecoinNameService.init()
- Update package paths from nip05.namecoin to nip05DnsIdentifiers.namecoin
2026-03-06 14:22:49 +11:00
M 050fd3a412 feat: propagate distinct error types from ElectrumX to search UI
Add NamecoinLookupException sealed class to distinguish:
- NameNotFound: name queried successfully but doesn't exist on blockchain
- NameExpired: name exists but expired (>36000 blocks since last update)
- ServersUnreachable: all ElectrumX servers failed with connection errors

Previously, all three cases returned null from nameShowWithFallback,
making it impossible for the UI to show meaningful feedback.

Changes:
- ElectrumxClient.connectAndQuery: throws NameNotFound/NameExpired
  instead of returning null for definitive blockchain answers
- ElectrumxClient.nameShow: lets NamecoinLookupException propagate
  (only catches connection/IO errors as null)
- ElectrumxClient.nameShowWithFallback: short-circuits on NameNotFound/
  NameExpired (no point trying other servers for definitive answers),
  throws ServersUnreachable when all servers fail with connection errors
- SearchBarViewModel: new namecoinSearchState flow with typed states
  (Idle/Loading/Resolved/NotFound/Expired/ServersUnreachable) for UI
  to show loading spinners, resolved profiles, and specific error
  messages. Derived namecoinResolvedUser from this flow.

Discovered while porting to notedeck (damus-io/notedeck#1314).
2026-03-06 14:15:11 +11:00
M ee418bdd0a fix: address race conditions and improve Namecoin NIP-05 resolution
Fixes discovered while porting Namecoin NIP-05 to Primal Android
(PrimalHQ/primal-android-app#934):

1. Race condition: stale intermediate lookups overwrite final result
   - Changed map to mapLatest in SearchBarViewModel so that previous
     in-flight ElectrumX lookups are cancelled when the query changes
   - Without this, typing 'd/testls' character by character causes
     stale results from 'd/test', 'd/testl' etc. to arrive after
     the correct 'd/testls' result and overwrite it with null

2. CancellationException swallowed in catch block
   - mapLatest cancels previous coroutines via CancellationException
   - The generic catch was catching it and emitting null, wiping the
     valid result. Now re-throws CancellationException

3. Root lookup fails when names object has no underscore key
   - extractFromDomainValue tried names[localPart] then names[underscore]
     which is the same thing for root lookups
   - Now falls back to first available entry for root lookups when
     no underscore key exists
   - Non-root lookups still fail correctly (no false matches)

4. Global Mutex serializes all lookups
   - Single Mutex in ElectrumxClient blocked unrelated lookups to
     different servers. A 25s timeout on one server stalled everything
   - Now uses per-server mutexes via ConcurrentHashMap

5. customServers set but never read
   - NamecoinNameService.setCustomServers() stored the list but the
     resolver was constructed with the default serverListProvider
   - Now wires customServers through to the resolver

6. resolveLive uses orphaned CoroutineScope
   - Now accepts an optional external scope parameter so callers can
     tie resolution to their own lifecycle

Adds 2 new tests: root fallback to first entry, non-root no-fallback.
2026-03-06 14:14:29 +11:00
Vitor Pamplona 13f401df8c Moves test cases to commonTest 2026-03-05 08:34:18 -05:00
Vitor Pamplona 73c5418114 Fixes bug on Show More calculations for very long texts. 2026-03-05 08:31:01 -05:00
Vitor Pamplona cb6391085a Improving the ui for reaction row settings 2026-03-04 17:37:52 -05:00
Vitor Pamplona f4ec5735d3 Better description of the settings 2026-03-04 17:21:32 -05:00
Vitor Pamplona 0e124f3017 Merge pull request #1769 from vitorpamplona/l10n_crowdin_translations
New Crowdin Translations
2026-03-04 17:18:51 -05:00
Crowdin Bot 52ec6eded8 New Crowdin translations by GitHub Action 2026-03-04 22:09:54 +00:00
Vitor Pamplona 6be2c7cbdf Merge pull request #1768 from vitorpamplona/claude/add-drag-drop-reactions-43YJ2
Replace move buttons with drag-to-reorder in reactions settings
2026-03-04 17:08:14 -05:00
Claude c2384d2082 feat: add drag-and-drop reordering for reaction row items
Replace up/down arrow buttons with a drag handle icon that supports
long-press drag gestures for reordering reaction items in settings.
Items visually lift with elevation and scale during drag, and swap
positions when dragged past neighboring item thresholds.

https://claude.ai/code/session_01RYsPFgnoeJ3BmwjFPMvTuU
2026-03-04 21:32:09 +00:00
David Kaspar 13dadeda37 Merge pull request #1767 from vitorpamplona/l10n_crowdin_translations
New Crowdin Translations
2026-03-04 20:13:57 +00:00
Crowdin Bot 9f772b0e13 New Crowdin translations by GitHub Action 2026-03-04 20:12:55 +00:00
Vitor Pamplona 9b9c2a722a Merge branch 'main' of https://github.com/vitorpamplona/amethyst
* 'main' of https://github.com/vitorpamplona/amethyst:
  New Crowdin translations by GitHub Action
2026-03-04 15:09:40 -05:00
Vitor Pamplona c95a9842a4 Adds the latin1 characters to the ascii block to avoid splitting words 2026-03-04 15:09:26 -05:00
David Kaspar 82ff8010c5 Merge pull request #1766 from vitorpamplona/l10n_crowdin_translations
New Crowdin Translations
2026-03-04 19:57:11 +00:00
Crowdin Bot 3a97f89199 New Crowdin translations by GitHub Action 2026-03-04 19:42:16 +00:00
Vitor Pamplona 2f94b3cb15 Adds the latin1 characters to the ascii block to avoid splitting words 2026-03-04 14:38:48 -05:00
Vitor Pamplona be5c1f4832 Removes encrypted data from search 2026-03-04 13:56:06 -05:00
Vitor Pamplona a536cc6f82 Merge pull request #1764 from greenart7c3/claude/reactions-settings-HhrO0
Add customizable reactions row settings screen
2026-03-04 13:35:03 -05:00
Vitor Pamplona 4839535355 Fixes test case for new class names 2026-03-04 13:29:09 -05:00
greenart7c3 4bd0ed97aa Explicit imports 2026-03-04 14:46:44 -03:00
Claude d2d887a782 feat: Add reactions row settings (enable/disable, order, show/hide counters)
Add a new Reactions Settings screen that allows users to:
- Enable or disable each reaction button (Reply, Boost, Like, Zap, Share)
- Reorder reaction buttons with up/down arrows
- Show or hide the counter for each reaction type

Changes:
- AccountSyncedSettingsInternal: Add ReactionRowAction enum, ReactionRowItem
  data class, and reactionRowItems field to AccountReactionPreferencesInternal
- AccountSyncedSettings: Wrap reactionRowItems in MutableStateFlow
- AccountSettings/Account: Add changeReactionRowItems methods
- AccountViewModel: Add reactionRowItemsFlow() and changeReactionRowItems()
- ReactionsRow: Add showCounter param to BoostReaction, LikeReaction,
  ZapReaction, ReplyReaction variants; refactor GenericInnerReactionRow to
  render dynamically based on settings
- New ReactionsSettingsScreen with per-button enable/counter toggles and
  move-up/move-down ordering
- Routes, AppNavigation, AllSettingsScreen: wire up new settings screen

https://claude.ai/code/session_01QizUFfWDeKjLK2SuhanipJ
2026-03-04 17:24:25 +00:00
Vitor Pamplona fbbc506e84 updates all dependencies 2026-03-04 12:19:57 -05:00
Vitor Pamplona 1fa93788db android target seems to be creating some issues between plugin dependencies after adding spm 2026-03-04 12:19:47 -05:00
Vitor Pamplona da01c6ccd1 Moves smp plugin to version catalog 2026-03-04 12:18:55 -05:00
Vitor Pamplona 67390bb8ec Updating Coil 2026-03-04 12:18:11 -05:00