mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-18 21:45:31 +09:00
feat(app): add quick reply and edit keybinds (#3032)
This commit is contained in:
1 parent
364084c819
commit
9908518f5b
43 files changed
+3475
-2972
No files matched your search
@@ -20,6 +20,10 @@ export const isKeybindAllowedDuringVoiceCallFullscreen = (action: KeybindCommand
|
||||
|
||||
const COMPACT_CALL_TEXTAREA_ACTIONS = new Set<KeybindCommand>([
|
||||
'message_focus_textarea',
|
||||
'message_reply_prev',
|
||||
'message_reply_next',
|
||||
'message_edit_prev',
|
||||
'message_edit_next',
|
||||
'chat_focus_textarea',
|
||||
'chat_upload',
|
||||
'chat_toggle_emoji',
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
import type {HandlerHost} from '@app/features/app/keybindings/keybind_manager/handlers/types';
|
||||
import {
|
||||
requestAdjacentMessageReply,
|
||||
requestCopyMessageId,
|
||||
requestCopyMessageLink,
|
||||
requestCopyMessageText,
|
||||
@@ -13,6 +14,7 @@ import {
|
||||
requestSpeakMessage,
|
||||
requestToggleBookmark,
|
||||
requestToggleSuppressEmbeds,
|
||||
startAdjacentMessageEdit,
|
||||
startMessageEdit,
|
||||
triggerAddReaction,
|
||||
} from '@app/features/channel/components/MessageActionUtils';
|
||||
@@ -50,6 +52,22 @@ export function registerMessageHandlers(host: HandlerHost, i18n: I18n): void {
|
||||
if (!message) return;
|
||||
requestMessageReply(message, {sourceChannel: context?.focusedChannel});
|
||||
});
|
||||
host.register('message_reply_prev', ({type}) => {
|
||||
if (type !== 'press' || !host.currentChannelId) return;
|
||||
requestAdjacentMessageReply(host.currentChannelId, -1);
|
||||
});
|
||||
host.register('message_reply_next', ({type}) => {
|
||||
if (type !== 'press' || !host.currentChannelId) return;
|
||||
requestAdjacentMessageReply(host.currentChannelId, 1);
|
||||
});
|
||||
host.register('message_edit_prev', ({type}) => {
|
||||
if (type !== 'press' || !host.currentChannelId) return;
|
||||
startAdjacentMessageEdit(host.currentChannelId, -1);
|
||||
});
|
||||
host.register('message_edit_next', ({type}) => {
|
||||
if (type !== 'press' || !host.currentChannelId) return;
|
||||
startAdjacentMessageEdit(host.currentChannelId, 1);
|
||||
});
|
||||
host.register('message_forward', ({type, context}) => {
|
||||
if (type !== 'press') return;
|
||||
const message = context?.focusedMessage ?? MessageFocus.getFocusedMessage();
|
||||
|
||||
Reference in new issue
Block a user