-
Notifications
You must be signed in to change notification settings - Fork 12
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
Introduce group-level selection and navigation for table #140
Conversation
- Disable row and cell navigation and selection - Introduce custom selection and navigation handling based on groups - Select a group by hitting 'Enter' - Edit a group by hitting 'Space' (only available for data groups) - Support copying data from the groups using Ctrl+C and Ctrl+X - Only allow single selection for now
f49f2ec
to
d345e2c
Compare
I'll take a thorough look at this tomorrow |
Some usability observations first of all: Tentative SelectionThe 'tentative' selection state (orange outline) is a bit confusing. The 'full' selection state available after Keyboard NavigationKeyboard navigation is broken when data is missing in one column: Navigation works here: Because the variable column is populated But I can't get to the ASCII column from the data column in these rows: because there's nothing in the Variables column here, and the logic assumes it will only jump one column. Shift SelectionSince we're allowing selection + copy, it would be nice to be able to use shift selection to select e.g. multiple groups or an entire row for copying. |
Thanks, @martin-fleck-at !
Styling issues which might have been there before, only spotted them now. Probably better to tackle via separate issue if no regressions:
|
Thank you for the review @jreineckearm and @colin-grant-work! I'll have a closer look at this tomorrow but just to clarify some things.
This sounds like you want no highlighting of the currently focus cell (orange outline), is that right? I could imagine that might be quite confusing if you navigate more than one or two cells further. What exactly is confusing or maybe I'm not fully understanding your remark.
Good catch! We need to check how far we can actually get to the right instead of giving up just after one jump I guess.
I'll check how much effort this might be since supporting the shift selection also kind of implies multi-select which in turn also implies the support of Ctrl+click selection of non-adjacent cell. Maybe it is quite straight-forward but if it is not, I might suggest pulling this out into a separate issue. What is your opinion of multi-select behavior @jreineckearm?
That seems like a reasonable enough request, I'll check how fast I can implement this and how it feels. I assume this shall only be available on single-select then, is that right? Just trying to consolidate the feedback ;-)
Interesting, I thought I had fixed that but will definitely double-check.
Yeah, that might make sense.
Will need to check on those, hopefully not too much work anyway. |
I think the confusion is that, while you refer to it as the 'the currently focused cell,' it doesn't behave as though it's the current focus: additional action is necessary to turn it blue, and so make it the actual focus. While it's orange, no action seems to apply to it: copy targets blue cells, editing turns the cell blue, etc. I'm not sure if part of the implementation is based on the Theia extension's behavior. In that case, selection applied only to data columns, and there were only two selection states, highlighted (orangish) but not editing and editing. In this implementation, there are three selection states for data column groups, orange, blue but not editing, and editing, and two for everything else, orange and blue. I think in both cases, it's one state too many.
I'd suggest that a lot of the index passing (row index, column index, group index) that the new code introduced may be off the mark. If we need to be dynamic anyway to account for the possibility of missing data (vertically, as well - variables can be sparse in the vertical direction), a combination of |
- Improve keyboard navigation to skip over non-existing groups - Copy should always use the focused group and not the selected one - Fix issue of losing focus when submitting a data edit - Support pasting values in data cells without going into edit mode - Improve styling in all themes -- Avoid orange focus outline and use same as tree for visibility -- Selected cells get their colors overwritten -- Slightly increase padding between two data groups
8431a65
to
eb2d8b3
Compare
@jreineckearm @colin-grant-work I pushed an update that addresses some of your concerns:
While I re-implemented the navigation with no data attributes, I did not yet remove the data attributes of the groups because I still believe they are useful, e.g., when restoring focus after an operation. If you agree, I'd rather move multi selection out into a separate issue/PR. I think with the new styling changes maybe the confusion about the states is mostly removed. I tried to mimic what is happening in the VS Code tree (e.g., file tree), where you have selection and can then start to navigate using the arrow keys while the "old" selection is still highlighted. However, as rightfully pointed out by Colin, any operations should target the focused cell and not the selected cell so copy is now handled on that level. |
Tested it on macOS:
|
@arekzaluski Thank you for your feedback! Indeed, under MacOS the events need to be handled a bit differently due to the |
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.
LGTM. Thank You for a fix. It works correctly now. I can copy and paste on macOS in non-edit mode.
The only issue I found is that copy and paste does not work in edit mode on macOS.
@arekzaluski Very curious, I cannot reproduce this on Linux and as far as I can see we do rely on the InputText from PrimeReact for that. We do stop propagation of the event but it should still be handled I believe. Maybe we should create a separate task for it. @colin-grant-work Do you want to have another look at it or are you good with the changes so far? |
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.
@martin-fleck-at Thank you very much Martin! Looks and works great for me.
@colin-grant-work Please feel free to reopen an issue, if you have any remaining concerns on this change.
What it does
Introduce group-level selection and navigation for table
Relates to #106 but does not include quick navigation up and down with PageUp/PageDown/Home/End/etc keys.
How to test
Review checklist
Reminder for reviewers