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: Input Tables cannot paste more rows than number of visible rows #2152

Merged

Conversation

AkshatJawne
Copy link
Contributor

Resolves #2089

@AkshatJawne AkshatJawne requested a review from mofojed July 17, 2024 14:26
@AkshatJawne AkshatJawne self-assigned this Jul 17, 2024
Copy link

codecov bot commented Jul 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 46.67%. Comparing base (58ee88d) to head (9046ded).
Report is 12 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2152      +/-   ##
==========================================
+ Coverage   46.62%   46.67%   +0.05%     
==========================================
  Files         685      692       +7     
  Lines       38493    38623     +130     
  Branches     9589     9628      +39     
==========================================
+ Hits        17948    18028      +80     
- Misses      20535    20584      +49     
- Partials       10       11       +1     
Flag Coverage Δ
unit 46.67% <100.00%> (+0.05%) ⬆️

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.

Copy link
Member

@mofojed mofojed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A case that's needs the failure case cleaned up: If you copy multiple columns, and then paste in the right-most column you get an error. e.g.

from deephaven import empty_table, input_table
copy_here = empty_table(1000).update(["X=i", "Y=-i"])
paste_here = input_table(init_table=empty_table(1).update(["X=0", "Y=0", "Z=0"]))

Copy from copy_here, then paste in column Z in paste_here. The error thrown is an actually a TypeError, when we should be throwing an error saying the Copy/Paste area are not the same size.

image

Comment on lines 1506 to 1507
(GridRange.rowCount([range]) === tableHeight &&
GridRange.columnCount([range]) === tableWidth)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we checking if row/column count are the full table size? Need to update the comment above this to reflect what we're checking (since it just says if each cell is a single selection).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed - stale check.

packages/grid/src/Grid.tsx Show resolved Hide resolved
@@ -1661,17 +1663,6 @@ class IrisGridTableModelTemplate<
return false;
}

// Editing the aggregations/totals which are floating above/below is not allowed
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As mentioned on our previous call, I think we still need this check - we need to make sure we don't paste and edit the aggregation row. If you have an input table and Add Aggregation, right now you can edit that aggregation row (though it's also not displaying the correct value when placed on the Bottom, which is another bug which should be fixed).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having this check will automatically fail cases where the pasting size is larger, given that the endRow will always be larger than the topRowCount + table size + pendingRowCount -- which is why I had initially opted to remove it, and then after we had spoken, I had tested further, but had not re-added it. With regards, to the aggregation row, is there any other way we can tell if a row is an aggregation row, and then based on that, I can have a check to basically check if the endRow is going beyond the aggregation row?

With regards to the separate bug you identified, as we discussed in call, I had created a seperate ticket for that: #2156

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea in terms of aggregation row we have a bit of a conflict there... it uses floatingBottomRowCount when aggregations are pinned to the bottom, and assumes the aggregations are the last rows in the table; but with these pending rows we actually want an "infinite" number of rows/always able to scroll. One of the downsides of the design of floating rows (as opposed to having it as a separate "table" of data for just the floating rows or something).

I think we'll just need to address that with #2156, but I won't hold it up for this (since the aggregations don't appear correctly already anyway).

@AkshatJawne AkshatJawne requested a review from mofojed July 24, 2024 19:27
@AkshatJawne AkshatJawne merged commit 1d51585 into deephaven:main Jul 29, 2024
11 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Jul 29, 2024
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.

Input Tables cannot Paste More than the Number of Visible Rows
3 participants