discourse/spec/system/composer
David Battersby af0a65eefd
FEATURE: Validate Mentions in Rich Text Editor (#32879)
This change validates mentions for `users` and `groups` when using the
rich text editor.

When the mention is valid (ie. the user or group exists) it will
visually show as a mention node, but when the user or group does not
exist then it will appear as regular text in the editor.

There are 2 parts to this:

### Existing drafts / toggling from Markdown to Rich Text

We automatically add mention nodes for all `@mentions` and then process
any invalid mentions by removing the mention node and replacing it with
text.

### When manually typing in Rich Text

We find the mention within the text and then if valid we replace it with
a mention node.

### Validation

The validation happens in a single request when loading a draft or
switching from Markdown to Rich Text. The response provides a list of
valid usernames and groups. It also provides additional context for
groups and users that are not reachable (ie. unmentionable groups or
suspended users etc) but we don't use this currently.

We then store the valid and invalid mentions to prevent unnecessary
requests later.

As new mentions are typed then they will also be validated using the
same request as above (if they are not already stored in our valid /
invalid sets).
2025-06-10 11:37:20 +04:00
..
category_templates_spec.rb FIX: uses correct waiters and APIs (#32778) 2025-05-17 15:32:07 +02:00
default_to_subcategory_spec.rb DEV: Convert min_trust_to_create_topic to groups (#24740) 2023-12-13 14:50:13 +11:00
discard_draft_spec.rb FEATURE: Multiple Draft Topics (#30790) 2025-01-29 10:23:26 +04:00
dont_feed_the_trolls_popup_spec.rb DEV: move post flags into database (#27125) 2024-05-23 12:19:07 +10:00
post_validation_spec.rb DEV: Automatically update groups for test users with explicit TL (#25415) 2024-01-29 17:52:02 +08:00
prosemirror_editor_spec.rb FEATURE: Validate Mentions in Rich Text Editor (#32879) 2025-06-10 11:37:20 +04:00
review_media_unless_trust_level_spec.rb FIX: attempts to fix flaky in review media (#32787) 2025-05-18 22:57:00 +02:00
template_validation_spec.rb FEATURE: Implement tag group selection in dropdown and multi-select for topic creation and preview when using Form Templates (#32108) 2025-04-17 08:38:03 -05:00