Quick Fix: reopen after a restart only when its own rebuild caused it

The chat reopened on every shell start while a stale "unseen" result was
left over. Now the helper checks the job's unit for a running rebuild
(zcli, nixos-rebuild, nh, home-manager) and only then reopens; other
restarts keep following a running job quietly.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
mxandClaude Opus 5.5 committed 2026-11-28 01:09:35 +01:00
1 parent f35dbee430
commit 94530d3bd3
4 files changed
+84 -11

No files matched your search

+7 -5
View File
@@ -5,8 +5,8 @@ import Quickshell.Io
// Shared state for every Quick Fix widget (one per bar): the conversation on
// screen, whether a job runs, history. Jobs run in their own systemd user
// units (helpers/quickfix.py), so a rebuild that restarts the shell does not
// stop them; on start this reopens the chat when a job is running or its
// result has not been seen yet.
// stop them; on start this reopens the chat only when the running job is the
// one whose rebuild restarted the shell, and otherwise keeps following it.
Item {
id: root
@@ -192,7 +192,7 @@ Item {
onTriggered: root.refresh()
}
// After a restart: reopen on a running job or an unseen result.
// After a restart: reopen when the running job's own rebuild restarted the shell.
property int summonTries: 0
Timer {
id: summonRetry
@@ -205,9 +205,11 @@ Item {
}
}
Component.onCompleted: call({ op: "state" }, result => {
if (!result.ok || !result.session || !(result.running || !result.seen)) return
if (!result.ok || !result.session || !result.running) return
// Follow a running job either way, so its result is announced.
root.session = result.session
root.running = result.running
root.running = true
if (!result.rebuilt) return
root.passive = true
root.summonTries = 0
summonRetry.start()