Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Console history did not stick to bottom on visibility changes #2326

Merged

Conversation

mofojed
Copy link
Member

@mofojed mofojed commented Jan 2, 2025

  • When debugging, I found that the Code block was rendering while the Console tab was in the background (invisible, size 0) so when it did finally render, there was a lot of content added but it wasn't scrolled. By checking sticky bottom when visibility changes, we handle this situtation where content causes a resize while it is invisible
  • Use an IntersectionObserver to detect visibility changes: https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API
  • Tested by running the following:
  1. Run a code snippet to print a bunch of lines, causing the console history to scroll:
for i in range(0, 200):
    print("i is", i)
  1. Run a snippet to create a dashboard, and have a lot of text in the command:
from deephaven import ui

... have lots of blank lines so that it takes up more than a page of scroll space

d = ui.dashboard(ui.panel("Hello"))
  1. Go back to the Console tab, see that it is still scroll to the bottom.

…eephaven#2324)

- When debugging, I found that the `Code` block was rendering while the
Console tab was in the background (invisible, size 0) so when it did
finally render, there was a lot of content added but it wasn't scrolled.
By checking sticky bottom when visibility changes, we handle this
situtation where content causes a resize while it is invisible
- Use an IntersectionObserver to detect visibility changes:
https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API
- Tested by running the following:
1. Run a code snippet to print a bunch of lines, causing the console
history to scroll:
```python
for i in range(0, 200):
    print("i is", i)
```
2. Run a snippet to create a dashboard, and have a lot of text in the
command:
```python
from deephaven import ui

... have lots of blank lines so that it takes up more than a page of scroll space

d = ui.dashboard(ui.panel("Hello"))
```
3. Go back to the Console tab, see that it is still scroll to the
bottom.
- It defaults to instant anyway, for some reason it's a type error on this branch
@mofojed mofojed requested a review from vbabich January 2, 2025 18:36
@mofojed mofojed self-assigned this Jan 2, 2025
- Wasn't in this branch yet
@mofojed mofojed merged commit 259e065 into deephaven:release/v0.78 Jan 3, 2025
8 checks passed
@mofojed mofojed deleted the v0.78-console-scroll-fix-pick branch January 3, 2025 14:25
@github-actions github-actions bot locked and limited conversation to collaborators Jan 3, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants