From 150df382f8e0b84aa6028622480c28186c99b8a7 Mon Sep 17 00:00:00 2001 From: Sandy Tao Date: Fri, 27 Jun 2025 16:39:54 -0700 Subject: Upgrade to Ink 6 and React 19 (#2096) Co-authored-by: jacob314 --- packages/cli/src/ui/App.tsx | 29 ----------------------------- 1 file changed, 29 deletions(-) (limited to 'packages/cli/src/ui/App.tsx') diff --git a/packages/cli/src/ui/App.tsx b/packages/cli/src/ui/App.tsx index bccba9e6..6bbe47d4 100644 --- a/packages/cli/src/ui/App.tsx +++ b/packages/cli/src/ui/App.tsx @@ -351,18 +351,6 @@ const App = ({ config, settings, startupWarnings = [] }: AppProps) => { // the user starts interacting with the app. enteringConstrainHeightMode = true; setConstrainHeight(true); - - // If our pending history item happens to exceed the terminal height we will most likely need to refresh - // our static collection to ensure no duplication or tearing. This is currently working around a core bug - // in Ink which we have a PR out to fix: https://github.com/vadimdemedes/ink/pull/717 - if (pendingHistoryItemRef.current && pendingHistoryItems.length > 0) { - const pendingItemDimensions = measureElement( - pendingHistoryItemRef.current, - ); - if (pendingItemDimensions.height > availableTerminalHeight) { - refreshStatic(); - } - } } if (key.ctrl && input === 'o') { @@ -530,23 +518,6 @@ const App = ({ config, settings, startupWarnings = [] }: AppProps) => { }; }, [terminalWidth, terminalHeight, refreshStatic]); - useEffect(() => { - if (!pendingHistoryItems.length) { - return; - } - - const pendingItemDimensions = measureElement( - pendingHistoryItemRef.current!, - ); - - // If our pending history item happens to exceed the terminal height we will most likely need to refresh - // our static collection to ensure no duplication or tearing. This is currently working around a core bug - // in Ink which we have a PR out to fix: https://github.com/vadimdemedes/ink/pull/717 - if (pendingItemDimensions.height > availableTerminalHeight) { - setStaticNeedsRefresh(true); - } - }, [pendingHistoryItems.length, availableTerminalHeight, streamingState]); - useEffect(() => { if (streamingState === StreamingState.Idle && staticNeedsRefresh) { setStaticNeedsRefresh(false); -- cgit v1.2.3