agent: tasks — restyle with WIP limits, manual input

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
jake
2026-03-21 11:04:06 +00:00
parent 85d34f234b
commit 3f69543f73

View File

@@ -4,6 +4,9 @@
tasks, addTask, completeTask, uncompleteTask, deleteTask, updateTask, tasks, addTask, completeTask, uncompleteTask, deleteTask, updateTask,
taskLists, addTaskList, renameTaskList, deleteTaskList, taskLists, addTaskList, renameTaskList, deleteTaskList,
} from "$lib/stores/page.svelte.js"; } from "$lib/stores/page.svelte.js";
import WipTaskList from '$lib/components/WipTaskList.svelte';
import EmptyState from '$lib/components/EmptyState.svelte';
import { SquareCheck, Search, ExternalLink, ChevronLeft, ArrowUpDown, Plus, X, ChevronRight } from 'lucide-svelte';
import Card from "$lib/components/Card.svelte"; import Card from "$lib/components/Card.svelte";
import { formatTimestamp } from "$lib/utils/time.js"; import { formatTimestamp } from "$lib/utils/time.js";
import { BUCKET_COLORS, EFFORT_LABELS, EFFORT_ORDER } from "$lib/utils/constants.js"; import { BUCKET_COLORS, EFFORT_LABELS, EFFORT_ORDER } from "$lib/utils/constants.js";
@@ -23,21 +26,18 @@
let editingName = $state(""); let editingName = $state("");
const buckets = [ const buckets = [
{ id: "all", label: "All", icon: "M4 6h16M4 12h16M4 18h16" }, { id: "all", label: "All" },
{ id: "inbox", label: "Inbox", icon: "M20 12V6a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v6m16 0v6a2 2 0 0 0-2 2H6a2 2 0 0 0-2-2v-6m16 0H4" }, { id: "inbox", label: "Inbox" },
{ id: "today", label: "Today", icon: "M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20Zm0 18a8 8 0 1 1 0-16 8 8 0 0 1 0 16Zm-1-13v5l4.28 2.54.72-1.21-3.5-2.08V7h-1.5Z" }, { id: "today", label: "Today" },
{ id: "soon", label: "Soon", icon: "M17 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2ZM7 7h10M7 11h10M7 15h5" }, { id: "soon", label: "Soon" },
{ id: "later", label: "Later", icon: "M5 3v18l7-3 7 3V3H5Z" }, { id: "later", label: "Later" },
]; ];
let filteredTasks = $derived.by(() => { let filteredTasks = $derived.by(() => {
let list = tasks.filter((t) => !t.done); let list = tasks.filter((t) => !t.done);
// Bucket filter
if (activeBucket !== "all") { if (activeBucket !== "all") {
list = list.filter((t) => t.bucket === activeBucket); list = list.filter((t) => t.bucket === activeBucket);
} }
// List filter
if (activeListId !== "all") { if (activeListId !== "all") {
if (activeListId === "inbox") { if (activeListId === "inbox") {
list = list.filter((t) => !t.listId); list = list.filter((t) => !t.listId);
@@ -45,12 +45,10 @@
list = list.filter((t) => t.listId === activeListId); list = list.filter((t) => t.listId === activeListId);
} }
} }
// Search
if (searchQuery.trim()) { if (searchQuery.trim()) {
const q = searchQuery.toLowerCase(); const q = searchQuery.toLowerCase();
list = list.filter((t) => t.text.toLowerCase().includes(q)); list = list.filter((t) => t.text.toLowerCase().includes(q));
} }
// Sort
if (sortMode === "quick-first") { if (sortMode === "quick-first") {
list.sort((a, b) => (EFFORT_ORDER[a.effort] || 4) - (EFFORT_ORDER[b.effort] || 4)); list.sort((a, b) => (EFFORT_ORDER[a.effort] || 4) - (EFFORT_ORDER[b.effort] || 4));
} else if (sortMode === "deep-first") { } else if (sortMode === "deep-first") {
@@ -118,7 +116,6 @@
updateTask(taskId, { effort: effort === tasks.find((t) => t.id === taskId)?.effort ? "" : effort }); updateTask(taskId, { effort: effort === tasks.find((t) => t.id === taskId)?.effort ? "" : effort });
} }
function getListName(listId) { function getListName(listId) {
if (!listId) return null; if (!listId) return null;
return taskLists.find((l) => l.id === listId)?.name || null; return taskLists.find((l) => l.id === listId)?.name || null;
@@ -132,7 +129,6 @@
} }
} }
// List management
function handleCreateList(e) { function handleCreateList(e) {
if (e.key === "Enter" && newListName.trim()) { if (e.key === "Enter" && newListName.trim()) {
addTaskList(newListName.trim()); addTaskList(newListName.trim());
@@ -174,28 +170,25 @@
<div class="flex items-center px-7 pt-6 pb-2"> <div class="flex items-center px-7 pt-6 pb-2">
<div> <div>
<h2 class="text-xl font-display text-text italic">Tasks</h2> <h2 class="text-xl font-display text-text italic">Tasks</h2>
<p class="text-[11px] text-text-tertiary mt-1">Extracted from transcripts or added manually</p> <p class="text-[11px] text-text-tertiary mt-1">Add tasks manually. Automatic extraction from your transcripts is coming.</p>
</div> </div>
<div class="flex-1"></div> <div class="flex-1"></div>
<button <button
class="flex items-center gap-1.5 btn-md rounded-lg text-text-secondary hover:bg-hover hover:text-text" class="flex items-center gap-1.5 btn-md rounded-lg text-text-secondary hover:bg-hover hover:text-text"
style="transition-duration: var(--duration-ui)"
onclick={popOutTasks} onclick={popOutTasks}
aria-label="Pop out task window" aria-label="Pop out task window"
> >
<svg class="w-3.5 h-3.5" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"> <ExternalLink size={14} aria-hidden="true" />
<path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6M15 3h6v6M10 14L21 3" />
</svg>
Pop out Pop out
</button> </button>
</div> </div>
<!-- Search --> <!-- Search -->
<div class="px-7 pb-2"> <div class="px-7 pb-2">
<div class="flex items-center gap-2 bg-bg-input border border-border rounded-lg px-3 py-1.5 focus-within:border-accent transition-colors"> <div class="flex items-center gap-2 bg-bg-input border border-border rounded-lg px-3 py-1.5 focus-within:border-accent"
<svg class="w-3.5 h-3.5 text-text-tertiary flex-shrink-0" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"> style="transition-duration: var(--duration-ui)">
<circle cx="11" cy="11" r="8" /> <Search size={14} class="text-text-tertiary flex-shrink-0" aria-hidden="true" />
<path d="M21 21l-4.35-4.35" stroke-linecap="round" />
</svg>
<input <input
type="text" type="text"
class="flex-1 bg-transparent text-[12px] text-text placeholder:text-text-tertiary focus:outline-none" class="flex-1 bg-transparent text-[12px] text-text placeholder:text-text-tertiary focus:outline-none"
@@ -211,10 +204,9 @@
<!-- Quick capture --> <!-- Quick capture -->
<div class="px-7 pb-3"> <div class="px-7 pb-3">
<div class="flex items-center gap-2 bg-bg-input border border-border rounded-xl px-4 py-2.5 focus-within:border-accent transition-colors"> <div class="flex items-center gap-2 bg-bg-input border border-border rounded-xl px-4 py-2.5 focus-within:border-accent"
<svg class="w-4 h-4 text-text-tertiary flex-shrink-0" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"> style="transition-duration: var(--duration-ui)">
<path d="M12 5v14M5 12h14" stroke-linecap="round" /> <Plus size={16} class="text-text-tertiary flex-shrink-0" aria-hidden="true" />
</svg>
<input <input
type="text" type="text"
class="flex-1 bg-transparent text-[13px] text-text placeholder:text-text-tertiary focus:outline-none" class="flex-1 bg-transparent text-[13px] text-text placeholder:text-text-tertiary focus:outline-none"
@@ -235,15 +227,13 @@
<nav aria-label="Task filters"> <nav aria-label="Task filters">
{#each buckets as bucket} {#each buckets as bucket}
<button <button
class="flex items-center gap-1.5 btn-md rounded-lg transition-colors class="flex items-center gap-1.5 btn-md rounded-lg
{activeBucket === bucket.id {activeBucket === bucket.id
? 'bg-nav-active text-text font-medium' ? 'bg-nav-active text-text font-medium'
: 'text-text-secondary hover:bg-hover hover:text-text'}" : 'text-text-secondary hover:bg-hover hover:text-text'}"
style="transition-duration: var(--duration-ui)"
onclick={() => activeBucket = bucket.id} onclick={() => activeBucket = bucket.id}
> >
<svg class="w-3.5 h-3.5 {activeBucket === bucket.id ? 'text-accent' : 'text-text-tertiary'}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d={bucket.icon} />
</svg>
{bucket.label} {bucket.label}
{#if bucketCounts[bucket.id] > 0} {#if bucketCounts[bucket.id] > 0}
<span class="text-[10px] px-1.5 py-0.5 rounded-full bg-bg-elevated text-text-tertiary"> <span class="text-[10px] px-1.5 py-0.5 rounded-full bg-bg-elevated text-text-tertiary">
@@ -263,9 +253,7 @@
onclick={() => showSortMenu = !showSortMenu} onclick={() => showSortMenu = !showSortMenu}
aria-label="Sort tasks" aria-label="Sort tasks"
> >
<svg class="w-3.5 h-3.5" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"> <ArrowUpDown size={14} aria-hidden="true" />
<path d="M3 6h18M3 12h12M3 18h6" stroke-linecap="round" />
</svg>
{sortMode === "date" ? "" : sortMode === "quick-first" ? "Quick first" : "Deep first"} {sortMode === "date" ? "" : sortMode === "quick-first" ? "Quick first" : "Deep first"}
</button> </button>
{#if showSortMenu} {#if showSortMenu}
@@ -286,8 +274,9 @@
<div class="flex flex-1 min-h-0 px-7 pb-4 gap-3"> <div class="flex flex-1 min-h-0 px-7 pb-4 gap-3">
<!-- List sidebar --> <!-- List sidebar -->
<div <div
class="flex flex-col bg-bg-elevated rounded-2xl border border-border-subtle overflow-hidden transition-[width] duration-150 class="flex flex-col bg-bg-elevated rounded-2xl border border-border-subtle overflow-hidden
{sidebarCollapsed ? 'w-[40px] min-w-[40px]' : 'w-[160px] min-w-[160px]'}" {sidebarCollapsed ? 'w-[40px] min-w-[40px]' : 'w-[160px] min-w-[160px]'}"
style="transition: width var(--duration-ui)"
> >
<!-- Collapse toggle --> <!-- Collapse toggle -->
<button <button
@@ -295,9 +284,11 @@
onclick={() => sidebarCollapsed = !sidebarCollapsed} onclick={() => sidebarCollapsed = !sidebarCollapsed}
aria-label={sidebarCollapsed ? "Expand list sidebar" : "Collapse list sidebar"} aria-label={sidebarCollapsed ? "Expand list sidebar" : "Collapse list sidebar"}
> >
<svg class="w-3 h-3 transition-transform {sidebarCollapsed ? 'rotate-180' : ''}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"> {#if sidebarCollapsed}
<path d="M15 18l-6-6 6-6" stroke-linecap="round" stroke-linejoin="round" /> <ChevronRight size={12} aria-hidden="true" />
</svg> {:else}
<ChevronLeft size={12} aria-hidden="true" />
{/if}
</button> </button>
<!-- List items --> <!-- List items -->
@@ -388,30 +379,22 @@
<!-- Task list --> <!-- Task list -->
<div class="flex-1 overflow-y-auto min-h-0"> <div class="flex-1 overflow-y-auto min-h-0">
{#if filteredTasks.length === 0} {#if filteredTasks.length === 0}
<div class="flex flex-col items-center justify-center h-full text-center py-12 opacity-60"> <EmptyState
<svg class="w-10 h-10 text-text-tertiary mb-3" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"> icon={SquareCheck}
<path d="M9 11l3 3L22 4M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11" stroke-linecap="round" stroke-linejoin="round" /> message={searchQuery
</svg> ? "No matching tasks"
<p class="text-[13px] text-text-secondary"> : "Add tasks manually. Automatic extraction from your transcripts is coming."}
{searchQuery ? "No matching tasks" />
: activeListId !== "all" && activeBucket !== "all"
? `No ${activeBucket} tasks in ${activeListName}`
: activeListId !== "all"
? `No tasks in ${activeListName}`
: activeBucket === "all" ? "No tasks yet" : `Nothing in ${activeBucket}`}
</p>
<p class="text-[11px] text-text-tertiary mt-1">
{searchQuery ? "Try a different search" : "Tasks are extracted from transcripts or added above"}
</p>
</div>
{:else} {:else}
<div class="flex flex-col gap-1"> <div class="flex flex-col gap-1">
{#each filteredTasks as task (task.id)} {#each filteredTasks as task (task.id)}
<div class="group flex items-start gap-3 p-3 rounded-xl bg-bg-card border border-border-subtle hover:border-border transition-colors"> <div class="group flex items-start gap-3 p-3 rounded-xl bg-bg-card border border-border-subtle hover:border-border"
style="transition-duration: var(--duration-ui)">
<!-- Checkbox --> <!-- Checkbox -->
<button <button
aria-label="Complete task" aria-label="Complete task"
class="mt-0.5 w-[18px] h-[18px] rounded-md border-2 border-border-subtle hover:border-accent flex-shrink-0 flex items-center justify-center transition-colors" class="mt-0.5 w-[18px] h-[18px] rounded-md border-2 border-border-subtle hover:border-accent flex-shrink-0 flex items-center justify-center"
style="transition-duration: var(--duration-ui)"
onclick={() => completeTask(task.id)} onclick={() => completeTask(task.id)}
></button> ></button>
@@ -422,10 +405,11 @@
<!-- Bucket pills --> <!-- Bucket pills -->
{#each ["today", "soon", "later"] as b} {#each ["today", "soon", "later"] as b}
<button <button
class="text-[10px] px-2 py-0.5 rounded-full border transition-colors class="text-[10px] px-2 py-0.5 rounded-full border
{task.bucket === b {task.bucket === b
? `${BUCKET_COLORS[b]} border-current bg-current/10 font-medium` ? `${BUCKET_COLORS[b]} border-current bg-current/10 font-medium`
: 'text-text-tertiary border-transparent hover:border-border-subtle hover:text-text-secondary'}" : 'text-text-tertiary border-transparent hover:border-border-subtle hover:text-text-secondary'}"
style="transition-duration: var(--duration-ui)"
onclick={() => setBucket(task.id, b)} onclick={() => setBucket(task.id, b)}
>{b}</button> >{b}</button>
{/each} {/each}
@@ -433,10 +417,11 @@
<!-- Effort pills --> <!-- Effort pills -->
{#each ["quick", "medium", "deep"] as e} {#each ["quick", "medium", "deep"] as e}
<button <button
class="text-[10px] px-2 py-0.5 rounded-full border transition-colors class="text-[10px] px-2 py-0.5 rounded-full border
{task.effort === e {task.effort === e
? 'text-accent border-accent/30 bg-accent/10 font-medium' ? 'text-accent border-accent/30 bg-accent/10 font-medium'
: 'text-text-tertiary border-transparent hover:border-border-subtle hover:text-text-secondary'}" : 'text-text-tertiary border-transparent hover:border-border-subtle hover:text-text-secondary'}"
style="transition-duration: var(--duration-ui)"
onclick={() => setEffort(task.id, e)} onclick={() => setEffort(task.id, e)}
>{EFFORT_LABELS[e]}</button> >{EFFORT_LABELS[e]}</button>
{/each} {/each}
@@ -454,12 +439,11 @@
<!-- Delete --> <!-- Delete -->
<button <button
aria-label="Delete task" aria-label="Delete task"
class="mt-0.5 text-text-tertiary hover:text-danger opacity-0 group-hover:opacity-100 focus:opacity-100 transition-opacity" class="mt-0.5 text-text-tertiary hover:text-danger opacity-0 group-hover:opacity-100 focus:opacity-100"
style="transition: opacity var(--duration-ui)"
onclick={() => deleteTask(task.id)} onclick={() => deleteTask(task.id)}
> >
<svg class="w-4 h-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"> <X size={16} aria-hidden="true" />
<path d="M18 6L6 18M6 6l12 12" stroke-linecap="round" />
</svg>
</button> </button>
</div> </div>
{/each} {/each}
@@ -473,23 +457,21 @@
class="flex items-center gap-2 text-[12px] text-text-tertiary hover:text-text-secondary mb-2" class="flex items-center gap-2 text-[12px] text-text-tertiary hover:text-text-secondary mb-2"
onclick={() => showCompleted = !showCompleted} onclick={() => showCompleted = !showCompleted}
> >
<svg class="w-3 h-3 transition-transform {showCompleted ? 'rotate-90' : ''}" viewBox="0 0 24 24" fill="currentColor"> <ChevronRight size={12} class="{showCompleted ? 'rotate-90' : ''}" aria-hidden="true"
<path d="M8 5l8 7-8 7z" /> style="transition: transform var(--duration-ui)" />
</svg>
Completed ({completedTasks.length}) Completed ({completedTasks.length})
</button> </button>
{#if showCompleted} {#if showCompleted}
<div class="flex flex-col gap-1 animate-fade-in"> <div class="flex flex-col gap-1 animate-fade-in">
{#each completedTasks as task (task.id)} {#each completedTasks as task (task.id)}
<div class="group flex items-start gap-3 px-4 py-2.5 rounded-xl opacity-50 hover:opacity-70 transition-opacity"> <div class="group flex items-start gap-3 px-4 py-2.5 rounded-xl opacity-50 hover:opacity-70"
style="transition: opacity var(--duration-ui)">
<button <button
aria-label="Uncomplete task" aria-label="Uncomplete task"
class="mt-0.5 w-[18px] h-[18px] rounded-md border-2 border-accent bg-accent/20 flex-shrink-0 flex items-center justify-center" class="mt-0.5 w-[18px] h-[18px] rounded-md border-2 border-accent bg-accent/20 flex-shrink-0 flex items-center justify-center"
onclick={() => uncompleteTask(task.id)} onclick={() => uncompleteTask(task.id)}
> >
<svg class="w-3 h-3 text-accent" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3"> <SquareCheck size={12} class="text-accent" aria-hidden="true" />
<path d="M5 12l5 5L20 7" stroke-linecap="round" stroke-linejoin="round" />
</svg>
</button> </button>
<div class="flex-1 min-w-0"> <div class="flex-1 min-w-0">
<p class="text-[13px] text-text-secondary line-through">{task.text}</p> <p class="text-[13px] text-text-secondary line-through">{task.text}</p>
@@ -499,12 +481,11 @@
</div> </div>
<button <button
aria-label="Delete completed task" aria-label="Delete completed task"
class="mt-0.5 text-text-tertiary hover:text-danger opacity-0 group-hover:opacity-100 focus:opacity-100 transition-opacity" class="mt-0.5 text-text-tertiary hover:text-danger opacity-0 group-hover:opacity-100 focus:opacity-100"
style="transition: opacity var(--duration-ui)"
onclick={() => deleteTask(task.id)} onclick={() => deleteTask(task.id)}
> >
<svg class="w-4 h-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"> <X size={16} aria-hidden="true" />
<path d="M18 6L6 18M6 6l12 12" stroke-linecap="round" />
</svg>
</button> </button>
</div> </div>
{/each} {/each}