docs: add comprehensive static daily reminders documentation

- Add static daily reminders to README.md core features and API reference
- Create detailed usage guide in USAGE.md with examples and best practices
- Add version 2.1.0 changelog entry documenting new reminder functionality
- Create examples/static-daily-reminders.ts with complete usage examples
- Update test-apps README to include reminder testing capabilities

The static daily reminder feature provides simple daily notifications
without network content dependency, supporting cross-platform scheduling
with rich customization options.
This commit is contained in:
Matthew Raymer
2025-10-05 05:12:06 +00:00
parent 9ec30974da
commit f9c21d4e5b
21 changed files with 2120 additions and 0 deletions

View File

@@ -402,6 +402,57 @@
<button id="test-phase4-integration" class="btn-secondary">Test Complete Integration</button>
</div>
</div>
<!-- Static Daily Reminders Testing -->
<div class="ui-section">
<h3>⏰ Static Daily Reminders</h3>
<div class="button-grid">
<button id="schedule-reminder" class="btn-primary">Schedule Daily Reminder</button>
<button id="cancel-reminder" class="btn-primary">Cancel Reminder</button>
<button id="get-reminders" class="btn-primary">Get Scheduled Reminders</button>
<button id="update-reminder" class="btn-primary">Update Reminder</button>
</div>
<div class="form-section">
<h4>Reminder Configuration</h4>
<div class="form-group">
<label for="reminder-id">Reminder ID:</label>
<input type="text" id="reminder-id" value="morning_checkin" placeholder="e.g., morning_checkin">
</div>
<div class="form-group">
<label for="reminder-title">Title:</label>
<input type="text" id="reminder-title" value="Good Morning!" placeholder="Reminder title">
</div>
<div class="form-group">
<label for="reminder-body">Body:</label>
<input type="text" id="reminder-body" value="Time to check your TimeSafari community updates" placeholder="Reminder message">
</div>
<div class="form-group">
<label for="reminder-time">Time (HH:mm):</label>
<input type="text" id="reminder-time" value="09:00" placeholder="09:00">
</div>
<div class="form-group">
<label>
<input type="checkbox" id="reminder-sound" checked> Sound
</label>
<label>
<input type="checkbox" id="reminder-vibration" checked> Vibration
</label>
</div>
<div class="form-group">
<label for="reminder-priority">Priority:</label>
<select id="reminder-priority">
<option value="low">Low</option>
<option value="normal" selected>Normal</option>
<option value="high">High</option>
</select>
</div>
<div class="form-group">
<label>
<input type="checkbox" id="reminder-repeat" checked> Repeat Daily
</label>
</div>
</div>
</div>
<!-- Error Handling Section -->
<div class="ui-section">

View File

@@ -469,6 +469,12 @@ class TimeSafariAndroidTestApp {
document.getElementById('test-endorser-api-client')?.addEventListener('click', () => this.testEndorserAPIClient());
document.getElementById('test-notification-manager')?.addEventListener('click', () => this.testTimeSafariNotificationManager());
document.getElementById('test-phase4-integration')?.addEventListener('click', () => this.testPhase4Integration());
// Static Daily Reminder event listeners
document.getElementById('schedule-reminder')?.addEventListener('click', () => this.scheduleDailyReminder());
document.getElementById('cancel-reminder')?.addEventListener('click', () => this.cancelDailyReminder());
document.getElementById('get-reminders')?.addEventListener('click', () => this.getScheduledReminders());
document.getElementById('update-reminder')?.addEventListener('click', () => this.updateDailyReminder());
}
private async initializeUI(): Promise<void> {
@@ -1116,6 +1122,98 @@ class TimeSafariAndroidTestApp {
this.errorDisplay.showError(error as Error);
}
}
// Static Daily Reminder Methods
private async scheduleDailyReminder(): Promise<void> {
try {
this.log('Scheduling daily reminder...');
const reminderOptions = {
id: (document.getElementById('reminder-id') as HTMLInputElement)?.value || 'morning_checkin',
title: (document.getElementById('reminder-title') as HTMLInputElement)?.value || 'Good Morning!',
body: (document.getElementById('reminder-body') as HTMLInputElement)?.value || 'Time to check your TimeSafari community updates',
time: (document.getElementById('reminder-time') as HTMLInputElement)?.value || '09:00',
sound: (document.getElementById('reminder-sound') as HTMLInputElement)?.checked ?? true,
vibration: (document.getElementById('reminder-vibration') as HTMLInputElement)?.checked ?? true,
priority: (document.getElementById('reminder-priority') as HTMLSelectElement)?.value || 'normal',
repeatDaily: (document.getElementById('reminder-repeat') as HTMLInputElement)?.checked ?? true
};
this.log('Reminder options:', reminderOptions);
await this.plugin.scheduleDailyReminder(reminderOptions);
this.log('✅ Daily reminder scheduled successfully');
this.errorDisplay.showSuccess('Daily reminder scheduled successfully!');
} catch (error) {
this.log('❌ Failed to schedule daily reminder:', error);
this.errorDisplay.showError(error as Error);
}
}
private async cancelDailyReminder(): Promise<void> {
try {
this.log('Cancelling daily reminder...');
const reminderId = (document.getElementById('reminder-id') as HTMLInputElement)?.value || 'morning_checkin';
await this.plugin.cancelDailyReminder(reminderId);
this.log('✅ Daily reminder cancelled successfully');
this.errorDisplay.showSuccess('Daily reminder cancelled successfully!');
} catch (error) {
this.log('❌ Failed to cancel daily reminder:', error);
this.errorDisplay.showError(error as Error);
}
}
private async getScheduledReminders(): Promise<void> {
try {
this.log('Getting scheduled reminders...');
const result = await this.plugin.getScheduledReminders();
this.log('✅ Scheduled reminders retrieved:', result);
if (result.reminders && result.reminders.length > 0) {
this.errorDisplay.showSuccess(`Found ${result.reminders.length} scheduled reminders`);
console.table(result.reminders);
} else {
this.errorDisplay.showInfo('No scheduled reminders found');
}
} catch (error) {
this.log('❌ Failed to get scheduled reminders:', error);
this.errorDisplay.showError(error as Error);
}
}
private async updateDailyReminder(): Promise<void> {
try {
this.log('Updating daily reminder...');
const reminderId = (document.getElementById('reminder-id') as HTMLInputElement)?.value || 'morning_checkin';
const updateOptions = {
title: (document.getElementById('reminder-title') as HTMLInputElement)?.value,
body: (document.getElementById('reminder-body') as HTMLInputElement)?.value,
time: (document.getElementById('reminder-time') as HTMLInputElement)?.value,
sound: (document.getElementById('reminder-sound') as HTMLInputElement)?.checked,
vibration: (document.getElementById('reminder-vibration') as HTMLInputElement)?.checked,
priority: (document.getElementById('reminder-priority') as HTMLSelectElement)?.value,
repeatDaily: (document.getElementById('reminder-repeat') as HTMLInputElement)?.checked
};
this.log('Update options:', updateOptions);
await this.plugin.updateDailyReminder(reminderId, updateOptions);
this.log('✅ Daily reminder updated successfully');
this.errorDisplay.showSuccess('Daily reminder updated successfully!');
} catch (error) {
this.log('❌ Failed to update daily reminder:', error);
this.errorDisplay.showError(error as Error);
}
}
}
// Initialize app when DOM is ready