Added a lot of functionality. Bugfixes and changes
This commit is contained in:
@@ -34,15 +34,20 @@ struct InputBar: View {
|
||||
VStack(spacing: 0) {
|
||||
// Command dropdown (if showing)
|
||||
if showCommandDropdown && text.hasPrefix("/") {
|
||||
CommandSuggestionsView(
|
||||
searchText: text,
|
||||
selectedIndex: selectedSuggestionIndex,
|
||||
onSelect: { command in
|
||||
selectCommand(command)
|
||||
}
|
||||
)
|
||||
.frame(maxHeight: 200)
|
||||
.transition(.move(edge: .bottom).combined(with: .opacity))
|
||||
HStack {
|
||||
CommandSuggestionsView(
|
||||
searchText: text,
|
||||
selectedIndex: selectedSuggestionIndex,
|
||||
onSelect: { command in
|
||||
selectCommand(command)
|
||||
}
|
||||
)
|
||||
.frame(width: 400)
|
||||
.frame(maxHeight: 200)
|
||||
.transition(.move(edge: .bottom).combined(with: .opacity))
|
||||
Spacer()
|
||||
}
|
||||
.padding(.leading, 96) // Align with input box (status badges + spacing)
|
||||
}
|
||||
|
||||
// Input area
|
||||
@@ -127,13 +132,13 @@ struct InputBar: View {
|
||||
return .handled
|
||||
}
|
||||
}
|
||||
// Plain Return on single line: send
|
||||
if !text.contains("\n") && !text.isEmpty {
|
||||
// Return (plain or with Cmd): send message
|
||||
if !text.isEmpty {
|
||||
onSend()
|
||||
return .handled
|
||||
}
|
||||
// Otherwise: let system handle (insert newline)
|
||||
return .ignored
|
||||
// Empty text: do nothing
|
||||
return .handled
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -323,7 +328,6 @@ struct CommandSuggestionsView: View {
|
||||
RoundedRectangle(cornerRadius: 8)
|
||||
.stroke(Color.oaiBorder, lineWidth: 1)
|
||||
)
|
||||
.padding(.horizontal)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user