feat: in-app version check & update from the web UI#23
Merged
Conversation
Add a "Version" row to the index and session menus that shows the current pi-web version and opens a popup to view the changelog, check for updates, and update + restart the server without dropping into the Pi TUI. - internal/updater: cached npm/GitHub version checker with 6h background poll, semver comparison, and dev/git-describe build detection (in-app update is disabled for local builds so it can't downgrade local work) - server: /api/version, /api/check-update, /api/update, /api/restart - app: pi-install + detached launchctl/systemd restart wiring - frontend: version menu row + changelog modal with update→restart→ reconnect flow; normalizes the leading "v" and shortens dev versions
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
internal/updaterpackage: in-memory cache with a 6h background poll, npm-registry version lookup (beta dist-tag) + GitHub Releases changelog, semver comparison (incl. prerelease precedence), andgit describe/-dirtydev-build detection so in-app update is disabled for local builds (avoids downgrading uncommitted work).GET /api/version,POST /api/check-update,POST /api/update(runspi install), andPOST /api/restart(detachedlaunchctl/systemdrestart, then exit). Two-step UI-chained flow: update → restart → reconnect-poll → reload.version.jscontroller + changelog modal (XSS-safe markdown-lite render); normalizes the leadingvand shortens dev versions in the row. Export/Gist snapshots are unaffected (their menus render empty).Testing
go test ./...go vet ./...npm run test --prefix web(267 tests)npm run build --prefix web