feat: add update notification system

Backend:
- Add /api/v1/version endpoint returning current and latest version
- Fetch latest release from GitHub API with 1-hour cache
- Semver comparison to detect available updates
- Configurable via GITHUB_REPO env var (default: vikingowl/vessel)

Frontend:
- Add VersionState store with 12-hour periodic checking
- Check on app load and periodically for new versions
- Persist dismissed versions in localStorage
- Add UpdateBanner component with teal styling
- Slide-in animation from top, dismissible

The notification appears below TopNav when a new version is available
and remembers dismissals per-version across sessions.
This commit is contained in:
2026-01-02 19:29:02 +01:00
parent 448db59aac
commit 2f28b689f5
7 changed files with 438 additions and 3 deletions

View File

@@ -17,6 +17,9 @@ import (
"vessel-backend/internal/database"
)
// Version is set at build time via -ldflags, or defaults to dev
var Version = "0.2.0"
func getEnvOrDefault(key, defaultValue string) string {
if value := os.Getenv(key); value != "" {
return value
@@ -61,7 +64,7 @@ func main() {
}))
// Register routes
api.SetupRoutes(r, db, *ollamaURL)
api.SetupRoutes(r, db, *ollamaURL, Version)
// Create server
srv := &http.Server{