feat(tasks) : add delete button to TaskDrawer and toggle timer from TaskCard
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -9,10 +9,11 @@
|
||||
<div class="flex items-start justify-between gap-2">
|
||||
<h4 class="text-sm font-semibold text-neutral-900">{{ task.title }}</h4>
|
||||
<button
|
||||
class="shrink-0 text-neutral-400 hover:text-primary-500"
|
||||
@click.stop="onPlay"
|
||||
class="shrink-0 transition-colors"
|
||||
:class="isTimerOnTask ? 'text-red-500 hover:text-red-600' : 'text-neutral-400 hover:text-primary-500'"
|
||||
@click.stop="isTimerOnTask ? timerStore.stop() : onPlay()"
|
||||
>
|
||||
<Icon name="mdi:play-circle-outline" size="20" />
|
||||
<Icon :name="isTimerOnTask ? 'mdi:stop-circle-outline' : 'mdi:play-circle-outline'" size="20" />
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@@ -62,6 +63,16 @@ const emit = defineEmits<{
|
||||
|
||||
const timerStore = useTimerStore()
|
||||
|
||||
const isTimerOnTask = computed(() => {
|
||||
const entry = timerStore.activeEntry
|
||||
if (!entry?.task) return false
|
||||
const entryTaskId = typeof entry.task === 'string'
|
||||
? entry.task
|
||||
: (entry.task['@id'] ?? entry.task.id)
|
||||
const taskId = props.task['@id'] ?? props.task.id
|
||||
return entryTaskId === taskId || entryTaskId === `/api/tasks/${props.task.id}`
|
||||
})
|
||||
|
||||
function onPlay() {
|
||||
timerStore.startFromTask(props.task)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user