-
Notifications
You must be signed in to change notification settings - Fork 1
Conversation
<Col> | ||
<SearchField | ||
query={query} | ||
className="application__search__field" |
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.
rename to application__search-field
showSuggestions={showSuggestions} | ||
loadingSuggestions={loadingSuggestions} | ||
loadingRelations={loadingRelations} | ||
onRelationSuggestionClick={(_relationSuggestion) => this.onRelationSuggestionClick(_relationSuggestion)} |
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.
split lines
showSuggestions={showSuggestions} | ||
loadingSuggestions={loadingSuggestions} | ||
loadingEntities={loadingEntities} | ||
onEntitySuggestionClick={(_entitySuggestion) => this.onEntitySuggestionClick(_entitySuggestion)} |
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.
split lines
@lustoykov how about replacing the progress bar with a spinner (or just leaving the space blank while loading). Does it take long to load the results? Also, would it be possible to test this with the real data provided by the other groups? If it's not possible yet, when do you think we would be able to do that? |
@vviro yes, suggestion taken - will replace with spinner and then you can feedback again. It shouldn't take long to load anyways, so I might leave it empty. @martomi will provide the API very soon I think (my best bet is latest this weekend). The other groups are working on the database, so it's ultimately up to them to populate the API's database. @martomi do you know how the other groups are progressing regarding DB? I lost the overview there. |
@lustoykov It's currently a bit chaotic with the API, since there was a major refactor last days and there are still errors that need to be fixed and changes merged before I can do any substantial progress. Also the database is currently empty, I just spoke with other teams, the plan is to populate some test data in the database, but that might take a while since the data needs to be processed by all teams 1-4 before it's ready. My very optimistic guess is today evening for the database, probably tomorrow. |
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.
Well done, @lustoykov! Your code is clean as always, and I like the concept of the search very much. This is a good beginning for certain!
I'm just not sure if the current presentation of the autosuggestion is really intuitive. I needed quite some moments to realize that those strings under "Suggestions..." are clickable and thought that the search is already finished. I guess that it would better to split the place for the results and the place for the suggestions like Google does with a box right under the search field.
Furthermore, do you think that the subject should be fixed? Because I believe that on a page for Mozart, all kinds of relations relating Mozart should be displayed. That also contains relations where Mozart's father is the subject or where Mozart is an object.
Should I approve it by now, or are you going to implement the suggestion of @vviro right now so that I should wait?
@@ -0,0 +1,15 @@ | |||
const relations = new Array(100).fill(undefined).map((_, index) => { |
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.
Because you've done it at several places, a small info: new Array(n)
fills an Array per default with undefined
and there is no need to call fill()
.
And another small info for the unlikely case that you don't know it: you can return a newly created object in an arrow function without return by using ()
. That means, that you could have written:
.map((_, index) => ({ title: `Relation${index}` }));
@chaoran-chen thanks, I agree with your suggestions, so don't approve yet. I need to push fixup containing:
dunno how to design that to be honest, we only have as much space as 500 width and 300 height. I think it's ok for now to fix the subject. Let's try to finish this widget so that it works at least for a fixed subject and take it from there, because most of our widgets have begun very ambitiously (the pagination, the graph) and currently neither any of them are in presentable state, nor we actually need them. I'd like to follow the KISS Principle here. |
I agree with @chaoran-chen that it's not very intuitive. Will definitely require some experimentation to get it right. @lustoykov we hove more than 500 width by the way. That depends on the width of the browser window of course, but most users would have at least 1100px. However if you decide to take advantage of it, you'd need to be able to scale back to less. |
I'll think about it and make some proposals / mockups then so we can vote before implementing it. I'm open to any suggestions, so you can post your ideas as well. |
Guys, wait, I just realized you are working on the search functionality in the context of a "preview" widget. Therefore not enough space. I'm actually not sure that the search functionality would nicely fit the widget. As @lustoykov mentioned, this is indeed difficult to accomplish. Maybe it can be done, but in any case we cannot use the whole widget for search. Pre-defined entries will also take space, so even if search would be available straight in the widget (which might be a very good idea), it would at first occupy only a small space (for the search bar) and expand only when the user does something with it. Ideally we would have a full-page version of this search view that would be linked from the widget and the widget would only present the top results as an invitation to dive in deeper following the link to the full version. These top results would still take all the widget's space, so the other widget content will be hidden/replaced by it. When the search is cleared or in any other way "closed" or minimized, the widget should return to the initial state. What do you think? |
@vviro what do you mean by predefined entries? We have data in form |
I think he means entities that you would expect most users to be interested in. So you show those as pre-defined options instead of requiring a search. If there's not enough space for a search function inside the widget, we can simply show some pre-defined entities (pre-defined search queries if you will) that will show some interesting data. Users can go to the full page to search and explore the rest of the available data we have. |
Thanks for clarifying, makes sense.
Should we go for this solution, without search? I personally like it better. |
Yes I like it. We would need an API for those predefined entries. We'll still have the search, just not inside the widget. |
Maybe we could build a simple search (like in #48) in the preview widget and use the complex search in the "expert" mode |
Yees, this might change the API, @martomi take it into consideration. I'll come up with mockups by tonight. We might as well have modes for the widget, where you can switch between search and predefined entities to save space - I think that's the solution I'm going for. For example in the beginning we have predefined entities and then you click "explore more" they disappear and a search bar appears. |
Soo... Feedback? Anyone? If not, I'll implement it like this and won't accept any complains afterwards :) |
@lustoykov I mean it looks interesting but without much of an explanation of the parts its hard to follow. Questions for mode 1: how do you determine what to show in the "explore" section? Do you Mix Entities / Relations? Mode 2: would basically be the current functionality of this PR? |
@kordianbruck, @vviro was keen on showing predefined entries in the "explore" section - those should be delivered by the backend based on their algorithm. So we thought there would be no place for search bar and we should only go with predefined entries. Then we came up with the idea of two modes - the first mode represents predefined entries and the second is the current PR, yes. |
@lustoykov Hiding the search bar behind a mode switch will probably prevent 90% of users from using it or learning about its existence in the first place. So if the search bar makes any sense in a given context, it should be visible from the beginning. We definitely want to have pre-defined relations and related entities displayed from the beginning (when the user sees the widget/page for the first time). The question is how to structure them. Is this a bag of tags? A list of hand-picked sections with a few entries in every section? How many such entries do we plan to display? What is the maximum number? What are the implications for the API? How does the interaction with those items work? Is mouse-over involved? What happens when one clicks on a relation or entity? Can one click on the whole section and see more relations/entities of the same kind? If so, does one leave this page and go somewhere else, or how does the view change? I think it would be very useful to plan these details through before starting with the implementation. |
@vviro that is a lot of questions that I'm not sure this is the right place to discuss them. We should have a meeting for that over hangouts or in person in order to clarify this. Regarding this PR: lets finish it up, move the open stuff to an issue so we can merge an continue. This thread is getting kinda long. I like the idea of having to predefined terms - lets just move it to an issue and deal with them there. |
ok, team, can we merge it as it is and improve further in a separate thread as suggested by @kordianbruck? I think changes don't makes sense at this point without getting the requirements right in the first place. What's your opinion? |
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.
I agree. Let's merge this version and will iterate on it with subsequent PRs.
I agree, too. |
Maybe look at the codacy issues before merging. |
I think that the code style is good as it is. We have our own .eslint config and it is enough to fulfill that. |
@chaoran-chen it is using your configuration file. But you can really ignore it if you fine with the results. |
Oh, that's strange because, in our setup, we are not getting those issues. Does codacy also consider the eslint-configuration versions that are defined in package.json? |
Our ling config / modules are a bit outdated and doesn't have the same version as codacy, thus the difference. |
#42
after @martomi is done with the API, we can integrate both. @martomi relevant for you is everything in folder
/remote
We had requirements that the widgets takes very little space. Try it out on your PC cause the images dont speak too much. Works also if you click suggestion for composer, then it displays pagination with relations.