Files
z-bar-qt/Modules/Notifications/Sidebar/Wrapper.qml
T
zach 1fe8a3a959
C++ / fmt (pull_request) Failing after 6s
C++ / build (pull_request) Failing after 10s
C++ / clang-tidy (pull_request) Failing after 9s
JS/TS / fmt (pull_request) Successful in 10s
JS/TS / lint (pull_request) Successful in 8s
Python / static (pull_request) Successful in 30s
Rust / build (pull_request) Successful in 49s
Python / verify (pull_request) Successful in 1m35s
Rust / fmt (pull_request) Successful in 36s
Rust / clippy (pull_request) Successful in 54s
chore: restructure llm plugin to be more coherent & fix various bugs in llm ui
2026-10-18 12:58:38 +02:00

59 lines
1.3 KiB
QML

pragma ComponentBehavior: Bound
import qs.Components
import qs.Components.Toast
import ZShell
import ZShell.Config
import ZShell.Llm
import Quickshell
import QtQuick
Item {
id: root
readonly property bool chatActive: screenState.sidebarTab === 1
property real offsetScale: shouldBeActive ? 0 : 1
required property var panels
required property ScreenState screenState
readonly property bool shouldBeActive: root.screenState.sidebar && Config.sidebar.enabled
anchors.rightMargin: (-implicitWidth - 5) * offsetScale
implicitWidth: Config.sidebar.sizes.width
opacity: 1 - offsetScale
visible: offsetScale < 1
Behavior on offsetScale {
Anim {
duration: Tokens.anim.durations.expressiveDefaultSpatial
easing: Tokens.anim.expressiveDefaultSpatial
}
}
Connections {
target: LlmClient
function onGenerationFailed(session: ChatSession, message: string): void {
if (root.shouldBeActive && root.chatActive)
return;
Toaster.toast(qsTr("Chat"), message, "error_outline", Toast.Error);
}
}
Loader {
id: content
active: root.shouldBeActive || root.visible
anchors.bottom: parent.bottom
anchors.bottomMargin: 0
anchors.left: parent.left
anchors.margins: 8
anchors.top: parent.top
sourceComponent: Content {
implicitWidth: Config.sidebar.sizes.width - Tokens.padding.small * 2
screenState: root.screenState
}
}
}