FEATURE: Add descriptions on hover for hashtag search results (#19162)

Adds the description as a title="" attribute on the hashtag
autocomplete search items for tags, categories, and channels.
These descriptions can be seen by the user since they are
able to see the results that are returned by the search via
Guardian checks.
This commit is contained in:
Martin Brennan
2022-11-23 14:59:00 +10:00
committed by GitHub
parent 34ce8f9915
commit c9ab270abd
7 changed files with 29 additions and 6 deletions

View File

@ -8,6 +8,7 @@ class Chat::ChatChannelHashtagDataSource
def self.channel_to_hashtag_item(guardian, channel)
HashtagAutocompleteService::HashtagItem.new.tap do |item|
item.text = channel.title(guardian.user)
item.description = channel.description
item.slug = channel.slug
item.icon = icon
item.relative_url = channel.relative_url