Add Quick Fix: a bar chat that hands quick fixes to Claude, Codex or a local model
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>
This commit is contained in:
1 parent
30e98bac63
commit
3d976b5961
8 files changed
+1693
No files matched your search
@@ -0,0 +1,45 @@
|
||||
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
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user