diff options
| author | Adam Malczewski <[email protected]> | 2026-06-28 20:15:10 +0900 |
|---|---|---|
| committer | Adam Malczewski <[email protected]> | 2026-06-28 20:15:10 +0900 |
| commit | b22c6c6e897fc8ad48c6a21c8034973f40a5f1a1 (patch) | |
| tree | 52a70da66803b687ee684b4e243858e7c8589b0d /src/features | |
| parent | 4d1269a52feefc39113caf3e4148195570e24fb5 (diff) | |
| download | dispatch-web-b22c6c6e897fc8ad48c6a21c8034973f40a5f1a1.tar.gz dispatch-web-b22c6c6e897fc8ad48c6a21c8034973f40a5f1a1.zip | |
fix(tasks): keep fixed 60vh height even with 0 tasks
Diffstat (limited to 'src/features')
| -rw-r--r-- | src/features/surface-host/ui/TodoList.svelte | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/features/surface-host/ui/TodoList.svelte b/src/features/surface-host/ui/TodoList.svelte index 466cc2d..30cdf8f 100644 --- a/src/features/surface-host/ui/TodoList.svelte +++ b/src/features/surface-host/ui/TodoList.svelte @@ -6,10 +6,11 @@ const data = $derived(parseTodoPayload(payload)); </script> -{#if data !== null && data.todos.length > 0} - <!-- Fixed at 60% of the viewport height so a long task list scrolls inside - this region instead of growing the whole sidebar (mirrors the tabs view). --> - <ul class="flex h-[60vh] flex-col gap-1 overflow-y-auto pr-1"> +<!-- Fixed at 60% of the viewport height so the region is consistent whether the + list is empty or overflowing — it always reserves the space and scrolls + internally (mirrors the tabs view). --> +<ul class="flex h-[60vh] flex-col gap-1 overflow-y-auto pr-1"> + {#if data !== null && data.todos.length > 0} {#each data.todos as todo, i (i)} <li class="flex items-start gap-2 rounded-box bg-base-200 px-3 py-2 text-sm"> <!-- Status indicator --> @@ -59,5 +60,7 @@ </span> </li> {/each} - </ul> -{/if} + {:else} + <li class="text-xs opacity-60">No tasks yet.</li> + {/if} +</ul> |
