Skip to content

armgit / kaneo

Public Imported from GitHub
0

⚡ Project management that doesn't become the project. Boards, Gantt charts, and GitHub integration. Self-host it or use Kaneo Cloud.

622 B
Raw Blame
import type { ProjectWithTasks } from "@/types/project";
import { moveBoardTask } from "../move-task";
import { getVisualTaskPlacement } from "./get-visual-task-placement";
import { moveIntoHoveredColumn } from "./move-into-hovered-column";

export function getPreviewDropPlacement(
  board: ProjectWithTasks,
  activeId: string,
  overId: string,
) {
  const settled =
    moveIntoHoveredColumn(board, activeId, overId) ??
    (overId === activeId
      ? board
      : (moveBoardTask(board, activeId, overId, false, undefined, false)
          ?.project ?? board));
  return getVisualTaskPlacement(settled, activeId);
}