Commit 95868b2
authored
fix(stoa-health): clicks, empty Settings, and no-terminal background actions (#142)
## Summary
Three concrete bugs from the report ("clicks don't work", "settings
panel is empty", "terminal opens and does nothing"), plus the
no-terminal background mode you asked for. The previous round didn't
actually solve clicks or settings; this one is grounded in the official
plugin source (verified against noctalia-plugins/clipboard).
### 1. Panel clicks finally fire
`runInTerm()` / `runSilent()` called `pluginApi.closePanel()` **before**
`Quickshell.execDetached()`. Closing the panel destroys the QML tree
synchronously — anything after it in the same JS handler runs in a
torn-down context and silently no-ops. Order is now: **spawn first,
close second**. Same fix on the header gear.
### 2. Settings panel renders content
The previous Settings.qml imported `NLabel` and `NTextInput` — neither
exists on the public plugin widget set. The official clipboard plugin
only uses `NSpinBox` / `NToggle` / `NComboBox`. A missing widget type
makes the whole file invalid, hence the empty panel. Section headers now
use plain `Text`; the per-action label editor uses
`QtQuick.Controls.TextField` styled to match.
### 3. No terminal, no confirmation
Every action runs through `Quickshell.execDetached` wrapped in a tiny
`sh -c` that fires three `notify-send` calls (Running / Done / Failed).
No terminal. Pacman/yay get `--noconfirm` so they never block on a
prompt.
For commands that genuinely need root (updates, scheduled cleanup), a
new **Privileged commands** setting picks between:
- **`pkexec`** *(default)* — graphical polkit prompt once per action.
Safe, not silent.
- **`sudo -n`** — fully silent, but **requires you to add NOPASSWD
sudoers rules** for the specific commands (`/usr/bin/pacman`,
`/usr/bin/yay`, `~/.local/bin/stoa-maintain`). Real security tradeoff —
chosen consciously.
### Also
- Removed the inert `panelAnchorHorizontalCenter` / `panelAnchorTop`
properties — confirmed in the official source that panels don't declare
them; anchoring is decided by the shell from the `caller` arg to
`openPanel(screen, this)`.
- Dropped the `terminal` setting (no longer used).
- README and per-action customisation (label/icon/visibility/order)
preserved.
## Test plan
- [x] Click a Vitals action → notification "Running: Doctor" → "Done:
Doctor", **no terminal**
- [x] Open Settings from the panel header gear → all sections render
(Appearance / Privileged / Actions)
- [x] Edit an action label and save → label persists after Noctalia
restart
- [x] Right-click → Settings opens the same panel
- [x] Update all on pkexec mode → one polkit prompt, then silent
execution
- [x] Switch to `sudo -n` without adding sudoers rules → "Failed: Update
all" notification (fast, correct)
https://claude.ai/code/session_01NS2BA7fzvSsp3ZhPzU18fL
---
_Generated by [Claude
Code](https://claude.ai/code/session_01NS2BA7fzvSsp3ZhPzU18fL)_4 files changed
Lines changed: 159 additions & 123 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
34 | 33 | | |
35 | 34 | | |
36 | 35 | | |
| |||
81 | 80 | | |
82 | 81 | | |
83 | 82 | | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
88 | 94 | | |
89 | | - | |
| 95 | + | |
90 | 96 | | |
91 | 97 | | |
92 | 98 | | |
| |||
165 | 171 | | |
166 | 172 | | |
167 | 173 | | |
168 | | - | |
| 174 | + | |
169 | 175 | | |
170 | | - | |
| 176 | + | |
171 | 177 | | |
172 | | - | |
| 178 | + | |
173 | 179 | | |
174 | 180 | | |
175 | 181 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | | - | |
13 | | - | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | 30 | | |
35 | 31 | | |
36 | 32 | | |
37 | | - | |
38 | | - | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
39 | 38 | | |
40 | 39 | | |
41 | 40 | | |
| |||
113 | 112 | | |
114 | 113 | | |
115 | 114 | | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
120 | 133 | | |
121 | | - | |
| 134 | + | |
| 135 | + | |
122 | 136 | | |
123 | 137 | | |
124 | | - | |
| 138 | + | |
125 | 139 | | |
| 140 | + | |
126 | 141 | | |
127 | 142 | | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
142 | 157 | | |
143 | 158 | | |
144 | 159 | | |
| |||
271 | 286 | | |
272 | 287 | | |
273 | 288 | | |
274 | | - | |
275 | 289 | | |
276 | 290 | | |
| 291 | + | |
277 | 292 | | |
278 | 293 | | |
279 | 294 | | |
| |||
0 commit comments