Skip to content

feat: in-app version check & update from the web UI#23

Merged
setkyar merged 1 commit into
mainfrom
feat/update-via-ui
May 31, 2026
Merged

feat: in-app version check & update from the web UI#23
setkyar merged 1 commit into
mainfrom
feat/update-via-ui

Conversation

@setkyar
Copy link
Copy Markdown
Contributor

@setkyar setkyar commented May 31, 2026

Summary

  • 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 — no need to drop into the Pi TUI.
  • New internal/updater package: in-memory cache with a 6h background poll, npm-registry version lookup (beta dist-tag) + GitHub Releases changelog, semver comparison (incl. prerelease precedence), and git describe/-dirty dev-build detection so in-app update is disabled for local builds (avoids downgrading uncommitted work).
  • New server endpoints behind auth: GET /api/version, POST /api/check-update, POST /api/update (runs pi install), and POST /api/restart (detached launchctl/systemd restart, then exit). Two-step UI-chained flow: update → restart → reconnect-poll → reload.
  • Frontend version.js controller + changelog modal (XSS-safe markdown-lite render); normalizes the leading v and 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

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
@setkyar setkyar marked this pull request as ready for review May 31, 2026 15:30
@setkyar setkyar merged commit aef9111 into main May 31, 2026
1 check passed
@setkyar setkyar deleted the feat/update-via-ui branch May 31, 2026 16:44
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