discourse/plugins/chat/test/javascripts
Régis Hanol 5834fcca50
UX: Prioritize chat search results by relevance (#36959)
When searching for a chat, results were returned in a fixed order (users
→ groups → DMs → channels) without considering how well they matched the
search term. This meant searching for "dev" could show 10 users named
"developer" or "devops" before the actual #dev channel.

Results are now sorted by match quality first, then by type:

1. Exact matches (name equals search term)
2. Prefix matches (name starts with search term)
3. Partial matches (name contains search term)

Within each match tier, channels appear before users/groups, and users
with chat enabled appear before those with chat disabled. This ensures
that searching "dev" shows the #dev channel first, followed by a user
named "dev", then "dev-talk" channel, and so on.

Ref - t/124487

**BEFORE**

<img width="1573" height="1396" alt="BEFORE"
src="https://github.com/user-attachments/assets/8e4bb827-9418-400c-ac16-fb35631d772a"
/>

**AFTER**

<img width="1573" height="1396" alt="AFTER"
src="https://github.com/user-attachments/assets/418d24a8-05d7-4146-8473-fa3be2f3415f"
/>
2026-01-06 08:57:08 +01:00
..
acceptance DEV: Add page-aware plugin APIs for saving user preferences (#36757) 2025-12-18 10:58:16 +01:00
components FIX: Preserve all date attributes in rich text editor (#36781) 2025-12-24 14:01:52 +01:00
helpers DEV: Move discourse-common/(utils|lib) to discourse/lib (#30733) 2025-01-13 13:02:49 +00:00
integration DEV: Update Ember to 6.6.0 (#34460) 2025-08-27 16:48:40 +01:00
unit UX: Prioritize chat search results by relevance (#36959) 2026-01-06 08:57:08 +01:00
chat-fixtures.js DEV: Replace Ember's deprecated mapBy with standard .map (#34963) 2025-09-26 12:59:35 -03:00