MCPcopy Create free account
hub / github.com/Noumena-Network/code / shouldClearScreen

Function shouldClearScreen

src/ink/frame.ts:107–126  ·  view source on GitHub ↗
(
  prevFrame: Frame,
  frame: Frame,
)

Source from the content-addressed store, hash-verified

105 * 3. Previous frame screen height exceeded available terminal rows → 'offscreen'
106 */
107export function shouldClearScreen(
108 prevFrame: Frame,
109 frame: Frame,
110): FlickerReason | undefined {
111 const didResize =
112 frame.viewport.height !== prevFrame.viewport.height ||
113 frame.viewport.width !== prevFrame.viewport.width
114 if (didResize) {
115 return 'resize'
116 }
117
118 const currentFrameOverflows = frame.screen.height >= frame.viewport.height
119 const previousFrameOverflowed =
120 prevFrame.screen.height >= prevFrame.viewport.height
121 if (currentFrameOverflows || previousFrameOverflowed) {
122 return 'offscreen'
123 }
124
125 return undefined
126}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected