diff --git a/frontend/app.js b/frontend/app.js index a8a8267..9fa6782 100644 --- a/frontend/app.js +++ b/frontend/app.js @@ -3,6 +3,8 @@ (function () { "use strict"; + const APP_VERSION = "1.5.0"; + // --------------------------------------------------------------------------- // State // --------------------------------------------------------------------------- @@ -4762,29 +4764,68 @@ function showWelcome() { hideProgressBar(); - // Ensure the dashboard container exists (it might have been wiped by renderFile) + // Ensure the dashboard container exists and has the correct structure (it might have been wiped by renderFile or be an old version) const area = document.getElementById("content-area"); - if (area && !document.getElementById("dashboard-home")) { + const home = document.getElementById("dashboard-home"); + const bookmarksSection = document.getElementById("dashboard-bookmarks-section"); + + if (area && (!home || !bookmarksSection)) { area.innerHTML = ` -
-
-
- -

Derniers fichiers ouverts

+
+ +
+
+
+ +

Bookmarks

+
+
+
+
+ + Aucun bookmark +

Épinglez des fichiers pour les retrouver ici.

-
-
-
-
-
-
- `; + + // Re-initialize widgets which might need to bind events to new elements + if (typeof DashboardRecentWidget !== "undefined") { + DashboardRecentWidget.init(); + } safeCreateIcons(); } @@ -5825,6 +5866,8 @@ initCustomDropdowns(); document.getElementById("theme-toggle").addEventListener("click", toggleTheme); document.getElementById("header-logo").addEventListener("click", goHome); + const refreshBtn = document.getElementById("header-refresh-btn"); + if (refreshBtn) refreshBtn.addEventListener("click", goHome); initSearch(); initSidebarToggle(); initMobile(); @@ -5848,6 +5891,11 @@ try { await Promise.all([loadVaultSettings(), loadVaults(), loadTags()]); + // Initialize dashboard widgets now that vaults are loaded + if (typeof DashboardRecentWidget !== "undefined") { + DashboardRecentWidget.init(); + } + // Check for popup mode query parameter const urlParams = new URLSearchParams(window.location.search); if (urlParams.get("popup") === "true") { @@ -5863,6 +5911,9 @@ const path = decodeURIComponent(hashVal.substring(sepIndex + 1)); openFile(vault, path); } + } else if (urlParams.get("popup") !== "true") { + // Default to dashboard if no deep link and not in popup mode + showWelcome(); } } catch (err) { console.error("Failed to initialize ObsiGate:", err); @@ -5958,9 +6009,5 @@ document.addEventListener("DOMContentLoaded", () => { init(); registerServiceWorker(); - // Initialize the dashboard recent files widget - if (typeof DashboardRecentWidget !== "undefined") { - DashboardRecentWidget.init(); - } }); })(); diff --git a/frontend/index.html b/frontend/index.html index cfcb91e..65c1471 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -373,21 +373,31 @@

Derniers fichiers ouverts

+ +
+
+
+
+
-
-
-
-
-
-
-
- + +
diff --git a/frontend/sw.js b/frontend/sw.js index 136874e..521e270 100644 --- a/frontend/sw.js +++ b/frontend/sw.js @@ -1,6 +1,6 @@ /* ObsiGate Service Worker - PWA Support */ -const CACHE_VERSION = 'obsigate-v1.4.0'; +const CACHE_VERSION = 'obsigate-v1.5.0'; const STATIC_CACHE = `${CACHE_VERSION}-static`; const DYNAMIC_CACHE = `${CACHE_VERSION}-dynamic`; const MAX_DYNAMIC_CACHE_SIZE = 50;