Each request runs in its own systemd user unit and survives the shell restarting; the chat reopens on a running job or an unseen result. Auto picks the subscription with the most usage left (ai-usagebar). Runs are snapshotted so Undo can restore files and revert commits. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
46 lines
1.3 KiB
QML
46 lines
1.3 KiB
QML
import QtQuick
|
|
import Quickshell
|
|
import qs.Commons
|
|
import qs.Ui
|
|
|
|
// Bar button for Quick Fix. Click opens the chat under it; the icon turns
|
|
// into an hourglass while a job runs and takes the alert colour when one
|
|
// failed while the chat was closed.
|
|
BarWidget {
|
|
id: root
|
|
moduleName: "mx-quickfix"
|
|
|
|
readonly property var service: bar && bar.shell ? bar.shell.serviceFor(moduleName) : null
|
|
readonly property bool opened: panel.opened
|
|
readonly property bool popoutSwitchClosing: panel.popoutSwitchClosing
|
|
|
|
implicitWidth: button.implicitWidth
|
|
implicitHeight: button.implicitHeight
|
|
|
|
function open() { panel.open() }
|
|
function close() { panel.close() }
|
|
function toggle() { panel.opened ? panel.close() : panel.open() }
|
|
function closeForPopoutSwitch() { panel.closeForPopoutSwitch() }
|
|
|
|
BarIconButton {
|
|
id: button
|
|
anchors.fill: parent
|
|
bar: root.bar
|
|
text: root.service && root.service.running ? "" : ""
|
|
tooltipText: root.service && root.service.running ? "Quick fix: working…" : "Quick fix"
|
|
active: !!root.service && root.service.unseenFailure
|
|
onPressed: function(mouseButton) {
|
|
if (mouseButton === Qt.LeftButton) root.toggle()
|
|
}
|
|
}
|
|
|
|
ChatPanel {
|
|
id: panel
|
|
bar: root.bar
|
|
moduleName: root.moduleName
|
|
settings: root.settings
|
|
anchorItem: button
|
|
service: root.service
|
|
}
|
|
}
|