fix: Use correct offset in snapshot#2217
Merged
mofojed merged 6 commits intodeephaven:mainfrom Sep 12, 2024
Merged
Conversation
- Was using `row.offsetInSnapshot`, which was a "protected" API and recently removed from the JS API - API was removed in JS API refactoring: deephaven/deephaven-core#5890 - Instead just use the viewport `offset` and add the index of the row in the snapshot, which is there in both versions of the API - New API does support `row.index`, but this way is compatible with both - Updated unit tests - Tested using a deephaven.ui.list_view: ```python from deephaven import time_table, ui import datetime initial_row_count = 200 column_types = time_table( "PT1S", start_time=datetime.datetime.now() - datetime.timedelta(seconds=initial_row_count), ).update( [ "Id=new Integer(i)", "Display=new String(`Display `+i)", ] ) @ui.component def ui_list_view_table(): value, set_value = ui.use_state([]) lv = ui.list_view( column_types, aria_label="List View", on_change=set_value, selected_keys=value, ) text = ui.text("Selection: " + ", ".join(map(str, value))) return ui.flex( lv, text, direction="column", margin=10, gap=10, width=500, # necessary to avoid overflowing container height min_height=0, ) lv_table = ui_list_view_table() ```
dgodinez-dh
previously approved these changes
Sep 11, 2024
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main deephaven/web-client-ui#2217 +/- ##
==========================================
- Coverage 46.78% 46.77% -0.01%
==========================================
Files 694 694
Lines 38627 38625 -2
Branches 9659 9780 +121
==========================================
- Hits 18070 18068 -2
+ Misses 20546 20504 -42
- Partials 11 53 +42
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
- Throw if gridLocation is null, removes some unnecessary null checks - Have a little wait after getting the grid location, looks like we think it's loaded before it actually is - There should be a more robust way to do this, this is not the best.
Member
Author
|
e2e tests are failing due to deephaven/deephaven-core#6056 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
row.offsetInSnapshot, which was a "protected" API and recently removed from the JS APIoffsetand add the index of the row in the snapshot, which is there in both versions of the APIrow.index, but this way is compatible with both