-
Notifications
You must be signed in to change notification settings - Fork 334
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
Show advanced search filter tags in search overview #1891
Comments
Updated WIP design (full flow) Just Search results |
The version within the tab has weird spacing without showing where the actions would be. I think we need to rethink the title of search part as there are two approaches and we need to be clear which one we take.
|
Search Results of Files/Models/Files (Show in a new view) Search Results of Gridfields (Show in same view)
Related |
Renamed this issue from "Pages search should show filter criteria and highlight search filters" to "Show advanced search filter tags in search overview" |
My thinking here is we need a separate component for rendering the search tags. The search tag will reflect what the current search results are showing. So if you add some value to a search field but don't trigger a search, the tags won't be added. Equally, if you dismiss a tag, the a search will be the only filter value updated will be dismissed tag. Let's say you type in a new search term, but don't hit enter. You dismiss an existing tag. A new search is triggered, but your the old keyword.
|
@maxime-rainville Thanks for your thoughts on this! Generally agree that we need a new component. It's probably not as specific as a "search tag". Please check out the CCers recent work on tagfield, might be something to reuse or harmonise? https://github.com/silverstripe/silverstripe-tagfield @newleeland Can you please go through Max's "complications"? |
@chillu Jared is away for the week, I've had a chat and will do my best to fill any gaps or questions. |
Reusing SilverStripe TagI had a look at I might be able to write the style for the tag in a generic way that could be reapplied to the react-select tags, but that's about it. edit Handling large number of Search FiltersI had a meeting with @clarkepaul and we touch on how to handle the use case where there's lots of tags to display in the search box. We touch on a few ideas Scrolling through the filters and search termPaul mentioned that there original idea was that you would be able to scroll through the text box using your cursor and the tag would drop off on the left as if they were text. I explained this would be very difficult to achieve, because the tags themselves are not text that can be put in an input field. The ability to use the left/right arrow keys to go through a long input field value is native to the browser and it's not something we can highjack. Multiple lines search fieldLooking at how rich select component handles this use case, most of them just add an extra row of entry when the list of tags gets bigger than the width of the component. That would probably look weird in the context of our search box. Summary view of filtersAnother way we could handle this, is to display a summary view once the number of active search filters gets bigger than certain width. I found an example of a search component doing this the other day, but for the life of me can't find it anymore. It looked something like this (my apologies to designers and UX experts everywhere). |
@maxime-rainville design wise it looks really good ;). Normally I would prefer if the overflow was scrollable as a standard field normally is, but I can understand that technically that might not be an option. In principle I'm on board with the compact view, and it could be clickable to trigger the filter panel opening. Do you think you can find a good way to trigger the filter summary? eg, when it consumes more than 60% of the field width. |
I'm thinking of doing new Clicking on the compact view would be equivalent to clicking on the 'Show Filters' button. That's probably enough for me to get started. I wouldn't mind having a proper mock up the compact view thought. |
This is also used in TreeDropdownField. We have two existing uses, why would we approach the third one (search tags) differently?
Why? I think that's acceptable, particularly given that only a small fraction of users will ever see this view. "Summary view of filters" is nicer, but also more unplanned implementation complexity. I'll have a talk to Paul. |
In terms of
In exchange, we get:
Might or might not be worth the tradeoff, but should be investigated |
react-select allows you to completely define what to do when it's trying to find options for a given search. While it's a slightly convoluted solution, returning with an empty response will prevent the component from trying to match tags. As an aside - |
React-select vs custom implementationWhile the look of our search box and of the react select component is similar, I think the functionality is actually quite different:
I'm not inimitably familiar with how react-select is implemented, so maybe all this stuff is easy. But to me this sounds like these two components are trying to do different things. If we decide to use react-select, pretty much everything I did for the search component will have to be scraped. Displaying the search field over two linesFrom what I can see of the mock up, it look it was designed so it would be same height has the Profile link on the left nav. If you spread it over two lines, it won't aligned. Also a lot of the icons attached to the box might get in the way. Again, apologies to designers and UX expert everywhere (I'm racking up a lot of bad karma with these guys today) In terms of implementation time, I guess the compact view and the multi line solution would be about equivalent. |
This is Work in progress design guide for advance search interactions: |
So I've created the following components:
This videos showcases the various components https://youtu.be/SrYNF1q_rTY
|
I got the tag hooked into the search field:
The tags don't do anything yet however. |
The tags can now be interacted with:
I also fix the resizing logic to work in all browsers. I still need to add logic to handle non-generic search fields, which is probably not going to be trivial. I figure there's probably another day of work in this. |
I've adjusted the logic so different fields will generate different tags:
I've also added some logic so developers can customise how the tags are rendered. |
Got my PRs lined up. Still need to write the doc, but otherwise it's ready for peer review. |
Acceptance Criteria
Type: RedirectorPage
)Notes
https://invis.io/FTG16IYV5KB#/283335179_POC_CMS_Search_Model_Results_C2(see design guide)https://invis.io/FTG16IYV5KB#/284539430_POC_CMS_Search_Gridfield_Results_C2(see design guide)https://invis.io/YGGYS6HDMRK#/310647254_Searchhttps://projects.invisionapp.com/dsm/silver-stripe/silver-stripe/section/components/5b57ee3fb5d1030010cb90b3Type:RedirectorPage
) instead of entering them in the "advanced search" input fieldsDesign preview (for context):
Related
Subtasks
<Tag />
component based of ReactStrap's<Badge />
.<TagList />
component grouping a list of<Tag />
together and providing a compact view.<Tag />
and<TagList />
PRs
The text was updated successfully, but these errors were encountered: