diff --git a/src/modules/nostr-feed/components/NostrFeed.vue b/src/modules/nostr-feed/components/NostrFeed.vue
index b3dfc22..529b7d7 100644
--- a/src/modules/nostr-feed/components/NostrFeed.vue
+++ b/src/modules/nostr-feed/components/NostrFeed.vue
@@ -107,6 +107,7 @@ const {
startTask,
completeEvent,
unclaimTask,
+ deleteTask,
allCompletions
} = useScheduledEvents()
@@ -301,6 +302,15 @@ async function onUnclaimTask(event: ScheduledEvent, occurrence?: string) {
}
}
+async function onDeleteTask(event: ScheduledEvent) {
+ console.log('🗑️ NostrFeed: Deleting task:', event.title)
+ try {
+ await deleteTask(event)
+ } catch (error) {
+ console.error('❌ Failed to delete task:', error)
+ }
+}
+
// Handle collapse toggle with cascading behavior
function onToggleCollapse(postId: string) {
const newCollapsed = new Set(collapsedPosts.value)
@@ -555,6 +565,7 @@ function cancelDelete() {
@start-task="onStartTask"
@complete-task="onCompleteTask"
@unclaim-task="onUnclaimTask"
+ @delete-task="onDeleteTask"
/>
diff --git a/src/modules/nostr-feed/components/ScheduledEventCard.vue b/src/modules/nostr-feed/components/ScheduledEventCard.vue
index 25d312a..46c188e 100644
--- a/src/modules/nostr-feed/components/ScheduledEventCard.vue
+++ b/src/modules/nostr-feed/components/ScheduledEventCard.vue
@@ -16,7 +16,7 @@ import {
CollapsibleContent,
CollapsibleTrigger,
} from '@/components/ui/collapsible'
-import { Calendar, MapPin, Clock, CheckCircle, PlayCircle, Hand } from 'lucide-vue-next'
+import { Calendar, MapPin, Clock, CheckCircle, PlayCircle, Hand, Trash2 } from 'lucide-vue-next'
import type { ScheduledEvent, EventCompletion, TaskStatus } from '../services/ScheduledEventService'
import { injectService, SERVICE_TOKENS } from '@/core/di-container'
import type { AuthService } from '@/modules/base/auth/auth-service'
@@ -34,6 +34,7 @@ interface Emits {
(e: 'start-task', event: ScheduledEvent, occurrence?: string): void
(e: 'complete-task', event: ScheduledEvent, occurrence?: string): void
(e: 'unclaim-task', event: ScheduledEvent, occurrence?: string): void
+ (e: 'delete-task', event: ScheduledEvent): void
}
const props = withDefaults(defineProps
(), {
@@ -84,6 +85,12 @@ const canUnclaim = computed(() => {
return completion.value.pubkey === currentUserPubkey.value
})
+// Check if current user is the author of the task
+const isAuthor = computed(() => {
+ if (!currentUserPubkey.value) return false
+ return props.event.pubkey === currentUserPubkey.value
+})
+
// Status badges configuration
const statusConfig = computed(() => {
switch (taskStatus.value) {
@@ -150,7 +157,7 @@ const formattedTimeRange = computed(() => {
})
// Action type for confirmation dialog
-const pendingAction = ref<'claim' | 'start' | 'complete' | 'unclaim' | null>(null)
+const pendingAction = ref<'claim' | 'start' | 'complete' | 'unclaim' | 'delete' | null>(null)
// Handle claim task
function handleClaimTask() {
@@ -176,6 +183,12 @@ function handleUnclaimTask() {
showConfirmDialog.value = true
}
+// Handle delete task
+function handleDeleteTask() {
+ pendingAction.value = 'delete'
+ showConfirmDialog.value = true
+}
+
// Confirm action
function confirmAction() {
if (!pendingAction.value) return
@@ -198,6 +211,9 @@ function confirmAction() {
case 'unclaim':
emit('unclaim-task', props.event, occurrence.value)
break
+ case 'delete':
+ emit('delete-task', props.event)
+ break
}
showConfirmDialog.value = false
@@ -239,6 +255,12 @@ const dialogContent = computed(() => {
description: `This will remove your claim on "${props.event.title}" and make it available for others.\n\nHave you communicated to others that you are unclaiming this task?`,
confirmText: 'Unclaim Task'
}
+ case 'delete':
+ return {
+ title: 'Delete Task?',
+ description: `This will permanently delete "${props.event.title}". This action cannot be undone.`,
+ confirmText: 'Delete Task'
+ }
default:
return {
title: '',
@@ -461,6 +483,19 @@ const dialogContent = computed(() => {
+
+
+