Open-source, secure environment with real-world tools for enterprise-grade agents.
Python agentaiai-agentai-agentscode-interpretercopilotdevelopmentdevtoolsgptgpt-4javascriptllmnextjsopenaipythonreactsoftwaretypescript
Fix logs scrolling
Tomas Valenta6da5d1738470
diff --git a/components/Editor/RouteEditor/PromptEditor.tsx b/components/Editor/RouteEditor/PromptEditor.tsxindex 9deb6d523..a16992bf0 100644--- a/components/Editor/RouteEditor/PromptEditor.tsx+++ b/components/Editor/RouteEditor/PromptEditor.tsx@@ -24,7 +24,11 @@ function PromptEditor({ onChange, block }: Props) {"><EditorContenteditor={editor}- className="w-full h-full outline-none"+ className="+ w-full+ h-full+ outline-none+ "/></div>)diff --git a/components/Editor/Sidebar/Logs/LogStream.tsx b/components/Editor/Sidebar/Logs/LogStream.tsxindex e5056a3a6..56de7fd8a 100644--- a/components/Editor/Sidebar/Logs/LogStream.tsx+++ b/components/Editor/Sidebar/Logs/LogStream.tsx@@ -10,15 +10,30 @@ export interface Props {logs?: Log[]rawLogs?: string | nullonAnswer?: (logID: string, answer: string) => void+ isDeployRequestRunning?: boolean}-function LogStream({ logs, rawLogs, onAnswer }: Props) {+function LogStream({+ logs,+ rawLogs,+ onAnswer,+ isDeployRequestRunning,+}: Props) {const ref = useRef<HTMLDivElement>(null)useEffect(function scrollLogs() {if (!ref.current) return+ if (!isDeployRequestRunning) return+ref.current.scrollIntoView({ behavior: 'smooth' })- }, [logs])+ }, [logs, isDeployRequestRunning])++ useEffect(function scrollLogs() {+ if (!ref.current) return+ if (isDeployRequestRunning) return++ ref.current.scrollIntoView({ behavior: 'auto' })+ }, [logs, isDeployRequestRunning])return (<divdiff --git a/components/Editor/Sidebar/Logs/Thought.tsx b/components/Editor/Sidebar/Logs/Thought.tsxindex c8455bb54..87086a121 100644--- a/components/Editor/Sidebar/Logs/Thought.tsx+++ b/components/Editor/Sidebar/Logs/Thought.tsx@@ -12,7 +12,7 @@ function Thought({return log.content.replaceAll('\nAction:', '').replaceAll('Thought:', '')- .replaceAll('\nFinal Answer:', '')+ .replaceAll('Final Answer:', '').trim()}, [log.content])diff --git a/components/Editor/Sidebar/Logs/index.tsx b/components/Editor/Sidebar/Logs/index.tsxindex 1329bf05c..8e58284ea 100644--- a/components/Editor/Sidebar/Logs/index.tsx+++ b/components/Editor/Sidebar/Logs/index.tsx@@ -28,10 +28,12 @@ const tabsProps = {export interface Props {deployment?: deployments+ isDeployRequestRunning?: boolean}function Logs({deployment,+ isDeployRequestRunning,}: Props) {const [selectedTab, setSelectedTab] = useState(0)const client = useSupabaseClient<Database>()@@ -95,11 +97,13 @@ function Logs({<LogStreamlogs={deployment?.logs as Log[] | undefined}onAnswer={saveAnswer}+ isDeployRequestRunning={isDeployRequestRunning}/>}{selectedTab === 1 &&<LogStreamrawLogs={deployment?.logs_raw}+ isDeployRequestRunning={isDeployRequestRunning}/>}</div>diff --git a/components/Editor/Sidebar/index.tsx b/components/Editor/Sidebar/index.tsxindex 776a8f9d3..13f68c63a 100644--- a/components/Editor/Sidebar/index.tsx+++ b/components/Editor/Sidebar/index.tsx@@ -99,7 +99,6 @@ function Sidebar({className={clsx(`flexbg-white- flexw-fullflex-colmin-h-0@@ -164,6 +163,7 @@ function Sidebar({<Envs /><Logsdeployment={deployment}+ isDeployRequestRunning={isDeployRequestRunning}/></div>)