Skip to content

feat(MessageComposer): control command sendability#1746

Open
MartinCupela wants to merge 10 commits into
masterfrom
feat/command-sendability
Open

feat(MessageComposer): control command sendability#1746
MartinCupela wants to merge 10 commits into
masterfrom
feat/command-sendability

Conversation

@MartinCupela
Copy link
Copy Markdown
Contributor

@MartinCupela MartinCupela commented May 14, 2026

Goal

Closes REACT-971

Add API that allows to verify, whether the message composer in command mode has state ready to be composed and sent to the server.

This are the rules:

  • ban - requires mention and additional text in order the MessageComposer.isCommandSendable returns true
  • unban - requires mention in order the MessageComposer.isCommandSendable returns true
  • mute - requires mention in order the MessageComposer.isCommandSendable returns true
  • unmute - requires mention in order the MessageComposer.isCommandSendable returns true

It is possible to provide custom command sendability validation function(s) in case the integrators have custom commands and want to apply custom validation rules.

Mentioned users state kept up-to-date on text change
Make sure that the mentioned users array in text composer state is not stale. Until now, this was verified only at the composition time. Now we prune stale user mentions on every text change middleware execution.

MartinCupela and others added 5 commits May 13, 2026 13:12
Add configurable command sendability validators so the composer can block submit for incomplete built-in and custom commands. Reuse the same validation context for send-button gating and final composition validation to keep command readiness consistent.

Co-authored-by: Cursor <cursoragent@cursor.com>
Provide a default ban validator in composer config.
Allow command validator arrays to be replaced via config overrides.

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 14, 2026

Size Change: +5.35 kB (+1.38%)

Total Size: 393 kB

📦 View Changed
Filename Size Change
dist/cjs/index.browser.js 131 kB +1.78 kB (+1.38%)
dist/cjs/index.node.js 132 kB +1.84 kB (+1.42%)
dist/esm/index.mjs 130 kB +1.73 kB (+1.35%)

compressed-size-action

Comment thread src/messageComposer/configuration/commands.configuration.ts Outdated
Comment thread src/messageComposer/configuration/commands.configuration.ts Outdated
Comment thread src/messageComposer/middleware/messageComposer/compositionValidation.ts Outdated
Comment thread src/messageComposer/middleware/messageComposer/compositionValidation.ts Outdated
Comment thread src/messageComposer/messageComposer.ts Outdated
Comment thread src/messageComposer/configuration/commands.configuration.ts
@MartinCupela MartinCupela force-pushed the feat/command-sendability branch from 5250cfb to 6c096ad Compare May 19, 2026 11:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants