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 ?
); })