Commit Graph

59 Commits

Author SHA1 Message Date
Alex Gleason a796f279a5 release: v2.2.2 2026-03-29 15:48:26 -05:00
Chad Curtis 8a6cb02dc0 Convert blobbi audio from MP3 to M4A (AAC-LC 32kbps mono), enable R8 shrinking
Replace 36 MB of MP3 files with 4.6 MB of M4A (AAC-LC) files encoded
at 32kbps mono. M4A is required for iOS/Safari compatibility in
Capacitor's WKWebView.

Enable R8 minification and resource shrinking in the Android release
build to further reduce APK size. Add ProGuard rules to keep Capacitor
and OkHttp classes.
2026-03-28 11:35:49 -05:00
Chad Curtis f7821451c7 release: v2.2.1 2026-03-28 10:15:52 -05:00
Chad Curtis 3ee880d1dd release: v2.2.0 2026-03-28 08:00:41 -05:00
Lemon a1ef06510e Remove stale DEFAULT_KINDS fallback, skip polling until JS configures kinds 2026-03-28 00:20:21 -07:00
Lemon bac5d71480 Respect 'only from people I follow' in native Android notifications
Pass followed pubkeys through the Capacitor plugin to the native
polling service. When onlyFollowing is enabled, the relay query
includes an authors filter so only events from followed accounts
trigger native Android notifications.
2026-03-27 23:58:31 -07:00
Lemon 0ad655d1cf Fix notification preferences not filtering push notifications or unread dot
Disabled notification types (e.g. reactions) still triggered push
notifications and showed the unread dot indicator, even though the
notification tab correctly filtered them out.

Three root causes fixed:
- useHasUnreadNotifications now uses getEnabledNotificationKinds to
  only query for enabled types, preventing phantom unread dots
- NotificationSettings now syncs type preference changes to the
  nostr-push server via updateSubscription (is_active toggle)
- Native Android poller now receives enabled kinds from the JS layer
  and uses them in the relay filter instead of hardcoded kinds
2026-03-27 23:58:31 -07:00
Alex Gleason 0bd4877dd3 release: v2.1.1 2026-03-27 20:22:00 -05:00
Alex Gleason da27054a9b Fix file downloads and URL opening on Capacitor iOS
The <a download> and <a target="_blank"> patterns don't work in
WKWebView. Add downloadTextFile() and openUrl() utilities in
src/lib/downloadFile.ts that use @capacitor/filesystem and
@capacitor/share on native platforms, falling back to standard
browser behavior on web.

Update all call sites: onboarding key download (InitialSyncGate,
SignupDialog), image lightbox buttons (ImageGallery, ProfilePage).

Document Capacitor compatibility constraints in AGENTS.md.
2026-03-27 16:42:36 -05:00
Mary Kate Fain f82adab05d Fix: add letter (kind 8211) notifications
Letters were completely absent from the notification pipeline — users had
to visit the Letters page to discover incoming letters. This integrates
kind 8211 into every layer of the notification system:

- useNotifications: query, grouping, and referenced-event exclusion
- useHasUnreadNotifications: unread dot indicator
- NotificationsPage: LetterNotification component with link to /letters
- NotificationSettings: toggleable Letters row
- notificationTemplates: web push template
- Android NotificationRelayService + NostrPoller: native push support
- EncryptedSettings + schema: letters preference field

Closes #188
2026-03-27 14:15:50 -05:00
Alex Gleason 58a5c470bd release: v2.1.0 2026-03-26 23:14:03 -05:00
Alex Gleason 95db4e4dcf release: v2.0.1 2026-03-26 22:39:07 -05:00
Alex Gleason c1b33e17c8 release: v2.1.0 2026-03-26 22:31:54 -05:00
Alex Gleason cbbb576b26 Add release system with semver versioning, changelog, and release skill
- Switch from CalVer (date+SHA) to semantic versioning starting at v2.0.0
- Create release skill (.agents/skills/release/) with full AI-guided release workflow
- Add CHANGELOG.md with initial 2.0.0 entry
- Update CI tag regex to match semver tags (v2.0.0 instead of v2026.03.24-sha)
- Extract changelog content into GitLab release descriptions
- Update Android versionName to 2.0.0 in build.gradle
- Update iOS MARKETING_VERSION to 2.0.0 in pbxproj
- Expose VERSION (semver) and BUILD_DATE (ISO 8601) as build-time constants
- Display version and build date in Settings page footer
- Remove npm release script (releases are now done via the AI skill)
2026-03-26 21:15:35 -05:00
Alex Gleason 2cac567b26 Gitignore keystore files and key.properties 2026-03-18 13:11:12 -05:00
Chad Curtis 39fee6aa5d Filter notifications for reactions/reposts/zaps on posts user didn't author 2026-03-18 05:36:10 -05:00
Chad Curtis 67fc5f3fb2 Fix NPE crash in NotificationRelayService.onDestroy when httpClient is null
When onCreate() catches ForegroundServiceStartNotAllowedException and calls
stopSelf() early, httpClient is never initialized. onDestroy() still runs and
was crashing with a NullPointerException on httpClient.dispatcher().
2026-03-18 05:17:36 -05:00
Chad Curtis 341d9764b4 Fix crash: catch ForegroundServiceStartNotAllowedException in notification service
Android 16 (targetSdk 36) enforces strict time limits on dataSync
foreground services. When the limit is exhausted, calling startForeground()
or startForegroundService() throws ForegroundServiceStartNotAllowedException
and kills the app. Catch the exception in both NotificationRelayService.onCreate()
and MainActivity.onCreate() so the app continues running; the AlarmManager
will reschedule the next fetch cycle at the normal interval.
2026-03-16 01:42:50 -05:00
Chad Curtis 947bbfccb0 Add deep linking for ditto.pub Android App Links
- Add Android intent-filter with autoVerify for https://ditto.pub/*
- Create DeepLinkHandler component to handle appUrlOpen events at runtime
- Mount DeepLinkHandler in AppRouter inside BrowserRouter context
- Add public/.well-known/assetlinks.json with pub.ditto.app package and signing cert fingerprint
2026-03-16 01:39:56 -05:00
Chad Curtis 53eb0f37e9 Add kind 1111 to Android native notification service
- Add kind 1111 to the Nostr REQ filter in NotificationRelayService
- Add case 1111 to kindToAction() in NostrPoller with the same context-aware
  label logic: 'replied to your comment' when k=1111, 'commented on your post' otherwise
2026-03-07 02:01:59 -06:00
Chad Curtis ac09b0670a Losslessly compress public and Android image assets
Reduced PNG file sizes using sharp (compressionLevel 9, effort 10) with
no quality loss. Saved ~132K from public/ and ~960K from Android res/.
2026-03-04 03:21:37 -06:00
Chad Curtis fb9064cb0e Add pull-to-refresh to notifications; simplify Android notifications to use 'Someone' instead of fetching kind 0 metadata 2026-02-26 18:06:53 -06:00
Chad Curtis cbecefad84 Fix Android launcher icons: generate ic_launcher.png and ic_launcher_round.png with logo
The icon generation script was only producing ic_launcher_foreground.png
(adaptive icon layer) and leaving ic_launcher.png/ic_launcher_round.png as
solid purple squares with no logo. This caused the app icon to appear as a
big purple circle on device. The script now generates all three icon types
at all density buckets.
2026-02-26 15:32:02 -06:00
Chad Curtis 8c6747e46f Regenerate Android adaptive icon foreground PNGs 2026-02-26 14:56:50 -06:00
Chad Curtis a2f0397c0c Scale down adaptive icon foreground to 70% for proper safe-zone fit 2026-02-25 21:28:01 -06:00
Chad Curtis b138b04afb Restore all Android icons and generate-icons.sh to known good state (4abe629)
Reverts broken changes from intermediate commits that:
- Changed ic_launcher_foreground.xml viewport from 100x100 to 90x80 with scale
- Changed mipmap-anydpi-v26 to reference @drawable instead of @mipmap foreground
- Changed ic_stat_ditto.xml viewport from 100x100 to 90x80
- Rewrote generate-icons.sh to generate legacy icons with broken viewBox hack
- Produced tiny broken foreground PNGs (318-340 bytes)

All icon resources and the script are now identical to 4abe629, with freshly
regenerated foreground PNGs at the correct 66% content size.
2026-02-25 17:52:16 -06:00
Chad Curtis fd8fc1c3d6 Fix Android icon regressions: regenerate launcher PNGs and fix notification icon viewport
- Regenerate all ic_launcher*.png and ic_launcher_foreground.png which had regressed
  to tiny broken files (318-343 bytes) that rendered as white squares on purple
- Fix ic_stat_ditto.xml: change viewportWidth/Height from 100x100 to 90x80 to match
  the effective logo bounds, correcting the off-center logo in the notification tray
2026-02-25 17:52:16 -06:00
Chad Curtis f4cbb71e38 Fix Android icon centering by correcting SVG viewBox
The logo was still off-center because the SVG viewBox '-5 -10 100 100'
is asymmetric and doesn't properly frame the logo content.

Changes:
- Update generate-icons.sh: Change viewBox from '-5 -10 100 100' to '0 0 90 80'
- Update vector foreground: Change viewportWidth/Height from 100x100 to 90x80
- Adjust pivot point to match new viewport dimensions
- Regenerate all launcher PNGs and adaptive foreground PNGs with corrected viewBox

The logo should now be properly centered without the left gap.
2026-02-25 01:03:49 +00:00
Chad Curtis 407b4f1e4d Fix Android icon centering to remove left gap
The logo was off-center with a gap on the left due to the SVG's asymmetric
viewBox (-5, -10, 100, 100). Fixed by adjusting rendering and positioning.

Changes:
- Update generate-icons.sh: Render at 600px and crop to 512px for better centering
- Update vector foreground: Shift translateX from 5 to 7 to compensate for viewBox offset
- Regenerate all launcher PNGs and adaptive foreground PNGs

The logo now appears properly centered in the icon.
2026-02-25 00:54:01 +00:00
Chad Curtis cde98744d6 Reduce Android icon logo size to 40% for more breathing room
Zoomed out the logo further from 50% to 40% for better visual balance
and more padding around the logo.

Changes:
- Update generate-icons.sh: Change content_size from 50% to 40%
- Update vector foreground: Scale from 0.75 to 0.6 to match PNG sizing
- Regenerate all launcher PNGs and adaptive foreground PNGs

The logo now has generous padding and looks more refined in the app launcher.
2026-02-25 00:45:32 +00:00
Chad Curtis c82e9722d9 Reduce Android icon logo size from 66% to 50% for better appearance
The logo was zoomed in too far, making it difficult to see the full design.
Reduced the logo size to 50% of the icon canvas for proper padding.

Changes:
- Update generate-icons.sh: Change content_size from 66% to 50%
- Update vector foreground: Add 0.75 scale transformation to match PNG sizing
- Regenerate all launcher PNGs with the smaller, better-proportioned logo
- Regenerate all adaptive foreground PNGs

The logo now has proper breathing room and looks much better in the app launcher.
2026-02-25 00:38:06 +00:00
Chad Curtis 7f8f492acd Fix Android launcher icons to show Ditto logo on purple background
The APK was showing just a purple circle because the legacy launcher PNG files
(ic_launcher.png and ic_launcher_round.png) were solid purple with no logo.

Changes:
- Update generate-icons.sh to generate legacy launcher PNGs (for Android < 8.0)
- Add ImageMagick as fallback SVG renderer when inkscape/rsvg unavailable
- Replace 'bc' calculations with bash arithmetic for better compatibility
- Generate both square and round launcher icons with white logo on purple bg
- Regenerate all launcher icons (mdpi, hdpi, xhdpi, xxhdpi, xxxhdpi)

The icons now properly display:
- Purple background (#7c52e0)
- White Ditto logo (66% safe zone sizing)
- Round variant with circular mask

This fixes the issue for both:
- Modern devices (Android 8.0+): Uses adaptive icon system with vector foreground
- Legacy devices (Android < 8.0): Uses pre-rendered PNG launcher icons
2026-02-25 00:06:35 +00:00
Chad Curtis 04349db2b1 Fix Android app icon to show Ditto logo instead of purple circle
- Delete conflicting ic_launcher_background.xml drawable with teal grid pattern
- Update adaptive icon XMLs to use vector drawable instead of PNG mipmap
- Change from @mipmap/ic_launcher_foreground to @drawable/ic_launcher_foreground
- Vector drawable (drawable-v24/ic_launcher_foreground.xml) contains proper white Ditto logo
- Background color (#7c52e0 purple) is correctly defined in values/ic_launcher_background.xml

The APK was showing only a purple circle because the vector foreground logo wasn't being used. Now the adaptive icon system will properly composite the white Ditto logo on the purple background.
2026-02-25 00:04:16 +00:00
Chad Curtis 015a3a7e3f Fix Android app name capitalization to Ditto
- Update strings.xml to use 'Ditto' instead of 'ditto'
- Update capacitor.config.ts appName to 'Ditto'
- Update GitLab CI/CD artifact naming to use 'Ditto-' prefix
- Ensures consistency with web version branding
2026-02-25 00:01:41 +00:00
Chad Curtis 7132c43afa Add foreground PNGs for adaptive icon, restore foreground reference 2026-02-24 10:25:58 -06:00
Chad Curtis e2f94de1a2 Fix adaptive icon: use committed launcher PNG instead of broken foreground vector 2026-02-24 10:10:55 -06:00
Chad Curtis 4abe62962d Commit launcher PNGs directly, remove from CI generation 2026-02-24 06:11:54 -06:00
Chad Curtis 4f31b57d12 Fix icon branding: white SVG recolor, new logo notification icon, splash uses vector 2026-02-24 04:11:45 -06:00
Chad Curtis c8e92644d8 Fix spurious JSONException catch in EOSE handler 2026-02-24 01:49:26 -06:00
Chad Curtis 49d6166b99 Rewrite notification service: connect-fetch-disconnect per cycle, limit 5 events, adaptive interval 2026-02-24 01:18:11 -06:00
Chad Curtis b02b2a9e56 Rebrand Android app icons to Ditto logo with purple background 2026-02-24 01:03:53 -06:00
Alex Gleason 1f035f4a6e Rename Mew to Ditto across entire codebase
- Update all branding: titles, meta tags, OG tags, manifest
- Rename MewLogo component to DittoLogo
- Update Capacitor config: appId to pub.ditto.app, hostname to ditto.pub
- Migrate Android Java package from com.mew.app to pub.ditto.app
- Rename MewNotificationPlugin to DittoNotificationPlugin
- Update all localStorage keys from mew: to ditto: prefix
- Update Nostr encrypted settings d-tag from mew-metadata to ditto-metadata
- Update all page titles, zap comments, and UI strings
- Rename ic_stat_mew.xml drawable to ic_stat_ditto.xml
- Update build script references (mew.apk -> ditto.apk)
- Update all domain references (mew.shakespeare.wtf -> ditto.pub)
2026-02-23 11:50:00 -06:00
Chad Curtis 24c577e152 Show zap amount in native notifications, navigate to /notifications on tap
- Extract zap amount from kind 9735 events in NostrPoller.java (checks
  amount tag then falls back to description tag's zap request)
- Format amounts compactly (e.g. 1.5K sats, 2M sats)
- Set data URI on notification PendingIntent so tapping opens /notifications
- Handle deep link intent in MainActivity (both onCreate and onNewIntent)
- Remove dead localNotificationActionPerformed listener from TypeScript
  (only fired for Capacitor-API notifications, not natively posted ones)
2026-02-22 17:40:33 -06:00
Chad Curtis e00802d027 Build v2026.02.22: Update mew.apk (6.4M) 2026-02-22 03:40:46 -06:00
Chad Curtis 07123403cd Fix excessive battery drain: replace permanent WakeLock with AlarmManager keepalive
The notification service was holding a PARTIAL_WAKE_LOCK indefinitely,
preventing the CPU from ever sleeping. Combined with OkHttp's 30-second
ping interval, this caused continuous CPU wake-ups — worse than the
previous polling approach.

Changes:
- Remove permanent WakeLock that kept CPU running 24/7
- Disable OkHttp's 30s ping interval (useless without WakeLock in Doze)
- Add AlarmManager keepalive using setAndAllowWhileIdle() every ~8 min
- Acquire brief WakeLock (15s timeout) only during keepalive checks
- Track connection liveness via relay message timestamps
- Reconnect automatically when Doze kills the TCP connection
- Missed events are recovered via the existing 'since' timestamp

Expected improvement: ~3 brief wake-ups/hour vs continuous CPU usage.
Notifications may be delayed up to ~8 min in deep sleep.
2026-02-22 03:37:41 -06:00
Chad Curtis c565050779 Build v2026.02.21: Update mew.apk (6.3M) 2026-02-21 05:34:24 -06:00
Chad Curtis 34a2cda6fd Add ACCESS_NETWORK_STATE permission for ConnectivityManager 2026-02-20 17:49:57 -06:00
Chad Curtis 8ba7c16958 Fix startup crash: call startForeground() immediately in onCreate
Android 12+ crashes the app if startForeground() isn't called within 5
seconds of startForegroundService(). Moved it from onStartCommand() to
the top of onCreate() to ensure the foreground notification is posted
before any other initialization.
2026-02-20 17:48:04 -06:00
Chad Curtis 6066b5ec49 Replace polling notification system with persistent WebSocket subscription
Replaces the AlarmManager-based polling (wake every 60s, open/close WebSocket
connections) with a persistent WebSocket subscription to a Nostr relay. Events
are delivered in real-time via the open connection. A partial WakeLock keeps
the connection alive through Doze mode (same approach as Signal without FCM).

- Add NotificationRelayService: foreground service with persistent WebSocket,
  exponential backoff reconnection, network-aware reconnect, relay rotation
  on failure, and SharedPreferences config listener
- Refactor NostrPoller into notification dispatcher with metadata caching
  (SharedPreferences-based, avoids redundant WebSocket connections for
  repeat authors)
- Remove NotificationService (AlarmManager scheduler) and PollAlarmReceiver
  (WakeLock-based polling)
- Remove SCHEDULE_EXACT_ALARM permission (no longer needed)
- Disable web-layer background refetch on native (persistent connection
  handles it)
2026-02-20 17:43:26 -06:00
Chad Curtis 0ff2ea4198 Untrack generated mipmap PNGs and ignore android/downloads/ 2026-02-20 17:09:22 -06:00