Skip to content

Notice a newer copy of the plugin and offer to restart the shell - #10

Merged
jeremy-robotsson merged 2 commits into
mainfrom
feat/notice-plugin-update
Oct 7, 2026
Merged

jeremy-robotsson merged 2 commits into
mainfrom
feat/notice-plugin-update

Conversation

@jeremy-robotsson

Copy link
Copy Markdown
Member

The Omarchy counterpart of the macOS app's 0.2.0 restart prompt.

Why

omarchy plugin update pulls newer code into ~/.config/omarchy/plugins/varlatch, and the shell (Omarchy 4.0.4) notices the change through inotifywait and re-creates the widget, but from the component it cached when it started: tested live by swapping commits whose debugState differs, the old fields stayed for 10+ seconds after the reload. Only omarchy restart shell loads the new code, and nothing told you.

Changes

  • varlatch-menu plugin-info fingerprints the code the shell loads (manifest.json and *.qml; the helper runs fresh on every call, so bin/ is left out) and reports the version and fingerprint on disk plus the ones the running shell loaded. The first call from a shell process records what it loaded, keyed by the parent process's id and start time (the widget runs the helper directly, so the shell is the parent); later calls from the same shell, re-created widgets included, get the same answer. Records of exited processes are dropped. Without this, a re-created widget would fingerprint the new files as "loaded" and never notice.
  • The widget checks every minute and when the panel opens. Newer code on disk shows "Varlatch for Omarchy 0.5.0 is installed" with restart in the panel (or "A newer copy of this widget is installed" when the version is the same), a tooltip line, a "Restart to load Varlatch for Omarchy 0.5.0" row in the launcher menu (sync-menu --restart <version>), and one notification per newer copy with Restart now. Restart runs omarchy restart shell. A sign-in under way survives it, since its helper runs outside the shell.
  • debugState reports loadedVersion, installedVersion, and pluginUpdated.

Testing

  • tests/run.sh: 78 passed. New: the fingerprint and version, a README change keeping it, a QML change giving newer code on disk while the same parent keeps the old loaded fingerprint, a new parent process recording what is on disk, pruning of exited parents, the notification's Restart now running omarchy restart shell (and nothing when dismissed), and the menu row present only with newer code.
  • Live bar, the way omarchy plugin update does it: loaded this branch with a shell restart (loaded 0.4.0, installed 0.4.0, no notice), then moved the plugin checkout to a throwaway commit bumping the manifest to 0.5.0 without restarting. Within seconds: pluginUpdated true, the panel footer showed "Varlatch for Omarchy 0.5.0 is installed" with restart (screenshot), the menu had the restart row, and the shell's notification history has the notification. After omarchy restart shell: loaded 0.5.0, no notice, no menu row.

🤖 Generated with Claude Code

jeremy-robotsson and others added 2 commits October 7, 2026 23:37
`omarchy plugin update` puts newer code on disk, but the shell keeps
running the widget it loaded until it restarts, and nothing said so.
The helper's new plugin-info fingerprints the manifest and QML; the
widget records the fingerprint it was loaded from and compares every
minute and when the panel opens. Newer code shows "Varlatch for Omarchy
0.5.0 is installed" with restart in the panel, a "Restart to load" row in
the launcher menu, a line in the tooltip, and one notification per newer
copy with "Restart now" (omarchy restart shell). A sign-in under way
survives the restart, since its helper runs outside the shell.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… widget's

The shell re-creates the widget when plugin files change, but from the
copy it cached at start, so a fingerprint taken by the new instance
named the new code as loaded and the notice never showed. plugin-info
now records the loaded fingerprint once per shell process (keyed by the
parent's id and start time, pruned when it exits) and reports both.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jeremy-robotsson
jeremy-robotsson merged commit 9eb7773 into main Oct 7, 2026
1 check passed
@jeremy-robotsson
jeremy-robotsson deleted the feat/notice-plugin-update branch October 7, 2026 21:44
@jeremy-robotsson jeremy-robotsson mentioned this pull request Oct 7, 2026
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.

1 participant