Skip to content

Display shortcut for each MessageView button #1570

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

mobile-ar
Copy link
Contributor

Based on this comment I added this functionality to display the shortcut of each button in the MessageView.

Dark mode
image

and Light mode
image

Copy link
Owner

@nikitabobko nikitabobko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, merged with the patch:

diff --git a/Sources/AppBundle/ui/MessageView.swift b/Sources/AppBundle/ui/MessageView.swift
index 6572bd2e..d86fa2cb 100644
--- a/Sources/AppBundle/ui/MessageView.swift
+++ b/Sources/AppBundle/ui/MessageView.swift
@@ -76,12 +76,7 @@ public struct MessageView: View {
                             openConfigButton(showShortcutGroup: true)
                     }
                 }
-                let closeButton = Button {
-                    model.message = nil
-                } label: {
-                    Text("Close")
-                }
-                .keyboardShortcut(.defaultAction)
+                let closeButton = Button("Close") { model.message = nil }.keyboardShortcut(.defaultAction)
                 shortcutGroup(label: Image(systemName: "return.left"), content: closeButton)
             }
             .padding()

Comment on lines -74 to 78
Button("Close") {
let closeButton = Button {
model.message = nil
} label: {
Text("Close")
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like we can leave Button("Close") { ... }

@nikitabobko nikitabobko added the pr-merged Pull Request is merged label Jul 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-merged Pull Request is merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants