-
Notifications
You must be signed in to change notification settings - Fork 86
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
[KTable]: Update Sorting Flow to Include "Unsorted" State #797
Comments
Hey @BabyElias @MisRob I would like to work on this issue. Please assign me this issue. |
Hi @Sahil-Sinha-11, thank you for volunteering. I will assign you. Please take some time to understand the current |
https://github.com/user-attachments/assets/718d1dff-80bf-4c48-9428-69a707611e63 |
I don't see the new sorting flow as described in the issue in the video, @Sahil-Sinha-11 as you don't click the sort buttons there. Regarding unit test, please familiarize yourself with the existing testing suite and use it as a guide. |
I'm sorry @Sahil-Sinha-11, this was just a technical issue on my side - for some reason I saw time elapsing but nothing happening in the video. I tried to preview it again and it works now. Yes, this is expected behavior, thank you. Here's the reference to unit tests https://github.com/learningequality/kolibri-design-system/tree/develop/lib/KTable/useSorting/__tests__, even though you may also consider starting a new spec file for |
@Sahil-Sinha-11 If that helps, you can find many more tests in other components, such as https://github.com/learningequality/kolibri-design-system/tree/develop/lib/tabs/tests, to serve as inspiration. We use Vue 2 + Jest + Vue Test Utils. Let us know if you had more questions. |
Its fine and thanks for the guidance. |
|
@Sahil-Sinha-11 Yes, this is the right way to test the change introduced. Did you run the |
|
@Sahil-Sinha-11 You might try running the tests with the Jest CLI option You should be able to do so with |
@BabyElias The error encountered is not in the file I made changes in I made changes in[i.e. i made changes in Ktable but the test fails for kTabLists] should I proceed with a PR? |
@Sahil-Sinha-11 You can go ahead and raise the PR. |
@BabyElias I raised a PR #803 . |
Closed by #803 |
🌱 Are you new to the codebase? Welcome! Please see the contributing guidelines.
Summary
Currently, once a user clicks on a header to sort a column in KTable, the sorting flow cycles between unsorted > ascending > descending > ascending > descending, with no way to return to the default unsorted state without refreshing the page. This issue aims to update the sorting behavior to allow users to return to the unsorted/default state after any column header has been clicked.
The Value Add
Adds flexibility in how users can interact with the table, especially when sorting is not desired or needs to be reset.
New Sorting Flow
The desired behavior after clicking a sortable column header should be:
unsorted > ascending > descending > unsorted > ascending > descending
and so on.Guidance
<KTable sortable>
is used i.e KTable with enabled default sorting, which makes use of the useSorting composable as referenced here.Acceptance Criteria
The text was updated successfully, but these errors were encountered: