-
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
Upgrade react-table #3095
Upgrade react-table #3095
Conversation
return `[${value.join(', ')}]` | ||
} | ||
|
||
export const buildColumns = ( |
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.
Function buildColumns
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Issues I've found so far:
Screen.Recording.2023-01-19.at.5.40.44.PM.mov
|
|
…code-dvc into upgrade-react-table
🤞🏼 Everything is fixed. Will have another fresh look tomorrow, because I think I might be losing the big picture right now at the end of the day. Feel free to recheck or to wait until I have taken a second look tomorrow. |
export const cellValue = (raw: CellValue) => | ||
isValueWithChanges(raw) ? raw.value : raw | ||
|
||
export const Cell: React.FC<CellContext<Experiment, CellValue>> = cell => { |
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.
Function Cell
has 34 lines of code (exceeds 30 allowed). Consider refactoring.
Thanks, @sroy3 ! I think everything reported above is fixed. Do we plan to review and fix chromatic tests? One more thing that I found (the first column width jumps): Screen.Recording.2023-01-23.at.6.37.14.PM.movBtw, on the resizer. I think it makes sense from the product perspective to show them separate in some cases: Screen.Recording.2023-01-23.at.6.34.50.PM.movThey have a bit different semantics. The group one can change width evenly underneath it. While the cell one at the bottom can change only that cell width. It's not exactly consistent at the moment, but it might be easier to fix it to work that way. WDYT? |
How about resizer lines span all the way to the top (to ancestor columns), but they do not span down to descendant and leaf columns)? I think I can do that and it makes the most sense. If you're resizing a leaf column, the parent columns also resize accordingly. If we resize a parent column, the new size applies to all child columns. This is what this looks like: Screen.Recording.2023-01-24.at.10.07.08.AM.mov |
header: Header<Experiment, unknown> | ||
} | ||
|
||
export const ColumnResizer: React.FC<ColumnResizerProps> = ({ |
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.
Function ColumnResizer
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
I went over pretty much everything this morning and everything is pretty much as it was without any border or misalignment problems. We can see from storybook that the biggest difference is in the placeholders (ancestor column vs leaf column). This is a difference inside of react-table itself and there isn't much we can do about it. Other than that, things move a little bit, but this is expected when changing the layout so much. |
Idea makes total sense to me. Let's do it that way. Not a blocker for merging this if it's approved from the code perspective by @julieg18 and/or @mattseddon . From the video though, I see that it's a bit inconsistent still, right? E.g. when you move the |
It also resizes the |
Okay, makes sense. Let's proceed with this! |
Code Climate has analyzed commit cdd01cc and detected 1 issue on this pull request. Here's the issue category breakdown:
The test coverage on the diff in this pull request is 93.1% (85% is the threshold). This pull request will bring the total coverage in the repository to 96.0% (-0.2% change). View more on Code Climate. |
Closes #2130
Will also fix #2307
Hopefully no use cases were missed.
In the end, if you look at the diff size, the upgrade should be very beneficial code-wise.