-
Notifications
You must be signed in to change notification settings - Fork 29
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
Make plots ribbon sticky on scroll #2759
Conversation
3522711
to
29d711e
Compare
354f9cc
to
1062145
Compare
@@ -1,4 +1,5 @@ | |||
.webviewWrapper { | |||
width: 100%; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changing this to min-content
would solve the following bug:
Screen.Recording.2022-11-14.at.8.58.31.AM.mov
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically, this bug is in main and not part of this pr. Could be fixed separately :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is more apparent with a sticky banner though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks @sroy3, good catch. The fix proposed changes the whole UX in a way that we probably don't want. Instead of the ribbon taking always size of the viewport only and overflowing items, it's now taking the whole space (defined by the most wide plot). I'm not sure this is a good idea. Also, plots size control will move to the edge if we do it this way
I can find a way to fill the space with something, but the whole layout might change after the #2747 and further changes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right, it is not as simple as that a change. What I'd do is make the ribbon 100%
and create a div inside (ribbon-content or something else) and give it a width of 100vw
(might have to calculate padding in there).
But yeah once #2585 is completely done, we shouldn't have horizontal scrollbars for the whole webview.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's skip it for now and get back to it after #2585 is done then
top: 0; | ||
width: 100%; | ||
z-index: 100; | ||
background-color: var(--vscode-editor-background); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
variable $bg-color
maps to var(--vscode-editor-background)
. We try to only use scss variables (easier to use and understand).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work!
36f914f
to
cfd8330
Compare
Code Climate has analyzed commit cfd8330 and detected 0 issues on this pull request. The test coverage on the diff in this pull request is 100.0% (85% is the threshold). This pull request will bring the total coverage in the repository to 96.7% (0.0% change). View more on Code Climate. |
Closes #2731
Screen.Recording.2022-11-11.at.6.46.11.PM.mov
(writing it here primarily for the sake of future generation wondering how to use intersection observer API /
react-intersection-observer
to handle top nav bar / menu that changes its size):rootMargin
can be used to offset the root / parent element to the height of the menu. It works well if menu / nav bar height is stable. But would require creating a new observer when / if size changes. It breaks the point of using it and complicates code, etc, etc. See also Allow dynamically changing rootMargin w3c/IntersectionObserver#428threshold
is 1 or close to that)I was not able to make 1.0 threshold work (some pixels are not visible in the sticky mode?), but it work well with 0.95-0.99, etc.