From 671befe6107f66eeac109ad2b1c207f9c8c1a7eb Mon Sep 17 00:00:00 2001 From: Bruno Charest Date: Mon, 15 Jun 2026 23:04:47 -0400 Subject: [PATCH] =?UTF-8?q?feat:=20#59=20finalisation=20mode=20hors-ligne?= =?UTF-8?q?=20PWA=20=E2=80=94=20badge=20+=20conflits?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Badge hors-ligne dans le header (icone wifi-off + compteur pending) - Modale resolution de conflits (garder local vs serveur) - CSS offline-indicator, offline-pending badge - Integration: initOffline (sync.js), cacheViewedFile (viewer.js), searchOffline (search.js) - IndexedDB: files, content, pending stores avec sync queue - ROADMAP: #59 marque FAIT --- docs/ROADMAP.md | 17 +++++++++-------- frontend/index.html | 24 ++++++++++++++++++++++++ frontend/style.css | 28 ++++++++++++++++++++++++++++ 3 files changed, 61 insertions(+), 8 deletions(-) diff --git a/docs/ROADMAP.md b/docs/ROADMAP.md index 2fec91e..c4bc7a4 100644 --- a/docs/ROADMAP.md +++ b/docs/ROADMAP.md @@ -146,17 +146,18 @@ ## ⚪ Backlog — Priorité 3 (P3) -### 59. Mode hors-ligne PWA complet +### 59. Mode hors-ligne PWA complet ✅ FAIT - **Effort :** 3-4 jours | **Impact :** 🟡 - **Description :** Service worker avancé avec IndexedDB pour permettre la navigation et la recherche en mode hors-ligne, avec file de synchronisation au retour réseau. +- **Implémentation :** `offline-db.js` (377 lignes) + `offline.js` (209 lignes). IndexedDB 3 stores (files, content, pending). Badge hors-ligne dans le header. Modale résolution de conflits. - **Sous-tâches :** - - [ ] IndexedDB : stockage local de l'index des fichiers (paths, titles, tags) - - [ ] Moteur de recherche offline via IndexedDB (cursor + filtre) - - [ ] Cache des fichiers markdown récemment ouverts (derniers 50) - - [ ] Stratégie de cache : Network First avec fallback IndexedDB - - [ ] File de synchronisation : modifications offline → appliquées au retour réseau - - [ ] UI indicateur : badge « Hors-ligne » + compteur de modifications en attente - - [ ] Gestion des conflits : détection et résolution manuelle (choix version locale vs serveur) + - [x] IndexedDB : stockage local de l'index des fichiers (paths, titles, tags) + - [x] Moteur de recherche offline via IndexedDB (cursor + filtre) + - [x] Cache des fichiers markdown récemment ouverts (derniers 50, prune) + - [x] Stratégie de cache : Network First avec fallback IndexedDB + - [x] File de synchronisation : modifications offline → appliquées au retour réseau + - [x] UI indicateur : badge « Hors-ligne » + compteur de modifications en attente + - [x] Gestion des conflits : détection et résolution manuelle (choix version locale vs serveur) ### 60. OAuth2 / OIDC — Authentification SSO - **Effort :** 2-3 jours | **Impact :** 🟡 diff --git a/frontend/index.html b/frontend/index.html index 2b2bbda..83d1541 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -411,6 +411,13 @@
+ +
wd
+ +
+
+
+ Conflit hors-ligne +
+ +
+
+

+
+ + +
+
+
+
diff --git a/frontend/style.css b/frontend/style.css index 86ba58c..26feac2 100644 --- a/frontend/style.css +++ b/frontend/style.css @@ -2117,6 +2117,34 @@ select { color: var(--accent); border-color: var(--accent); } +/* Offline indicator */ +.offline-indicator { + display: flex; + align-items: center; + gap: 6px; + padding: 2px 8px; + border-radius: 4px; + font-size: 0.7rem; + cursor: default; +} +.offline-indicator.offline { + background: var(--warn-bg, rgba(251,191,36,0.12)); + color: var(--warn); + border: 1px solid var(--warn); +} +.offline-pending { + display: inline-flex; + align-items: center; + justify-content: center; + min-width: 16px; + height: 16px; + padding: 0 4px; + border-radius: 8px; + background: var(--warn); + color: #000; + font-size: 0.6rem; + font-weight: 700; +} .saved-search-vault { font-size: 0.65rem; color: var(--text-muted);