fix(stoa-health): clicks, empty Settings, and no-terminal background actions#142
Merged
Merged
Conversation
…inal actions
Three concrete bugs the previous round didn't actually solve, plus the
no-terminal background mode you asked for.
1. Panel clicks never fired runAction:
runInTerm/runSilent called pluginApi.closePanel() BEFORE
Quickshell.execDetached(). closePanel() 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 applied to the header gear button.
2. Settings.qml rendered blank because it imported widget types that
don't exist on the plugin widget set. The official clipboard plugin
uses only NSpinBox / NToggle / NComboBox (verified against
noctalia-plugins source). NLabel and NTextInput were guesses —
loading them invalidates the whole file, hence the empty panel.
Section headers now use plain Text; text fields use QtQuick.Controls
TextField with an Noctalia-styled background.
3. Background-only action execution:
• Every action now runs through Quickshell.execDetached with a
short sh -c wrapper that fires three notify-send calls
(Running / Done / Failed). No terminal is opened anywhere.
• Commands that need root (updates, scheduled cleanup) use a
configurable privilege helper: "pkexec" (default, graphical
polkit prompt) or "sudo -n" (fully silent — requires the user
to add NOPASSWD sudoers rules). The choice lives in Settings.
• pacman/yay get --noconfirm so they never block on a prompt.
Also removed the inert panelAnchorHorizontalCenter / panelAnchorTop
properties: confirmed by reading official plugin sources that panels
don't declare those — anchoring is decided by the shell from the
caller passed to openPanel(screen, this). They were no-ops.
The "terminal" setting is gone (no longer used). README and per-action
customisation remain.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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()calledpluginApi.closePanel()beforeQuickshell.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
NLabelandNTextInput— neither exists on the public plugin widget set. The official clipboard plugin only usesNSpinBox/NToggle/NComboBox. A missing widget type makes the whole file invalid, hence the empty panel. Section headers now use plainText; the per-action label editor usesQtQuick.Controls.TextFieldstyled to match.3. No terminal, no confirmation
Every action runs through
Quickshell.execDetachedwrapped in a tinysh -cthat fires threenotify-sendcalls (Running / Done / Failed). No terminal. Pacman/yay get--noconfirmso 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
panelAnchorHorizontalCenter/panelAnchorTopproperties — confirmed in the official source that panels don't declare them; anchoring is decided by the shell from thecallerarg toopenPanel(screen, this).terminalsetting (no longer used).Test plan
sudo -nwithout adding sudoers rules → "Failed: Update all" notification (fast, correct)https://claude.ai/code/session_01NS2BA7fzvSsp3ZhPzU18fL
Generated by Claude Code