feat: implement file and text drop handling for chat and add shrunk sidebar override for window view

This commit is contained in:
2026-10-24 16:28:13 +02:00
parent e35c87b3f2
commit 5401cfbc0a
13 changed files with 929 additions and 486 deletions
+9 -18
View File
@@ -21,12 +21,8 @@ Item {
property bool chatOpen: ChatState.chatSession !== null
readonly property bool isWide: root.width >= root.breakpoint
readonly property bool showList: isWide || !chatOpen
readonly property bool showContent: !isWide && chatOpen
function openConversation(conv: ChatSession, index: int): void {
}
readonly property bool wideExpandedSidebar: isWide && !ChatState.shrinkSidebarOverride
readonly property bool narrowExpandedSidebar: !isWide && ChatState.narrowSidebarExpanded
BlobGroup {
id: blobGroup
@@ -54,9 +50,9 @@ Item {
anchors.left: parent.left
anchors.bottom: parent.bottom
anchors.margins: Tokens.padding.medium
implicitWidth: root.isWide || ChatState.narrowSidebarExpanded ? Config.sidebar.sizes.width : root.iconSize
implicitWidth: root.wideExpandedSidebar || root.narrowExpandedSidebar ? Config.sidebar.sizes.width : root.iconSize
highlight: true
slim: !root.isWide && !ChatState.narrowSidebarExpanded
slim: !root.wideExpandedSidebar && !root.narrowExpandedSidebar
z: 1
Behavior on implicitWidth {
@@ -86,13 +82,13 @@ Item {
}
}
ClipRect {
Item {
anchors.fill: parent
anchors.leftMargin: invertedRect.borderLeft
anchors.topMargin: invertedRect.borderTop
anchors.bottomMargin: invertedRect.borderBottom
anchors.rightMargin: invertedRect.borderRight
radius: invertedRect.radius
clip: true
children: [contentArea, dim]
}
@@ -100,9 +96,10 @@ Item {
CustomRect {
id: dim
anchors.fill: parent
radius: invertedRect.radius
color: Colors.palette.m3shadow
opacity: ChatState.narrowSidebarExpanded && !root.isWide ? 0.3 : 0
opacity: root.narrowExpandedSidebar ? 0.3 : 0
z: 1
Behavior on opacity {
@@ -155,7 +152,7 @@ Item {
id: dimArea
anchors.fill: parent
preventStealing: true
enabled: !root.isWide && ChatState.narrowSidebarExpanded
enabled: root.narrowExpandedSidebar
cursorShape: undefined
onClicked: {
@@ -175,12 +172,6 @@ Item {
}
}
Binding {
target: ChatState
property: "windowIsWide"
value: root.showList
}
Binding {
target: ChatState
property: "isWide"