discourse/plugins/chat/spec
Joffrey JAFFEUX fc437052bb
DEV: Add optional clear button to FilterInput component (#35569)
Introduces a new `@onClearInput` argument to the FilterInput component
that enables an optional clear button (X icon) to reset the input value.

API Changes:

FilterInput component now accepts:
- `@onClearInput` (optional) - Callback invoked when clear button is
clicked
- When both `@onClearInput` and `@value.length` are truthy, a clear
button appears on the right side of the input

Behavior:
- Clear button automatically shows/hides based on input value length
- Clicking clear button invokes the provided callback
- Input automatically receives focus after clearing

Usage:
```gjs
<FilterInput
  @value={{this.searchTerm}}
  @onClearInput={{this.handleClear}}
  @filterAction={{this.handleInput}}
/>
```

This new API is used on this commit for clearing the input of chat
search queries:

<img width="345" height="84" alt="Screenshot 2025-10-23 at 10 51 33"
src="https://github.com/user-attachments/assets/817912cb-acbc-4a15-877e-c130d8087863"
/>
<img width="672" height="57" alt="Screenshot 2025-10-23 at 10 51 27"
src="https://github.com/user-attachments/assets/6aa17f26-04fe-49c9-9fca-555e1cc7298c"
/>
2025-10-23 12:39:37 +02:00
..
components/chat DEV: fix flakey spec (#34875) 2025-09-19 11:40:15 +02:00
fabricators FEATURE: disable chat DM threads by default (#34840) 2025-09-17 16:52:13 +04:00
integration DEV: add shortcut fab!(:variable, :fabricator) to specs (#33577) 2025-07-11 11:16:34 -03:00
jobs DEV: Update rubocop-discourse to 3.13 and autofix issues (#35073) 2025-10-06 16:11:01 +02:00
lib FIX: add data attrs to quoted images (#35455) 2025-10-17 11:16:39 +04:00
mailers DEV: add shortcut fab!(:variable, :fabricator) to specs (#33577) 2025-07-11 11:16:34 -03:00
models FEATURE: Add full-text search for chat messages (#34704) 2025-10-22 11:30:35 +02:00
queries/chat DEV: add shortcut fab!(:variable, :fabricator) to specs (#33577) 2025-07-11 11:16:34 -03:00
requests PERF: Fix N+1 queries due to user custom fields when loading chat DMs (#35516) 2025-10-22 09:39:01 +08:00
serializer DEV: add shortcut fab!(:variable, :fabricator) to specs (#33577) 2025-07-11 11:16:34 -03:00
services FEATURE: Add full-text search for chat messages (#34704) 2025-10-22 11:30:35 +02:00
support DEV: add shortcut fab!(:variable, :fabricator) to specs (#33577) 2025-07-11 11:16:34 -03:00
system DEV: Add optional clear button to FilterInput component (#35569) 2025-10-23 12:39:37 +02:00
validators FEATURE: Add setting to prevent anonymous users from using chat (#31842) 2025-03-21 13:32:52 +03:00
plugin_helper.rb FIX: remove complicated 'chat_duplicate_message_sensitivity' site setting (#30516) 2025-01-13 12:32:51 +01:00
plugin_spec.rb DEV: add shortcut fab!(:variable, :fabricator) to specs (#33577) 2025-07-11 11:16:34 -03:00