-
Notifications
You must be signed in to change notification settings - Fork 75
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 data menu cutoff in smaller viewers #2630
Fix data menu cutoff in smaller viewers #2630
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2630 +/- ##
=======================================
Coverage ? 90.84%
=======================================
Files ? 162
Lines ? 21140
Branches ? 0
=======================================
Hits ? 19205
Misses ? 1935
Partials ? 0 ☔ View full report in Codecov by Sentry. |
46fa635
to
276b528
Compare
This comment was marked as outdated.
This comment was marked as outdated.
6590146
to
b4acd68
Compare
fdabb2a
to
625800a
Compare
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.
There is a very slight jitter during scroll and the data-menu can appear above the jupyter notebook interface, but I think those are small prices to pay for the benefits that this brings.... and all in a pretty lightweight and clean solution, thanks!
@@ -107,6 +108,7 @@ | |||
</div> | |||
</v-list> | |||
</v-menu> | |||
<div ref="placeholder" :id="'target-' + viewer.id"></div> |
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.
is this ref ever used (I don't see anywhere in the final diff) or just referred to by id (target-viewerid)?
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.
Good catch, and thank you for pointing that out. Initially, my intention was to implement this feature in a Vue-centric way, and the ref on the div was a part of that approach. I will remove the redundant reference in the upcoming commit.
methods: { | ||
onScroll(e) { | ||
const dataMenuHeight = document.getElementById("menu-button").parentElement.getBoundingClientRect().height |
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.
I'm surprised that this doesn't need viewer id as well.... is that just because we currently hardcode the heights of the menus (and therefore they're all the same)?
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.
Absolutely right, the use of a single ID across all viewers stems from their menus having a uniform hardcoded height of 42 px. Initially, I considered directly using the value, but opted for a slightly less coupled approach :)
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.
ok, technically there are still multiple elements with this same ID, and it probably just grabs the first one (right?), but I think that's fine for now since we keep the same height. Might just be worth a comment in-line (either here or where the id is set) in case we ever have different heights per-menu. Or if it's just as easy to append the viewer id in both places, then that is a little more future-proofed.
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.
Seems to work well for me, thanks!
Owee, I'm MrMeeseeks, Look at me. There seem to be a conflict, please backport manually. Here are approximate instructions:
And apply the correct labels and milestones. Congratulations — you did some good work! Hopefully your backport PR will be tested by the continuous integration and merged soon! Remember to remove the If these instructions are inaccurate, feel free to suggest an improvement. |
* Scroll when data menu list gets longer * Add dynamic menu position update - in progress * Menu scrolls with the viewer but location needs update * Sync with the main * Dynamically position the menu with the button * Add a change log * Remove redundant ref * Add unique viewer IDs to buttons for improved specificity (cherry picked from commit 31576fc)
* Scroll when data menu list gets longer * Add dynamic menu position update - in progress * Menu scrolls with the viewer but location needs update * Sync with the main * Dynamically position the menu with the button * Add a change log * Remove redundant ref * Add unique viewer IDs to buttons for improved specificity (cherry picked from commit 31576fc)
* Scroll when data menu list gets longer * Add dynamic menu position update - in progress * Menu scrolls with the viewer but location needs update * Sync with the main * Dynamically position the menu with the button * Add a change log * Remove redundant ref * Add unique viewer IDs to buttons for improved specificity
Description
This pull request fixes the issue of the cut-off data menu in smaller viewers when the list is longer.
Screen.Recording.2023-12-20.at.10.26.09.AM.mov
Fixes #2551
Change log entry
CHANGES.rst
? If you want to avoid merge conflicts,list the proposed change log here for review and add to
CHANGES.rst
before merge. If no, maintainershould add a
no-changelog-entry-needed
label.Checklist for package maintainer(s)
This checklist is meant to remind the package maintainer(s) who will review this pull request of some common things to look for. This list is not exhaustive.
trivial
label.