feat(timer): wire VisualTimer to tasks with notifications and persistence
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,7 +1,13 @@
|
||||
<script>
|
||||
import { getTasks, createTask, completeTask, deleteTask } from '$lib/stores/tasks.svelte.js';
|
||||
const tasks = getTasks();
|
||||
import { ChevronDown } from 'lucide-svelte';
|
||||
import { ChevronDown, Timer } from 'lucide-svelte';
|
||||
|
||||
function startTimer(task, duration = 120) {
|
||||
window.dispatchEvent(new CustomEvent('kon:start-timer', {
|
||||
detail: { id: task.id, text: task.text, duration }
|
||||
}));
|
||||
}
|
||||
|
||||
let { wipLimit = 3 } = $props();
|
||||
|
||||
@@ -55,6 +61,15 @@
|
||||
>
|
||||
</button>
|
||||
<span class="text-[13px] text-text flex-1 min-w-0 truncate">{task.text}</span>
|
||||
<button
|
||||
class="text-text-tertiary hover:text-accent opacity-0 group-hover:opacity-100"
|
||||
style="transition: opacity var(--duration-ui)"
|
||||
onclick={() => startTimer(task)}
|
||||
aria-label="Start 2-minute timer"
|
||||
title="Just start — 2 minutes"
|
||||
>
|
||||
<Timer size={14} aria-hidden="true" />
|
||||
</button>
|
||||
<button
|
||||
class="text-text-tertiary hover:text-danger opacity-0 group-hover:opacity-100 text-[11px]"
|
||||
onclick={() => deleteTask(task.id)}
|
||||
|
||||
Reference in New Issue
Block a user