-
Notifications
You must be signed in to change notification settings - Fork 93
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
Fixes keyboard navigation in Ktable #900
base: develop
Are you sure you want to change the base?
Conversation
Hi @Pandaa007, thank you! I appreciate your critical and pro-active mindset, and it is true these improvements are needed. However I'd recommend to check on proposed changes that are out of scope beforehand in the issue comment with the team. Unfortunately, we won't be able to accept everything. Some of the extra issues you took on are already addressed and reviewed, and only wait for final QA here:
I'd recommend you only keep changes directly related to #883. We're a bit behind on QA but I hope we can merge all pre-existing |
Thanks @MisRob for the review. Totally my bad as I wasn't aware that these problems of refactoring and keyboard navigation were already being worked upon by other contributors, and thus felt that I might adress them here itself. As per your advice, I'd like to wait for them to be merged to the codebase first and then make my changes on top of them! Would really appreciate a tag whenever the same are merged and I can start working again on it. Thanks :) |
Thanks for your understanding @Pandaa007. I will make sure to let you know when it's time to rebase. |
Hi @Pandaa007, we're close to having everything ready for you. I will follow-up hopefully next week. |
Hi @Pandaa007, we've just merged
and I assume that #883 will still be valid but let' see. |
Hi @MisRob! Thanks for the heads-up. I had checked out the latest changes and noted that the same playground example that I was using to test the navigation was not working correctly with the current code. It was most probably due to not handling the I have updated the PR with the changes so that the example functions well again, as well tried to pull out some of the stuff that was inlined before to sepearate functions for better maintainability. I have also seperated out the code for forward and backward tab navigation, as it allows us to make some minor improvements in performace (like while forwarding navigating with tab, if we are at the end of the focusable elements in the current cell, we do not need to query all the focusable elements of the next cell, and can directly just focus on the next cell itself!) I would love to hear the views of the team on these changes. Thanks! |
Hi @Pandaa007, would you be able to update the PR description with the changes you described in the latest comment and the recordings of the latest issues you mention? I think it would help us to orient ourselves. Thank you. |
@MisRob I have updated the same with detailed descriptions of the changes as well as before & after videos! Please let me know if any more modifications are needed! |
Thank you @Pandaa007, that's helpful. @BabyElias this is another chunk of work on your |
Thanks for the heads up @MisRob, will have a look at it :) |
Thank you @BabyElias, as always. There's no time pressure around this work, so any time you can - this review will take a while. |
@Pandaa007, thank you for working on this issue!
I think these can also be noticed in the video samples that you have attached in the PR description. |
Thank you @BabyElias. @Pandaa007 since the refactor as a whole has some important regressions, I'd recommend to separate this work into two parts. The first one would be solely for #883. After that, if you'd still like to do further improvements, we can consider. This will make it easier for everyone to understand the source of these regressions, and help us to focus on the bug we need to fix and which has much higher priority than further internal refactors. |
This will also help the review process since it seems there will be some things to look into deeper here - |
Hi @BabyElias. Thanks for your review. I actaully tried to setup Thanks for your time! |
@Pandaa007, it might take some time before I am able to send the video here. Just for reference uptil then, the current.mp4 file that you have added in the PR description- these can be noticed there as well. The light grey color bg that appears all over the row cell which is active, and the corresponding column header cell is not happening for the first cell of each row or when shift+tab key is used. |
Ahh okay! Got it. Completely missed that part. I will look into fixing the same. Thanks for the review! Also just for reference, is this the correct table which you had earlier mentioned in your comment? classes.mp4 |
Yes, this is the table I am talking about. But for noticing your KDS changes in Kolibri, you need to run Kolibri with your local KDS repo. The command to do so is |
Thanks for the guidance @BabyElias. I wasn't aware about the classes-updated.mp4pg-updated.mp4I have attached the demo for both the playground the earlier mentioned table. Hope that this is the functionlity that we looking for! I have updated the video demo's in the PR description as well, so that it makes for easier review. I wanted to take @MisRob's advice of separating out the work into two PRs, but I feel that tracking down the exact source of the bug is actually much more cumbersome that refactoring the table internals into clean functions (to reduce inlining). I have mostly followed the original implementation, but just make it more conscise with the help of utilities. I hope that would be okay for this PR. Please let me know if you have any more suggestions on the same. |
Hi @Pandaa007
Sounds fine - take my words as recommendations in case it would actually be helpful, and no problem to leave it aside when it's not. I am glad to have @BabyElias to coordinate with you as fits best since she's the main reviewer of this work now :) |
The changes look good to me, functionality is working as expected and the Shift+Tab key nav doesn't get stuck anymore :) On a side note - I did work with the playground code provided here, and noticed something that might be worth working on (not as a part of this issue, but maybe a follow-up). The checkbox as a part of KTable is focusable, but on pressing the enter key - it's not toggled as such (i.e originally, checkboxes are meant to toggle state as checked and unchecked upon pressing the enter key but that does not happen here). If you are interested in working on this @Pandaa007, I'll create an issue for the same and assign it to you, or maybe you can raise an issue yourself and start working on it. Apart from this, talking about a wider scope of work - I was thinking that the code for checking focusable elements within a cell and their subsequent navigation could be refactored within KTableGridItem itself rather than KTable. This would help us continue ensuring the separation of responsibilities between KTable and KTableGridItem, making tracking of bugs easier in the future and also, allowing us to incorporate more functionalities easily when needed. This might require major refactor and number of considerations to be made, so not suggesting that we do it immediately - but for future references, I thought it would be good to put it out here, |
Thanks a lot for the review @BabyElias for the review and recommending the PR for further QA. Thanks for pointing out the additional issue with accessibility issue associated with the Edit: Maybe we could add this as a sub-issue to #829? It could act as a parent issue tracker for the |
Also, might be a bit out of scope for this discussion, but since we are ideating here, I also had an idea that I thought I would open post the merging of this PR: I have been working on introducing VTL to KDS via my pull request #897. After the same is merged, I could use the same to create a bit more elaborate test suite for keyboard naviagtion using:
that can make sure that the order of the elements in foucs, and the row and column highlights work as expected. This would help us to future-proof these changes across PR, and can help to reduce the burden of this mannual testing of PRs before QA to catch regressions in the bud itself. I really have had a pleasant experience (that is both challenging and educative) working with the Thanks @MisRob @BabyElias again for all the guidance. |
Thanks both @Pandaa007 @BabyElias, wonderful work, and so many good suggestions for the future work! (1) Kolibri QA PR for final approval here (2)
This is general checkbox intended behavior, only Space should toggle it, not Enter (can be tried out here). Few references
I too was a bit surprised when I learned about it on another opportunity :) It's confirmed with @radinamatic though so no updates needed.
High-level this makes sense to me @BabyElias and @Pandaa007, yes I welcome a new issue (but not sub-issue of #829, that's concerned with public interface only). Please also post a comment to the issue right away if it's something you wish to work on and reference this comment of mine to ensure it's reserved for you. (3)
That would be very helpful in long term, and if it was done before (2), then it would give us even more confidence during refactoring, right? #897 slipped my attention, I will try if we can get it in finally. |
I am happy to hear it is rewarding, |
Ohhh, that's interesting and new. Thank you so much for sharing all the resources! An year of getting to know about web accessibility and it still keeps surprising me with it's depth.
Indeed. @Pandaa007, I recommend opening an issue for enhancing the test suite for KTable in terms of keyboard navigation first - once the previous PR concerning VTL is merged and then maybe, we can open another issue for the code refactor later on. |
Wow nice! I wasn't aware of the same at all! That's for this new information byte!
Got it @MisRob! I will open a new issue for the same soon and will leave a comment there.
Thanks! I would love to work on the same on a priority basis as soon as the changes are merged. Thanks! |
Description
Changed the handling of Tab & Shift-Tab navigation in the
KTable
component to address the following:disabled
elements (as the current code tries to focus on them blindly by calling.focus()
on them, which is not supported for disabled elements)You can see the behaviour on the current implementation in the following video (The key presses that I am making can't be seen, but I am first trying to navigating forward to the end of the page, and then reverse navigate to the starting. If stuck on disbaled elements, or the header cell in the first table, I using mouse to refocus and continue navigation):
prev.mp4
The same after the changes in the PR are checked out is as follows:
classes-updated.mp4
pg-updated.mp4
I used the following playground snippet to generate the sample page for testing (on which the demo videos are recorded).
Playground
To make the changes, I have
getNextCellCoordinates
andgetPreviousCellCoordinates
to that the actual navigation logic becomes more concise and easy to follow (reducing the inling of code)Issue addressed
Fixes #883
Changelog
KTable
KTable
Testing checklist
Reviewer guidance