import type { ReactNode } from "react" import { useCallback, useState } from "react" import { SegmentedControl } from "../SegmentedControl/SegmentedControl.tsx" import { toClassName } from "../toClassName.ts" import { VisuallyHidden } from "../VisuallyHidden/VisuallyHidden.tsx" import type { BoardLane } from "./BoardLaneList.tsx" import { BoardLaneList } from "./BoardLaneList.tsx" import { describeMove, getIsMoveMeaningful, toSettledIndex, } from "./boardMove.ts" import { useBoardDrag } from "./useBoardDrag.ts" export type BoardMove = { /** Where the card was, in `fromLane.items`. */ fromIndex: number fromLaneKey: string itemKey: string /** * Where it goes, **already corrected for its own removal** — so a * consumer's handler is `splice(fromIndex, 1)` then * `splice(toIndex, 0, item)` with no arithmetic of its own. A * within-lane move quoted against the un-spliced list is one too * high for every position below the origin, and that off-by-one is * the single most common bug in a hand-rolled board. */ toIndex: number toLaneKey: string } export type BoardProps = { className?: string /** * What level the lane headings are. The caller's, because only the * caller knows what the board sits under: a board directly below a * page `