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 #2324

Merged
merged 6 commits into from
Jan 2, 2025

Conversation

mofojed
Copy link
Member

@mofojed mofojed commented Dec 30, 2024

  • 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.

- Wait for server log messages to come in before running scroll tests
@mofojed mofojed self-assigned this Dec 30, 2024
Copy link

codecov bot commented Dec 30, 2024

Codecov Report

Attention: Patch coverage is 52.38095% with 10 lines in your changes missing coverage. Please review.

Project coverage is 46.71%. Comparing base (9d6719a) to head (a67797b).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
packages/console/src/Console.tsx 47.36% 10 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2324   +/-   ##
=======================================
  Coverage   46.71%   46.71%           
=======================================
  Files         704      704           
  Lines       39013    39031   +18     
  Branches     9932     9937    +5     
=======================================
+ Hits        18224    18234   +10     
+ Misses      20778    20743   -35     
- Partials       11       54   +43     
Flag Coverage Δ
unit 46.71% <52.38%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mofojed mofojed requested a review from vbabich December 30, 2024 20:38
vbabich
vbabich previously approved these changes Dec 30, 2024
- Instead of using a timeout, just wait for the element to be attached. Should be more reliable
vbabich
vbabich previously approved these changes Dec 31, 2024
- Check if the content or the scroll pane are resized at all. If either of them resize, verify we're at the bottom
@mofojed mofojed merged commit ca5f6cd into deephaven:main Jan 2, 2025
11 checks passed
@mofojed mofojed deleted the console-visibility-scroll-fix branch January 2, 2025 16:45
@github-actions github-actions bot locked and limited conversation to collaborators Jan 2, 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