feat(app): composer send-button toggle and active button hover (#2093)

This commit is contained in:
Hampus authored and GitHub committed 2026-08-29 20:25:49 +02:00
1 parent cb889b1160
commit d75a29f099
2 files changed
+20 -5

No files matched your search

@@ -21,7 +21,8 @@
} }
.button:hover:not(:disabled), .button:hover:not(:disabled),
.button.contextMenuHover:not(:disabled) { .button.contextMenuHover:not(:disabled),
.button.selected:not(:disabled) {
color: var(--text-primary); color: var(--text-primary);
background-color: var(--background-modifier-hover); background-color: var(--background-modifier-hover);
} }
@@ -31,10 +32,6 @@
opacity: 0.7; opacity: 0.7;
} }
.button.selected {
color: var(--text-primary);
}
.icon { .icon {
width: var(--textarea-button-icon-size); width: var(--textarea-button-icon-size);
height: var(--textarea-button-icon-size); height: var(--textarea-button-icon-size);
@@ -1,5 +1,7 @@
// SPDX-License-Identifier: AGPL-3.0-or-later // SPDX-License-Identifier: AGPL-3.0-or-later
import * as AccessibilityCommands from '@app/features/accessibility/commands/AccessibilityCommands';
import Accessibility from '@app/features/accessibility/state/Accessibility';
import {PRODUCT_NAME} from '@app/features/app/config/I18nDisplayConstants'; import {PRODUCT_NAME} from '@app/features/app/config/I18nDisplayConstants';
import Spellcheck from '@app/features/messaging/state/Spellcheck'; import Spellcheck from '@app/features/messaging/state/Spellcheck';
import {isEditableTextInput, replaceSelectedText} from '@app/features/messaging/utils/TextInputEditUtils'; import {isEditableTextInput, replaceSelectedText} from '@app/features/messaging/utils/TextInputEditUtils';
@@ -97,6 +99,11 @@ const SPELLCHECK_SETTINGS_DESCRIPTOR = msg({
'Item in the textarea spellcheck submenu that opens the full settings page. Trailing horizontal ellipsis (…) indicates the action opens settings.', 'Item in the textarea spellcheck submenu that opens the full settings page. Trailing horizontal ellipsis (…) indicates the action opens settings.',
}); });
const SHOW_SEND_BUTTON_DESCRIPTOR = msg({
message: 'Show send button',
comment: 'Short label in the channel and chat textarea plus menu. Keep it concise.',
});
export interface TextareaContextMenuEditFlags { export interface TextareaContextMenuEditFlags {
canUndo: boolean; canUndo: boolean;
canRedo: boolean; canRedo: boolean;
@@ -117,6 +124,7 @@ interface TextareaContextMenuProps {
export const TextareaContextMenu = observer( export const TextareaContextMenu = observer(
({misspelledWord, suggestions = [], editFlags, targetElement, onClose}: TextareaContextMenuProps) => { ({misspelledWord, suggestions = [], editFlags, targetElement, onClose}: TextareaContextMenuProps) => {
const {i18n} = useLingui(); const {i18n} = useLingui();
const showMessageSendButton = Accessibility.showMessageSendButton;
const electronAPI = isElectron() ? getElectronAPI() : null; const electronAPI = isElectron() ? getElectronAPI() : null;
const focusTargetElement = () => { const focusTargetElement = () => {
if (!targetElement?.isConnected) { if (!targetElement?.isConnected) {
@@ -301,6 +309,16 @@ 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">
<CheckboxItem
checked={showMessageSendButton}
onCheckedChange={(checked) => AccessibilityCommands.update({showMessageSendButton: checked})}
closeOnChange={false}
data-flx="channel.textarea.textarea-context-menu.checkbox-item.show-send-button"
>
{i18n._(SHOW_SEND_BUTTON_DESCRIPTOR)}
</CheckboxItem>
</MenuGroup>
</> </>
); );
}, },