Commit Graph

10047 Commits

Author SHA1 Message Date
nrobi144 598256639b fix(chats): share single DesktopIAccount across deck — DMs now visible
DeckColumnContainer was creating its own DesktopIAccount (and ChatroomList)
for the Messages column, while Main.kt created a separate one for DM relay
subscriptions. Events were added to one ChatroomList but the UI read from
the other, so DMs never appeared.

Fix: thread the single iAccount from Main.kt through DeckLayout →
DeckColumnContainer → RootContent → DesktopMessagesScreen. Removed the
duplicate DesktopIAccount and DmSendTracker creation from RootContent.

Audited all other deck column types — no similar instance duplication found.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-19 07:31:27 +02:00
nrobi144 24d4073b9b feat(media): encrypted file sharing in desktop DMs (NIP-17 Phase 6)
Add full send + receive encrypted media support in desktop DM chat:
- Paperclip attach button and drag-and-drop in ChatPane (NIP-17 mode only)
- AES-GCM encryption before upload to Blossom server
- ChatMessageEncryptedFileHeaderEvent (kind 15) wrapped in GiftWrap
- sendNip17EncryptedFile() added to IAccount interface and implementations
- DesktopUploadOrchestrator.uploadEncrypted() with proper encrypted hash
- DesktopBlossomClient ByteArray upload overload for encrypted blobs
- LRU cache in EncryptedMediaService to avoid re-downloading
- Error handling: retry on failure, disable send during upload

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-19 06:53:36 +02:00
Vitor Pamplona 3e3adaff10 Finalizes the RelaySync utility 2026-03-18 17:35:05 -04:00
Vitor Pamplona e57023cad9 Fix: Filters onCannotConnect to the relays that sent a req 2026-03-18 17:34:50 -04:00
davotoula 7bfc35e04d Fixes Applied
Code reuse
  - Extracted remuxTracks() helper to deduplicate video/audio remux loop (~40 lines)
  - Extracted stripAfterCompression() to deduplicate identical blocks in upload()/uploadEncrypted()
  - Replaced 8 identical showStrippingFailureDialog() copy-pastes with shared SuspendableConfirmation utility
  Privacy
  - 4 metadata ViewModels now error on strip failure instead of silently uploading unstripped media
  Efficiency
  - Eliminated temp input file copy for video/audio — MediaExtractor reads URIs directly
  Bug fixes
  - Fixed Long.toInt() overflow for MP3 files >2GB
  - Fixed MP3 temp file leak on exception and null InputStream paths
  Cleanup
  - Mutex field and wrapping the suspendCancellableCoroutine in mutex.withLock. Concurrent callers now queued
  - Converted MetadataStripper from class to object (stateless)
  - Moved StrippingFailureState from service layer to UI as generic ConfirmationCallbacks
2026-03-18 20:59:46 +01:00
davotoula 0cf256e5b2 Merge branch 'main-upstream' into claude/strip-file-metadata-sVIEd 2026-03-18 19:32:43 +01:00
davotoula bfc04497d6 Profile picture upload fails with an error instead of silently uploading unstripped media when stripping fails 2026-03-18 19:25:57 +01:00
davotoula eb13bab738 fix grammar 2026-03-18 18:31:34 +01:00
davotoula 97e6206244 fix persisted account preference 2026-03-18 18:31:07 +01:00
davotoula a7ac30493c Extension mismatch fix
Temp file leak fix
2026-03-18 18:25:31 +01:00
davotoula 49c8423be5 moving the stripping decision after compressIfNeeded 2026-03-18 18:20:01 +01:00
davotoula 127079ede3 - Hide privacy toggle when video compression is selected (compression
already handles metadata stripping)
- Pass stripMetadata=false when toggle is hidden for compressed video
- Hide compression quality for audio and other non-compressible media types
- refactor
2026-03-18 13:54:15 +01:00
nrobi144 c90bf8f610 feat(media): add Note/Picture post type selector; fix gallery crash
- Post type toggle (Note vs Picture/kind 20) in compose dialog, only
  shown when image files are attached. Text input disabled in picture mode.
- Fix LazyVerticalGrid crash in GalleryTab: bounded height via
  fillParentMaxHeight() when nested inside LazyColumn.
- Phase 1 testing plan: all pass.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 14:42:44 +02:00
nrobi144 cf17dea53f feat(media): add Note/Picture post type selector in compose dialog
When images are attached, a Note/Picture toggle appears letting the user
publish as kind 20 (PictureEvent) instead of kind 1. Text input is
disabled in picture mode. Selector only shows for image file types.
Updates testing plan: Phase 1 all pass.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 14:37:48 +02:00
nrobi144 1d1d32da0e feat(media): add server selector to compose dialog; update testing plan
Server selector dropdown appears when files are attached, letting the
user choose which Blossom server to upload to. Updates testing plan:
Phase 2 & 3 all pass, Phase 9 audio tested with volume bug tracked.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 14:26:47 +02:00
nrobi144 836e024bd7 feat(media): use VLC :start-volume for initial audio; document volume bug
Passes :start-volume media option to VLC on play. Removes polling/delay
volume hacks. Documents 9.7 volume bug in testing plan — VLC ignores
initial volume on macOS, needs further investigation.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 13:26:52 +02:00
nrobi144 f0c80f3c7c fix(media): delay volume enforcement — VLC audio output not ready at playing event
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 12:34:36 +02:00
nrobi144 11b9fdad80 fix(media): enforce volume on playback start — VLC resets volume on new media
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 12:30:57 +02:00
nrobi144 2a6087af27 feat(media): global media player — persistent playback across navigation
Media playback now survives navigation. A GlobalMediaPlayer singleton owns
VLC players and exposes StateFlows. Composables are thin viewports.
NowPlayingBar has full controls (volume, mute, save, fullscreen).
GlobalFullscreenOverlay renders video fullscreen above all screens.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 12:27:13 +02:00
davotoula 20ab105e44 feat: add metadata stripping failure dialog to all upload ViewModels
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-18 11:12:36 +01:00
davotoula c0632e17bd feat: add onStrippingFailed callback to upload orchestrators
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-18 10:51:30 +01:00
davotoula 9ce1ff3e63 feat: plumb stripMetadata from UI through ViewModels to upload orchestrators
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-18 10:50:16 +01:00
davotoula 3b1b15911f feat: rename stripLocationMetadata to stripMetadata in UI state and dialogs
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-18 10:42:59 +01:00
davotoula c76459859d feat: update all Screen call-sites for new stripMetadata onAdd parameter
Add 6th Boolean parameter to onAdd lambdas in all 6 files that call
ImageVideoDescription. The parameter is unused (_) for now in 5 sites
and named in ShortNotePostScreen for future plumbing.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-18 10:38:04 +01:00
davotoula 0d514a46d7 feat: add privacy toggle to ImageVideoDescription
Add stripMetadata state and SettingSwitchItem toggle. Extend onAdd
callback signature with 6th Boolean parameter for stripMetadata.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-18 10:36:56 +01:00
davotoula f7a9389a66 feat: add string resources for privacy toggle and metadata dialog
Rename strip_location_metadata_label/description to strip_metadata_label/description
to reflect broader scope. Add new strings for the metadata stripping failure dialog.
Update references in NewMediaView.kt and ChatFileUploadDialog.kt.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-18 10:36:03 +01:00
davotoula 24e8487db6 fix: hide codec toggle when video compression is set to uncompressed
When the compression quality slider is set to UNCOMPRESSED (value 3),
no encoding happens so the H264/H265 codec choice is irrelevant. Hide
the codec toggle in this case to avoid confusion.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-18 10:33:35 +01:00
davotoula 0e62904883 fix: hide compression slider for audio uploads
Audio has no compression support in MediaCompressor (falls through to
no-op), so showing the compression quality slider for audio files is
misleading. This removes audio from the slider visibility condition in
ImageVideoDescription and wraps the unconditionally-shown slider in
ChatFileUploadDialog with a media type check.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-18 10:33:28 +01:00
davotoula 489e731eea feat: add MP3 ID3 tag stripping and early-exit for unsupported audio
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-18 10:29:09 +01:00
davotoula b9d62edaad feat: support multiple tracks in audio metadata stripping
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-18 10:28:13 +01:00
davotoula 7219c787a6 fix: update direct MetadataStripper.strip() call sites for StrippingResult
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-18 10:26:02 +01:00
davotoula 4fc5166815 feat: propagate StrippingResult through UploadOrchestrator
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-18 10:25:55 +01:00
davotoula f9176fc3fb feat: add StrippingResult data class to MetadataStripper
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-18 10:25:50 +01:00
nrobi144 6e1315a4fa feat(media): improve video player pool, thumbnail extraction, and NoteCard layout
Harden VLC player pool with dedicated thumbnail acquisition, better error
logging, and defensive buffer checks. Simplify lightbox/video controls,
fix NoteCard media sizing across feed, thread, bookmarks, and search screens.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 09:24:00 +02:00
Vitor Pamplona f25be5e7bd removes the benchmark action... it's not that useful. 2026-03-17 16:00:46 -04:00
Vitor Pamplona bc5b254d01 merge 2026-03-17 15:57:44 -04:00
Vitor Pamplona 62811282a1 Merge pull request #1871 from vitorpamplona/claude/reorganize-nip47-wallet-mbVxR
Refactor NIP47 WalletConnect into organized subpackages
2026-03-17 15:47:51 -04:00
Vitor Pamplona 3e19195e4a Renaming and making a test case that considers limits.
Fixes active filter index bug
2026-03-17 15:45:52 -04:00
davotoula 72158e8fc2 Add rotation to stripped video 2026-03-17 20:27:15 +01:00
davotoula e5e51c9c42 REMUX_BUFFER_SIZE = 8MB — extracted as a companion constant (was 1024 * 1024 inline in both video and audio). 8MB prevents silent frame loss on 4K keyframes.
stripAudioMetadata try/finally — now mirrors stripVideoMetadata exactly: muxer/extractor always released, incomplete output file deleted on failure.
2026-03-17 20:09:33 +01:00
Claude 5029db2302 refactor: reorganize nip47 wallet connect package into subpackages
Split the flat nip47WalletConnect package into logical subpackages:
- rpc/ - JSON-RPC protocol models (Request, Response, Notification, NwcMethod, NwcErrorCode, NwcTransaction, etc.)
- events/ - Nostr event types (LnZapPaymentRequestEvent, LnZapPaymentResponseEvent, NwcInfoEvent, NwcNotificationEvent)
- cache/ - Decryption caches (NostrWalletConnectRequestCache, NostrWalletConnectResponseCache)

Root level keeps the entry points: Nip47WalletConnect (URI parsing), Nip47Client, Nip47Server.
Existing subpackages (tags/, kotlinSerialization/, jackson/) remain unchanged.

https://claude.ai/code/session_018YcwMeTHPXmeqpbZHcBEUg
2026-03-17 19:04:24 +00:00
davotoula d87bf37138 added comment about limitations 2026-03-17 19:53:57 +01:00
davotoula e7d11fdc84 add Track interleaving 2026-03-17 19:51:58 +01:00
davotoula a2f29d5e2e Early return with the original uri if there are no tracks 2026-03-17 19:43:16 +01:00
davotoula 4cf3a84190 delete orphaned output file on failure 2026-03-17 19:42:18 +01:00
davotoula b61e1d5779 fix resource leak(s) on exception 2026-03-17 19:40:12 +01:00
Vitor Pamplona b8351b8e29 Merge branch 'main' into claude/event-sync-screen-sYGtN 2026-03-17 14:17:13 -04:00
Vitor Pamplona 18fdfcc9d8 Merge branch 'main' of https://github.com/vitorpamplona/amethyst
* 'main' of https://github.com/vitorpamplona/amethyst:
  adaptability: use constant instead of repeated string literals
2026-03-17 14:10:45 -04:00
Vitor Pamplona b22aa1ad0f Shows default banner if the user's image is not available 2026-03-17 14:02:09 -04:00
Vitor Pamplona 7f5baab5df Adds last seen to the user profile 2026-03-17 13:58:07 -04:00