From ebe250ca018e959385637d0446db2c2aac0dca0c Mon Sep 17 00:00:00 2001 From: Scarriffle Date: Thu, 7 May 2026 19:49:48 +0200 Subject: [PATCH] =?UTF-8?q?fix:=20Plus-Icon=20symmetrisch=20+=20Service-Wo?= =?UTF-8?q?rker=20Network-First=20f=C3=BCr=20HTML?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Erstellen-Button in der Sidebar: SVG-Path war asymmetrisch (M19 13h-6v9...) — Vertikalbalken hing nach unten heraus. Jetzt Standard-Plus mit gleich langen Armen. - Service Worker holt index.html und version.js ab sofort per Network-First — neue Releases greifen damit beim nächsten Seiten-Reload, ohne dass der SW manuell deregistriert werden muss. Statics bleiben Cache-First für Offline-Tauglichkeit; auf Aktivierung wird der alte Cache komplett gelöscht. Version v9 → v10. --- frontend/index.html | 22 +++++++++++----------- frontend/js/version.js | 2 +- frontend/sw.js | 25 ++++++++++++++++++++++++- 3 files changed, 36 insertions(+), 13 deletions(-) diff --git a/frontend/index.html b/frontend/index.html index 12ee6ed..c61f3c6 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -4,7 +4,7 @@ - Calendarr v9 + Calendarr v10 @@ -80,7 +80,7 @@ - + @@ -159,7 +159,7 @@ @@ -235,7 +235,7 @@
- +
@@ -243,7 +243,7 @@
- +
@@ -253,7 +253,7 @@
- +
@@ -261,7 +261,7 @@
- +
@@ -311,7 +311,7 @@
- +
@@ -870,7 +870,7 @@ scarriffleservices@gmail.com

diff --git a/frontend/js/version.js b/frontend/js/version.js index 90db215..31ecc0c 100644 --- a/frontend/js/version.js +++ b/frontend/js/version.js @@ -1,2 +1,2 @@ // Increment APP_VERSION with every code change -export const APP_VERSION = 'v9'; +export const APP_VERSION = 'v10'; diff --git a/frontend/sw.js b/frontend/sw.js index f19b29b..11b9f36 100644 --- a/frontend/sw.js +++ b/frontend/sw.js @@ -1,7 +1,7 @@ // Calendarr Service Worker // Cache-first for static assets, network-first for /api/* (graceful offline) -const CACHE_VERSION = 'calendarr-v9'; +const CACHE_VERSION = 'calendarr-v10'; const STATIC_ASSETS = [ '/', '/index.html', @@ -65,6 +65,29 @@ self.addEventListener('fetch', event => { return; } + // Network-first for navigation (HTML) and the version-defining files — + // ensures users always get the freshest entry point so new releases + // take effect on the next reload without a manual SW unregister. + const isHtml = req.mode === 'navigate' + || url.pathname === '/' + || url.pathname === '/index.html'; + const isVersionFile = url.pathname === '/static/js/version.js'; + + if (isHtml || isVersionFile) { + event.respondWith( + fetch(req).then(resp => { + if (resp && resp.status === 200) { + const clone = resp.clone(); + caches.open(CACHE_VERSION).then(c => c.put(req, clone)).catch(() => {}); + } + return resp; + }).catch(() => + caches.match(req).then(c => c || caches.match('/index.html')) + ) + ); + return; + } + // Cache-first for everything else (static) event.respondWith( caches.match(req).then(cached => {