discourse/plugins/chat
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
..
admin/assets/javascripts DEV: Remove unused service injections (#34750) 2025-10-08 13:31:41 +02:00
app FEATURE: Add full-text search for chat messages (#34704) 2025-10-22 11:30:35 +02:00
assets DEV: Add optional clear button to FilterInput component (#35569) 2025-10-23 12:39:37 +02:00
config FEATURE: Add full-text search for chat messages (#34704) 2025-10-22 11:30:35 +02:00
db FEATURE: Add full-text search for chat messages (#34704) 2025-10-22 11:30:35 +02:00
lib PERF: Fix N+1 queries due to user custom fields when loading chat DMs (#35516) 2025-10-22 09:39:01 +08:00
public
spec DEV: Add optional clear button to FilterInput component (#35569) 2025-10-23 12:39:37 +02:00
test/javascripts FEATURE: Add full-text search for chat messages (#34704) 2025-10-22 11:30:35 +02:00
about.json DEV: Only load specific plugin bundles during qunit test (#33678) 2025-07-21 21:00:48 +01:00
plugin.rb FEATURE: Add full-text search for chat messages (#34704) 2025-10-22 11:30:35 +02:00
README.md DEV: Chat service object initial implementation (#19814) 2023-02-13 13:09:57 +01:00

This plugin is still in active development and may change frequently

Documentation

The Discourse Chat plugin adds chat functionality to your Discourse so it can natively support both long-form and short-form communication needs of your online community.

For user documentation, see Discourse Chat.

For developer documentation, see Discourse Documentation.