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,
taskLists, addTaskList, renameTaskList, deleteTaskList,
} 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 { formatTimestamp } from "$lib/utils/time.js";
import { BUCKET_COLORS, EFFORT_LABELS, EFFORT_ORDER } from "$lib/utils/constants.js";
@@ -23,21 +26,18 @@
let editingName = $state("");
const buckets = [
{ id: "all", label: "All", icon: "M4 6h16M4 12h16M4 18h16" },
{ 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: "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: "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: "later", label: "Later", icon: "M5 3v18l7-3 7 3V3H5Z" },
{ id: "all", label: "All" },
{ id: "inbox", label: "Inbox" },
{ id: "today", label: "Today" },
{ id: "soon", label: "Soon" },
{ id: "later", label: "Later" },
];
let filteredTasks = $derived.by(() => {
let list = tasks.filter((t) => !t.done);
// Bucket filter
if (activeBucket !== "all") {
list = list.filter((t) => t.bucket === activeBucket);
}
// List filter
if (activeListId !== "all") {
if (activeListId === "inbox") {
list = list.filter((t) => !t.listId);
@@ -45,12 +45,10 @@
list = list.filter((t) => t.listId === activeListId);
}
}
// Search
if (searchQuery.trim()) {
const q = searchQuery.toLowerCase();
list = list.filter((t) => t.text.toLowerCase().includes(q));
}
// Sort
if (sortMode === "quick-first") {
list.sort((a, b) => (EFFORT_ORDER[a.effort] || 4) - (EFFORT_ORDER[b.effort] || 4));
} else if (sortMode === "deep-first") {
@@ -118,7 +116,6 @@
updateTask(taskId, { effort: effort === tasks.find((t) => t.id === taskId)?.effort ? "" : effort });
}
function getListName(listId) {
if (!listId) return null;
return taskLists.find((l) => l.id === listId)?.name || null;
@@ -132,7 +129,6 @@
}
}
// List management
function handleCreateList(e) {
if (e.key === "Enter" && newListName.trim()) {
addTaskList(newListName.trim());
@@ -174,28 +170,25 @@
<div class="flex items-center px-7 pt-6 pb-2">
<div>
<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 class="flex-1"></div>
<button
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}
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">
<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>
<ExternalLink size={14} aria-hidden="true" />
Pop out
</button>
</div>
<!-- Search -->
<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">
<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">
<circle cx="11" cy="11" r="8" />
<path d="M21 21l-4.35-4.35" stroke-linecap="round" />
</svg>
<div class="flex items-center gap-2 bg-bg-input border border-border rounded-lg px-3 py-1.5 focus-within:border-accent"
style="transition-duration: var(--duration-ui)">
<Search size={14} class="text-text-tertiary flex-shrink-0" aria-hidden="true" />
<input
type="text"
class="flex-1 bg-transparent text-[12px] text-text placeholder:text-text-tertiary focus:outline-none"
@@ -211,10 +204,9 @@
<!-- Quick capture -->
<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">
<svg class="w-4 h-4 text-text-tertiary flex-shrink-0" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M12 5v14M5 12h14" stroke-linecap="round" />
</svg>
<div class="flex items-center gap-2 bg-bg-input border border-border rounded-xl px-4 py-2.5 focus-within:border-accent"
style="transition-duration: var(--duration-ui)">
<Plus size={16} class="text-text-tertiary flex-shrink-0" aria-hidden="true" />
<input
type="text"
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">
{#each buckets as bucket}
<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
? 'bg-nav-active text-text font-medium'
: 'text-text-secondary hover:bg-hover hover:text-text'}"
style="transition-duration: var(--duration-ui)"
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}
{#if bucketCounts[bucket.id] > 0}
<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}
aria-label="Sort tasks"
>
<svg class="w-3.5 h-3.5" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M3 6h18M3 12h12M3 18h6" stroke-linecap="round" />
</svg>
<ArrowUpDown size={14} aria-hidden="true" />
{sortMode === "date" ? "" : sortMode === "quick-first" ? "Quick first" : "Deep first"}
</button>
{#if showSortMenu}
@@ -286,8 +274,9 @@
<div class="flex flex-1 min-h-0 px-7 pb-4 gap-3">
<!-- List sidebar -->
<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]'}"
style="transition: width var(--duration-ui)"
>
<!-- Collapse toggle -->
<button
@@ -295,9 +284,11 @@
onclick={() => sidebarCollapsed = !sidebarCollapsed}
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">
<path d="M15 18l-6-6 6-6" stroke-linecap="round" stroke-linejoin="round" />
</svg>
{#if sidebarCollapsed}
<ChevronRight size={12} aria-hidden="true" />
{:else}
<ChevronLeft size={12} aria-hidden="true" />
{/if}
</button>
<!-- List items -->
@@ -388,30 +379,22 @@
<!-- Task list -->
<div class="flex-1 overflow-y-auto min-h-0">
{#if filteredTasks.length === 0}
<div class="flex flex-col items-center justify-center h-full text-center py-12 opacity-60">
<svg class="w-10 h-10 text-text-tertiary mb-3" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5">
<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" />
</svg>
<p class="text-[13px] text-text-secondary">
{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>
<EmptyState
icon={SquareCheck}
message={searchQuery
? "No matching tasks"
: "Add tasks manually. Automatic extraction from your transcripts is coming."}
/>
{:else}
<div class="flex flex-col gap-1">
{#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 -->
<button
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)}
></button>
@@ -422,10 +405,11 @@
<!-- Bucket pills -->
{#each ["today", "soon", "later"] as b}
<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
? `${BUCKET_COLORS[b]} border-current bg-current/10 font-medium`
: 'text-text-tertiary border-transparent hover:border-border-subtle hover:text-text-secondary'}"
style="transition-duration: var(--duration-ui)"
onclick={() => setBucket(task.id, b)}
>{b}</button>
{/each}
@@ -433,10 +417,11 @@
<!-- Effort pills -->
{#each ["quick", "medium", "deep"] as e}
<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
? 'text-accent border-accent/30 bg-accent/10 font-medium'
: 'text-text-tertiary border-transparent hover:border-border-subtle hover:text-text-secondary'}"
style="transition-duration: var(--duration-ui)"
onclick={() => setEffort(task.id, e)}
>{EFFORT_LABELS[e]}</button>
{/each}
@@ -454,12 +439,11 @@
<!-- Delete -->
<button
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)}
>
<svg class="w-4 h-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M18 6L6 18M6 6l12 12" stroke-linecap="round" />
</svg>
<X size={16} aria-hidden="true" />
</button>
</div>
{/each}
@@ -473,23 +457,21 @@
class="flex items-center gap-2 text-[12px] text-text-tertiary hover:text-text-secondary mb-2"
onclick={() => showCompleted = !showCompleted}
>
<svg class="w-3 h-3 transition-transform {showCompleted ? 'rotate-90' : ''}" viewBox="0 0 24 24" fill="currentColor">
<path d="M8 5l8 7-8 7z" />
</svg>
<ChevronRight size={12} class="{showCompleted ? 'rotate-90' : ''}" aria-hidden="true"
style="transition: transform var(--duration-ui)" />
Completed ({completedTasks.length})
</button>
{#if showCompleted}
<div class="flex flex-col gap-1 animate-fade-in">
{#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
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"
onclick={() => uncompleteTask(task.id)}
>
<svg class="w-3 h-3 text-accent" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3">
<path d="M5 12l5 5L20 7" stroke-linecap="round" stroke-linejoin="round" />
</svg>
<SquareCheck size={12} class="text-accent" aria-hidden="true" />
</button>
<div class="flex-1 min-w-0">
<p class="text-[13px] text-text-secondary line-through">{task.text}</p>
@@ -499,12 +481,11 @@
</div>
<button
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)}
>
<svg class="w-4 h-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M18 6L6 18M6 6l12 12" stroke-linecap="round" />
</svg>
<X size={16} aria-hidden="true" />
</button>
</div>
{/each}