From ba8f98db65f4180a85f10e87827bf1b05c97bf17 Mon Sep 17 00:00:00 2001 From: Matthew Raymer Date: Fri, 28 Nov 2025 08:56:06 +0000 Subject: [PATCH] refactor(test-app): remove alarm list UI from test app MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove the 'List Alarms' button and alarm list display functionality from the Android test app UI. This feature was added for testing but is no longer needed as alarm verification is handled by the test scripts. Removed: - '📋 List Alarms' button - alarmListContainer div and alarm list display - loadAlarmList() JavaScript function - getSchedulesWithStatus() API call usage The getSchedulesWithStatus() plugin method remains available for programmatic use if needed in the future. --- .../app/src/main/assets/public/index.html | 86 ------------------- 1 file changed, 86 deletions(-) diff --git a/test-apps/android-test-app/app/src/main/assets/public/index.html b/test-apps/android-test-app/app/src/main/assets/public/index.html index 618650a..5f60ee0 100644 --- a/test-apps/android-test-app/app/src/main/assets/public/index.html +++ b/test-apps/android-test-app/app/src/main/assets/public/index.html @@ -74,14 +74,6 @@ - - -
Ready to test... @@ -393,89 +385,11 @@ } } - function loadAlarmList() { - const status = document.getElementById('status'); - const alarmListContainer = document.getElementById('alarmListContainer'); - const alarmList = document.getElementById('alarmList'); - - status.innerHTML = 'Loading alarm list...'; - status.style.background = 'rgba(255, 255, 0, 0.3)'; // Yellow background - alarmListContainer.style.display = 'block'; - alarmList.innerHTML = 'Loading...'; - - try { - if (!window.DailyNotification) { - status.innerHTML = 'DailyNotification plugin not available'; - status.style.background = 'rgba(255, 0, 0, 0.3)'; // Red background - alarmList.innerHTML = '❌ Plugin unavailable'; - return; - } - - window.DailyNotification.getSchedulesWithStatus({ - kind: 'notify', - enabled: true - }) - .then(result => { - const schedules = result.schedules || []; - - if (schedules.length === 0) { - alarmList.innerHTML = 'No alarms scheduled'; - status.innerHTML = '✅ No alarms found'; - status.style.background = 'rgba(255, 255, 255, 0.1)'; - return; - } - - let html = '
'; - - schedules.forEach(schedule => { - const nextRun = schedule.nextRunAt ? new Date(schedule.nextRunAt) : null; - const nextRunStr = nextRun ? nextRun.toLocaleString() : 'Not scheduled'; - const statusIcon = schedule.isActuallyScheduled ? '✅' : '⚠️'; - const statusText = schedule.isActuallyScheduled ? 'Scheduled in AlarmManager' : 'Not in AlarmManager'; - const statusColor = schedule.isActuallyScheduled ? 'rgba(0, 255, 0, 0.2)' : 'rgba(255, 165, 0, 0.2)'; - - html += ` -
-
- ${statusIcon} ${schedule.id} -
-
- 📅 Next Run: ${nextRunStr} -
-
- ${schedule.cron ? `Cron: ${schedule.cron}` : schedule.clockTime ? `Time: ${schedule.clockTime}` : 'No schedule pattern'} -
-
- Status: ${statusText} -
-
- `; - }); - - html += '
'; - alarmList.innerHTML = html; - - status.innerHTML = `✅ Found ${schedules.length} alarm(s)`; - status.style.background = 'rgba(0, 255, 0, 0.3)'; // Green background - }) - .catch(error => { - alarmList.innerHTML = `❌ Error: ${error.message}`; - status.innerHTML = `Failed to load alarms: ${error.message}`; - status.style.background = 'rgba(255, 0, 0, 0.3)'; // Red background - }); - } catch (error) { - alarmList.innerHTML = `❌ Error: ${error.message}`; - status.innerHTML = `Failed to load alarms: ${error.message}`; - status.style.background = 'rgba(255, 0, 0, 0.3)'; // Red background - } - } - // Attach to window object window.configurePlugin = configurePlugin; window.testNotification = testNotification; window.requestPermissions = requestPermissions; window.checkComprehensiveStatus = checkComprehensiveStatus; - window.loadAlarmList = loadAlarmList; function loadPermissionStatus() { const notificationPermStatus = document.getElementById('notificationPermStatus');