File tree Expand file tree Collapse file tree
Core/Sources/SuggestionWidget/SuggestionPanelContent Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -61,7 +61,7 @@ struct ChatPanelToolbar: View {
6161
6262struct ChatPanelMessages : View {
6363 @ObservedObject var chat : ChatProvider
64-
64+
6565 var body : some View {
6666 List {
6767 Group {
@@ -288,12 +288,6 @@ struct ChatPanelInputArea: View {
288288 . multilineTextAlignment ( . leading)
289289 . textFieldStyle ( . plain)
290290 . padding ( 8 )
291- . onSubmit {
292- if chat. isReceivingMessage { return }
293- if typedMessage. isEmpty { return }
294- chat. send ( typedMessage)
295- typedMessage = " "
296- }
297291
298292 Button ( action: {
299293 if typedMessage. isEmpty { return }
@@ -305,6 +299,7 @@ struct ChatPanelInputArea: View {
305299 }
306300 . buttonStyle ( . plain)
307301 . disabled ( chat. isReceivingMessage)
302+ . keyboardShortcut ( KeyEquivalent . return, modifiers: [ ] )
308303 }
309304 . frame ( maxWidth: . infinity)
310305 . background {
@@ -315,6 +310,14 @@ struct ChatPanelInputArea: View {
315310 RoundedRectangle ( cornerRadius: 6 )
316311 . stroke ( Color ( nsColor: . controlColor) , lineWidth: 1 )
317312 }
313+ . background {
314+ Button ( action: {
315+ typedMessage += " \n "
316+ } ) {
317+ EmptyView ( )
318+ }
319+ . keyboardShortcut ( KeyEquivalent . return, modifiers: [ . shift] )
320+ }
318321 }
319322 . onAppear {
320323 isInputAreaFocused = true
@@ -536,3 +539,4 @@ struct ChatPanel_Light_Preview: PreviewProvider {
536539 . colorScheme ( . light)
537540 }
538541}
542+
You can’t perform that action at this time.
0 commit comments