React.useEffect(() => {
// @todo: Only scroll down automatically if the view hasn't been scrolled up by the user yet.
if (logsBottomRef && logsBottomRef.current) {
logsBottomRef.current.scrollIntoView();
}
}, [logs]);
Update (by Joaquim): This is about:
[ ] By default the log viewer shows the logs as they happen, scrolling to the bottom automatically like a terminal view
[ ] If the user scrolls the view up, even the tiniest bit, it should remain showing that portion of the log even if more logs arrive
[ ] If the user scrolls down to the bottom again, then new updates will keep the view at the bottom (i.e. it will show the latest contents)
https://github.com/kinvolk/headlamp/blob/620e79d80c4330a0914ebbb6238b23e27b192efd/frontend/src/components/common/LogViewer.tsx#L62
Update (by Joaquim): This is about: