Skip to content
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

Standardize presentation of "no results" messages on tag page tabs #9510

Closed
ebarry opened this issue Apr 15, 2021 · 16 comments
Closed

Standardize presentation of "no results" messages on tag page tabs #9510

ebarry opened this issue Apr 15, 2021 · 16 comments
Labels
add-code-links brainstorm Issues that need discussion and requirements need to be elucidated break-me-up break up for cleaner code separation, discrete tests, and, easier and iterative collaboration design issue requires more design work and discussion (i.e. mockups and sketches) discussion feature explains that the issue is to add a new feature

Comments

@ebarry
Copy link
Member

ebarry commented Apr 15, 2021

Tag pages are great

Tag pages can benefit from greater standardization 😄

When a tag is clicked from a piece of content, the person is brought to the tag page. This is good.

In the gif below, observe the following non-optimized situations:

  • the tag page loads on the Research Notes tab, however, IF there are no Research Notes, then the display is "No results found; try searching for 'effect-based-test': Search for "effect-based-test" . In this user journey, this is rather confusing because the person was just reading effect-based-test content immediately before arriving on this page, although it was a Wiki vs a Research Note, which many will not understand upon first glance. In general, a person may not instantly understand the tab layout of the tag page, so the "no result" messages should be edited to instead encourage the person to "look at each tab to see where content might exist or else search" -- this suggested text needs copyediting :)

  • Observe that the Questions tab also returns no results, but here we are presented with no text but instead an empty pagination device. Ideally, this would be consistent with how "no results" are shown on other tabs with the encouraging text suggesting people look at all the tabs to see where results might be.

  • The wiki tab presents properly-- hooray!!! 🎉 🎉 🎉

  • the Contributors tab has an actual error. Although the count on the tab correctly shows "1", in tab itself displays "no result" text: "No contributors for that tag; try searching for 'effect-based-test':" Secondly, in terms of standardization, the text is almost like the Research Notes Tab "no results" display except after the colon the actual link to go "Search" seems to have been left out, another inconsistency. This tab needs both a bug fix and a standardization.

standardize-results-notice

@ebarry ebarry added the feature explains that the issue is to add a new feature label Apr 15, 2021
@TildaDares
Copy link
Member

@ebarry I'd love to work on this.

@ebarry
Copy link
Member Author

ebarry commented Apr 19, 2021

Thank you @TildaDares ! Would you like to choose just one specific part of this to begin with? Please write back with what you'd like to break off to start with. Are there any questions i can answer?

@TildaDares
Copy link
Member

@ebarry I'll start with the first one. For the no results text I'm thinking 'No results. Have you checked the other tabs? or try searching:'.

@ebarry
Copy link
Member Author

ebarry commented Apr 19, 2021

This is exactly the kind of improvement that would really help! Thanks @TildaDares :)
Building on your suggestion, how about adding a greeting, and then inviting them to look at other tabs? For instance:

Hi! No research notes have this tag, try checking the Questions or Wiki tabs on this page. Or try searching:__(active search link)_

I'm sure this can be improved, please write back with more edit ideas!
CC @bhamster07 to also give wording suggestions.

@bhamster07
Copy link

Thanks @TildaDares! Also wondering if a small emoji might help make the message friendlier? Building off your and @ebarry's ideas now, maybe something like:

Hi! No research notes have this tag 🤷, try checking the Questions or Wiki tabs on this page. Or try searching:__(active search link)_

@TildaDares
Copy link
Member

@bhamster07 @ebarry Your suggestions definitely add more warmth. I'll start working on it.

@jywarren jywarren added break-me-up break up for cleaner code separation, discrete tests, and, easier and iterative collaboration brainstorm Issues that need discussion and requirements need to be elucidated design issue requires more design work and discussion (i.e. mockups and sketches) discussion add-code-links labels Apr 20, 2021
@jywarren
Copy link
Member

jywarren commented Apr 20, 2021

Hi all, thanks and love the brainstorming happening here. I'm just marking this with labels to show it can be broken out into multiple issues (or pull requests) and also that discussion on the exact text for each tab is still ongoing. Maybe we should think about presenting the texts like this:

is this OK for all three options to be standardized?

I'm also adding the add-code-links label so we can work on linking to each code file where such changes would be made. That'll help whoever wants to make the changes.

Once we agree on the exact texts for each, we can mark this as an fto-candidate so multiple issues can be made for newcomers from it. It's a pretty ideal one for that!

@ebarry
Copy link
Member Author

ebarry commented Apr 20, 2021

These texts look perfect to me, exactly how i was hoping we could standardize, and i see @bhamster07 gave a 👍 as well, so these texts are good to go!

@TildaDares
Copy link
Member

@jywarren @ebarry I think the issue with the count error in the contributors tab is because of

plots2/app/models/tag.rb

Lines 348 to 354 in 9b60ef6

def self.tagged_node_count(tag_name, type = 'note')
Node.where(status: 1, type: type)
.includes(:revision, :tag)
.references(:term_data, :node_revisions)
.where('term_data.name = ?', tag_name)
.size
end

That method is used to count the number of notes which excludes wikis
@note_count = Tag.tagged_node_count(params[:id]) || 0

Is it possible to replace @note_count with @users in
<% end %>
<br />
<% if @wildcard %>
<p><%= raw translation('tag.contributors.wild_card_search_detected', :tag => params[:id]) %></p>
<% elsif @note_count.nil? || @note_count == 0 %>
<p><%= raw translation('tag.contributors.no_contributors', :tag => params[:id]) %>:</p>
<% else %>
<div class="row">

@jywarren
Copy link
Member

Just writing that I added checkboxes for the 4 forms and noticed @TildaDares put one in for Contributors too (sorry i missed that) so i added it to the list. Thanks!!!

Thank you @TildaDares for this digging on the contributors count. I want to link to possibly related older issues... #6675 for example? or #9301 or #2539

I feel like we may have had a related issue here not so long ago, and am thinking about it. But, actually, almost all this code is years old:

https://github.com/publiclab/plots2/blame/main/app/models/tag.rb#L155-L170

Maybe I'm just getting mixed up? In any case the inconsistency Liz pointed out is only on the Contributors tab, so I think it should be only this line:

https://github.com/publiclab/plots2/blame/main/app/views/tag/show/_nav_tabs.html.erb#L48

That leads back to this variable which really could be better named to be clearer, maybe something like "@contributor_count"? That itself would make a nice FTO!

Finally that leads back to this line:

plots2/app/models/tag.rb

Lines 80 to 83 in b03d391

def self.contributor_count(tagname)
uids = Tag.contributors(tagname)
uids.size
end

It is odd that we're seeing 1 on https://publiclab.org/contributors/effect-based-test. I can try running this on the console to see what's up.

@jywarren
Copy link
Member

Strangely that user is bhamster! I'm not sure why it's not appearing on the page:

irb(main):001:0> Tag.contributor_count('effect-based-test')
=> 1
irb(main):002:0> Tag.contributors('effect-based-test')
=> #<ActiveRecord::Relation [#<User id: 664477, username: "bhamster"

Weird!! Let's compare what the queries are that are generating the actual lists of people.

@jywarren jywarren changed the title Standardize presentation of results on tag pages Standardize presentation of "no results" messages on tag page tabs May 18, 2021
@jywarren
Copy link
Member

Just noting that the "no results" message standardization is DONE. Great work everyone!

Last thing is to look into this odd contributor count. But I'm going to close this as the main issue is resolved. 🎉

@jywarren
Copy link
Member

The two queries are:

@length = Tag.contributor_count(params[:id]) || 0

vs

@users = Tag.contributors(@tagnames[0])

but this should be the same???

plots2/app/models/tag.rb

Lines 80 to 83 in b03d391

def self.contributor_count(tagname)
uids = Tag.contributors(tagname)
uids.size
end

@jywarren
Copy link
Member

@jywarren
Copy link
Member

got it. Fix in #9643!!

@ebarry
Copy link
Member Author

ebarry commented May 18, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
add-code-links brainstorm Issues that need discussion and requirements need to be elucidated break-me-up break up for cleaner code separation, discrete tests, and, easier and iterative collaboration design issue requires more design work and discussion (i.e. mockups and sketches) discussion feature explains that the issue is to add a new feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants