mirror of
https://github.com/Palm1r/QodeAssist.git
synced 2026-02-12 10:10:44 -05:00
refactor: Change handling finished tools and thinking blocks
This commit is contained in:
@ -217,11 +217,6 @@ ChatRootView::ChatRootView(QQuickItem *parent)
|
||||
&Utils::BaseAspect::changed,
|
||||
this,
|
||||
&ChatRootView::isThinkingSupportChanged);
|
||||
connect(
|
||||
&Settings::toolsSettings().debugToolsAndThinkingComponent,
|
||||
&Utils::BaseAspect::changed,
|
||||
this,
|
||||
&ChatRootView::isToolDebugging);
|
||||
}
|
||||
|
||||
ChatModel *ChatRootView::chatModel() const
|
||||
@ -1131,9 +1126,5 @@ bool ChatRootView::isThinkingSupport() const
|
||||
return provider && provider->supportThinking();
|
||||
}
|
||||
|
||||
bool ChatRootView::isToolDebugging() const
|
||||
{
|
||||
return Settings::toolsSettings().debugToolsAndThinkingComponent();
|
||||
}
|
||||
|
||||
} // namespace QodeAssist::Chat
|
||||
|
||||
@ -58,7 +58,6 @@ class ChatRootView : public QQuickItem
|
||||
Q_PROPERTY(int currentMessagePendingEdits READ currentMessagePendingEdits NOTIFY currentMessageEditsStatsChanged FINAL)
|
||||
Q_PROPERTY(int currentMessageRejectedEdits READ currentMessageRejectedEdits NOTIFY currentMessageEditsStatsChanged FINAL)
|
||||
Q_PROPERTY(bool isThinkingSupport READ isThinkingSupport NOTIFY isThinkingSupportChanged FINAL)
|
||||
Q_PROPERTY(bool isToolDebugging READ isToolDebugging NOTIFY isToolDebuggingChanged FINAL)
|
||||
|
||||
QML_ELEMENT
|
||||
|
||||
@ -143,8 +142,6 @@ public:
|
||||
|
||||
bool isThinkingSupport() const;
|
||||
|
||||
bool isToolDebugging() const;
|
||||
|
||||
public slots:
|
||||
void sendMessage(const QString &message);
|
||||
void copyToClipboard(const QString &text);
|
||||
@ -180,8 +177,6 @@ signals:
|
||||
|
||||
void isThinkingSupportChanged();
|
||||
|
||||
void isToolDebuggingChanged();
|
||||
|
||||
private:
|
||||
void updateFileEditStatus(const QString &editId, const QString &status);
|
||||
QString getChatsHistoryDir() const;
|
||||
|
||||
@ -135,7 +135,7 @@ ChatRootView {
|
||||
}
|
||||
|
||||
onLoaded: {
|
||||
if (componentLoader.sourceComponent == chatItemComponent && !root.isToolDebugging) {
|
||||
if (componentLoader.sourceComponent == chatItemComponent) {
|
||||
chatListView.hideServiceComponents(index)
|
||||
}
|
||||
}
|
||||
@ -194,15 +194,11 @@ ChatRootView {
|
||||
width: parent.width
|
||||
toolContent: model.content
|
||||
|
||||
FadeListItemAnimation{
|
||||
id: toolFadeAnimation
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: chatListView
|
||||
function onHideServiceComponents(itemIndex) {
|
||||
if (index !== itemIndex) {
|
||||
toolFadeAnimation.start()
|
||||
toolsItem.headerOpacity = 0.5
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -238,6 +234,8 @@ ChatRootView {
|
||||
id: thinkingMessageComponent
|
||||
|
||||
ThinkingStatusItem {
|
||||
id: thinking
|
||||
|
||||
width: parent.width
|
||||
thinkingContent: {
|
||||
let content = model.content
|
||||
@ -249,15 +247,11 @@ ChatRootView {
|
||||
}
|
||||
isRedacted: model.isRedacted !== undefined ? model.isRedacted : false
|
||||
|
||||
FadeListItemAnimation{
|
||||
id: thinkingFadeAnimation
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: chatListView
|
||||
function onHideServiceComponents(itemIndex) {
|
||||
if (index !== itemIndex) {
|
||||
thinkingFadeAnimation.start()
|
||||
thinking.headerOpacity = 0.5
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -28,6 +28,8 @@ Rectangle {
|
||||
property bool isRedacted: false
|
||||
property bool expanded: false
|
||||
|
||||
property alias headerOpacity: headerRow.opacity
|
||||
|
||||
radius: 6
|
||||
color: palette.base
|
||||
clip: true
|
||||
|
||||
@ -26,6 +26,8 @@ Rectangle {
|
||||
property string toolContent: ""
|
||||
property bool expanded: false
|
||||
|
||||
property alias headerOpacity: headerRow.opacity
|
||||
|
||||
readonly property int firstNewline: toolContent.indexOf('\n')
|
||||
readonly property string toolName: firstNewline > 0 ? toolContent.substring(0, firstNewline) : toolContent
|
||||
readonly property string toolResult: firstNewline > 0 ? toolContent.substring(firstNewline + 1) : ""
|
||||
|
||||
Reference in New Issue
Block a user