-
Notifications
You must be signed in to change notification settings - Fork 39
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
182849961 table advance selection #1527
base: main
Are you sure you want to change the base?
Conversation
Adds marquee selection in table. WIP deselect when user reverses drag to make less selection
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1527 +/- ##
==========================================
- Coverage 85.29% 85.13% -0.17%
==========================================
Files 560 560
Lines 27952 28041 +89
Branches 7180 7722 +542
==========================================
+ Hits 23842 23872 +30
- Misses 3954 4013 +59
Partials 156 156
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
codap-v3 Run #4502
Run Properties:
|
Project |
codap-v3
|
Branch Review |
182849961-table-advance-selection
|
Run status |
Passed #4502
|
Run duration | 08m 34s |
Commit |
b410029327: changes the condition to check against for deleting cases
|
Committer | eireland |
View all properties for this run ↗︎ |
Test results | |
---|---|
Failures |
0
|
Flaky |
0
|
Pending |
30
|
Skipped |
0
|
Passing |
221
|
View all changes introduced in this branch ↗︎ |
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.
Overall this is looking good! I looked through much of the code and thought it was fine, then decided to test it. I think it generally works well, but I did have some problems with dragging to select. These all seem to be inconsistencies with v2. I'm not sure how many of these issues need to be addressed, but I think at least the final one should be, which is reproduceable.
- Selection stops working when you drag outside of the collection table. In v2, selection continues to change as you move the mouse up and down anywhere in the document. If you then move the mouse back into the collection table, you can select discontinuous cases. I can imagine this one would be difficult to fix without a major overhaul of how this is set up.
- Dragging up and down, I encountered issues with cases sometimes deselecting incorrectly. Maybe the most obvious example of this was starting in the middle of the table, dragging down, then dragging up above the starting case. Sometimes doing this, the starting case would deselect, while other times it wouldn't. In v2, the starting case never deselects when you scroll past it.
- When you start dragging on a case that's already selected, it becomes deselected and never gets selected. In v2, if you start dragging on an already selected case, that case remains selected.
- The final issue is that if you start dragging on the top case, then drag downwards, then back up to the top, the second case never becomes deselected. So in that case both the top and second case always remain selected.
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.
👍 Keyboard handling looks good. I didn't look too closely at the marquee selection code given @tealefristoe's comments. The traditional way of handling marquee selection is to identify the mouse-down location as the anchor, the current mouse position defines the other corner of a rectangle, and then you select the rows that intersect the rectangle. This avoids any need to track direction of motion and how many times the user may or may not have doubled back on themselves.
@@ -36,7 +36,7 @@ export function useWhiteSpaceClick({ gridRef }: IProps) { | |||
}) | |||
}, [componentRef, data]) | |||
|
|||
const handleWhiteSpaceClick = useCallback(() => { | |||
const clearCurrentSelection = useCallback(() => { |
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.
The reason I named this function handleWhiteSpaceClick
originally is because a name like clearCurrentSelection
implies rather strongly that calling it will clear the selection, but it doesn't actually change the selection under some very important circumstances. If you would like to have access to a function which actually clears the selection, then the clearCaseSelection
function can be exported from this hook in addition to handleWhiteSpaceClick
.
Adds ability to select multiple cases in the table via: