-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
search design details #1606
search design details #1606
Conversation
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.
Actually for a user it is not transparent, why there are two different "no results" messages and it looks like a jump frame.
@@ -217,7 +217,7 @@ | |||
$status.addClass('emptycontent').removeClass('status'); | |||
$status.html(''); | |||
$status.append('<div class="icon-search"></div>'); | |||
$status.append('<h2>' + t('core', 'No search results in other folders') + '</h2>'); | |||
$status.append('<h2>' + t('core', 'No search results in other folders {filter}', {filter:this._filter}) + '</h2>'); |
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.
This is not substituted and will be shown as {filter} on my end.
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.
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.
Isn't it supposed to be ('... folders %s', this._filter) – or something like this?
Edit: this is for php, I guess.
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.
Okay, I see, you might just need the last two parameters, maybe?
..., {filter:this._filter}, null, {'escape': false}) as in filelist.js
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.
cc @nextcloud/javascript can you help in this regard?
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.
@jancborchardt is this supposed to display the searched string?
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 this._filter is undefined for me. I think we should pass the query in the function arguments if that's what you were planning! :)
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.
this is undefined, will fix
Signed-off-by: Joas Schilling <coding@schilljs.com>
@nickvergessen Thanks for the fix!
|
It still looks like the search icon and the text are jumping down/up at 2 to 3 characters |
@nickvergessen @skjnldsv That's what I addressed in my review. One is handled in core and the other in files??? |
There's something strange here indeed! :) |
It is by intention: up to 2 charaters it only filters the current view and starting with 3 characters it also triggers a search in all other folders (parents and childs). |
@jancborchardt Could I ask you to respond to all the open questions. |
@MorrisJobke Why though? |
Yeah ok, that’s weird. To clarify, any search error should only have that one large line of text. Anything else is too complex for a simple search error. Will get on it. |
Btw @ChristophWurst here too I would like to bold the search string like we did the folders for the mail error messages: nextcloud/mail#57 (review) Can you help me with that? Cause there’s no tag and endtag like in Mail. |
@@ -217,7 +217,7 @@ | |||
$status.addClass('emptycontent').removeClass('status'); | |||
$status.html(''); | |||
$status.append('<div class="icon-search"></div>'); | |||
$status.append('<h2>' + t('core', 'No search results in other folders') + '</h2>'); | |||
$status.append('<h2>' + t('core', 'No search results in other folders {filter}', {filter:lastQuery}) + '</h2>'); |
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.
@jancborchardt since you're using append here, we can use directly into the string.
$status.append('<h2>' + t('core', 'No search results in other folders for <strong>{filter}</strong>', {filter:lastQuery}) + '</h2>');
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.
Won’t that be a problem with translators again because they often mess up the tags? I thought that was a problem cc @LukasReschke
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.
<fett>{filter}</fett>
🙈
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.
Oh yes it will indeed!
We should proceed th same way as ChristophWurst.
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.
@jancborchardt
var error = t('core', 'No search results in other folders {tag}{filter}{endtag}', {filter:lastQuery}).replace('{tag}', '<strong>').replace('{endtag}', '</strong>'); $status.append('<h2>' + error + '</h2>');
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.
@skjnldsv can you add that as a commit directly on this branch? You are a Nextcloud member so you should be able to do that ;)
@@ -2427,7 +2427,7 @@ | |||
$('#searchresults .emptycontent').addClass('emptycontent-search'); | |||
if ( $('#searchresults').length === 0 || $('#searchresults').hasClass('hidden') ) { | |||
this.$el.find('.nofilterresults').removeClass('hidden'). | |||
find('p').text(t('files', "No entries in this folder match '{filter}'", {filter:this._filter}, null, {'escape': false})); | |||
find('h2').text(t('files', "No results in this folder for {filter}", {filter:this._filter}, null, {'escape': false})); |
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.
Same here, you can use html instead of text if you want to add <strong>
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.
find('p').html(t('files', "No entries in this folder match '{tag}{filter}{endtag}'", {filter:this._filter}, null, {'escape': false}).replace('{tag}', '<strong>').replace('{endtag}', '</strong>'));
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.
Same here ;)
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.
You mean {tag}
and {endtag}
?
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.
@skjnldsv I meant if the solution you suggested works, you are welcome to add a commit :)
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 it works, I used the same as here nextcloud/mail#57 (review)
But I can't tell you if this will cause issue with the translators or not. I don't really knows how they work :)
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.
@skjnldsv then go ahead and add a commit in this branch, you should be able to since you are in the Nextcloud organization ;) You know Javascript better than me. :)
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.
Okay, I will commit. But we need to be sure the issue you raised with the translators is fine! :)
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.
@skjnldsv Looks good 👍
@jancborchardt Could we clarify the text error? |
Commit pushed @jancborchardt ! :) |
@@ -217,7 +217,8 @@ | |||
$status.addClass('emptycontent').removeClass('status'); | |||
$status.html(''); | |||
$status.append('<div class="icon-search"></div>'); | |||
$status.append('<h2>' + t('core', 'No search results in other folders {filter}', {filter:lastQuery}) + '</h2>'); | |||
var error = t('core', "No search results in other folders '{tag}{filter}{endtag}'", {filter:lastQuery}); |
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.
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.
Pushed & rebased 👍
Fix wording
4f07cba
to
1930aa3
Compare
@eppfel Review update pls? 😄 |
@nickvergessen @MorrisJobke @eppfel another review please? ;) |
👍 |
Counting @eppfel approval as 👍 ;) Merge it |
Some search design details I did a while ago. Including:
Please review @nextcloud/designers @nextcloud/javascript :)