From 94ef46d8ebb9b814a0294319ab7952faef9e77cd Mon Sep 17 00:00:00 2001 From: Lars Date: Sat, 17 Oct 2026 12:55:04 +0200 Subject: [PATCH] Zeige die Einfuegelinie beim Ziehen eines Kapitels nach unten an der Stelle, an der das Kapitel ankommt. Co-authored-by: Cursor --- frontend/src/pages/content.jsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frontend/src/pages/content.jsx b/frontend/src/pages/content.jsx index 2abe832..717f7ec 100644 --- a/frontend/src/pages/content.jsx +++ b/frontend/src/pages/content.jsx @@ -623,10 +623,12 @@ export function ContentBoard({ const chapterIndex = chapters.findIndex((chapter) => chapter.id === section.id); const expanded = !onlyChapter || section.id === onlyChapter; const movable = canMoveChapters && section.id !== "loose"; + const fromIndex = chapters.findIndex((chapter) => chapter.id === draggingId); const classes = ["content-section"]; if (draggingId === section.id) classes.push("is-dragging"); if (!expanded) classes.push("is-collapsed"); - if (indicator?.kind === "chapter" && chapterIndex === indicator.index && draggingId !== section.id) classes.push("is-chapter-target"); + const insertBefore = indicator?.kind === "chapter" && fromIndex > indicator.index && chapterIndex === indicator.index; + const insertAfter = indicator?.kind === "chapter" && fromIndex >= 0 && fromIndex < indicator.index && chapterIndex === indicator.index; return (
+ {insertBefore ?
); })