Commit Graph
14941 Commits
Author SHA1 Message Date
Claude a699bcd1c4 feat: zap renderings embed the zapped post, like reactions and reposts do
RenderLnZap, RenderNutzap, and RenderOnchainZap now show the post the zap
targets above the transfer card (via the zap note's replyTo, mirroring
RenderReaction), so the target is visible wherever a zap renders — the
thread master view, composer reply previews, and quoted embeds. Reactions
already embedded their target.

https://claude.ai/code/session_01LM3KTECMMAdNBHZfs1dANa
2026-06-12 19:28:09 +00:00
Claude eb5f7d5434 feat: single click on like/zap chips opens the event's thread view
Clicking a zap, nutzap, or like chip in the notification galleries now
navigates to that event's own thread, where anyone can reply, boost, zap,
or share it — the sender's profile remains one tap away via their avatar
in the thread header. Boost chips keep navigating to the profile.

To make those threads render properly:
- The thread master view now dispatches ReactionEvent (kind 7) through
  RenderReaction and NutzapEvent (kind 9321) through a new RenderNutzap
  transfer card; NoteCompose gains the NutzapEvent branch as well.
- The master header shows the zap sender (from the embedded zap request)
  instead of the lightning provider that signed the receipt, including
  the avatar click target.

The private-zap reply-via-DM fallback moves from the chip long-press into
routeReplyTo, so every reply entry point — including the thread view's
reply button — routes private zaps to the sender's DM room when we hold
the decrypted sender, instead of a public composer that cannot tag them.

https://claude.ai/code/session_01LM3KTECMMAdNBHZfs1dANa
2026-06-12 19:27:35 +00:00
Claude b9595d91a9 Merge remote-tracking branch 'origin/main' into claude/sweet-shannon-smjotq 2026-06-11 23:55:00 +00:00
Vitor PamplonaandGitHub d91988b26b Merge pull request #3185 from vitorpamplona/claude/focused-einstein-6jjqmj
Add unified profile payment screen with multi-rail support
2026-06-11 19:14:43 -04:00
Claude 98d8a73337 fix(profile): move the payment rail chips below the identity claims
The chip row now renders after the website link and external identities
(GitHub/Twitter/etc.) instead of between NIP-05 and the website.
2026-06-11 23:07:05 +00:00
Claude 86cd1315c2 fix(profile): equalize wrapped-row spacing across all Send Payment chip groups
Pay from, zap receipt, amount preset, and on-chain fee chips wrap with
the same 8dp row gap as the Receive-on pills. Material chips reserve a
48dp interactive height around their 32dp visual, inflating wrapped-row
gaps to ~24dp; the new shared ChipFlowRow drops that enforcement inside
the chip groups so the spacing matches.
2026-06-11 23:05:39 +00:00
Claude a311ffec22 fix(profile): wrap spacing on Send Payment chip rows + cashu mark on its chips
- All chip FlowRows on the Send Payment screen (Receive on, Pay from,
  zap types, amount presets, fee tiers) now declare an 8dp vertical
  arrangement so wrapped lines get the same gap as the in-row spacing —
  the custom Receive-on pills had no intrinsic padding and touched when
  the row broke.
- The cashu rail chip and the cashu 'Pay from' wallet chip use the Cashu
  vector mark (tinted with the chip content color) instead of the
  generic wallet symbol.
2026-06-11 22:34:39 +00:00
Vitor PamplonaandGitHub 1e23b14ff2 Merge pull request #3184 from vitorpamplona/claude/beautiful-turing-j0czsm
Add NIP-101e fitness workout support (Kind 1301)
2026-06-11 18:26:36 -04:00
Claude 5635f89f3a feat(profile): drop Receive-on detail line; long-press chips copy destinations
The detail text under the Send Payment rail selector (e.g. the lightning
address, already visible in the recipient header) is gone. Instead every
chip carries its destination via long-press copy:

- Send Payment 'Receive on' chips copy the lightning address, the
  noffer pointer, the on-chain destination (announced target address or
  the pubkey-derived Taproot address — otherwise invisible), and the
  shared cashu mint URL. The chips are now custom selectable pills since
  M3 FilterChip has no long-press support.
- Profile rail chips gain the same copy values (clink noffer, derived
  taproot address, mint URL) alongside the existing lightning and
  payment-target copies.
- The announced bitcoin address moved from the detail line into the
  on-chain receipt note so it stays visible when it differs from the
  derived address.
2026-06-11 22:15:07 +00:00
Claude dcb6c6a2ba fix(profile): render rail and payment-target chips in one FlowRow
The wallet-rail chips and the NIP-A3 payment-target chips were two
separately padded FlowRows, so the gap between the two rows was about
double the in-row spacing. The target chips now render inside the same
FlowRow as the rail chips, wrapping together with uniform 6dp spacing.
DisplayPaymentTargets is gone; PaymentTargetChip is rendered by
DisplayPaymentRailChips directly.
2026-06-11 22:09:42 +00:00
Claude 1883f1b032 refactor: full-screen NewWorkout route + audit fixes
- Replace the NewWorkoutDialog with a Route.NewWorkout full screen
  (NewGoalScreen pattern: NewWorkoutViewModel + PostingTopBar), which
  also fixes the audit-found race where the dialog closed before the
  signer finished — the screen now pops back only after a successful
  sign/broadcast, keeping external-signer (Amber) flows alive.
- Move template building from Account.sendWorkout into the ViewModel.
- Render workout cards in thread view (ThreadFeedView fall-through gap).
- Snapshot parsed workout tags once per note (remember + WorkoutInfo)
  instead of re-scanning the tag array on every recomposition.
- Fix Double.trimmed() Int overflow on absurd distances.
- Flatten the distance-unit chip layout.

https://claude.ai/code/session_01Kpx53UEeJqqR7CASzMu6GB
2026-06-11 22:09:12 +00:00
David KasparandGitHub 8b9176bc02 Merge pull request #3179 from vitorpamplona/l10n_crowdin_translations
New Crowdin Translations
2026-06-12 00:08:29 +02:00
Claude adb59eb276 fix(profile): tint the cashu chip icon and brighten its purple
The Cashu vector is a monochrome black outline meant to be tinted like a
Material Symbol — with Color.Unspecified it rendered black and vanished
on dark backgrounds. Tint it with the chip color and lift the purple
from 0xFF7E57C2 to 0xFFA855F7 so the chip reads on both themes.
2026-06-11 22:06:43 +00:00
Crowdin Bot 344797ce87 New Crowdin translations by GitHub Action 2026-06-11 22:01:40 +00:00
Claude e7b4f8edbb feat(profile): unified payment rail chips on the profile header
Replaces the lightning-address icon+text row with a chip and completes
the rail set, so every way to pay a profile reads as one chip row:

- Lightning chip shows the lud16 (long-press still copies it) and opens
  the Send Payment screen on the Lightning rail.
- CLINK Offer chip moves into the same row (same look as before).
- New On-chain chip (when the chain backend is configured) and Cashu
  chip (when the logged-in user's cashu wallet shares a mint the
  recipient accepts), each opening their rail on the Send Payment
  screen.
- All four render through a shared ProfilePaymentChip pill that matches
  the NIP-A3 payment-target chips, replacing the old DisplayLNAddress
  row and the one-off clink chip in DrawAdditionalInfo.

https://claude.ai/code/session_01UERRsbDoRPz46Qx5HCXgAa
2026-06-11 21:59:47 +00:00
Vitor PamplonaandGitHub ae17c2378b Merge pull request #3183 from vitorpamplona/claude/friendly-lovelace-aw7vfj
Add pinned chatrooms feature with NIP-78 sync
2026-06-11 17:59:24 -04:00
Claude afa341f2fc fix(profile): rename rail selector label from 'Pay with' to 'Receive on'
The rail chips describe how the recipient receives the funds, not which
wallet pays — that's the 'Pay from' row below.
2026-06-11 21:51:09 +00:00
Claude 4361f95a17 feat: NIP-101e workout records (kind 1301) + Workouts feed screen
Quartz: new experimental/fitness/workout package shaped like nip88Polls —
WorkoutRecordEvent with per-tag classes (exercise, duration, distance,
elevation, calories, steps, heart rate, splits, strength sets/reps/weight,
source, workout_start_time), TagArrayBuilder/TagArray extensions, lax
RUNSTR-dialect parsing (unit defaults, HH:MM:SS or raw seconds), and
EventFactory + LocalCache registration. Covered by fixture tests.

Amethyst: new Workouts feed (drawer entry, route, follow-list top bar,
per-relay filter assemblers mirroring the Pictures feed) with a + FAB
opening a manual workout composer that publishes canonical kind-1301
events. Workout cards render stats chips and also display inside threads
via NoteCompose. Adds fitness Material Symbols glyphs and regenerates the
subset font.

https://claude.ai/code/session_01Kpx53UEeJqqR7CASzMu6GB
2026-06-11 21:48:32 +00:00
Claude a3a938253f feat(chat): sync pinned DM rooms via the NIP-78 AppSpecificData event
Pinned chatrooms were stored local-only in encrypted SharedPreferences, so
they were lost on uninstall and never reached other devices. Move them into
AccountSyncedSettings as a new 'chats' group in the encrypted settings blob
(each room serialized as its member pubkeys sorted ascending), publishing a
new AppSpecificData event on every pin/unpin like the other synced settings.

Local persistence now comes from the existing latestAppSpecificData event
backup, so the dedicated pinned_chatrooms preference is removed (the local
format never shipped, so no migration is needed). Pins arriving from another
device flow through AccountSyncedSettings.updateFrom and re-sort the chat
list via the existing pinnedChatrooms feed invalidation collector.

https://claude.ai/code/session_0131YwG6bE3yH8Kk9MxjMA5i
2026-06-11 21:47:17 +00:00
Vitor PamplonaandGitHub 3044e430ab Merge pull request #3182 from vitorpamplona/claude/awesome-gauss-hd9xjn
Add kotlinx-serialization support for CLINK protocol DTOs
2026-06-11 17:47:16 -04:00
Claude 9999d92bca fix: register CLINK DTO serializers in KotlinSerializationMapper for native targets
All CLINK tests failed on iosSimulatorArm64 with IllegalArgumentException
because OptimizedJsonMapper on native dispatches through
KotlinSerializationMapper, whose fromJsonTo/toJson type lists did not
include the CLINK payload DTOs (Jackson handles them reflectively on
JVM/Android, which is why only iOS failed).

Adds hand-written kotlinx serializers for OfferRequest/OfferResponse/
OfferReceipt, DebitRequest/DebitResponse, and ManageRequest/ManageResponse,
mirroring Jackson behavior: ManageResponse.details coerces a lone object
into a one-element list (ACCEPT_SINGLE_VALUE_AS_ARRAY) and
OfferRequest.payer_data round-trips as a free-form JSON object.

Covered by a JVM test driving KotlinSerializationMapper directly and
cross-checking against Jackson, since the native path shares this code.

https://claude.ai/code/session_01SevV4fUCumKZ1UscSz85vS
2026-06-11 21:33:49 +00:00
Claude e62bef8610 perf(chat): defer pinned-room state reads to the row and menu slots
Reading pinnedChatrooms.value in the UserRoomCompose body invalidated the
whole function scope on every pin toggle. Keep the single subscription but
read the set only inside the firstRow slot (pin icon) and the dropdown
menu-item text, so those two small scopes are the only ones that recompose.

https://claude.ai/code/session_0131YwG6bE3yH8Kk9MxjMA5i
2026-06-11 21:22:25 +00:00
Claude 23605ef630 feat(profile): 'Pay from' wallet selector on the Send Payment screen
The screen now shows which wallet the payment will come from and lets
the user switch before paying:

- Lightning and CLINK-offer rails list every configured wallet (NWC +
  CLINK debit, via PaymentSourceResolver.all) plus an 'Another wallet
  app' entry that hands the invoice to the system via intent. The
  selection defaults to the account's default payment source and
  re-resolves if the picked wallet is removed while the screen is open.
- On-chain and cashu rails show a fixed, disabled chip naming their
  intrinsic wallet so the money's origin is always visible.
- payBolt11 now charges the picked source instead of silently using the
  account default.

https://claude.ai/code/session_01UERRsbDoRPz46Qx5HCXgAa
2026-06-11 21:18:11 +00:00
Claude 02e0d9a4be feat(profile): pay bitcoin payment targets through the in-app on-chain wallet
Lightning payment targets already route into the Send Payment screen;
this extends the same treatment to bitcoin targets. Tapping a profile's
bitcoin payment-target chip (or its pay action in the wallet-button
dialog) now opens the Send Payment screen with the on-chain rail locked
to that announced address, paid directly from the user's NIP-BC Taproot
wallet — falling back to the external bitcoin: URI when the chain
backend is missing or the address isn't a payable native-segwit mainnet
address.

- quartz: SegwitAddress.scriptPubKeyFor/isPayableMainnetAddress;
  OnchainZapBuilder.buildToScripts core shared by the pubkey paths.
- commons: OnchainZapSender.sendToAddress — plain wallet send with the
  same fund-safety signing contract but no kind:8333 receipt (the
  destination isn't pubkey-derived, so none is possible); the signing
  block is now a single shared helper across send/sendSplit/sendToAddress
  and Success.receiptEventId is nullable for receipt-less sends.
- amethyst: Account.sendOnchainToAddress; Route.SendPayment gains
  btcAddressOverride; a shared inAppPaymentRouteFor() decides which
  payment targets the user's wallets can pay in-app (used by both the
  target chips and the payment-targets dialog).
- Send Payment screen: with an address override the on-chain rail shows
  the target address, hides the message field (no receipt to carry it),
  explains that no zap receipt is published, and dispatches the plain
  address send.

https://claude.ai/code/session_01UERRsbDoRPz46Qx5HCXgAa
2026-06-11 21:01:07 +00:00
Vitor PamplonaandGitHub e8ed9379b8 Merge pull request #3181 from vitorpamplona/claude/focused-knuth-4zi90p
Fix ThumbnailDiskCache to recreate cache dir if cleared at runtime
2026-06-11 16:45:43 -04:00
Vitor PamplonaandGitHub 77a26ed131 Merge pull request #3180 from vitorpamplona/claude/dazzling-sagan-1c0ncz
Optimize string resource loading in WalletScreen
2026-06-11 16:40:07 -04:00
Claude 9ebee56dba fix: recreate thumbnail cache dir before writing temp file
The profile_thumbnails_v2 dir was only created in ThumbnailDiskCache's
constructor, but Android can delete cache subdirectories while the app
runs (system cache trim under storage pressure, or the user tapping
Clear cache in Settings). After that, every generateFromFile call
failed with ENOENT on the temp-file write until process restart,
silently disabling thumbnail caching.

Recreate the dir right before the write, and add instrumented
regression tests covering the cleared-at-runtime path.

https://claude.ai/code/session_01RQinCw5QKpaYXqtyb4gf3h
2026-06-11 20:16:37 +00:00
Claude 4563bf872d fix(profile): harden Send Payment screen after audit
Audit fixes for the unified payment screen:
- Re-peek cashu nutzap funding when the profile data refreshes so a
  late-arriving kind:10019 doesn't keep the Cashu rail hidden, and read
  the on-chain backend availability live instead of freezing it at first
  composition.
- Seed the active CLINK offer only while unset so a kind:0 refresh
  mid-flow can't discard an expired-or-moved redirect; drop the !!
  derefs in the offer range check.
- Marshal payment-callback stage updates to the Main scope (matching the
  app's progress-callback convention) and run the on-chain send off the
  Main thread since the sender signs the PSBT on the calling thread.
- Launch the external-wallet intent from the Main scope instead of the
  invoice fetcher's IO callback.
- Restore the old LN-address error affordance: payment failures now
  offer 'Message the recipient about this', opening a DM prefilled with
  the failure detail.
- Reuse the wallet sheet's FeeTier instead of a duplicated enum, memoize
  the zap-type options, and hoist the lightning target-type set.

https://claude.ai/code/session_01UERRsbDoRPz46Qx5HCXgAa
2026-06-11 20:15:05 +00:00
Claude 6775ad8e62 docs: add RUNSTR interop research plan (kind 1301 + related events)
Catalogs every Nostr kind the RUNSTR app publishes/consumes, the exact
1301 tag dialect, the Supabase-migration caveats, and a phased plan for
Quartz event classes and Amethyst fitness screens.

https://claude.ai/code/session_01Kpx53UEeJqqR7CASzMu6GB
2026-06-11 20:12:30 +00:00
Claude 38023dac45 fix: resolve iOS test-name compile error and LocalContext lint error
- Rename Nip05Test backticked test name to drop parentheses, which are
  illegal identifier characters on Kotlin/Native (iosSimulatorArm64).
- Resolve CLINK budget toast strings at composition time via stringRes
  instead of context.getString inside the async callback, fixing the
  LocalContextGetResourceValueCall lint errors in WalletScreen.

https://claude.ai/code/session_01UgP8ErzBbQYkTDtkJx5nrt
2026-06-11 20:10:20 +00:00
Vitor PamplonaandGitHub 6c8dea755d Merge pull request #3178 from vitorpamplona/claude/kind-lamport-dwtzh8
Marmot: seed subscription since from stored messages on restart
2026-06-11 16:08:39 -04:00
Claude 73a63cf43a fix: address audit findings on the MLS unread/restore changes
- Clamp the seeded kind:445 subscription since at wall-clock now: the
  inner createdAt is sender-controlled, so a single future-dated message
  could push since past the present and silently skip genuinely new
  events on every restart. Covered by a new regression test.

- Drop the remember() around the group-list unread count: the chatroom's
  message set can shrink without newestMessage or lastReadTime changing
  (pruning, kind:5 deletion of an older message), which left the cached
  count stale. The set is pruned to ~100 entries, so counting per
  recomposition is cheap.

- Extract marmotGroupLastReadRoute(): the "MarmotGroup/<id>" last-read
  key was inlined at three call sites; a prefix drift between the
  mark-as-read side and the unread checks would silently reintroduce
  the bug this branch fixes.

- Derive GROUP_EVENT_REFETCH_OVERLAP_SEC from TimeUtils.ONE_DAY instead
  of re-deriving 24*60*60.
2026-06-11 20:05:25 +00:00
Claude 7d7f2f275f refactor(quartz): dedicated NutzapEvent.buildToUser for profile nutzaps
Restores the non-null zappedEvent on NutzapEvent.build and adds a
separate buildToUser builder (p tag only, no e/k tags) for nutzaps that
target a profile instead of an event — mirroring NIP-57's profile zap
convention. CashuWalletOps.sendNutzap dispatches between the two.

https://claude.ai/code/session_01UERRsbDoRPz46Qx5HCXgAa
2026-06-11 19:48:56 +00:00
Claude f2702f9299 feat(profile): unified Send Payment screen for lightning, clink, on-chain and cashu zaps
Replaces the click-to-expand payment cards on the profile page with a
dedicated Send Payment screen that collects amount, optional message and
zap type, pays on the spot through the selected rail, and shows the
invoice-request + payment progress in the screen itself before closing.

- New Route.SendPayment(userHex, method, lnAddressOverride) with a
  stateless SendPaymentContent (previews for editing, fixed-price clink,
  in-progress, success and failure states).
- Rails offered per profile: Lightning (lud16/lud06 or a lightning
  payment target), CLINK offer (kind-0 / NIP-05, with expired-or-moved
  redirect), on-chain NIP-BC (fee tier selector), and NIP-61 cashu
  nutzaps gated on a shared funded mint.
- Lightning rail keeps the Public/Private/Anonymous zap types and adds
  the Non-Zap (plain payment) option; clink is a direct payment; cashu
  and on-chain receipts are inherent to their protocols and noted as such.
- Paying from this screen skips the extra in-app wallet confirmation
  dialog: the explicit amount + Pay tap is the confirmation.
- Profile LN-address row, CLINK chip, lightning payment-target chips and
  the wallet button's pay action now navigate to the new screen; other
  target types keep their external payto/URI behavior.
- NutzapEvent.build / CashuWalletState.sendNutzap now accept a null
  zapped event so nutzaps can target a profile (p-tag only), and
  AccountViewModel gains sendNutzapToUser + a zapType override on
  sendSats.

https://claude.ai/code/session_01UERRsbDoRPz46Qx5HCXgAa
2026-06-11 19:28:02 +00:00
Claude 67ea7c5c95 Merge remote-tracking branch 'origin/main' into claude/sweet-shannon-smjotq 2026-06-11 19:01:36 +00:00
Claude 438f37a1ad Merge remote-tracking branch 'origin/main' into claude/kind-lamport-dwtzh8 2026-06-11 19:00:39 +00:00
Claude 0c9a7ed9ee Merge remote-tracking branch 'origin/main' into claude/friendly-lovelace-aw7vfj 2026-06-11 19:00:33 +00:00
Claude 9ce3b91f81 feat: route replies to private zaps into the sender's DM room
A public kind 1111 reply can never reach a private zapper: tagging the
decrypted sender would publicly expose them, so the composer correctly
refuses to — leaving the reply addressed to no one. Since only the zap
recipient can decrypt the sender, long-pressing a private-zap chip now
opens the DM room with that sender instead of the public comment
composer. Public and anonymous zaps keep the public reply path, and a
private zap we could not decrypt falls back to it as well.

https://claude.ai/code/session_01LM3KTECMMAdNBHZfs1dANa
2026-06-11 19:00:32 +00:00
Vitor PamplonaandGitHub 675580640d Merge pull request #3177 from vitorpamplona/claude/trusting-mayer-6o0yd5
Implement CLINK (Common Lightning Interface for Nostr Keys)
2026-06-11 14:42:25 -04:00
Claude d242eb62aa Merge remote-tracking branch 'origin/claude/trusting-mayer-6o0yd5' into claude/trusting-mayer-6o0yd5 2026-06-11 18:18:57 +00:00
Claude 990c5afe99 Merge remote-tracking branch 'origin/main' into claude/trusting-mayer-6o0yd5
# Conflicts:
#	amethyst/src/main/java/com/vitorpamplona/amethyst/ui/components/RichTextViewer.kt
2026-06-11 18:15:04 +00:00
Vitor PamplonaandClaude Opus 4.8 44a6ab6bd4 fix(clink): keep offer/debit payments on clearnet + short subscription id
Two bugs kept CLINK offer/debit round-trips from completing over the shared
account relay client:

- The offer relay was treated as a generic "new" relay, so with Tor on it
  was dialed through the proxy and failed on services that block Tor exits.
  Register the offer/debit relays as money-operation relays for the duration
  of the round-trip; the subscribe()-triggered reconnect plus the
  BasicRelayClient wrong-transport rebuild then move the socket to clearnet.

- The subscription id "clink-offer-<event id>" was 76 chars; relays cap REQ
  subscription ids at 64 (NIP-01) and reject the over-long REQ outright, so
  the reply never arrived. Use newSubId(); the reply is matched by request
  id in the listener, not by subscription id.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-11 14:00:32 -04:00
Vitor PamplonaandClaude Opus 4.8 f9f7de3ed0 feat(tor): money-operations relay category
Relay-socket Tor routing only had localhost/onion/DM/trusted/new buckets,
so a wallet or payment-service relay fell through to newRelaysViaTor and
got forced over Tor regardless of the "Money operations via Tor" toggle
(which previously governed only HTTP clients). On services that block Tor
exits this silently broke NIP-47 and CLINK payments.

Add a moneyOperationsViaTor field to TorRelaySettings and a moneyOpRelay
bucket to TorRelayEvaluation (taking precedence over DM/trusted/new, after
the onion reachability check). TorRelayState gains a persistent money-op
relay set — fed across all accounts from NIP-47 wallet relays and saved
CLINK debit relays via AccountsTorStateConnector — plus a reference-counted
ad-hoc registry for one-off payment relays (e.g. an noffer pointer). The
websocket builder resolves the per-relay decision from live source values
so ad-hoc registration takes effect on the next connect with no race.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-11 13:35:11 -04:00
Vitor PamplonaandClaude Opus 4.8 d1bd5734cd fix(relay): rebuild sockets opened on the wrong transport
connectAndSyncFiltersIfDisconnected() bailed whenever a socket already
existed, so a still-connecting socket built for the wrong transport (e.g.
a relay whose Tor classification changed since the dial started) could
never be preempted — it blocked until the hung dial timed out. The
connected-relay path in RelayPool.reconnectIfNeedsTo already rebuilds
ready sockets via needsToReconnect(); this covers the connecting state it
cannot see (isConnectionStarted() true but isConnected() false).

Now: if a socket exists but reports needsReconnect() (transport/proxy
mismatch against the current builder decision), drop it and redial on the
correct transport; otherwise leave it. Disconnected relays still honor
their reconnect backoff.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-11 13:34:49 -04:00
Vitor PamplonaandGitHub 226ceee6df Merge pull request #3175 from nrobi144/feat/desktop-vlcj-to-kdroidfilter
feat(desktop): replace vlcj (GPLv3) with kdroidFilter ComposeMediaPlayer + JCodec/FFmpeg
2026-06-11 12:11:53 -04:00
nrobi144 eae1ed88ec fix(desktop,media): address PR #3175 review findings
Correctness fixes in GlobalMediaPlayer.kt
- snapshotFlow { hasMedia } collector for initial seek used `return@collect`
  which only exits the lambda; the collector kept running and each
  subsequent playVideo() call accumulated a live collector that would
  re-fire a stale seekTo() on the wrong media. Replaced with `Flow.first`
  which terminates the collection cleanly.
- playVideo()/playAudio() reset the public MediaPlaybackState to
  volume=100/isMuted=false on a new URL, but the kdroidFilter player
  retains its `volume` across openUri(); muting one track and starting a
  new one left the engine silent while the UI showed unmuted. Reset
  `player.volume = 1f` to match the public state.
- ensureVideoPlayer()/ensureAudioPlayer() called createVideoPlayerState()
  synchronously from the Compose getter; if native init throws (missing
  GStreamer on Linux, broken NativeLibraryLoader extraction) the whole
  window would crash. Wrapped in runCatching and changed
  activeVideoPlayerState to nullable. Consumers in DesktopVideoPlayer
  and GlobalFullscreenOverlay handle the null path by rendering the
  thumbnail / blank backdrop respectively; playVideo()/playAudio()
  surface "Video playback unavailable" through the existing
  errorReason -> PlaybackErrorMessage path.

Crash mitigation (kdroidFilter 0.10.0 UAF in MacVideoPlayerSurface)
- NowPlayingBar previously mounted a SECOND VideoPlayerSurface against
  the same VideoPlayerState while the feed card was already mounting
  one, doubling the draw rate against the shared frame bitmap and
  widening the UAF window in MacVideoPlayerSurface's RasterFromBitmap
  path. Mini-preview now renders the cached thumbnail (or the music
  icon fallback). 0.10.1 contains an upstream fix
  ("recover video playback after composition removal") but is not yet
  on Maven Central — single-surface mounting is the only mitigation
  we can ship today.

VideoThumbnailCache.kt
- Truncated-download cache poisoning: when an origin ignored the
  Range: header and returned HTTP 200 with the full body, we capped
  the copy at MAX_THUMB_BYTES and persisted the truncated file
  forever. Subsequent thumbnail attempts hit the broken cache file
  and re-failed JCodec/ffmpeg every time. Tag download results with
  whether the server actually returned 206; on 200, extract from the
  temp file and delete it (no persistent cache hit).
- Tor bypass: replaced the bare OkHttpClient with
  DesktopHttpClient.currentClient() so thumbnail fetches respect the
  user's Tor preference (fail-closed when Tor is expected but
  bootstrapping).
- ffmpeg version probe leaked the process on hang: now drains stdout
  to DISCARD and calls destroyForcibly() on timeout.
- Frame-extract ffmpeg subprocess could deadlock on a chatty stderr
  pipe: redirectError(DISCARD) so we never wait on stderr; a finally
  block destroys the process if anything leaked through the timeout.

CI workflow cleanup
- Removed vlc-setup download cache + pre-fetch steps from
  build.yml and smoke-test-desktop.yml. They were targeting an
  ir.mahozad.vlc-setup plugin we no longer apply, so they wasted
  ~minutes of CI time per leg and tied the build to videolan.org
  reachability for no reason.
- Trimmed create-release.yml's stale VLC-plugins justification on
  the linuxdeploy-vs-appimagetool comment.

.gitignore + missing per-OS ffmpeg READMEs
- The pre-PR rules blanket-ignored desktopApp/src/jvmMain/appResources/{linux,macos,windows}/
  so the LGPL FFmpeg drop-in slot READMEs created in 704f4f44e never
  reached the commit. Refined the ignore rules to keep stale vlc/ workspace
  trees out of git (still ignored) while explicitly tracking the
  ffmpeg/README.md drop-in slot under each OS. The READMEs document the
  recommended LGPL build source per OS for the bundled-FFmpeg packaging
  path.

Verified on macOS arm64:
  ./gradlew :desktopApp:compileKotlin   BUILD SUCCESSFUL
  ./gradlew :desktopApp:test            BUILD SUCCESSFUL
  ./gradlew :desktopApp:spotlessApply   clean

Refs PR #3175 review by @davotoula.
2026-06-11 17:46:12 +03:00
David KasparandGitHub 013b029c86 Merge pull request #3176 from vitorpamplona/l10n_crowdin_translations
New Crowdin Translations
2026-06-11 16:36:23 +02:00
Crowdin Bot aa63d01b32 New Crowdin translations by GitHub Action 2026-06-11 11:47:22 +00:00
David KasparandGitHub 80b9c91c59 Merge pull request #3174 from vitorpamplona/l10n_crowdin_translations
New Crowdin Translations
2026-06-11 13:45:08 +02:00
Róbert NagyandGitHub e3441157ad Merge branch 'main' into feat/desktop-vlcj-to-kdroidfilter 2026-06-11 13:50:42 +03:00