discourse/plugins/chat/test/javascripts/unit
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
..
components FEATURE: respect user presence when chat is on screen (#36652) 2025-12-16 17:23:32 +11:00
lib UX: Prioritize chat search results by relevance (#36959) 2026-01-06 08:57:08 +01:00
models FEATURE: Add full-text search for chat messages (#34704) 2025-10-22 11:30:35 +02:00
services FIX: Respect title_count_mode preference in chat (#36930) 2025-12-31 19:27:37 +03:00
utility Build(deps-dev): Bump the lint group across 1 directory with 4 updates (#33881) 2025-07-28 18:02:41 +02:00