From 06b937e2132174961ab48043391857a715660635 Mon Sep 17 00:00:00 2001 From: kaivalya Date: Tue, 21 Jul 2026 20:35:02 +0200 Subject: [PATCH] Plan for update button --- docs/plan.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/docs/plan.md b/docs/plan.md index 3fe66cd..9d4b945 100644 --- a/docs/plan.md +++ b/docs/plan.md @@ -913,6 +913,24 @@ Hugo 0.123.7 static site under `website/`. FR default at `/`, EN at `/en/`. Depl --- +### Backlog — Manual "Check for updates" button in Settings + +**Status:** 🔲 To do — not yet planned in detail, not implemented + +**Requested:** 2026-07-21, user request — the PWA doesn't seem to update automatically; add a manual update button in Settings. + +**Why:** Step 24 (`useAppUpdate.js`, `AppUpdateDialog.vue`) already shows an update prompt when the browser detects a new service worker, but that detection only runs on the browser's own schedule (roughly on navigation/reload) — if the PWA is left open, an update can go unnoticed for a long time. A manual trigger in Settings lets the user force a check on demand. + +**Discussed approach (not yet implemented):** + +- `useAppUpdate.js` — capture the SW `registration` via `useRegisterSW`'s `onRegisteredSW` callback; add `checkForUpdate()` that calls `registration.update()` to force the browser to re-fetch the SW script. If it changed, the existing `needRefresh` flow fires and `AppUpdateDialog` appears as usual (same "Update now" / "Later" choice — user retains the option to defer even when an update is found). +- `SettingsView.vue` — new "Application" card: a "Check for updates" button, with a brief inline status message ("You're up to date") shown for a few seconds when a check finds nothing (via a timeout heuristic, since there's no direct "no update" event from the SW API). +- Explicitly out of scope: no periodic/background auto-check — checking stays a deliberate user action, and updating stays optional even when available (user decision 2026-07-21). + +**Not started:** no code, no tests, no i18n keys yet. + +--- + ## Data Model ```mermaid