diff --git a/code.png b/code.png new file mode 100644 index 0000000..ed5d4fe Binary files /dev/null and b/code.png differ diff --git a/package-lock.json b/package-lock.json index 50668a4..8f13508 100644 --- a/package-lock.json +++ b/package-lock.json @@ -88,6 +88,10 @@ "webpack-cli": "^5.1.4", "webpack-dev-server": "^4.15.1", "webpack-merge": "^5.9.0" + }, + "engines": { + "node": ">=14.x", + "npm": ">=7.x" } }, "node_modules/@aashutoshrathi/word-wrap": { diff --git a/package.json b/package.json index 31d82fa..916f8b9 100644 --- a/package.json +++ b/package.json @@ -247,7 +247,7 @@ "collective": { "url": "https://opencollective.com/electron-react-boilerplate-594" }, - "devEngines": { + "engines": { "node": ">=14.x", "npm": ">=7.x" }, diff --git a/src/renderer/AppConsole.css b/src/renderer/AppConsole.css index 9c1a577..3c9daa2 100644 --- a/src/renderer/AppConsole.css +++ b/src/renderer/AppConsole.css @@ -15,6 +15,7 @@ margin: 0; margin-bottom: 50px; min-height: 0; + scroll-behavior: smooth; } .AppConsole-message { padding: 2px; diff --git a/src/renderer/AppConsole.tsx b/src/renderer/AppConsole.tsx index d7ef8dd..7767a70 100644 --- a/src/renderer/AppConsole.tsx +++ b/src/renderer/AppConsole.tsx @@ -1,3 +1,4 @@ +import { useRef, useEffect } from 'react'; import AppConsoleMessage from '../common/AppConsoleMessage'; import './AppConsole.css'; @@ -14,9 +15,17 @@ export default function AppConsole({ height: number; messages: AppConsoleMessage[]; }) { + const consoleRef = useRef(null); + + useEffect(() => { + if (consoleRef.current) { + consoleRef.current.scrollTop = consoleRef.current.scrollHeight; + } + }, [messages]); + return (
-
+      
         {messages.map((msg: AppConsoleMessage) => (