fix(threads): enable slash commands in the thread composer
The thread composer already showed the /command autocomplete (RoomInput.tsx:954 was never gated), but the interpreter was disabled (:523), so /me, /shrug, /invite, etc. sent literally in threads - a confusing inconsistency and the other half of the threads "v1" limitation. Remove the thread gate: content-transform commands (/me, /notice, /shrug, /tableflip, /unflip) flow into the normal send path, which already routes to the thread via threadRootId; the rest are room-level actions. No command sends a mis-routed timeline message (verified against useCommands). Scheduling stays disabled in threads for now. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -518,9 +518,12 @@ export const RoomInput = forwardRef<HTMLDivElement, RoomInputProps>(
|
||||
const submit = useCallback(() => {
|
||||
uploadBoardHandlers.current?.handleSend();
|
||||
|
||||
// Slash-command interpretation is disabled in thread mode (v1): "/foo"
|
||||
// sends literally rather than being parsed as a command.
|
||||
const commandName = threadRootId ? undefined : getBeginCommand(editor);
|
||||
// Slash commands work in threads too: content-transform commands (/me,
|
||||
// /notice, /shrug, /tableflip, /unflip) flow into the normal send below,
|
||||
// which routes to the thread via `threadRootId`; the rest (/invite, /kick,
|
||||
// …) are room-level actions. This also matches the command autocomplete,
|
||||
// which is already shown in the thread composer.
|
||||
const commandName = getBeginCommand(editor);
|
||||
let plainText = toPlainText(editor.children, isMarkdown).trim();
|
||||
let customHtml = trimCustomHtml(
|
||||
toMatrixCustomHTML(editor.children, {
|
||||
|
||||
Reference in New Issue
Block a user