diff --git a/apps/tauri/src/lib/components/TaskDetailView.svelte b/apps/tauri/src/lib/components/TaskDetailView.svelte index 259dccc..06863d9 100644 --- a/apps/tauri/src/lib/components/TaskDetailView.svelte +++ b/apps/tauri/src/lib/components/TaskDetailView.svelte @@ -87,7 +87,7 @@ + + + - + (showMenu = !showMenu)} class="rounded-lg p-1.5 opacity-50 hover:bg-black/5 hover:opacity-80 dark:hover:bg-white/10" @@ -109,7 +112,20 @@ {#if showMenu} - + + + + {#if isCompleted} + + {:else} + + {/if} + + {isCompleted ? "Restore task" : "Mark as completed"} + {/if} - - - - - - - - {isCompleted ? "Restore task" : "Mark as completed"} - - - {#if showDatePicker} { const _ = task.status; @@ -31,9 +32,12 @@ async function handleToggle(e: MouseEvent) { e.stopPropagation(); + justChecked = true; + await new Promise((r) => setTimeout(r, 300)); transitioning = true; animateInIds.add(task.id); await new Promise((r) => setTimeout(r, 200)); + justChecked = false; await app.toggleTask(task.id); } @@ -53,9 +57,12 @@ if (Math.abs(swipeX) > 100) { swipeX = 0; swiping = false; - transitioning = true; - animateInIds.add(task.id); - setTimeout(() => app.toggleTask(task.id), 200); + justChecked = true; + setTimeout(() => { + transitioning = true; + animateInIds.add(task.id); + setTimeout(() => { justChecked = false; app.toggleTask(task.id); }, 200); + }, 300); return; } swipeX = 0; @@ -105,11 +112,14 @@ - {#if isCompleted} + + {#if isCompleted || justChecked} {/if} + diff --git a/apps/tauri/src/lib/screens/TasksScreen.svelte b/apps/tauri/src/lib/screens/TasksScreen.svelte index 9f8396e..11c9e68 100644 --- a/apps/tauri/src/lib/screens/TasksScreen.svelte +++ b/apps/tauri/src/lib/screens/TasksScreen.svelte @@ -157,6 +157,83 @@ > + + + + + (showWorkspacePicker = !showWorkspacePicker)} + class="flex items-center gap-1.5 rounded-lg px-2 py-1 text-sm font-semibold hover:bg-black/5 dark:hover:bg-white/10" + > + {app.config?.current_workspace ?? "Workspace"} + + + + + {#if showWorkspacePicker} + + + {#each workspaceNames as name} + {@const ws = app.config?.workspaces[name]} + + { app.switchWorkspace(name); showWorkspacePicker = false; }} + class="flex min-w-0 flex-1 items-center gap-2 px-2 py-1.5 text-left {name === app.config?.current_workspace ? 'font-bold' : ''}" + > + {#if name === app.config?.current_workspace} + + + + {/if} + + {name} + {ws?.path ?? ""} + + + + { e.stopPropagation(); wsMenuName = wsMenuName === name ? null : name; }} + class="rounded p-1 opacity-0 transition-opacity group-hover:opacity-40 hover:!opacity-80 {wsMenuName === name ? '!opacity-80' : ''}" + > + + + + + {#if wsMenuName === name} + + { wsMenuName = null; if (confirm(`Remove workspace "${name}"? (Files remain on disk)`)) app.removeWorkspace(name); }} + class="flex w-full items-center gap-2 px-3 py-2 text-left text-sm text-danger hover:bg-black/5 dark:hover:bg-white/10" + > + + + + Delete + + + {/if} + + + {/each} + + { showWorkspacePicker = false; app.setScreen("setup"); }} + class="w-full rounded-md px-2 py-1.5 text-left text-sm text-primary hover:bg-primary/5" + > + + Add workspace + + + + {/if} + + + + {#each app.lists as list (list.id)} @@ -228,93 +305,20 @@ - - - - - (showWorkspacePicker = !showWorkspacePicker)} - class="flex w-full items-center gap-1.5 rounded-lg px-2 py-1.5 text-sm opacity-60 hover:bg-black/5 hover:opacity-100 dark:hover:bg-white/10" - > - - - - {app.config?.current_workspace ?? "Workspace"} - - {#if showWorkspacePicker} - - - {#each workspaceNames as name} - {@const ws = app.config?.workspaces[name]} - - { app.switchWorkspace(name); showWorkspacePicker = false; }} - class="flex min-w-0 flex-1 items-center gap-2 px-2 py-1.5 text-left {name === app.config?.current_workspace ? 'font-bold' : ''}" - > - {#if name === app.config?.current_workspace} - - - - {/if} - - {name} - {ws?.path ?? ""} - - - - { e.stopPropagation(); wsMenuName = wsMenuName === name ? null : name; }} - class="rounded p-1 opacity-0 transition-opacity group-hover:opacity-40 hover:!opacity-80 {wsMenuName === name ? '!opacity-80' : ''}" - > - - - - - {#if wsMenuName === name} - - { wsMenuName = null; if (confirm(`Remove workspace "${name}"? (Files remain on disk)`)) app.removeWorkspace(name); }} - class="flex w-full items-center gap-2 px-3 py-2 text-left text-sm text-danger hover:bg-black/5 dark:hover:bg-white/10" - > - - - - Delete - - - {/if} - - - {/each} - - { showWorkspacePicker = false; app.setScreen("setup"); }} - class="w-full rounded-md px-2 py-1.5 text-left text-sm text-primary hover:bg-primary/5" - > - + Add workspace - - - - {/if} - - - - - - - - - + + + + + + Settings + @@ -339,7 +343,7 @@ - - {app.config?.current_workspace ?? ""} - - {app.activeList?.title ?? "Tasks"} + {app.activeList?.title ?? "Tasks"}
{name}
{ws?.path ?? ""}
- {app.config?.current_workspace ?? ""} -
{app.activeList?.title ?? "Tasks"}