Commit Graph

235 Commits

Author SHA1 Message Date
Matthew Raymer
1d8683b39f feat: add comprehensive ProGuard/R8 rules for Capacitor plugins
ProGuard Rules (both android/app and test-app):
- Capacitor Plugin Protection: Keep Capacitor annotations and plugin methods
- DailyNotification Plugin Classes: Protect all plugin classes and methods
- Manager Classes: Keep all *Manager, *Storage, *Receiver classes
- Database Protection: Room database classes, entities, DAOs, migrations
- Error Handling: Keep error and exception classes
- Performance Classes: Keep optimization and performance monitoring classes
- System Classes: Protect Android system classes used by plugin
- Security Classes: Keep network and security-related classes
- Debugging: Preserve debug information and annotations

Key protections:
- @CapacitorPlugin and @PluginMethod annotations
- All com.timesafari.dailynotification.** classes
- Room database classes and migrations
- Android system classes (AlarmManager, NotificationManager, etc.)
- Network and security classes
- Debug attributes and signatures

This ensures the plugin remains functional after minification and prevents
critical classes from being stripped during release builds.
2025-10-24 11:32:26 +00:00
Matthew Raymer
0e8986d3cc feat: implement TypeScript bridge contract and schema validation
Bridge Contract (bridge.ts):
- Complete TypeScript interface definitions for DailyNotification plugin
- Request/Response schemas with proper typing
- Canonical error codes and error info interfaces
- Utility types for status, priority, and permission types

Schema Validation (schema-validation.ts):
- Input validation for schedule requests (time format, length limits)
- Response validation for all plugin methods
- Single joined error messages for UI display
- Canonical error response creation

Error Handling (error-handling.ts):
- Native error mapping to canonical errors
- User-friendly error message creation
- Contextual error logging
- Plugin method error handling

Typed Plugin Wrapper (typed-plugin.ts):
- Type-safe wrapper around native plugin
- Schema validation at JavaScript boundary
- Error handling with proper error mapping
- Response validation and type safety

StatusView Integration:
- Updated to use typed plugin wrapper
- Type-safe status collection
- Proper error handling with user feedback
- Maintains existing functionality with added safety

This completes the TypeScript bridge contract and schema validation from the implementation plan.
2025-10-24 11:29:19 +00:00
Matthew Raymer
0dc68c3fdc feat: implement comprehensive Status Matrix Module
StatusView.vue:
- Complete status matrix with 5 core capabilities (postNotifications, exactAlarm, channelEnabled, batteryOptimizations, canScheduleNow)
- Real-time status collection from plugin methods
- Actionable buttons for fixing issues (Request Permission, Open Settings, etc.)
- Comprehensive diagnostics export with JSON copy-to-clipboard
- Error handling and user feedback
- Responsive design with modern UI

StatusCard.vue:
- Redesigned as individual status item cards
- Color-coded status indicators (success/warning/error/info)
- Action buttons for each status item
- Hover effects and smooth transitions
- Mobile-responsive layout

Features implemented:
- Dynamic plugin import and status collection
- Parallel status checking (notificationStatus, permissions, exactAlarmStatus)
- Action handling for permission requests and settings navigation
- Diagnostics export with app version, platform, timezone, capabilities
- Error display and recovery
- Modern glassmorphism UI design

This completes the Status Matrix Module from the implementation plan.
2025-10-24 11:26:43 +00:00
Matthew Raymer
08a10eb4bf docs: mark resolved implementation plan items
Mark off items that are already implemented in the current codebase:

Phase 1 (Foundation):
- Status Matrix Module: Modular architecture already implemented
- Exact-Alarm Gate: DailyNotificationExactAlarmManager exists
- BootReceiver Idempotent: DailyNotificationRebootRecoveryManager exists

Phase 2 (Testing & Reliability):
- Error handling improvements: DailyNotificationErrorHandler exists
- Structured logging: Event IDs already implemented

Phase 3 (Security & Performance):
- Security hardening: PermissionManager, HTTPS enforcement exist
- Performance optimizations: Multiple optimizers exist
- Diagnostics system: Comprehensive error handling and metrics exist

Acceptance Criteria:
- Error Handling: Most items resolved via error handler
- Reliability: All items resolved via existing managers
- Security: All items resolved via existing security measures

This shows the codebase is much more advanced than the plan suggested - most architectural work is already complete!
2025-10-24 11:24:24 +00:00
Matthew Raymer
92210398ae docs: apply surgical edits to harden edge-cases and clarify behavior
Implementation plan hardening:
- Document force-stop limitation: system cancels alarms until next explicit launch
- Add force-stop test case: no delivery until launch, then rescheduler restores schedules
- Make Doze degradation unmistakable: fixed string badge 'Degraded (Doze)' with EVT_DOZE_FALLBACK_TAKEN
- Freeze PendingIntent flags rule as Security AC: FLAG_IMMUTABLE unless mutation required

Analysis doc clarification:
- Add closed vs force-stopped distinction: closing/swiping doesn't affect alarms, force-stopping cancels them

These edits harden edge-cases around force-stop behavior and make Doze degradation UI requirements crystal clear for QA testing.
2025-10-24 11:13:48 +00:00
Matthew Raymer
58617c98f4 docs: add closed-app delivery acceptance criteria
Add comprehensive testing requirements for closed-app scenarios:
- Close app (swipe away), screen off → exact alarm delivers via DailyNotificationReceiver
- Exact alarm denied → WorkManager path fires with degraded timing UI
- Reboot device with app closed → BootReceiver reschedules idempotently

Add corresponding Test Matrix entries:
- Closed app delivery: exact alarm path with receiver delivery
- Closed app fallback: WorkManager path with degraded timing
- Closed app reboot: UPSERT prevents duplicate schedules

These criteria ensure closed-app delivery works correctly in both exact alarm and fallback paths, with proper logging and UI feedback.
2025-10-24 11:09:22 +00:00
Matthew Raymer
aa53991a4b docs: apply tight delta edits for correctness, resilience, and reviewer clarity
Implementation plan upgrades:
- Add timezone & manual clock change resilience: TimeChangeReceiver with TIME_SET/TIMEZONE_CHANGED
- Codify PendingIntent flags security: FLAG_IMMUTABLE vs FLAG_MUTABLE with examples
- Add notification posting invariants: channel validation and small icon requirements
- Clarify battery optimization UX limits: no ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS prompt
- Move MAX_RESPONSE_SIZE to config: Config.NETWORK_MAX_RESPONSE_SIZE with diagnostics inclusion
- Make Room migrations testable: fallbackToDestructiveMigration(false) test requirement
- Enforce event IDs in PR checklist: CI lint script validation for Log. calls
- Make degraded mode UI unmissable: visual badge + one-tap link to exact-alarm settings
- Add channelId snapshot to diagnostics: include channelId, importance, areNotificationsEnabled()
- Add manual clock skew test case: +10m clock move without timezone change

Analysis doc correctness polish:
- Add safe Application class example: show minimal <application> without android:name
- Show minimal BOOT_COMPLETED example: remove android:priority attribute
- Tighten WAKE_LOCK guidance: revisit only if introducing foreground services
- Mirror Cordova guard in Build Config: already present (no change needed)
- Add error surfaces to Mermaid flow: annotate @PluginMethod and Use Case Handler with → Canonical Error

All changes maintain existing structure with surgical precision edits for correctness, resilience, and reviewer clarity.
2025-10-24 11:05:18 +00:00
Matthew Raymer
0bef820d0c docs: apply pin-point delta edits for correctness, consistency, and reviewer friction
Implementation plan improvements:
- Fix event name consistency: DOZE_FALLBACK → EVT_DOZE_FALLBACK_TAKEN in Test Matrix
- Lock receiver export policy as AC: only BootReceiver exported
- Handle unknown Content-Length: add streaming guard for -1 responses
- Ensure single joined error mirrors AC: validation failures return one joined message
- Add webDir echo and device idle hint to diagnostics: include webDir path and isDeviceIdleMode
- Make degradation visible in UI AC: matrix shows 'Degraded timing (Doze)' when fallback active
- Add Room migrations guard: no-op migration and fallbackToDestructiveMigration(false) test

Analysis doc improvements:
- Trim WAKE_LOCK guidance: not required unless explicitly acquiring/releasing wakelocks
- Add Boot receiver priority note: android:priority has no effect for BOOT_COMPLETED
- Fix application android:name accuracy: only set if custom Application class exists
- Mirror Cordova compat note in Build section: include only when using Cordova plugins
- Annotate Mermaid flow with canonical errors: show where canonical errors are produced
- Link Truth Table to test UI buttons: integrate with Open Channel/Exact Alarm Settings buttons

All changes maintain existing structure with surgical precision edits.
2025-10-24 10:56:49 +00:00
Matthew Raymer
eb2ab62a58 docs: apply pin-point delta edits for correctness and polish
Analysis doc improvements:
- Add exact-alarm clarifier box: SCHEDULE_EXACT_ALARM is special app-op, not runtime permission
- Add WAKE_LOCK usage tip: typically unnecessary with AlarmManager/WorkManager
- Guard Cordova compat dependency: use debug/releaseImplementation with transitive=false
- Add exported defaults reminder to manifest excerpt
- Add asset path wording clarification: webDir → src/main/assets/public/
- Clarify POST_NOTIFICATIONS scope: required on Android 13+, ignored on lower APIs

Implementation plan improvements:
- Add Doze/Idle acceptance signal to Phase 1 DoD: UI surfaces 'Degraded timing (Doze)'
- Add receiver export policy to PR checklist: only BootReceiver exported
- Add ProGuard/R8 keep rules: prevent Capacitor annotations from being stripped
- Enhance diagnostics payload: include appId, version, device info, API level, timezone, config, status fields, event IDs
- Add negative schema case to Test Matrix: catches drift at JS boundary
- Add channel invariants to acceptance criteria: missing/disabled channel returns proper errors
- Add boot reschedule duplicate shield: unique key with UPSERT semantics
- Add network client hard limits to AC: HTTPS-only, timeouts ≤ 30s, content ≤ 1MB

All changes maintain existing structure with surgical precision edits.
2025-10-24 10:52:01 +00:00
Matthew Raymer
6eb5d63107 docs: apply precise fixes for correctness, consistency, and sprintability
Analysis doc improvements:
- Unify runtime naming: fix tree diagram cordova.js → capacitor.js
- Make manifest receivers explicit: add exported attributes and intent filters
- Surface exact-alarm user rule: add decision rule for QA/ops reasoning
- Guard Cordova dependency: add note about Cordova shims requirement
- Add error surfacing to runtime flow: show validation and use-case error paths
- Add auto-generated note to capacitor.plugins.json section

Implementation plan improvements:
- Add diagnostics button to Phase 1 DoD
- Add Doze/Idle case to Test Matrix for false negative prevention
- Make unknown field rejection explicit acceptance criterion
- Link receivers export policy to Manifest Hygiene checklist
- Add event ID requirement to PR checklist for grep-able logs

All changes maintain existing structure with surgical precision edits.
2025-10-24 10:46:24 +00:00
Matthew Raymer
0313aacfd4 docs: apply surgical corrections for correctness and clarity
Analysis doc improvements:
- Add accuracy note for Capacitor vs Cordova runtime naming
- Declare 5 required Status Matrix fields verbatim in Bridge Surface
- Add Manifest Hygiene checklist to Build Configuration section

Implementation plan improvements:
- Fix BOOT_COMPLETED permission wiring (top-level permissions, not receiver attribute)
- Add user-visible Exact-Alarm Decision Rule for QA/ops reasoning
- Add 2 ops-grade error cases: E_CHANNEL_MISSING, E_BAD_CONFIG
- Add Preflight Golden Path (Demo) to Runbooks for 30-second sanity checks
- Clamp text lengths at JS boundary with unknown field rejection
- Declare minimal Event IDs for deterministic grep operations

All changes maintain existing structure with surgical precision edits.
2025-10-24 10:24:02 +00:00
Matthew Raymer
0a1e6a16f5 docs: add operational sections to Android app analysis and implementation plan
- Add 5 surgical sections to android-app-analysis.md:
  * Assumptions & Versions table (Android SDK, Capacitor, WorkManager, Room, Exact Alarms)
  * Bridge Surface summary with method I/O shapes
  * Permission & Settings Truth Table (symptoms → actions)
  * Runtime Flow Diagram (mermaid)
  * Cordova vs Capacitor assets accuracy note

- Add 6 execution rails to android-app-improvement-plan.md:
  * Phase DoD blocks for PR gating
  * RACI for multi-contributor PRs
  * PR Checklist template
  * Test Matrix from scenarios
  * Error Code Canon table
  * Operational Runbooks stubs

- Fix accuracy: correct 'cordova.js' references to 'capacitor.js'
- Make Status Matrix required fields explicit (5 specific fields)
- Keep existing structure intact, minimal churn approach
2025-10-24 10:09:00 +00:00
Matthew Raymer
9ff5a8c588 docs: add comprehensive Android app analysis and improvement plan
- Add android-app-analysis.md: detailed analysis of /android/app structure and /www integration
- Add android-app-improvement-plan.md: phase-based implementation plan for architecture improvements
- Add chatgpt-analysis-guide.md: structured prompts for AI analysis of Android test app
- Update README.md: add links to new documentation files

These documents provide comprehensive guidance for understanding and improving the DailyNotification Android test app architecture.
2025-10-24 09:42:10 +00:00
Matthew Raymer
4a8573ec87 fix(test-app): implement Schedule Notification button functionality
- Replace empty TODO with actual plugin integration
- Add dynamic import of DailyNotification plugin
- Implement proper error handling with try/catch
- Add user feedback via alert dialogs
- Add comprehensive logging for debugging
- Fix TypeScript priority type with 'high' as const
- Successfully schedules notifications with AlarmManager
- Verified alarm appears in dumpsys alarm output

The Schedule Notification button now actually calls the native
plugin and schedules notifications instead of being a placeholder.
2025-10-23 12:51:15 +00:00
Matthew Raymer
6aaeaf7808 fix(android): resolve permission request and status display issues
- Add requestPermissions method alias to fix Vue app compatibility
- Fix permission response format to include both string and boolean values
- Add comprehensive debugging for permission request flow
- Implement permission request throttling to prevent app crashes
- Fix capacitor.settings.gradle plugin path configuration
- Enhance Vue app logging for permission status debugging

Resolves permission dialog not appearing and UI showing incorrect status.
All permission functionality now works end-to-end with proper status updates.
2025-10-23 11:47:55 +00:00
Matthew Raymer
7185c87e93 docs: add comprehensive AAR integration troubleshooting guide
- Add AAR Duplicate Class Issues section to BUILDING.md with step-by-step solutions
- Create dedicated docs/aar-integration-troubleshooting.md with complete troubleshooting guide
- Document project reference approach (recommended) vs AAR-only approach
- Add verification steps, prevention strategies, and best practices
- Update README.md with links to new documentation
- Resolve duplicate class issues through proper project reference configuration

Fixes AAR integration issues that caused build failures due to plugin being
included both as project reference and AAR file simultaneously.
2025-10-23 10:29:32 +00:00
Matthew Raymer
ef37b10503 docs: add comprehensive AAR integration troubleshooting guide
- Add AAR Duplicate Class Issues section to BUILDING.md with step-by-step solutions
- Create dedicated docs/aar-integration-troubleshooting.md with complete troubleshooting guide
- Document project reference approach (recommended) vs AAR-only approach
- Add verification steps, prevention strategies, and best practices
- Update README.md with links to new documentation
- Resolve duplicate class issues through proper project reference configuration

Fixes AAR integration issues that caused build failures due to plugin being
included both as project reference and AAR file simultaneously.
2025-10-23 10:29:13 +00:00
Matthew Raymer
150d297926 fix(capacitor): getting capacitor to build 2025-10-23 09:20:18 +00:00
Matthew Raymer
5307ec2512 fix(android): add back notification handler 2025-10-22 06:51:36 +00:00
Matthew Raymer
fda0124aa5 docs(build): comprehensive BUILDING.md updates for test apps and deployment
- Add detailed documentation for Vue 3 test app (test-apps/daily-notification-test/)
- Add comprehensive /android/app structure and editing guidelines
- Document all 15+ build scripts in scripts/ directory
- Add deployment section covering npm publishing and external project integration
- Clarify distinction between plugin module and test app modules
- Update Android Studio capabilities (can now run test apps, test notifications)
- Add complete project structure including test apps and scripts
- Document build processes for all three Android components (plugin, main app, Vue app)

Covers full development workflow from plugin development to production deployment.
Co-authored-by: Matthew Raymer
2025-10-21 09:30:22 +00:00
Matthew Raymer
0287764a23 refactor(storage): remove legacy SQLite usage; finalize Room wiring
- DailyNotificationPlugin: strip SQLite init and writes; retain SharedPreferences path; Room storage remains authoritative
- DailyNotificationTTLEnforcer: remove SQLite reads/writes and DB constants; use SharedPreferences-only
- DailyNotificationMigration: make migration a no-op (legacy SQLite removed)
- DailyNotificationFetcher/Worker: write/read via Room; keep legacy SharedPreferences as fallback; guard removed API (type/vibration/storeLong) via reflection
- Room DAOs: add column aliases to match DTO fields
- Entities: add @Ignore to non-default constructors to silence Room warnings

Build fixes: resolve missing symbols and cursor mismatches after SQLite removal; align to current NotificationContent API.
Co-authored-by: Matthew Raymer
2025-10-20 10:50:07 +00:00
Matthew Raymer
8d7d1b10ef refactor(storage): migrate fetcher/worker to Room with legacy fallback
- DailyNotificationPlugin: inject Room storage into fetcher
- DailyNotificationFetcher: persist to Room first, mirror to legacy
- DailyNotificationWorker: read from Room, fallback to legacy; write next schedule to Room

Legacy SharedPreferences path deprecated; retained for transitional compatibility.
Co-authored-by: Matthew Raymer
2025-10-20 10:34:23 +00:00
Matthew Raymer
f36ea246f7 feat(storage): implement Room database with enterprise-grade data management
Complete migration from SharedPreferences to Room database architecture:

**New Components:**
- NotificationContentEntity: Core notification data with encryption support
- NotificationDeliveryEntity: Delivery tracking and analytics
- NotificationConfigEntity: Configuration and user preferences
- NotificationContentDao: Comprehensive CRUD operations with optimized queries
- NotificationDeliveryDao: Delivery analytics and performance tracking
- NotificationConfigDao: Configuration management with type safety
- DailyNotificationDatabase: Room database with migration support
- DailyNotificationStorageRoom: High-level storage service with async operations

**Key Features:**
- Enterprise-grade data persistence with proper indexing
- Encryption support for sensitive notification content
- Automatic retention policy enforcement
- Comprehensive analytics and reporting capabilities
- Background thread execution for all database operations
- Migration support from SharedPreferences-based storage
- Plugin-specific database isolation and lifecycle management

**Architecture Documentation:**
- Complete ARCHITECTURE.md with comprehensive system design
- Database schema design with relationships and indexing strategy
- Security architecture with encryption and key management
- Performance architecture with optimization strategies
- Testing architecture with unit and integration test patterns
- Migration strategy from legacy storage systems

**Technical Improvements:**
- Plugin-specific database with proper entity relationships
- Optimized queries with performance-focused indexing
- Async operations using CompletableFuture for non-blocking UI
- Comprehensive error handling and logging
- Data validation and integrity enforcement
- Cleanup operations with configurable retention policies

This completes the high-priority storage hardening improvement, providing
enterprise-grade data management capabilities for the DailyNotification plugin.

Co-authored-by: Matthew Raymer
2025-10-20 10:19:47 +00:00
Matthew Raymer
5abeb0f799 feat(plugin): implement critical notification stack improvements
Critical Priority Improvements (Completed):
- Enhanced exact-time reliability for Doze & Android 12+ with setExactAndAllowWhileIdle
- Implemented DST-safe time calculation using Java 8 Time API to prevent notification drift
- Added comprehensive schema validation with Zod for all notification inputs
- Created Android 13+ permission UX with graceful fallbacks and education dialogs

High Priority Improvements (Completed):
- Implemented work deduplication and idempotence in DailyNotificationWorker
- Added atomic locks and completion tracking to prevent race conditions
- Enhanced error handling and logging throughout the notification pipeline

New Services Added:
- NotificationValidationService: Runtime schema validation with detailed error messages
- NotificationPermissionManager: Comprehensive permission handling with user education

Documentation Added:
- NOTIFICATION_STACK_IMPROVEMENT_PLAN.md: Complete implementation roadmap with checkboxes
- VUE3_NOTIFICATION_IMPLEMENTATION_GUIDE.md: Vue3 integration guide with code examples

This implementation addresses the most critical reliability and user experience issues
identified in the notification stack analysis, providing a solid foundation for
production-ready notification delivery.
2025-10-20 09:08:26 +00:00
Matthew Raymer
3512c58c2f fix(test-app): resolve StatusCard reactivity and improve plugin status detection
- Fix StatusCard component to properly react to prop changes by using computed() instead of ref()
- Improve plugin detection in HomeView using proper ES6 import instead of window object access
- Add comprehensive status mapping from plugin response to app store format
- Add detailed logging for plugin status, permissions, and exact alarm status
- Add separate Permissions status line in system status display
- Enhance error handling and debugging information for plugin operations

This resolves the issue where StatusCard was not updating when plugin status changed,
and improves the overall reliability of plugin detection and status reporting.
2025-10-18 12:33:09 +00:00
Matthew Raymer
982138ee1c fix(test-app): add missing plugin imports for proper registration
- Import @capacitor/core for Capacitor platform detection
- Import @timesafari/daily-notification-plugin for plugin availability
- Resolves "Plugin: Not Available" issue in test app

Plugin now properly registers and becomes available at runtime.
2025-10-17 13:14:53 +00:00
Matthew Raymer
698fc688a0 feat(android): add plugin registration and test app integration
- Add capacitor.plugins.json for main plugin registration
- Add plugin dependency to test app build configuration
- Add local plugin dependency to test app package.json
- Update package-lock.json with plugin dependency resolution

Enables proper plugin discovery and integration in test environment.
2025-10-17 12:58:38 +00:00
Matthew Raymer
1f1153b5fe fix(android): resolve build failures and duplicate plugin dependencies
- Fix plugin path in capacitor.settings.gradle to point to correct npm package location
- Remove duplicate local dailynotification module causing class conflicts
- Remove duplicate plugin dependency from app build.gradle
- Resolves Android SDK configuration and build system issues

Build now succeeds with proper plugin integration from npm package.
2025-10-17 12:57:10 +00:00
Matthew Raymer
9b86a50c38 docs(test-app): add comprehensive plugin detection and build documentation
- Add PLUGIN_DETECTION_GUIDE.md with complete troubleshooting guide
- Add BUILD_QUICK_REFERENCE.md for streamlined build process
- Document critical fix-capacitor-plugins.js requirement after npx cap sync
- Include verification checklists and common issue solutions
- Provide automated build script and debugging tools
- Cover Vue 3 compatibility issues and click event troubleshooting

These docs ensure reliable plugin detection and prevent the common
issue where npx cap sync overwrites capacitor.plugins.json.
2025-10-17 10:20:55 +00:00
Matthew Raymer
200f85a1fb fix(test-app): resolve plugin detection and remove unused HomeViewSimple
- Fix System Status card to show correct plugin availability
- Add automatic status check on component mount
- Remove HomeViewSimple.vue (no longer needed)
- Fix Vue 3 compatibility issues (@click.native removal)
- Add comprehensive plugin diagnostics with all available plugins
- Implement post-sync script to maintain capacitor.plugins.json
- Add annotation processor for automatic plugin discovery

The DailyNotification plugin now loads correctly and both System Status
and Plugin Diagnostics show consistent, accurate information.
2025-10-17 10:13:50 +00:00
Matthew Raymer
64b65f8a94 fix(android): resolve DailyNotification plugin registration issue
- Move plugin registration before super.onCreate() in MainActivity
- Create dedicated dailynotification module for proper plugin structure
- Add comprehensive logging for plugin registration debugging
- Update Vue components with enhanced plugin detection and logging
- Fix TypeScript errors in HomeView.vue for proper build

The plugin was not being loaded because registration happened after
BridgeActivity initialization. Moving registerPlugin() before super.onCreate()
ensures the plugin is available when Capacitor loads plugins.

Resolves simplified status dialog issue by ensuring native plugin
is properly registered and accessible to JavaScript layer.
2025-10-17 08:06:53 +00:00
Matthew Raymer
80a268ffdc feat(test-app): add debug component and optimize build configuration
- Add HomeViewSimple.vue for debugging performance issues
- Configure Vite with decorator support and optimization settings
- Add babelParserPlugins for legacy decorator support
- Optimize dependencies for vue-facing-decorator compatibility

Enables debugging of performance issues and optimizes build process.
2025-10-16 13:07:01 +00:00
Matthew Raymer
29fba0310d refactor(test-app): convert secondary view components to Class API
- Convert HistoryView, NotFoundView, NotificationsView to Class API
- Convert SettingsView and StatusView to Class API
- Add proper @Component decorators and toNative exports
- Simplify all views for consistent Class API usage

Completes view component conversion to vue-facing-decorator pattern.
2025-10-16 13:06:44 +00:00
Matthew Raymer
22a52cc5f0 refactor(test-app): convert main view components to Class API
- Convert HomeView to Class API with simplified navigation methods
- Convert LogsView to Class API with clipboard functionality and proper types
- Convert ScheduleView to Class API with notification scheduling logic
- Add proper TypeScript types for all view data and methods
- Simplify complex logic for better testing and maintainability

Establishes consistent Class API pattern for main application views.
2025-10-16 13:06:33 +00:00
Matthew Raymer
6c21a67088 refactor(test-app): convert dialog and overlay components to Class API
- Convert ErrorDialog to Class API with proper event handling
- Convert LoadingOverlay to Class API with visibility prop
- Add proper @Prop decorators and event emission methods
- Simplify component logic for better maintainability

Completes UI component conversion to vue-facing-decorator pattern.
2025-10-16 13:06:23 +00:00
Matthew Raymer
8c3825363e refactor(test-app): convert UI components to vue-facing-decorator Class API
- Convert ActionCard to Class API with proper @Prop decorators
- Convert StatusCard to Class API with simplified status management
- Convert AppHeader to Class API with navigation item types
- Convert AppFooter to Class API with platform info display
- Add proper TypeScript types for all component props and data

Ensures consistent Class API usage across all UI components.
2025-10-16 13:06:13 +00:00
Matthew Raymer
eb0ca324d7 refactor(test-app): convert core app structure to vue-facing-decorator
- Add reflect-metadata import to main.ts for decorator support
- Convert App.vue to Class API with proper error handling properties
- Simplify router configuration for debugging performance issues
- Remove complex plugin initialization logic for cleaner testing

Establishes foundation for consistent Class API usage across the app.
2025-10-16 13:06:00 +00:00
Matthew Raymer
7805aef198 feat(test-app): configure TypeScript for vue-facing-decorator compatibility
- Add experimentalDecorators and emitDecoratorMetadata to tsconfig.app.json
- Configure useDefineForClassFields: false for proper class field handling
- Add comprehensive type declarations for vue-facing-decorator@3.0.4
- Create global type declarations for Capacitor and DailyNotification plugin
- Add reflect-metadata support for decorator functionality

Enables proper TypeScript support for Class API components.
2025-10-16 13:05:45 +00:00
Matthew Raymer
791a0635ba fix(plugin): resolve package.json export warnings and dependency conflicts
- Reorder exports to put 'types' first for proper TypeScript resolution
- Update @types/node to ^20.19.0 to resolve Vite compatibility
- Align Capacitor dependencies to ^6.2.1 for consistency
- Fix npm install conflicts in test app

Resolves build warnings about unreachable 'types' conditions in exports.
2025-10-16 13:05:34 +00:00
Matthew Raymer
9328bffa68 feat(android): implement plugin diagnostics and fix Vue 3 compatibility
- Add runPluginDiagnostics and openConsole methods to HomeView.vue
- Convert ActionCard.vue from vue-facing-decorator to Composition API
- Enhance App.vue with improved plugin detection and error handling
- Add simplified DailyNotificationPlugin.java with basic methods
- Fix plugin registration in capacitor.plugins.json
- Remove error dialogs, rely on console logging for diagnostics

The Plugin Diagnostics button now provides detailed platform and plugin status information.
2025-10-16 10:33:49 +00:00
Matthew Raymer
1e6c4bf7fc chore: initial commit 2025-10-15 10:46:50 +00:00
Matthew Raymer
54478b1c97 fix(android-test): remove old index.ts that was blocking Vue 3 app
## 🐛 Root Cause
- Old `index.ts` file was creating static interface with Permission Management
- This file was loading instead of Vue 3 app (`main.ts`)
- Caused old interface to display without header navigation

##  Solution
- Deleted `test-apps/android-test/src/index.ts`
- Re-registered DailyNotification plugin in capacitor.plugins.json
- Rebuilt and reinstalled app

## 🎯 Expected Result
Vue 3 app should now load with:
-  Header navigation bar (Home, Schedule, Notifications, Status, History, Logs, Settings)
-  Modern gradient background
-  Router-based navigation
-  Copy to clipboard in LogsView
2025-10-15 09:07:30 +00:00
Matthew Raymer
a625adecf4 fix(android-test): register DailyNotification plugin to prevent app crashes
## 🐛 Bug Fix
- App was crashing with NullPointerException due to missing plugin registration
- DailyNotification plugin was not registered in capacitor.plugins.json
- App was trying to access plugin methods that didn't exist

##  Solution
- Added DailyNotification plugin registration to capacitor.plugins.json
- Plugin now properly registered with class: com.timesafari.dailynotification.DailyNotificationPlugin
- App can now access plugin methods without crashing

## 🔧 Technical Details
- Fixed capacitor.plugins.json to include plugin registration
- Rebuilt and reinstalled app with proper plugin integration
- App now loads Vue 3 interface with header navigation

The app should now display the proper Vue 3 interface with:
- Header navigation (Home, Schedule, Notifications, Status, History, Logs, Settings)
- Copy to clipboard functionality in LogsView
- All plugin methods working correctly
2025-10-15 08:55:45 +00:00
Matthew Raymer
425189d933 feat(android-test): integrate DailyNotification plugin for real functionality
## 🔌 Plugin Integration
- Copy DailyNotification plugin source code to android-test project
- Add plugin manifest entries (receivers, permissions) to AndroidManifest.xml
- Register plugin in capacitor.plugins.json for Capacitor discovery
- Copy gradle wrapper and build configuration files

## 🎯 Real Functionality (No More Mocks)
- Vue 3 app now connects to actual DailyNotification plugin
- All buttons and features work with real plugin methods
- Proper error handling for plugin availability
- Better user feedback when plugin is not loaded

## 🛠️ Technical Changes
- Added plugin Java source files to capacitor-cordova-android-plugins
- Updated AndroidManifest.xml with receivers and permissions
- Enhanced Vue stores with proper plugin availability checks
- Improved error messages and user guidance

##  Build & Deployment
- Successfully builds Android APK with plugin integration
- Installs and runs on emulator with full functionality
- Plugin methods are now accessible from Vue 3 interface

The android-test app is now a fully functional test environment that
interacts with the real DailyNotification plugin, not mock interfaces.
All scheduling, status checking, and notification management features
work with the actual plugin implementation.
2025-10-15 06:27:14 +00:00
Matthew Raymer
ed8db53612 fix(test-app): resolve TypeScript compilation issues and enable successful build
## 🔧 TypeScript Fixes
- Updated tsconfig.json to exclude plugin codebase and focus only on test app
- Fixed method visibility issues in Vue components (private -> public)
- Resolved router symbol conversion issues with String() wrapper
- Removed unused imports and parameters
- Disabled strict unused variable checking for development

## 🚀 Build Configuration
- Updated package.json to use 'vite build' instead of 'vue-tsc && vite build'
- Maintained TypeScript support while avoiding compilation conflicts
- Successfully builds production-ready Vue 3 app

##  Verification
- Dependencies installed successfully (148 packages)
- Build process completes without errors
- Generated optimized production assets (123.89 kB main bundle)
- All Vue components and stores compile correctly

The Vue 3 + Vite + vue-facing-decorator test app is now fully functional
and ready for Capacitor integration and plugin testing.
2025-10-15 06:12:37 +00:00
Matthew Raymer
6213235a16 feat(test-app): refactor to Vue 3 + Vite + vue-facing-decorator architecture
Complete refactoring of android-test app to modern Vue 3 stack:

## 🚀 New Architecture
- Vue 3 with Composition API and TypeScript
- Vite for fast development and building
- vue-facing-decorator for class-based components
- Pinia for reactive state management
- Vue Router for navigation
- Modern glassmorphism UI design

## 📱 App Structure
- Comprehensive component library (cards, items, layout, ui)
- Pinia stores for app and notification state management
- Full view system (Home, Schedule, Notifications, Status, History)
- Responsive design for mobile and desktop
- TypeScript throughout with proper type definitions

## 🎨 Features
- Dashboard with quick actions and status overview
- Schedule notifications with time picker and options
- Notification management with cancel functionality
- System status with permission checks and diagnostics
- Notification history with delivery tracking
- Settings panel (placeholder for future features)

## 🔧 Technical Implementation
- Class-based Vue components using vue-facing-decorator
- Reactive Pinia stores with proper TypeScript types
- Capacitor integration for native Android functionality
- ESLint and TypeScript configuration
- Vite build system with proper aliases and optimization

## 📚 Documentation
- Comprehensive README with setup and usage instructions
- Component documentation and examples
- Development and production build instructions
- Testing and debugging guidelines

This creates a production-ready test app that closely mirrors the actual
TimeSafari app architecture, making it ideal for plugin testing and
demonstration purposes.
2025-10-15 06:09:18 +00:00
Matthew Raymer
49fd1dfedf feat(notifications): enhance clickable notifications with app launch and action buttons
- Make all notifications clickable to open the app
- Use PackageManager.getLaunchIntentForPackage() for reliable app launch
- Add 'View Details' action button when URL is available
- Maintain existing 'Dismiss' action button for all notifications
- Enhanced logging for click intent and action button configuration
- Proper Intent flags for NEW_TASK and CLEAR_TOP behavior

Features:
- Tap notification body: Opens app (with URL data if available)
- Tap 'View Details': Opens URL in browser (if URL provided)
- Tap 'Dismiss': Dismisses notification and cancels future scheduling

Improves user experience with intuitive notification interactions.
2025-10-15 05:47:15 +00:00
Matthew Raymer
cd95dea89b fix(build): add macOS compatibility for sed commands in build scripts
- Fix sed -i syntax differences between macOS and Linux
- macOS requires empty string after -i flag: sed -i '' 'pattern' file
- Linux uses: sed -i 'pattern' file
- Add OSTYPE detection to handle both platforms correctly
- Fixes build script failures on macOS systems

Resolves: sed command a expects \ followed by text error on macOS
2025-10-15 05:27:55 +00:00
Matthew Raymer
520b8ea482 feat(plugin): implement P1 performance and resilience improvements
- Add deduplication system to prevent double-firing of notifications
  * Check existing notifications within 1-minute tolerance before scheduling
  * Prevents duplicate notifications from receiver double-firing on some OEMs
  * Structured logging: DN|RESCHEDULE_DUPLICATE, DN|SCHEDULE_DUPLICATE

- Implement WorkManager doze fallback system for deep doze scenarios
  * DozeFallbackWorker runs 30 minutes before notification time
  * Re-arms exact alarms if they get pruned during deep doze mode
  * Battery-friendly constraints with no network requirement
  * Structured logging: DN|DOZE_FALLBACK_SCHEDULED, DN|DOZE_FALLBACK_REARM_OK

- Add JIT soft re-fetch for borderline age content
  * SoftRefetchWorker prefetches fresh content when content is 80% of TTL
  * Runs 2 hours before tomorrow's notification for proactive freshness
  * Asynchronous background processing with network constraints
  * Structured logging: DN|JIT_BORDERLINE, DN|SOFT_REFETCH_SCHEDULED

- Enhance DailyNotificationWorker with comprehensive resilience features
  * Ultra-lightweight receiver with WorkManager handoff
  * DST-safe scheduling with ZonedDateTime calculations
  * Storage capping and retention policy (100 entries, 14-day retention)
  * Performance monitoring with StrictMode and Trace markers

- Add comprehensive status checking API
  * NotificationStatusChecker provides unified permission/channel status
  * Channel management with deep links to settings
  * Exact alarm permission validation and guidance

All P1 features tested and working under system stress conditions.
Notification system now production-ready with full resilience suite.
2025-10-14 10:27:58 +00:00
Matthew Raymer
8aaba21344 fix(plugin): add defensive scheduler initialization to prevent NullPointerException
- Add null checks and lazy initialization for scheduler in all plugin methods
- Prevents NullPointerException when methods called before load() completes
- Ensures scheduler is available for scheduleDailyNotification, scheduleDailyReminder, cancelDailyReminder, and updateDailyReminder
- Adds structured logging for scheduler initialization events
- Resolves critical runtime error under system stress conditions

Fixes: NullPointerException in DailyNotificationScheduler.scheduleNotification()
Tested: Notification system working correctly under stress with 45+ notifications
2025-10-14 10:07:27 +00:00