feat(ai): auto-resize input with scroll (#3148)

This commit is contained in:
Minh
2026-03-27 22:56:30 +01:00
committed by GitHub
@@ -497,17 +497,24 @@ Inline w/ backslash and round brackets \\(e^{i\\pi} + 1 = 0\\)
RowLayout { // Input field and send button
id: inputFieldRowLayout
anchors {
top: attachedFileIndicator.bottom
bottom: commandButtonsRow.top
left: parent.left
right: parent.right
topMargin: 5
bottomMargin: 5
}
spacing: 0
StyledTextArea { // The actual TextArea
id: messageInputField
wrapMode: TextArea.Wrap
ScrollView {
id: inputScrollView
Layout.fillWidth: true
Layout.preferredHeight: Math.min(root.height * 3/5, messageInputField.height)
clip: true
ScrollBar.vertical.policy: ScrollBar.AsNeeded
StyledTextArea { // The actual TextArea (inside ScrollView to enable scrolling)
id: messageInputField
anchors.fill: parent
wrapMode: TextArea.Wrap
padding: 10
color: activeFocus ? Appearance.m3colors.m3onSurface : Appearance.m3colors.m3onSurfaceVariant
placeholderText: Translation.tr('Message the model... "%1" for commands').arg(root.commandPrefix)
@@ -686,10 +693,10 @@ Inline w/ backslash and round brackets \\(e^{i\\pi} + 1 = 0\\)
}
}
}
}
RippleButton { // Send button
id: sendButton
Layout.alignment: Qt.AlignTop
Layout.alignment: Qt.AlignBottom
Layout.rightMargin: 5
implicitWidth: 40
implicitHeight: 40