feat: Add disappearing tools and thinking component from chat

This commit is contained in:
Petr Mironychev
2025-11-13 02:19:49 +01:00
parent 75cbc46808
commit c302138568
8 changed files with 87 additions and 1 deletions

View File

@ -103,16 +103,20 @@ ChatRootView {
ListView {
id: chatListView
signal hideServiceComponents(int itemIndex)
Layout.fillWidth: true
Layout.fillHeight: true
leftMargin: 5
model: root.chatModel
clip: true
spacing: 10
spacing: 0
boundsBehavior: Flickable.StopAtBounds
cacheBuffer: 2000
delegate: Loader {
id: componentLoader
required property var model
required property int index
@ -129,6 +133,12 @@ ChatRootView {
return chatItemComponent
}
}
onLoaded: {
if (componentLoader.sourceComponent == chatItemComponent && !root.isToolDebugging) {
chatListView.hideServiceComponents(index)
}
}
}
header: Item {
@ -179,8 +189,23 @@ ChatRootView {
id: toolMessageComponent
ToolStatusItem {
id: toolsItem
width: parent.width
toolContent: model.content
FadeListItemAnimation{
id: toolFadeAnimation
}
Connections {
target: chatListView
function onHideServiceComponents(itemIndex) {
if (index !== itemIndex) {
toolFadeAnimation.start()
}
}
}
}
}
@ -223,6 +248,19 @@ ChatRootView {
return content
}
isRedacted: model.isRedacted !== undefined ? model.isRedacted : false
FadeListItemAnimation{
id: thinkingFadeAnimation
}
Connections {
target: chatListView
function onHideServiceComponents(itemIndex) {
if (index !== itemIndex) {
thinkingFadeAnimation.start()
}
}
}
}
}
}