fix(app): scope the show-send-button toggle to the main composer (#2104)

This commit is contained in:
Hampus authored and GitHub committed 2026-08-30 00:12:31 +02:00
1 parent f35c0effa2
commit 19efbd3d61
2 files changed
+22 -11

No files matched your search

@@ -118,11 +118,19 @@ interface TextareaContextMenuProps {
suggestions?: Array<string>; suggestions?: Array<string>;
editFlags?: TextareaContextMenuEditFlags; editFlags?: TextareaContextMenuEditFlags;
targetElement?: HTMLElement | null; targetElement?: HTMLElement | null;
showSendButtonToggle?: boolean;
onClose: () => void; onClose: () => void;
} }
export const TextareaContextMenu = observer( export const TextareaContextMenu = observer(
({misspelledWord, suggestions = [], editFlags, targetElement, onClose}: TextareaContextMenuProps) => { ({
misspelledWord,
suggestions = [],
editFlags,
targetElement,
showSendButtonToggle = false,
onClose,
}: TextareaContextMenuProps) => {
const {i18n} = useLingui(); const {i18n} = useLingui();
const showMessageSendButton = Accessibility.showMessageSendButton; const showMessageSendButton = Accessibility.showMessageSendButton;
const electronAPI = isElectron() ? getElectronAPI() : null; const electronAPI = isElectron() ? getElectronAPI() : null;
@@ -309,16 +317,18 @@ export const TextareaContextMenu = observer(
data-flx="channel.textarea.textarea-context-menu.menu-item-submenu" data-flx="channel.textarea.textarea-context-menu.menu-item-submenu"
/> />
</MenuGroup> </MenuGroup>
<MenuGroup data-flx="channel.textarea.textarea-context-menu.menu-group--6"> {showSendButtonToggle && (
<CheckboxItem <MenuGroup data-flx="channel.textarea.textarea-context-menu.menu-group--6">
checked={showMessageSendButton} <CheckboxItem
onCheckedChange={(checked) => AccessibilityCommands.update({showMessageSendButton: checked})} checked={showMessageSendButton}
closeOnChange={false} onCheckedChange={(checked) => AccessibilityCommands.update({showMessageSendButton: checked})}
data-flx="channel.textarea.textarea-context-menu.checkbox-item.show-send-button" closeOnChange={false}
> data-flx="channel.textarea.textarea-context-menu.checkbox-item.show-send-button"
{i18n._(SHOW_SEND_BUTTON_DESCRIPTOR)} >
</CheckboxItem> {i18n._(SHOW_SEND_BUTTON_DESCRIPTOR)}
</MenuGroup> </CheckboxItem>
</MenuGroup>
)}
</> </>
); );
}, },
@@ -218,6 +218,7 @@ export const useTextInputContextMenu = () => {
suggestions: params.suggestions, suggestions: params.suggestions,
editFlags: params.editFlags as TextareaContextMenuEditFlags | undefined, editFlags: params.editFlags as TextareaContextMenuEditFlags | undefined,
targetElement: resolvedTarget.editable, targetElement: resolvedTarget.editable,
showSendButtonToggle: resolvedTarget.editable.closest('flx-channel-textarea') != null,
}); });
}); });
return () => { return () => {