feat(journey-editor): JourneyEditor frontend — issue #753 #792

Merged
marcel merged 92 commits from feat/issue-753-journey-editor into feat/issue-750-lesereisen-data-model 2026-06-11 12:07:23 +02:00
Showing only changes of commit 63bc24d2f1 - Show all commits

View File

@@ -43,6 +43,7 @@ let items: JourneyItemView[] = $state(
let titleTouched = $state(false);
let mutationError = $state('');
let liveAnnounce = $state('');
let announceTimer: ReturnType<typeof setTimeout> | null = null;
const titleEmpty = $derived(title.trim().length === 0);
const showTitleError = $derived(titleEmpty && titleTouched);
@@ -138,7 +139,7 @@ async function handleNotePatch(itemId: string, note: string | null) {
const res = await csrfFetch(`/api/geschichten/${geschichte.id}/items/${itemId}`, {
method: 'PATCH',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ note: note ?? undefined })
body: JSON.stringify({ note: note })
});
if (!res.ok) throw new Error('note patch failed');
const updated: JourneyItemView = await res.json();
@@ -156,8 +157,10 @@ async function handleMoveUp(index: number) {
});
await handleReorder(ids);
// Clear so the live region does not re-announce on unrelated DOM mutations
setTimeout(() => {
if (announceTimer) clearTimeout(announceTimer);
announceTimer = setTimeout(() => {
liveAnnounce = '';
announceTimer = null;
}, 500);
}
@@ -172,8 +175,10 @@ async function handleMoveDown(index: number) {
});
await handleReorder(ids);
// Clear so the live region does not re-announce on unrelated DOM mutations
setTimeout(() => {
if (announceTimer) clearTimeout(announceTimer);
announceTimer = setTimeout(() => {
liveAnnounce = '';
announceTimer = null;
}, 500);
}