-
-
Notifications
You must be signed in to change notification settings - Fork 101
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
Improved filters panel #965
Conversation
@kelson42 I implemented what was needed as described in the ticket, going along with the design guidelines. Would like you to play around with the filters and let me know any changes! Little sneak peek: Peek.2023-07-23.21-36.mp4 |
@juuz0 Thank you very much! Will give you a detailed feedback, but I thunk the ultimate solution is more around a custom combobox. |
@juuz0 I had finally a look in detail. Here my remarks:
|
@juuz0 https://github.com/ThisIsClark/Qt-MultiSelectComboBox is the nearest thing I have found in Qt… but its pretty ugly. |
Can you expand more on this please, not sure I get it fully
This looks good imo, I'll try creating this
Yeah definitely similar on principle, although not good looking. Thanks for the reference I'll try replicating the first desing 👍 |
8685a31
to
5da7609
Compare
If you have a free text searchbox with no list, you can theoritically get any item of the list... but you can not scroll the whole list.
Just to be clear I meant this:
Would be reall awesome to get something like this!!! |
@juuz0 What is the status here? This is a very important PR which is open since 2 weeks already. |
5179cb1
to
66a6150
Compare
@kelson42 ready for another review, I have tried replicating that design :> |
599f88a
to
328d28b
Compare
Did some refactoring |
@juuz0 From the way it works, we are indeed near, but then we have design details to reach the usability we have with HTML element given as example. For the moment here are the most important things to fix:
Just try to near the UI/behaviour from what I have given in example. You are on the right path! :) |
I have a segmentation fault on my side with this branch (when starting the application) |
It's a listwidget so the same thing, but I had hidden the scrollbar so maybe that's why it looked like free text? Scrollbar is back now. Let me know if some other change is needed
Gone @kelson42 We go again, new review needed :> I think I'm almost there
I won't say the code is ready for review :P (shy). Jokes aside, what OS was this on? Seems to work fine on my Ubuntu. But I'll recheck. |
Yes. But better to know the sooner. I'm on Fedora 38 |
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.
@juuz0 Still a lot of differences to https://harvesthq.github.io/chosen/#multiple-select:
- Please remove "All", this is simply the case without any filter
- Really minimal radius in the corners of the boxes
- List appearing only if you search (click)
- Borders in the list
- Proper standard listitem selection (and custom like it curently with only bold)
- Removal of placeholder text "Search language" when focused/clicked, not when starting to input keyboard
Once this is done we can make a new review round.
@kelson42 new review needed!
But check and let me know please! |
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 !!
I have few graphical issues but I will open new issues on github.
This PR is long enough, it is time to merge it.
Those issues are not related to this PR, so we don't care.
We only have my last comment left.
Hum, I have a real issue after all with the last change about keeping the filter.
Keeping the filter after restart is good, but we must display it. I would say we can live with this (as we will fix soon with another issue) but @kelson42 may think it is a important bug to fix before merging. |
definitly, real filter should be like displayed filter. We have a last thing to fix here. But seems trivial even if this kind of bug is a bit worrying, seems symptomatic of a bad synchro algo, useless temporary variables for the filter values, etc. |
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.
Just a small change about the naming and we are good.
This change adds a new widget called KiwixChoiceBox The design inspiration is taken from here: https://harvesthq.github.io/chosen/#multiple-select setType() takes a string to put on the label We can add possible choices using the setSelections() method
Replaced the old Categories and Languages with KiwixChoiceBox
This removes the previous method of filtering books by category, which filtered using tags. Now, we move to a more generic way (similar to library) using the category filter.
Added styles for KiwixChoiceBox to make it match the model. Also moved everything in contentmanagerside more to the left.
Language and category values are now a setting
Replaced the old content type filters with KiwixChoiceBox Previously, the content type was a tri state checkbox having yes, no & no-filter values. This changes that to add the values in the following format: Pictures (_pictures:yes) No Pictures (_pictures:no) "no-filter" is simulated by not having any of the above 2 selected.
This change allows one to navigate through the choices using up and down arrow keys from keyboard Enter/Return key can be pressed to select the current item
Fixed the height of selector to show 6 elements maximum Reduced distance between filters Increased margin between choiceItem and container box All of the choicebox is now clickable and shows up the list on click
This change puts the file-search option after Catalog buttons (Online and local files) putting all filters on catalog in one place. First suggested in #965 (review)
Options menu shows up on pressing down arrow Clicking kiwixchoicebox when options is shown doesn't result in flashing now Display placeholder only if there are no options selected.
When a new item is selected, it is not kept on top of options menu
The searcher doesn't have a predefined width now. It increases based on text entered.
Earlier we used, "*" to signify all languages and "all" for all categories. This change removes these inconsistencies. Now, if the filter value is empty, it should signify that no filter is set (show all values)
If a filter which is available in remote catalog but not in local catalog (or vice versa) is selected, then we keep that filter applied even after the catalog is switched.
This change adds a new function parseStyleFromFile(QString filePath) It takes a file path, reads it and returns the string
Now, the filter settings (language, category and content type) are saved as: keys|values in QSettings.
0a14818
to
f61635e
Compare
We are good. Time to merge 🎉 |
Fixes #958
Fixes #973 as well
Fixes #974
This PR provides a new filter panel which:
Multiple selections work for languages (both local and remote) and categories (requires kiwix/libkiwix#974, remote filtering will obviously require that PR to be merged)