Skip to content

Commit c22d776

Browse files
committed
fix(queen): replace broken MultilineInput with SimpleMultilineInput
- Replace NSViewRepresentable-based MultilineInput with SwiftUI TextEditor - Removes @mention, /command, image paste (archived in MultilineInput struct) - Enter sends message, Shift+Enter inserts newline - Placeholder via ZStack overlay - Min height 40, max height 150 for multiline scroll Closes #415
1 parent 4bfae21 commit c22d776

1 file changed

Lines changed: 38 additions & 10 deletions

File tree

apps/queen/QueenUI/Screens/Brain/ChatScreen.swift

Lines changed: 38 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1967,20 +1967,13 @@ struct ChatScreen: View {
19671967

19681968
private var inputBarView: some View {
19691969
HStack(spacing: ParietalSpacing.md) {
1970-
MultilineInput(
1970+
SimpleMultilineInput(
19711971
text: $input,
19721972
placeholder: placeholder,
19731973
isFocused: $focused,
1974-
onSubmit: { send() },
1975-
onImagePaste: { name, path in
1976-
attachedFiles.append((name: name, content: "[Image: \(name)]"))
1977-
},
1978-
onMentionTrigger: { query in
1979-
mentionQuery = query ?? ""
1980-
showMentionPopup = query != nil
1981-
}
1974+
onSubmit: { send() }
19821975
)
1983-
.frame(maxWidth: 600) // FIXED: prevent oversized input width
1976+
.frame(maxWidth: 600)
19841977
.layoutPriority(1)
19851978

19861979
Button {
@@ -7715,3 +7708,38 @@ struct ThreadLoadingSkeleton: View {
77157708
.onAppear { shimmer = true }
77167709
}
77177710
}
7711+
7712+
struct SimpleMultilineInput: View {
7713+
@Binding var text: String
7714+
var placeholder: String
7715+
@FocusState.Binding var isFocused: Bool
7716+
var onSubmit: () -> Void
7717+
7718+
var body: some View {
7719+
ZStack(alignment: .topLeading) {
7720+
if text.isEmpty {
7721+
Text(placeholder)
7722+
.foregroundColor(.white.opacity(0.3))
7723+
.padding(.horizontal, 8)
7724+
.padding(.vertical, 10)
7725+
.allowsHitTesting(false)
7726+
}
7727+
7728+
TextEditor(text: $text)
7729+
.scrollContentBackground(.hidden)
7730+
.foregroundColor(.white)
7731+
.font(.system(size: 15))
7732+
.padding(.horizontal, 4)
7733+
.padding(.vertical, 4)
7734+
.focused($isFocused)
7735+
.onKeyPress(.return, modifiers: .shift) {
7736+
return .ignored
7737+
}
7738+
.onKeyPress(.return) {
7739+
onSubmit()
7740+
return .handled
7741+
}
7742+
}
7743+
.frame(minHeight: 40, maxHeight: 150)
7744+
}
7745+
}

0 commit comments

Comments
 (0)