Skip to content

feat(app-update): add in-app update flow with auto-check and manual trigger#103

Merged
j4rviscmd merged 2 commits intomainfrom
feat/app-update
Mar 28, 2026
Merged

feat(app-update): add in-app update flow with auto-check and manual trigger#103
j4rviscmd merged 2 commits intomainfrom
feat/app-update

Conversation

@j4rviscmd
Copy link
Copy Markdown
Owner

Summary

Add a complete in-app update flow for Scripta, including automatic update checks on startup and a manual "Check for Updates" option in Settings. The update dialog shows release notes rendered as Markdown, version comparison, download progress, and supports skip-version functionality.

Related Issue

N/A — No existing issue for this feature.

Type of Change

  • ✨ New feature
  • 💥 Breaking change
  • 🐛 Bug fix
  • 📝 Documentation
  • ♻️ Refactoring
  • 🔧 Chore

Key Changes

Update State Machine

  • Pure useReducer with 8 states (idle, checking, available, downloading, installing, restarting, upToDate, error) and 9 actions
  • Clean Architecture: domain logic separated from UI and infrastructure

UI (UpdateDialog)

  • 7 view states with appropriate UI for each phase
  • Markdown-rendered release notes via react-markdown
  • Current vs available version display
  • Download progress indicator
  • Text selection enabled for release notes
  • "View past releases" external link

Auto-Check on Startup

  • Runs immediately on mount, waits for splash completion before showing dialog
  • Silent on up-to-date or error (no dialog)
  • Respects skipped versions (persisted via tauri-plugin-store)
  • 10-second timeout for offline resilience

Manual Check (Settings)

  • "Check for Updates" button in Settings dialog
  • "Release Notes" external link
  • Shows dialog immediately (no splash wait)

CI/CD

  • New generate-notes job in release.yml using GitHub API generateReleaseNotes()
  • Release notes passed as releaseBody to tauri-action

Infrastructure

  • Added tauri-plugin-updater and tauri-plugin-process
  • Added process:allow-restart capability
  • Window focus on startup (window.set_focus())

Breaking Changes

None.

Test

  • Run npm run dev and verify the app starts without errors
  • Open Settings → confirm "Check for Updates" button appears
  • Click "Check for Updates" → verify checking spinner, then result dialog
  • Verify "Release Notes" link opens GitHub releases page
  • Verify release notes are rendered as Markdown with proper formatting
  • Verify text in release notes is selectable
  • Disconnect network → Click "Check for Updates" → verify error dialog after timeout
  • Build with cargo build → verify no compilation errors

Checklist

  • Code follows clean architecture (proper separation of concerns)
  • Code is simple and concise (no unnecessary complexity)
  • Comments are sufficient for non-obvious logic
  • No sensitive information included (credentials, secrets, personal data)
  • Conventional Commits format followed in commit messages
  • Tests added/updated (or N/A for docs/chore) — N/A (UI feature, requires Tauri runtime)

j4rviscmd and others added 2 commits March 28, 2026 19:06
- Add update state machine (useReducer) with 8 states and 9 actions
- Implement UpdateDialog with 7 views: checking, available, downloading,
  installing, restarting, up-to-date, and error
- Add startup auto-check that silently skips if up-to-date or on error
- Add manual check-for-updates button in Settings
- Display Markdown-rendered release notes via react-markdown
- Show current and available version comparison
- Add skip-version functionality with persistent storage
- Add 10-second timeout for update checks (offline resilience)
- Coordinate auto-check dialog with splash screen completion
- Add 'View past releases' external link in dialog and Settings
- Enable text selection for release notes content
- Generate release notes via GitHub API in CI workflow
- Add tauri-plugin-updater and tauri-plugin-process
- Set window focus on startup for foreground display

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@j4rviscmd j4rviscmd added the enhancement New feature or request label Mar 28, 2026
@j4rviscmd j4rviscmd merged commit 455db21 into main Mar 28, 2026
2 checks passed
@j4rviscmd j4rviscmd deleted the feat/app-update branch March 28, 2026 10:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant