Zeige die Einfuegelinie beim Ziehen eines Kapitels nach unten an der Stelle, an der das Kapitel ankommt.
Deploy Development / deploy (push) Successful in 23s
Test Suite / pytest-backend (push) Successful in 1m6s
Test Suite / smoke-dev (push) Successful in 0s
Test Suite / frontend-build (push) Successful in 5s

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
LarsandCursor committed 2026-10-17 12:55:04 +02:00
1 parent 1621a7eb2f
commit 94ef46d8eb
1 file changed
+5 -1
+5 -1
View File
@@ -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 (
<section
key={section.id}
@@ -634,6 +636,7 @@ export function ContentBoard({
data-section={section.id}
data-chapter={section.id === "loose" ? undefined : section.id}
>
{insertBefore ? <div className="insert-line" aria-hidden="true" /> : null}
{section.title ? (
<div
className={movable ? "chapter-head is-movable" : "chapter-head"}
@@ -745,6 +748,7 @@ export function ContentBoard({
})}
{indicator?.sectionId === section.id && indicator?.kind !== "chapter" && indicator.index === section.items.length ? <li className="insert-line" aria-hidden="true" /> : null}
</ol> : null}
{insertAfter ? <div className="insert-line" aria-hidden="true" /> : null}
</section>
);
})