MCPcopy Index your code
hub / github.com/callstack/agent-device / formatScrollEdgeMessage

Function formatScrollEdgeMessage

src/utils/scroll-edge-state.ts:119–133  ·  view source on GitHub ↗
(
  direction: ScrollDirection,
  edge: ScrollEdge | undefined,
  passes: number,
  amount: number | undefined,
  pixels: number | undefined,
)

Source from the content-addressed store, hash-verified

117}
118
119export function formatScrollEdgeMessage(
120 direction: ScrollDirection,
121 edge: ScrollEdge | undefined,
122 passes: number,
123 amount: number | undefined,
124 pixels: number | undefined,
125): string {
126 if (edge && passes === 0) {
127 return `Already at ${edge}; no hidden content ${edge === 'bottom' ? 'below' : 'above'} detected`;
128 }
129 if (edge) return `Scrolled to ${edge} with ${passes} ${direction} passes`;
130 if (pixels !== undefined) return `Scrolled ${direction} by ${pixels}px`;
131 if (amount !== undefined) return `Scrolled ${direction} by ${amount}`;
132 return `Scrolled ${direction}`;
133}
134
135function buildScrollEdgeVerificationError(
136 edge: ScrollEdge,

Callers 2

scrollCommandFunction · 0.90
handleScrollCommandFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected