Skip to content

Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.

TypeScript
826 B
Raw Blame
import type { UiScrollInput } from 'claude-code'

import Limits from '../../limits'
import type PaneState from '../../pane-state'
import Plan from './plan'

/**
 * Whether a scroll is a wheel tick over the docked list block while the
 * list overflows its window: it moves the list then, as ReplDiffSidebar's.
 *
 * @param model the pane's state
 * @param scroll the move: the cell the wheel was over, absent for keys
 * @returns whether the list takes it
 */
export function isWheelOverList(
  model: PaneState.PaneModel,
  scroll: Pick<UiScrollInput, 'pointer'>,
): boolean {
  const plan = Plan.dockPlanOf(model)
  const { listTop, listEnd } = Plan.bodyLayoutOf(model, plan)
  const row = scroll.pointer?.row ?? -1

  return (
    row >= listTop &&
    row < listEnd &&
    plan.rows.length > Limits.MAX_SUMMARY_ROWS
  )
}