Skip to content

feat(noctalia): merge doctor pill + vitals into stoa-health plugin#141

Merged
VictorGSchneider merged 5 commits into
mainfrom
claude/loving-ride-w82ov
Jun 11, 2026
Merged

feat(noctalia): merge doctor pill + vitals into stoa-health plugin#141
VictorGSchneider merged 5 commits into
mainfrom
claude/loving-ride-w82ov

Conversation

@VictorGSchneider

@VictorGSchneider VictorGSchneider commented Jun 11, 2026

Copy link
Copy Markdown
Owner

Summary

Fixes "actions don't run — terminal opens and closes, or nothing happens" and merges the two health-related plugins (stoa-doctor-pill + stoa-vitals) into a single stoa-health plugin.

Root cause of the broken actions

Every panel action was a Process object living inside the Panel, and clicks called closePanel() before running = true. Closing the panel destroys the QML tree — Quickshell kills the child process with it, so the spawned terminal died instantly (or never spawned). The old doctor pill had the exact same bug in its panel, which is why historically only its right-click menu (which lives in the persistent bar widget) ever worked.

A second failure mode: Quickshell's environment doesn't necessarily include ~/.local/bin, so bare commands like stoa-doctor could fail to resolve silently — which explains the right-click regression too.

The fix

  • All actions now use Quickshell.execDetached() — fully detached from QML object lifetime, immune to panel close.
  • Commands run via sh -c with ~/.local/bin prepended to PATH, and stoa scripts invoked by absolute path ($HOME/.local/bin/stoa-doctor etc.).
  • Status polling stays as Process + StdioCollector (read-only, re-spawned per poll — that part always worked).

The merge (per request)

One plugin replaces two:

  • Bar: icon-only capsule (NIcon heart — same component native widgets use) colored by overall severity, pulsing on warn/error, with a red count badge when there are issues/failed units. No more text pill.
  • Panel: the three tabs (Vitals / Snapshots / Maintenance) now with icons throughout — metric rows, tab headers, action buttons, icon refresh button.
  • Right-click: Run Doctor / Snapshot Now / Open Log preserved from the old doctor pill.
  • install.sh links stoa-health and removes the stale stoa-doctor-pill / stoa-vitals symlinks; plugins.json states and the settings.json bar-layout seed updated.

Post-merge steps (on the machine)

  1. git pull && ./install.sh — links the new plugin, removes the old ones
  2. Restart Noctalia
  3. ⚠️ Your live ~/.config/noctalia/settings.json is copy-seeded and won't update automatically — open Noctalia settings and replace the old doctor-pill bar widget with stoa-health (or edit the bar layout: plugin:stoa-doctor-pillplugin:stoa-health)

Test plan

  • Panel actions actually spawn and keep their terminal open (Run Doctor, Cleanup dry-run, updates)
  • Right-click → Run Doctor regenerates the log; Snapshot Now fires a notification
  • Heart icon colors: inject [FAIL]/[WARN] lines into ~/.config/stoa/doctor.log → red/amber + badge
  • Panel resizes per tab; icons render (heart, refresh, save, folder, clock, shield, trash)
  • No install error at boot; old plugin symlinks removed

https://claude.ai/code/session_01NS2BA7fzvSsp3ZhPzU18fL


Generated by Claude Code

claude added 5 commits June 11, 2026 15:43
The vitals panel actions never ran: every action was a Process object
living inside the Panel, and clicks called closePanel() before setting
running=true — closing the panel destroys the QML tree, which kills
the child process before (or just after) it spawns. The old doctor
pill had the same bug in its panel, which is why only its bar-level
right-click menu ever worked. A second failure mode: Quickshell's
environment may not include ~/.local/bin, so bare "stoa-doctor"
commands could fail to resolve at all.

Both plugins are now replaced by a single stoa-health plugin:

  • All actions go through Quickshell.execDetached() — fully detached
    from QML object lifetime — wrapped in sh -c with ~/.local/bin
    prepended to PATH, and stoa scripts invoked by absolute path.
  • Icon-only bar capsule (NIcon heart) colored by overall severity,
    with a count badge when issues/failed units exist — matching the
    look of native Noctalia widgets instead of a text pill.
  • Panel keeps the three tabs (Vitals / Snapshots / Maintenance),
    now with icons throughout and an icon refresh button.
  • Right-click menu preserved: Run Doctor / Snapshot Now / Open Log.

install.sh links the new plugin and removes the stale doctor-pill and
vitals symlinks; plugins.json states and the settings.json bar-layout
seed now reference stoa-health.
…menu

Adds a Settings.qml entry point (gear button in the plugin manager,
"Settings" item in the bar widget's right-click menu via
BarService.openPluginSettings — same pattern as the official clipboard
plugin). Configurable:

  • Bar icon       — heart / activity / stethoscope / heartbeat /
                     shield / first-aid kit
  • Issue badge    — toggle the red counter on the icon
  • Pulse          — toggle the warning/error animation
  • Poll interval  — 5–300 s status refresh
  • Terminal       — emulator used for actions (kitty default)

BarWidget and Panel read everything through pluginApi.pluginSettings
with manifest defaults as fallback; the panel header icon follows the
bar icon choice.
Each panel action becomes editable through Settings:
  • Label   — NTextInput per row
  • Icon    — NComboBox from a 20-icon palette
  • Visible — NToggle (hidden actions never render)
  • Order   — ↑/↓ buttons re-sort within the row's tab

manifest.json grows a defaultSettings.actions[] of 14 entries
(id/tab/label/icon/visible). Each id maps to a hardcoded handler in
Panel.runAction(), so reordering or renaming never breaks the
behaviour — only how it's labelled and where it sits.

Panel.qml now reads pluginSettings.actions, filters by tab+visible,
and renders all action rows through a single reusable component. The
per-tab boilerplate dropped accordingly. Defaults are duplicated in
Panel and Settings so the panel keeps working before the user has
ever saved a setting.

Settings layout: an "Appearance" section (icon, badge, pulse, poll,
terminal) followed by an "Actions" section with a per-tab list and
a "Reset to defaults" button.
…settings

stoa-health:
  • README.md so the plugin manager shows proper documentation
  • Panel floats top-center on screen (panelAnchorHorizontalCenter +
    panelAnchorTop) — same placement as the Clipboard History panel —
    instead of anchoring to the bar widget
  • Settings gear in the panel header (opens plugin settings via
    BarService.openPluginSettings), alongside refresh
  • version 1.1.0

stoa-drive-pill (brought up to the same standard):
  • Icon-only capsule (NIcon, cloud-off when nothing is mounted) with
    an optional m/t badge shown only when not all drives are mounted —
    replaces the text pill
  • Settings.qml: bar icon, badge toggle, poll interval, file manager
  • README.md for the plugin manager
  • Settings entry in the right-click menu
  • Actions moved to Quickshell.execDetached with absolute paths
    (same PATH/lifetime hardening applied to stoa-health)
  • version 1.1.0
@VictorGSchneider VictorGSchneider self-assigned this Jun 11, 2026
@VictorGSchneider VictorGSchneider merged commit 117efb1 into main Jun 11, 2026
1 check passed
@VictorGSchneider VictorGSchneider deleted the claude/loving-ride-w82ov branch June 11, 2026 16:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants