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 RowLayout { // Input field and send button
id: inputFieldRowLayout id: inputFieldRowLayout
anchors { anchors {
top: attachedFileIndicator.bottom bottom: commandButtonsRow.top
left: parent.left left: parent.left
right: parent.right right: parent.right
topMargin: 5 bottomMargin: 5
} }
spacing: 0 spacing: 0
StyledTextArea { // The actual TextArea ScrollView {
id: messageInputField id: inputScrollView
wrapMode: TextArea.Wrap
Layout.fillWidth: true 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 padding: 10
color: activeFocus ? Appearance.m3colors.m3onSurface : Appearance.m3colors.m3onSurfaceVariant color: activeFocus ? Appearance.m3colors.m3onSurface : Appearance.m3colors.m3onSurfaceVariant
placeholderText: Translation.tr('Message the model... "%1" for commands').arg(root.commandPrefix) 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 RippleButton { // Send button
id: sendButton id: sendButton
Layout.alignment: Qt.AlignTop Layout.alignment: Qt.AlignBottom
Layout.rightMargin: 5 Layout.rightMargin: 5
implicitWidth: 40 implicitWidth: 40
implicitHeight: 40 implicitHeight: 40