Commit graph

59 commits

Author SHA1 Message Date
Johannes Millan
40b18c4693 fix(sync): implement OAuth redirect for Dropbox on mobile
- Add redirect_uri parameter to OAuth flow for mobile platforms
- Create OAuthCallbackHandlerService to handle deep link callbacks
- Register custom URI scheme (com.super-productivity.app://) in Android/iOS
- Add platform-specific UI for OAuth flow (automatic vs manual)
- Implement proper error handling for OAuth callback errors
- Add comprehensive unit tests for callback handler
- Fix memory leak by properly cleaning up event listeners
- Use IS_NATIVE_PLATFORM constant for consistent platform detection

Web/Electron continue using manual code entry (no regression).
Mobile (iOS/Android) now use automatic redirect with deep linking.

Fixes Dropbox OAuth authentication on iOS and Android platforms.
2026-01-21 14:30:24 +01:00
Johannes Millan
2844560ef8 refactor(tasks): remove isEnableUrl config, always enable URL parsing 2026-01-20 17:07:24 +01:00
Johannes Millan
566760bd4a feat(android): add optional alarm-style notifications and fix reminder cancellation
- Fix bug where native Android alarms weren't cancelled when reminders were removed
- Add cancelNativeReminderOnUnschedule$ effect to cancel alarms on unschedule/dismiss
- Add useAlarmStyleReminders setting (default: false) for regular vs alarm notifications
- Create separate notification channels for alarm-style and regular reminders
- Add IS_ANDROID_WEB_VIEW_TOKEN injection token for testability
- Pass useAlarmStyle parameter through JS bridge to native Kotlin layer
2026-01-15 17:49:56 +01:00
Johannes Millan
dfa6a94a4b fix(android): show notification with sound when focus mode timer completes in background
When the app is backgrounded on Android, the focus mode countdown timer
now triggers a high-priority notification with alarm sound and vibration
when it completes. Previously, only the silent foreground service
notification was shown, causing users to miss timer completion.

Changes:
- Add completion notification channel with IMPORTANCE_HIGH
- Detect timer completion in FocusModeForegroundService
- Broadcast completion event to activity via LocalBroadcastManager
- Forward event to Angular via onFocusModeTimerComplete$ subject
- Handle native completion in effects to sync app state

Fixes #5923
2026-01-09 15:01:06 +01:00
Johannes Millan
1a79592aca build: update links to match our new organization 2026-01-05 14:45:06 +01:00
Johannes Millan
b7cbef2f79 feat(android): add alarm sound and vibration to task reminders
Use default alarm ringtone with USAGE_ALARM audio attributes so
reminders play even when phone is on silent. Add vibration pattern
and change notification category from REMINDER to ALARM.

Fixes #5603
2026-01-04 12:45:00 +01:00
Johannes Millan
a14c95093d fix(android): add error handling for native service calls
Wrap all androidInterface native method calls in try-catch blocks to
prevent app crashes when Java exceptions are raised during method
invocation. Users are now notified via snackbar when service start
fails, while update/stop failures are logged silently.

Changes:
- Add _safeNativeCall helper to TypeScript effects for DRY error handling
- Add safeCall inline helper to Kotlin JavaScriptInterface
- Wrap focus mode and tracking service calls with error handling
- Show user-friendly error notification on service start failures
- Add unit tests for error handling logic

Fixes #5819
2026-01-02 17:09:08 +01:00
Johannes Millan
00fdb29db9 fix(android): resolve race condition and improve widget reliability
- Add @Synchronized to WidgetTaskQueue methods to prevent task loss
- Use apply() instead of commit() in addTask() to avoid UI blocking
- Change QuickAddActivity to extend AppCompatActivity for consistency
- Add unit tests for setCounter() plugin API method
2026-01-01 12:34:39 +01:00
Johannes Millan
4a89c05d32 feat(android): add quick add widget 2025-12-31 12:45:17 +01:00
Johannes Millan
25edb4ff1e perf(android): prewarm WebView during idle time to speed up startup
Load WebView native libraries during main thread idle time using
IdleHandler and WebSettings.getDefaultUserAgent(). This reduces
the 200-300ms freeze on first WebView creation.
2025-12-31 11:45:52 +01:00
Johannes Millan
d11435808e fix(focus-mode): address critical focus mode and Android notification issues
- Fix pausedTaskId race condition: pass pausedTaskId in action payload
  instead of reading from state (reducer clears before effect reads)
- Fix Android focus notification: update title/isBreak on transitions,
  restart timer runnable on resume from paused state
- Fix Android reminder cancellation: track scheduled IDs and cancel
  alarms when reminders are removed
- Fix banner Start button: dispatch skipBreak first when isBreakTimeUp
  to properly resume task tracking
- Fix WebDAV validation: use translation key instead of hardcoded string

Addresses code review feedback for sync issues identified in focus mode,
Android notifications, and reminder scheduling.
2025-12-22 19:00:02 +01:00
Johannes Millan
2c910f6753 fix(android): sync notification timer when time spent is manually changed
Add updateTrackingService method to reset the notification timer when
the user manually edits time spent on a task. Previously, the Android
foreground service maintained its own timer that was only set at
tracking start, causing desync when users manually reset time.

Fixes #5772
2025-12-22 14:40:40 +01:00
Johannes Millan
f7901ba47f feat(android): add better notifications and permanent notification for focus mode 2025-12-19 15:52:11 +01:00
Johannes Millan
ffa7122aea feat(android): add background time tracking via foreground service
When a task is being tracked and the app goes to the background on Android,
JavaScript execution is paused/throttled, causing time tracking to stop.

This adds a native Foreground Service that:
- Shows a persistent notification with task title and elapsed time
- Tracks time independently using timestamps (not JS ticks)
- Provides Pause and Done action buttons on the notification
- Syncs elapsed time back to Angular when the app resumes or task changes

Architecture:
- Native service stores startTimestamp + accumulatedMs
- Calculates elapsed = (now - startTimestamp) + accumulated
- Angular effects sync time on resume, task switch, and notification actions
2025-12-19 13:38:52 +01:00
Johannes Millan
e69c39c3cc fix(android): address cold start share race condition and type mismatch
- Introduce `isFrontendReady` flag in Main Activity to strictly coordinate share intent flushing.
- Queue all share intents until the frontend explicitly signals readiness via `triggerGetShareData`.
- Change default share type from 'TEXT' (invalid) to 'NOTE' (valid) to match frontend type definitions.
- Fix race condition where `callJSInterfaceFunctionIfExists` was called before Angular subscriptions were active.
2025-12-02 13:30:36 +01:00
Johannes Millan
36285084bd feat(android): improve sharing robustness and UX
- Remove brittle 3s delay for share intent handling and replace with queueing mechanism.
- Add `triggerGetShareData` to pull pending shares upon app initialization.
- Improve `handleIntent` logic to avoid duplicate processing on warm starts.
- Detect `LINK` vs `TEXT` types for better icon selection.
- Increase title truncation limit to 150 chars.
2025-12-02 13:30:36 +01:00
Johannes Millan
62438af882 feat(android): implement sharing functionality with attachment support 2025-12-02 13:30:36 +01:00
Johannes Millan
2a615ecf8e fix: webview check for third party webviews #5447 2025-11-06 19:54:50 +01:00
Johannes Millan
4d9d0d1d2a fix: handle web view compatability check in android rather than in index.html 2025-11-01 13:18:33 +01:00
Johannes Millan
7313d4e14c build: fix android build 2025-10-29 18:15:50 +01:00
Johannes Millan
5fac5193e6 fix: sharing on android 2025-10-29 16:17:36 +01:00
Johannes Millan
73bdd10a49 fix: pin webkit version to fix android 9 issue
Closes #5285
2025-10-17 11:42:08 +02:00
Johannes Millan
9d029067f2 build: improve android perf?? 2025-08-10 15:28:42 +02:00
Johannes Millan
7b791199dd fix(android): improve WebDavHttpPlugin reliability and compatibility
- Fix WebDAV methods (PROPFIND, etc) by using OkHttp instead of HttpURLConnection
- Add proper async execution with coroutines to prevent UI thread blocking
- Improve error handling with specific error types and proper response format
- Add retry mechanism for transient network failures
- Normalize headers to lowercase for web compatibility
- Support all WebDAV methods including REPORT and OPTIONS
- Add kotlinx-coroutines dependency for async support

Fixes the "Expected one of [OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, PATCH] but was PROPFIND" error
2025-07-18 22:36:57 +02:00
Johannes Millan
291329e4d7 fix(sync): new kotlin plugin 2025-07-18 22:30:27 +02:00
Johannes Millan
b21572d715 refactor(android): convert WebDavHttpPlugin from Java to Kotlin
- Converted Java implementation to idiomatic Kotlin
- Used companion object for constants
- Leveraged Kotlin's null safety and scope functions
- Improved resource management with use extension
2025-07-18 21:30:30 +02:00
Johannes Millan
84c24ebf79 feat(sync): add custom cap http plugin for webdav methods 2025-07-18 21:25:44 +02:00
Johannes Millan
ea2ca8e622 feat(saf-droid): outline 2025-06-09 13:41:16 +02:00
Johannes Millan
11bfbe261b feat(android): re-add missing resource 2025-04-21 16:15:59 +02:00
Johannes Millan
ce40f44606 feat(android): cleanup unused resources 2025-04-21 15:32:43 +02:00
Johannes Millan
1b68b3e421 build: update and remove dependencies 2025-04-21 12:10:19 +02:00
Johannes Millan
8770d92c76 feat(android): darken status bar 2025-04-17 21:29:25 +02:00
Johannes Millan
68e284fc91 feat(android): cleanup old javascript interfaces 2025-04-17 19:33:04 +02:00
Johannes Millan
3d31018983 cleanup 2025-04-17 18:57:21 +02:00
Johannes Millan
2a825e50f2 feat(android): make auto dark mode switch work for android API 35 2025-04-17 18:43:49 +02:00
Johannes Millan
53e866bcd3 feat(android): cleanup 2025-04-17 16:03:06 +02:00
Johannes Millan
6136cbf6ea feat(android): cleanup request interceptor 2025-04-17 15:39:30 +02:00
Johannes Millan
7bb6735049 feat(android): cleanup styles and manifest 2025-04-17 15:30:47 +02:00
Johannes Millan
6173a2da6e feat(android): make most basic notifications work 2025-04-17 11:42:59 +02:00
Johannes Millan
2e4bea0a21 feat(pfapi): implement local file sync for android 2025-04-12 13:56:48 +02:00
Johannes Millan
88c25c6c0c feat(pfapi): improve error structure 2025-04-12 13:56:48 +02:00
Johannes Millan
6d6270638c fix(android): status bar for all 2025-04-12 13:50:08 +02:00
Johannes Millan
ab9d2a35f2 fix(android): status bar for android sdk 30 2025-04-12 11:06:40 +02:00
Johannes Millan
0d853f21e6 fix(android): status bar for android sdk 35 #4205 2025-04-05 11:30:11 +02:00
Johannes Millan
25ad554f21 build: update capacitor 2025-04-03 10:42:16 +02:00
Johannes Millan
0cea91441c fix(android): android file sync not working #3782 2024-12-21 10:45:36 +01:00
Johannes Millan
25b5585fac feat(android): formatting 2024-12-21 10:45:36 +01:00
Johannes Millan
6bd36f0f83 feat(android): also make gitlab requests work 2024-12-14 15:02:49 +01:00
Johannes Millan
16628a3e25 feat(android): make jira get requests work for android 2024-12-14 13:25:30 +01:00
Johannes Millan
0e3356f8e6 build(android): simplify WebViewRequestHandler 2024-12-14 11:39:20 +01:00