This commit is contained in:
beo3000 2026-02-23 17:21:26 +01:00
parent 63a862fd7d
commit 40574ba339
1 changed files with 44 additions and 3 deletions

View File

@ -45,6 +45,9 @@
let confirmDeleteTopic = $state(false); let confirmDeleteTopic = $state(false);
let editingTitle = $state(false); let editingTitle = $state(false);
let titleInput = $state(""); let titleInput = $state("");
let showSnoozeDialog = $state(false);
let snoozeDate = $state("");
let snoozeDateText = $state("");
// Sync collapsed state with global store // Sync collapsed state with global store
$effect(() => { $effect(() => {
@ -84,11 +87,18 @@
} }
function handleSnooze() { function handleSnooze() {
const dateInput = prompt("Datum (YYYY-MM-DD):", "2026-06-01"); snoozeDate = "";
if (!dateInput) return; snoozeDateText = "";
showSnoozeDialog = true;
}
function commitSnooze() {
const date = snoozeDate || snoozeDateText.trim();
if (!date) return;
saveNote(); saveNote();
updateTopic(topic.id, { snoozeUntil: dateInput, status: "snoozed", isNew: false }); updateTopic(topic.id, { snoozeUntil: date, status: "snoozed", isNew: false });
processedTopicIds.add(topic.id); processedTopicIds.add(topic.id);
showSnoozeDialog = false;
} }
function handleDone() { function handleDone() {
@ -271,6 +281,37 @@
{/if} {/if}
</div> </div>
{#if showSnoozeDialog}
<div class="mt-2 rounded border border-[#555] bg-[#2a2a2a] p-3">
<div class="mb-2 text-sm font-semibold text-[#ccc]">Verschieben auf</div>
<div class="flex flex-wrap items-center gap-2">
<input
type="date"
class="rounded border border-[#444] bg-bg px-2 py-1 text-sm text-white"
bind:value={snoozeDate}
oninput={() => (snoozeDateText = "")}
/>
<span class="text-xs text-[#888]">oder</span>
<input
type="text"
placeholder="YYYY-MM-DD"
class="w-32 rounded border border-[#444] bg-bg px-2 py-1 text-sm text-white placeholder-[#666]"
bind:value={snoozeDateText}
oninput={() => (snoozeDate = "")}
onkeydown={(e) => e.key === 'Enter' && commitSnooze()}
/>
<button
class="rounded bg-warning px-3 py-1 text-sm font-bold text-[#222] hover:brightness-110"
onclick={commitSnooze}
>Verschieben</button>
<button
class="rounded bg-[#444] px-3 py-1 text-sm text-white hover:bg-[#555]"
onclick={() => (showSnoozeDialog = false)}
>Abbrechen</button>
</div>
</div>
{/if}
<!-- History --> <!-- History -->
{#if $history?.some((h) => h.text !== 'Thema angelegt.')} {#if $history?.some((h) => h.text !== 'Thema angelegt.')}
<div <div