iachat/spec/enterprise
Sojan Jose 270f3c6a80
fix: slim help center search results (#13761)
Fixes help center public article search so query responses stay compact
and locale-scoped. Whitespace-only queries are now treated as empty in
both the portal UI and the server-side search path, and search
suggestions stay aligned with the trimmed query.

Fixes: https://github.com/chatwoot/chatwoot/issues/10402
Closes: https://github.com/chatwoot/chatwoot/issues/10402

## Why

The public help center search endpoint reused the full article
serializer for query responses, which returned much more data than the
search suggestions UI needed. That made responses heavier than necessary
and also surfaced nested portal and category data that made the results
look cross-locale.

Whitespace-only searches could also still reach the backend search path,
and in Enterprise that meant embedding search could be invoked for a
blank query.

## What changed

- return a compact search-specific payload for article query responses
- keep the existing full article serializer for normal article listing
responses
- preserve current-locale search behavior for the portal search flow
- trim whitespace-only search terms on the client so they do not open
suggestions or trigger a request
- reuse the normalized query on the backend so whitespace-only requests
are treated as empty searches in both OSS and Enterprise paths
- pass the trimmed search term into suggestions so highlighting matches
the actual query being sent
- add request and frontend regression coverage for compact payloads,
locale scoping, and whitespace-only search behavior

## Validation

1. Open `/hc/:portal/:locale` in the public help center.
2. Enter only spaces in the search box and confirm suggestions do not
open.
3. Search for a real term and confirm suggestions appear.
4. Verify the results are limited to the active locale.
5. Click a suggestion and confirm it opens the correct article page.
6. Inspect the query response and confirm it returns the compact search
payload instead of the full article serializer.

---------

Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
2026-03-17 00:46:23 -07:00
..
builders fix: restrict existing user sign-in to account members (#13793) 2026-03-13 12:22:25 +05:30
controllers fix: slim help center search results (#13761) 2026-03-17 00:46:23 -07:00
drops feat: Add push/email notification support for SLA (#9140) 2024-03-29 20:27:21 +11:00
jobs feat: Add force legacy auto-resolve flag (#13804) 2026-03-13 15:04:58 -07:00
lib feat: Add force legacy auto-resolve flag (#13804) 2026-03-13 15:04:58 -07:00
listeners feat: captain decides if conversation should be resolved or kept open (#13336) 2026-03-13 10:03:58 +05:30
mailers feat: setup invite to handle SAML enabled account [CW-5613] (#12439) 2025-09-17 19:33:38 +05:30
models fix: Use handoff_key for scenarios (#13755) 2026-03-11 14:01:25 +05:30
policies chore: Enforce custom role permissions on conversation access (#12583) 2025-10-22 20:23:37 -07:00
presenters/conversations feat: Conversation API to return applied_sla and sla_events (#9174) 2024-04-01 23:30:07 +05:30
services fix: optimize message query with account_id filter (#13759) 2026-03-10 16:46:20 -07:00