Enables marking scheduled events as complete

Implements a feature to mark scheduled events as complete, replacing the checkbox with a button for improved UX.

This commit enhances the Scheduled Events functionality by allowing users to mark events as complete. It also includes:

- Replaces the checkbox with a "Mark Complete" button for better usability.
- Adds logging for debugging purposes during event completion toggling.
- Routes completion events (kind 31925) to the ScheduledEventService.
- Optimistically updates the local state after publishing completion events.
This commit is contained in:
padreug 2025-10-21 22:31:35 +02:00
parent 9b05bcc238
commit 4050b33d0e
5 changed files with 91 additions and 60 deletions

View file

@ -169,10 +169,12 @@ async function onToggleLike(note: FeedPost) {
// Handle scheduled event completion toggle
async function onToggleComplete(event: ScheduledEvent) {
console.log('🎯 NostrFeed: onToggleComplete called for event:', event.title)
try {
await toggleComplete(event)
console.log('✅ NostrFeed: toggleComplete succeeded')
} catch (error) {
console.error('Failed to toggle event completion:', error)
console.error('❌ NostrFeed: Failed to toggle event completion:', error)
}
}
@ -397,8 +399,8 @@ function cancelDelete() {
v-for="event in todaysScheduledEvents"
:key="`${event.pubkey}:${event.dTag}`"
:event="event"
:completion="getCompletion(`31922:${event.pubkey}:${event.dTag}`)"
:get-display-name="getDisplayName"
:get-completion="getCompletion"
:admin-pubkeys="adminPubkeys"
@toggle-complete="onToggleComplete"
/>