From eb89564aac955a8bbb5df0ed19ce347dfac2d039 Mon Sep 17 00:00:00 2001 From: Niels Geens Date: Fri, 22 Nov 2024 17:43:23 +0100 Subject: [PATCH] autoscroll wip --- web/src/components/App.jsx | 6 +- web/src/components/Sidebar.jsx | 10 +++ web/src/components/editors/BaseEditor.jsx | 35 --------- web/src/components/editors/ContentEditor.jsx | 2 + web/src/components/editors/StandardEditor.jsx | 76 +++++++++++++------ 5 files changed, 67 insertions(+), 62 deletions(-) delete mode 100644 web/src/components/editors/BaseEditor.jsx diff --git a/web/src/components/App.jsx b/web/src/components/App.jsx index dd35769..b7c9b28 100644 --- a/web/src/components/App.jsx +++ b/web/src/components/App.jsx @@ -39,6 +39,7 @@ const App = () => { const [activeTab, setActiveTab] = useState(Tabs.CONTEXT); const [showDiff, setShowDiff] = useState(false); const [showSidebar, setShowSidebar] = useState(false); + const [autoScroll, setAutoScroll] = useState(false); // WebSocket connections const wsRoot = `${window.location.protocol === 'https:' ? 'wss:' : 'ws:'}//${window.location.host}/ws` @@ -239,7 +240,7 @@ const App = () => { originalContent={generatedContext} modifiedContent={modifiedContext} onChange={handleContextEdit} - validationError={null} + autoScroll={autoScroll} /> )} {activeTab === Tabs.RESPONSE && ( @@ -251,7 +252,6 @@ const App = () => { ...prev, [activeLlm]: value }))} - validationError={null} /> )} {activeTab === Tabs.INPUT && ( @@ -276,6 +276,8 @@ const App = () => { activeLlm={activeLlm} llmState={llms[activeLlm]} showDiff={showDiff} + autoScroll={autoScroll} + onAutoScrollChange={(enabled) => setAutoScroll(enabled)} input={input} output={output} autoApproverConfig={autoApproverConfig} diff --git a/web/src/components/Sidebar.jsx b/web/src/components/Sidebar.jsx index 7112063..34e1de7 100644 --- a/web/src/components/Sidebar.jsx +++ b/web/src/components/Sidebar.jsx @@ -11,6 +11,7 @@ export const Sidebar = ({ activeLlm, llmState, showDiff, + autoScroll, input, output, autoApproverConfig, @@ -20,6 +21,7 @@ export const Sidebar = ({ onClearOutput, onLlmChange, onNextLlm, + onAutoScrollChange, onAutoApproverConfigChange, }) => (