Fixes #2765 - Use the keyboard up arrow to edit the last message, use escape to cancel editing or replying.

This commit is contained in:
Stefan Ceriu
2024-05-07 12:56:51 +03:00
committed by Stefan Ceriu
parent 3017100e5e
commit e05e664f6d
8 changed files with 91 additions and 28 deletions
@@ -161,12 +161,19 @@ struct ComposerToolbar: View {
showResizeGrabber: context.viewState.bindings.composerActionsEnabled,
isExpanded: $context.composerExpanded) {
context.send(viewAction: .sendMessage)
} editAction: {
context.send(viewAction: .editLastMessage)
} pasteAction: { provider in
context.send(viewAction: .handlePasteOrDrop(provider: provider))
} replyCancellationAction: {
context.send(viewAction: .cancelReply)
} editCancellationAction: {
context.send(viewAction: .cancelEdit)
} cancellationAction: {
switch context.viewState.composerMode {
case .edit:
context.send(viewAction: .cancelEdit)
case .reply:
context.send(viewAction: .cancelReply)
default:
break
}
} onAppearAction: {
context.send(viewAction: .composerAppeared)
}