{#if showWorkspacePicker} {/if}
{#if app.config?.current_workspace} {/if}
{#each app.lists as list (list.id)} {/each}
{#if showNewList}
{ if (e.key === "Enter") handleNewList(); if (e.key === "Escape") { showNewList = false; newListName = ""; } }} />
{:else} {/if}
{#if app.isWebdav}
{app.syncing ? "Syncing..." : app.syncStatus === "synced" || app.syncStatus === "idle" ? "Synced" : app.syncStatus === "error" ? "Sync error" : "Offline"}{#if !app.syncing && app.lastSyncResult && (app.lastSyncResult.uploaded > 0 || app.lastSyncResult.downloaded > 0)}  {#if app.lastSyncResult.uploaded > 0}↑{app.lastSyncResult.uploaded}{/if}{#if app.lastSyncResult.uploaded > 0 && app.lastSyncResult.downloaded > 0} {/if}{#if app.lastSyncResult.downloaded > 0}↓{app.lastSyncResult.downloaded}{/if}{/if}
{:else} Local workspace {/if}
{ if (e.key === "Escape") closeDrawer(); }} >
{#if isDesktop}
{#if isWindows} {/if}
{/if}
{#if app.activeListId}
{#if showListMenu} {/if}
{/if} {#if renamingListId === app.activeListId} { if (e.key === "Enter") handleRenameList(); if (e.key === "Escape") renamingListId = null; }} onblur={handleRenameList} autofocus /> {:else}

{app.activeList?.title ?? "Tasks"}

{/if}
{#key app.activeListId} {#if app.lists.length === 0}

No lists yet

Tap the list name above to create one

{:else if !app.activeListId}
Select a list
{:else} {#each app.pendingTasks as task (task.id)}
handleDragStart(e, task.id)} ondragover={(e) => handleDragOver(e, task.id)} ondragend={handleDragEnd} ondrop={(e) => handleDrop(e, task.id)} class="{dragId === task.id ? 'opacity-30' : ''} {dragOverId === task.id && dragId !== task.id ? 'border-t-2 border-t-primary' : ''}" >
{/each} {#if app.pendingTasks.length === 0}
No tasks. Add one below.
{/if} {#if app.completedTasks.length > 0}
{#if completedVisible}
{#each app.completedTasks as task (task.id)} {/each}
{/if} {/if} {/if} {/key}
{#if parentTask} {#key parentTask.id} {/key} {/if}
{#if subtaskDetail} {#key subtaskDetail.id} {/key} {/if}
{ if (e.key === "Escape") closeSettings(); }} >
{ closeSettings(); confirmRemoveWorkspace = id; }} />
{#if confirmDeleteList} (confirmDeleteList = false)} /> {/if} {#if confirmRemoveWorkspace} { const id = confirmRemoveWorkspace; confirmRemoveWorkspace = null; if (id) app.removeWorkspace(id); }} oncancel={() => (confirmRemoveWorkspace = null)} /> {/if} {#if confirmDeleteCompleted} (confirmDeleteCompleted = false)} /> {/if}