cache text during chat sidebar anim + file search with plocate
C++ / fmt (pull_request) Successful in 6s
C++ / build (pull_request) Failing after 2m2s
C++ / clang-tidy (pull_request) Failing after 2m0s
JS/TS / fmt (pull_request) Failing after 11s
JS/TS / lint (pull_request) Successful in 9s
Python / static (pull_request) Successful in 27s
Rust / build (pull_request) Successful in 50s
Python / verify (pull_request) Successful in 1m32s
Rust / fmt (pull_request) Successful in 27s
Rust / clippy (pull_request) Successful in 48s
C++ / fmt (pull_request) Successful in 6s
C++ / build (pull_request) Failing after 2m2s
C++ / clang-tidy (pull_request) Failing after 2m0s
JS/TS / fmt (pull_request) Failing after 11s
JS/TS / lint (pull_request) Successful in 9s
Python / static (pull_request) Successful in 27s
Rust / build (pull_request) Successful in 50s
Python / verify (pull_request) Successful in 1m32s
Rust / fmt (pull_request) Successful in 27s
Rust / clippy (pull_request) Successful in 48s
This commit is contained in:
@@ -2,6 +2,7 @@ import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import ZShell.Llm
|
||||
import ZShell.Config
|
||||
import qs.Modules.Notifications.Sidebar.Chat
|
||||
import qs.Components
|
||||
import qs.Services
|
||||
|
||||
@@ -16,8 +17,6 @@ Item {
|
||||
required property ChatMessage message
|
||||
required property ChatGeneration current
|
||||
|
||||
// Widest the bubble may grow to; assistant bubbles always use it so
|
||||
// the markdown blocks have a deterministic width to wrap against.
|
||||
readonly property real contentMaxWidth: width - Tokens.spacing.extraSmall - Tokens.spacing.extraLarge
|
||||
|
||||
signal edit(text: string)
|
||||
@@ -27,21 +26,51 @@ Item {
|
||||
CustomClippingRect {
|
||||
id: bubble
|
||||
|
||||
property real liveTargetWidth: root.isUser ? Math.min(msgText.implicitWidth + Tokens.padding.medium * 2, root.contentMaxWidth) : root.contentMaxWidth
|
||||
property real frozenWidth: 0.0
|
||||
property bool layoutFrozen: false
|
||||
property real layoutWidth: root.isUser ? Math.min(msgText.implicitWidth + Tokens.padding.medium * 2, root.contentMaxWidth) : root.contentMaxWidth
|
||||
|
||||
radius: Tokens.rounding.medium
|
||||
color: root.isUser ? Colors.palette.m3primary : Colors.palette.m3surfaceContainer
|
||||
implicitWidth: root.isUser ? Math.min(msgText.implicitWidth + Tokens.padding.medium * 2, root.contentMaxWidth) : root.contentMaxWidth
|
||||
implicitWidth: layoutFrozen ? frozenWidth : layoutWidth
|
||||
implicitHeight: root.isUser ? msgText.contentHeight + Tokens.padding.medium * 2 : blocks.implicitHeight + blocks.anchors.topMargin * 2
|
||||
anchors.right: root.isUser ? parent.right : undefined
|
||||
layer.enabled: false
|
||||
layer.smooth: true
|
||||
|
||||
// Behavior on implicitHeight {
|
||||
// enabled: !root.segment.running
|
||||
//
|
||||
// Anim {
|
||||
// type: Anim.DefaultEffects
|
||||
// }
|
||||
// }
|
||||
transform: Scale {
|
||||
id: stretchScale
|
||||
origin.x: root.isUser ? bubble.width : 0
|
||||
xScale: bubble.layoutFrozen && bubble.frozenWidth > 0 ? bubble.liveTargetWidth / bubble.frozenWidth : 1.0
|
||||
}
|
||||
|
||||
states: [
|
||||
State {
|
||||
name: "toSlim"
|
||||
when: !ChatState.isWide && !ChatState.settledSlim
|
||||
|
||||
PropertyChanges {
|
||||
bubble.layer.enabled: true
|
||||
bubble.layoutFrozen: true
|
||||
}
|
||||
},
|
||||
State {
|
||||
name: "toWide"
|
||||
when: ChatState.isWide && !ChatState.settledWide
|
||||
|
||||
PropertyChanges {
|
||||
bubble.layer.enabled: true
|
||||
bubble.layoutFrozen: true
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
onLayoutFrozenChanged: {
|
||||
if (layoutFrozen)
|
||||
frozenWidth = width;
|
||||
}
|
||||
|
||||
// User messages stay a plain editable text field.
|
||||
TextEditBase {
|
||||
id: msgText
|
||||
|
||||
|
||||
Reference in New Issue
Block a user