Add ESC keyboard shortcut to close email detail view

Adds the ability to close the email detail/thread detail view by pressing
the ESC key, following the same pattern used for closing the composer.

Changes:
- Add closeThreadDetail to MailViewActionShortcutType enum
- Map ESC key to closeThreadDetail in AppShortcutManager
- Handle closeThreadDetail action in HandleMailShortcutActionsExtension

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Martin Kask
2026-01-20 18:37:21 +02:00
committed by Dat H. Pham
parent ea7b9fed33
commit f78f78c659
3 changed files with 13 additions and 1 deletions
@@ -25,6 +25,8 @@ class AppShortcutManager {
return MailViewActionShortcutType.newMessage;
} else if (keysPressed.isOnly(LogicalKeyboardKey.keyU)) {
return MailViewActionShortcutType.markAsUnread;
} else if (keysPressed.isOnly(LogicalKeyboardKey.escape)) {
return MailViewActionShortcutType.closeThreadDetail;
} else {
return null;
}
@@ -9,7 +9,8 @@ enum MailViewActionShortcutType {
forward,
delete,
newMessage,
markAsUnread;
markAsUnread,
closeThreadDetail;
EmailActionType? getEmailActionType({
required PresentationEmail currentEmail,
@@ -34,6 +35,8 @@ enum MailViewActionShortcutType {
return EmailActionType.compose;
case MailViewActionShortcutType.markAsUnread:
return EmailActionType.markAsUnread;
case MailViewActionShortcutType.closeThreadDetail:
return null;
}
}
}