Hashtags are getting a #makeover

Discourse has supported linking to categories (announcements) and tags (release-notes) for a long time using hashtags (#). With the introduction of Discourse Chat we wanted to be able to link to chat channels with hashtags, which required some overhauling of how the system works to allow for channels to be suggested with autocomplete and also to cook in posts and chat messages. We also decided to take the time to overhaul the design of the autocomplete menu and cooked hashtags.

A summary of the changes included with this overhaul:

  • The ability to search for chat channels if you have chat enabled
  • Hashtag search results prioritise exact matches based on the slug, and depending on whether you are using them in a post or a chat message, we prioritise different types of results (e.g. categories are at the top in a post, but channels are at the top in chat)
  • A distinct icon is shown for each result
  • A new style for cooked hashtags which include the distinct icon

The new autocomplete results:

image

The new cooked style for hashtag autocompletion, which closely matches the @mention style.

You can opt-in to using this new version of hashtag autocompletion and cooking by enabling the enable_experimental_hashtag_autocomplete site setting on your Discourse site:

We expect to make this the default in the new year, meanwhile this is still considered an experimental feature, so there are still a few things to fix and refine.

This feature is now enabled on Discourse Meta as well :sparkles:

42 Likes