Skip to content

armgit / cindy

Public Imported from GitHub
0

Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。

691 B
Raw Blame
/**
 * Keep task-switch prefetch limited to an intentional mouse primary click on
 * an inactive, non-editing row. Touch scrolling and modifier clicks belong to
 * navigation/selection gestures, while secondary buttons inside a row stop
 * propagation before reaching the row.
 */
export function shouldPrefetchSessionOnPointerDown(
  event: Pick<
    PointerEvent,
    'button' | 'pointerType' | 'shiftKey' | 'metaKey' | 'ctrlKey'
  >,
  opts: { isActive: boolean; isEditing: boolean },
): boolean {
  return (
    !opts.isActive &&
    !opts.isEditing &&
    event.pointerType === 'mouse' &&
    event.button === 0 &&
    !event.shiftKey &&
    !event.metaKey &&
    !event.ctrlKey
  );
}