{#snippet statusButton(t: Task)} {@const Icon = STATUS_ICON[t.status]}
{/snippet} {#snippet taskRow(t: Task, depth: number)} {@const due = dueState(t)}
  • {@render statusButton(t)}

    {#if t.flagged}{/if} {#if t.priority >= 2}{PRIORITY[t.priority]}{/if} {#if t.dueDate}{dueLabel(t)}{/if} {#if t.reminderAt && isOpen(t)} {reminderLabel(t.reminderAt)}{/if} {#if t.recurrence}{/if} {#each t.tags as tag (tag)}#{tag}{/each} {#if t.goalId} {goalTitle(t.goalId)}{/if}

    {#if t.notes}

    {t.notes}

    {/if}
  • {#each childrenOf[t.id] ?? [] as child (child.id)} {@render taskRow(child, depth + 1)} {/each} {/snippet}

    tasks

    to do
    {counts.todo}
    in progress
    {counts.in_progress}
    done
    {counts.done}
    0}>
    overdue
    {counts.overdue}
    this week
    {counts.week}
    flagged
    {counts.flagged}
    {#each data.areas as a (a.id)}{/each} {#if quickError}{/if}
    {#each STATUS_FILTERS as [value, label] (value)} {/each}
    {#each data.areas as a (a.id)}{/each}
    {#if upcoming.length && statusFilter === 'open' && areaFilter === 'all' && !search}

    Next two weeks

    {/if}
    {#each groups as g (g.key)}

    {g.name}

    {#if g.description}{g.description}{/if}
    {g.done}/{g.total} done
    {#if g.total}{/if}
      {#each expanded[g.key] ? g.tasks : g.tasks.slice(0, PAGE) as t (t.id)}{@render taskRow( t, 0 )}{/each}
    {#if g.tasks.length > PAGE && !expanded[g.key]} {/if}
    {:else}

    No tasks match these filters.

    {/each}

    goals

    {#each data.goals as goal (goal.id)} {@const stats = goalStats(goal)} {@const pct = metricPct(goal)} {:else}

    No goals yet.

    {/each}
    {confirmDelete ? 'Delete task' : editing ? 'Edit task' : 'New task'} Manage a private task. {#if confirmDelete && editing}

    Delete “{editing.title}”{childrenOf[editing.id]?.length ? ' and its subtasks' : ''}? This cannot be undone. (Marking it dropped keeps the history.)

    {#if error}{/if}
    {:else} {#key editing?.id ?? 'new'}
    {#if editing}{/if}