Skip to content

Commit

Permalink
fix: Console History Not Scrolling to Bottom (DH-14062) (#1481)
Browse files Browse the repository at this point in the history
I discovered DH-14062 independently and found that this method
occasionally was prematurely returning when the view should stay stuck
to the bottom of the contents.

Sometimes `pane.scrollTop` is sometimes 0.5 less than the expected value
when tailing the content. This `Math.round` bumps it up. I only saw
`xxxxx.0` and `xxxxx.5` values during investigation, but I did not do
any further research on the origin of the value or the rounding error.

Here is a sample groovy snippet that reproduces 100% of the time:
```groovy
import io.deephaven.internal.log.LoggerFactory
log = LoggerFactory.getLogger(Object.class
log.error().append(new RuntimeException()).endl()
t = io.deephaven.engine.util.TableTools.timeTable("PT1s")
```
  • Loading branch information
nbauernfeind authored Sep 8, 2023
1 parent 45e2ada commit 93687a7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/console/src/Console.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,10 @@ export class Console extends PureComponent<ConsoleProps, ConsoleState> {
scrollConsoleHistoryToBottom(force = false): void {
const pane = this.consoleHistoryScrollPane.current;
assertNotNull(pane);
if (!force && pane.scrollTop < pane.scrollHeight - pane.offsetHeight) {
if (
!force &&
Math.abs(pane.scrollHeight - pane.clientHeight - pane.scrollTop) >= 1
) {
return;
}

Expand Down

0 comments on commit 93687a7

Please sign in to comment.