Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bb6d95d867 | ||
|
|
1fe6a1bad0 | ||
|
|
6143d62f99 | ||
|
|
fdc7626ef0 | ||
|
|
865aff1957 | ||
|
|
3de4363f36 |
+11
-1
@@ -6,7 +6,7 @@ Format basé sur [Keep a Changelog](https://keepachangelog.com/fr/1.1.0/),
|
||||
et [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
> **En cours de développement** : les changements à venir sont listés dans la section
|
||||
> [Unreleased](#unreleased). La dernière version livrée est **2.98.0**.
|
||||
> [Unreleased](#unreleased). La dernière version livrée est **2.99.0**.
|
||||
|
||||
---
|
||||
|
||||
@@ -14,6 +14,16 @@ et [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
---
|
||||
|
||||
## [2.99.0] — 2026-12-01
|
||||
|
||||
### Ajouté
|
||||
|
||||
- **Mes vaults, recherches sauvées et personnalisation de l'Accueil (#249)** : cartes des vaults (clic = onglet de navigation du vault, vault personnel en premier), recherches sauvées relançables en un clic, bloc Raccourcis & Astuces compact, et panneaux de l'Accueil masquables/réaffichables avec choix persisté par utilisateur (localStorage — pas de préférences serveur pour le dashboard, repli documenté dans la fiche #246).
|
||||
- **Panneau « À traiter » dans l'Accueil (#248)** : conflits de synchronisation (widget existant, alimenté par `/api/conflicts`), partages reçus non encore ouverts et partages expirant sous 7 jours (via `/api/shares`), chaque élément ouvrable en un clic ; le panneau est entièrement masqué quand il n'y a rien à traiter.
|
||||
- **Page d'accueil « Reprendre » (#247, épopée #246)** : nouvel onglet **Accueil**, premier et actif par défaut dans le dashboard — bandeau statistiques en une ligne, recherche héros (focus sur la recherche globale), actions rapides (Nouveau fichier, Téléverser, Palette de fichiers) et section **Reprendre** (bookmarks/épinglés en tête, puis les 6 derniers fichiers ouverts). Les onglets Statistiques, Bookmarks, Récents et Partagés sont inchangés.
|
||||
|
||||
---
|
||||
|
||||
## [2.98.0] — 2026-11-30
|
||||
|
||||
### Ajouté
|
||||
|
||||
+3
-3
@@ -4,7 +4,7 @@
|
||||
|
||||
**Porte d'entrée web ultra-léger pour vos vaults Obsidian** — Accédez, naviguez et recherchez dans toutes vos notes Obsidian depuis n'importe quel appareil via une interface web moderne et responsive.
|
||||
|
||||
[]()
|
||||
[]()
|
||||
[](https://opensource.org/licenses/MIT)
|
||||
[](https://www.docker.com/)
|
||||
[](https://www.python.org/)
|
||||
@@ -981,8 +981,8 @@ Ce projet est sous licence **MIT** — voir le fichier [LICENSE](LICENSE) pour l
|
||||
|
||||
## 📝 Changelog
|
||||
|
||||
Consultez le [CHANGELOG.md](./CHANGELOG.md) pour l'historique complet de toutes les versions (v1.0.0 → v2.98.0).
|
||||
Consultez le [CHANGELOG.md](./CHANGELOG.md) pour l'historique complet de toutes les versions (v1.0.0 → v2.99.0).
|
||||
|
||||
---
|
||||
|
||||
*Projet : ObsiGate | Version : 2.98.0 | Dernière mise à jour : Septembre 2026*
|
||||
*Projet : ObsiGate | Version : 2.99.0 | Dernière mise à jour : Septembre 2026*
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
**Ultra-light web gateway for your Obsidian vaults** — Access, browse, and search all your Obsidian notes from any device via a modern, responsive web interface.
|
||||
|
||||
[]()
|
||||
[]()
|
||||
[](https://opensource.org/licenses/MIT)
|
||||
[](https://www.docker.com/)
|
||||
[](https://www.python.org/)
|
||||
@@ -1156,8 +1156,8 @@ This project is licensed under the **MIT License** - see the [LICENSE](LICENSE)
|
||||
|
||||
## 📝 Changelog
|
||||
|
||||
See [CHANGELOG.md](./CHANGELOG.md) for the complete version history (v1.0.0 → v2.98.0).
|
||||
See [CHANGELOG.md](./CHANGELOG.md) for the complete version history (v1.0.0 → v2.99.0).
|
||||
|
||||
---
|
||||
|
||||
*Project: ObsiGate | Version: 2.98.0 | Last updated: September 2026*
|
||||
*Project: ObsiGate | Version: 2.99.0 | Last updated: September 2026*
|
||||
|
||||
Generated
+1
-1
@@ -2626,7 +2626,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "obsigate-desktop"
|
||||
version = "2.98.0"
|
||||
version = "2.99.0"
|
||||
dependencies = [
|
||||
"chrono",
|
||||
"env_logger",
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "obsigate-desktop"
|
||||
version = "2.98.0"
|
||||
version = "2.99.0"
|
||||
description = "ObsiGate Desktop — Porte d'entrée native pour vos vaults Obsidian"
|
||||
authors = ["Bruno Charest"]
|
||||
edition = "2021"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"$schema": "https://raw.githubusercontent.com/nicedoc/obsigate/main/desktop/tauri.conf.schema.json",
|
||||
"productName": "ObsiGate",
|
||||
"version": "2.98.0",
|
||||
"version": "2.99.0",
|
||||
"identifier": "com.obsigate.desktop",
|
||||
"build": {
|
||||
"frontendDist": "../frontend",
|
||||
|
||||
+11
-2
@@ -1,6 +1,6 @@
|
||||
# ObsiGate — Roadmap
|
||||
|
||||
> **Version :** 2.98.0 | **Dernière mise à jour :** 2026-11-30
|
||||
> **Version :** 2.99.0 | **Dernière mise à jour :** 2026-12-01
|
||||
> **Ce fichier ne contient que le travail à venir** (🔵 En cours + ⚪ Backlog) et un index compact
|
||||
> vers les fonctionnalités livrées.
|
||||
> - **Méthode de livraison à appliquer pour toute tâche : [DELIVERY_WORKFLOW.md](./DELIVERY_WORKFLOW.md)**
|
||||
@@ -32,7 +32,7 @@
|
||||
|
||||
### 240. Épopée — Performance du chargement initial
|
||||
|
||||
- **Effort :** ~3 jours | **Impact :** 🔴 | **Ouvert :** 2026-11-30 | **Statut :** 🔵 en cours — branche `feat/perf-chargement-240` livrée, PR à fusionner (issue Gitea #106)
|
||||
- **Effort :** ~3 jours | **Impact :** 🔴 | **Ouvert :** 2026-11-30 | **Statut :** ✅ livré en 2.98.0 — PR #116 fusionnée dans main (issue Gitea #106)
|
||||
- **Fiche :** [features/perf-chargement-240.md](./features/perf-chargement-240.md)
|
||||
- **Description :** demande de Bruno (2026-11-30) — diviser par ~3 le premier affichage utile d'og.dracodev.net au bénéfice du retour SSO, des liens profonds `#file=`/`#folder=` et de l'accès de base. Baseline : TTFB 0,36–0,67 s, graphe ES statique 41 modules / 1 420 963 o, Mermaid CDN 745 Ko chargé d'emblée, statiques sans URL versionnées, `/api/dashboard` sans cache.
|
||||
- **Sous-tâches :**
|
||||
@@ -41,6 +41,15 @@
|
||||
- [x] **#243 P2** — `import()` dynamique des modules lourds + retrait des CDN du `<head>` — Gitea #109 (graphe −10,8 %, CDN retirés ; −50 % non atteint, voir fiche)
|
||||
- [x] **#244 P3** — bootstrap : lien profond ouvert avant le chargement complet — Gitea #110
|
||||
- [x] **#245 P4** — cache 60 s de `/api/dashboard` invalidé par le watcher — Gitea #111
|
||||
### 246. Épopée — Page d'accueil « Reprendre »
|
||||
|
||||
- **Effort :** ~2 jours | **Impact :** 🟡 | **Ouvert :** 2026-11-30 | **Statut :** 🔵 en cours — branche `feat/accueil-reprendre-246` livrée, PR à fusionner (issue Gitea #112)
|
||||
- **Fiche :** [features/accueil-reprendre-246.md](./features/accueil-reprendre-246.md)
|
||||
- **Description :** demande de Bruno (2026-11-30) — la page principale était la section Statistiques. Nouvel onglet Accueil par défaut, orienté « reprendre / à traiter » ; les onglets Statistiques, Bookmarks, Récents et Partagés restent inchangés.
|
||||
- **Sous-tâches :**
|
||||
- [x] **#247 A1** — onglet Accueil par défaut : bandeau stats, recherche héros, actions rapides, Reprendre — Gitea #113
|
||||
- [x] **#248 A2** — panneau « À traiter » (conflits existants, partages reçus non ouverts, expirations) — Gitea #114
|
||||
- [x] **#249 A3** — Mes vaults, recherches sauvées, raccourcis, personnalisation persistée — Gitea #115
|
||||
|
||||
### 239. Lien profond « dossier » `#folder=` (console Spark)
|
||||
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
# Page d'accueil « Reprendre » — épopée #246
|
||||
|
||||
> Demande de Bruno (2026-11-30). Issues Gitea : épopée #112, lots
|
||||
> #113 à #115. La page principale était la section Statistiques —
|
||||
> informative une fois, inutile au quotidien.
|
||||
|
||||
## Principe
|
||||
|
||||
Un nouvel onglet **Accueil** (`data-tab="home"`), premier et actif
|
||||
par défaut, dans le dashboard existant. Les onglets **Statistiques /
|
||||
Bookmarks / Récents / Partagés sont inchangés** (mêmes panneaux, mêmes
|
||||
widgets, mêmes appels). L'Accueil répond à « qu'est-ce que je
|
||||
reprends, qu'est-ce qui m'attend » et réutilise les données et les
|
||||
cartes existantes — aucun nouvel endpoint.
|
||||
|
||||
Le balisage vit aux deux endroits où le dashboard est construit :
|
||||
`frontend/index.html` (page initiale) et le gabarit de `showWelcome()`
|
||||
(`frontend/js/viewer.js`, reconstruction). Le widget est
|
||||
`DashboardHomeWidget` (`frontend/js/dashboard.js`), chargé par
|
||||
`showWelcome()` comme les autres widgets.
|
||||
|
||||
## Lots
|
||||
|
||||
- **#247 A1 — socle.** Bandeau stats en une ligne (les 4 chiffres de
|
||||
`/api/dashboard` : fichiers, tags, taille, vaults), recherche héros
|
||||
(le focus bascule sur le champ de recherche global existant, avec le
|
||||
texte saisi), actions rapides — **Nouveau fichier** (palette de
|
||||
commandes, où vit la commande existante), **Téléverser** (sélecteur
|
||||
de fichiers → `handleVaultDropUpload` existant, avec choix du
|
||||
dossier cible), **Palette de fichiers** (`palette.open('')`) — et
|
||||
section **Reprendre** : bookmarks/épinglés en tête
|
||||
(`/api/bookmarks`), puis les 6 derniers fichiers ouverts
|
||||
(`/api/recent?mode=opened`), rendus avec les cartes existantes
|
||||
(`DashboardRecentWidget._createCard`).
|
||||
- **#248 A2 — À traiter.** Conflits de synchronisation rendus par le
|
||||
widget existant `DashboardConflictsWidget.render()` alimenté par
|
||||
`/api/conflicts` (il était noyé dans la vue Statistiques) ; partages
|
||||
reçus non ouverts (`access_count` nul) et partages expirant sous
|
||||
7 jours, depuis `/api/shares`. **Le panneau est absent du DOM
|
||||
visible quand il n'y a rien à traiter** (`display:none` posé par le
|
||||
widget, pas un panneau vide).
|
||||
- **#249 A3 — vaults, recherches, personnalisation.** Cartes **Mes
|
||||
vaults** (nom, fichiers, taille depuis `/api/dashboard`, vault
|
||||
personnel `home-<user>` en premier ; clic = `TabManager.openNav`,
|
||||
l'onglet de navigation #158), **Recherches sauvées**
|
||||
(`/api/saved-searches`, clic = recherche relancée dans le champ
|
||||
global), bloc **Raccourcis & Astuces** compact (le bloc complet
|
||||
reste dans la vue Statistiques), et **personnalisation** : chaque
|
||||
panneau de l'Accueil peut être masqué/réaffiché (cases dans le bloc
|
||||
« Personnaliser »), choix persisté **par utilisateur dans
|
||||
localStorage** (clé `obsigate-home-hidden-panels-<user>`).
|
||||
⚠️ Repli documenté : il n'existe pas de mécanisme de préférences
|
||||
serveur pour le dashboard (les préférences serveur existantes sont
|
||||
celles des vaults/thème) — la personnalisation est donc propre à
|
||||
l'appareil, pas synchronisée entre appareils.
|
||||
|
||||
## i18n
|
||||
|
||||
Toutes les chaînes passent par les locales (`dashboard.home_*`,
|
||||
FR + EN, parité vérifiée par `tests/test_i18n_parity.py`).
|
||||
|
||||
## Tests
|
||||
|
||||
`tests/frontend/dashboard-home.test.mjs` (JSDOM sur le vrai
|
||||
`index.html` + formes des sources) : onglet par défaut, sections,
|
||||
branchements API, reconstruction par `showWelcome`.
|
||||
+80
-1
@@ -1283,6 +1283,16 @@
|
||||
<div class="dashboard-tabs">
|
||||
<button
|
||||
class="dashboard-tab active"
|
||||
data-tab="home"
|
||||
>
|
||||
<i
|
||||
data-lucide="home"
|
||||
style="width: 14px; height: 14px"
|
||||
></i>
|
||||
<span data-i18n="dashboard.home_tab">Accueil</span>
|
||||
</button>
|
||||
<button
|
||||
class="dashboard-tab"
|
||||
data-tab="stats"
|
||||
>
|
||||
<i
|
||||
@@ -1317,10 +1327,79 @@
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<!-- Home Panel — Accueil « Reprendre » (#247-#249) -->
|
||||
<div
|
||||
id="dashboard-panel-home"
|
||||
class="dashboard-panel active"
|
||||
>
|
||||
<div id="home-stats-strip" class="home-stats-strip"></div>
|
||||
<div class="home-hero">
|
||||
<input
|
||||
id="home-search-input"
|
||||
class="home-search-input"
|
||||
type="text"
|
||||
data-i18n-placeholder="dashboard.home_search_placeholder"
|
||||
placeholder="Rechercher dans vos vaults…"
|
||||
/>
|
||||
<div class="home-actions">
|
||||
<button id="home-action-new" class="home-action-btn">
|
||||
<i data-lucide="file-plus-2" style="width: 14px; height: 14px"></i>
|
||||
<span data-i18n="dashboard.home_new_file">Nouveau fichier</span>
|
||||
</button>
|
||||
<button id="home-action-upload" class="home-action-btn">
|
||||
<i data-lucide="upload" style="width: 14px; height: 14px"></i>
|
||||
<span data-i18n="dashboard.home_upload">Téléverser</span>
|
||||
</button>
|
||||
<button id="home-action-palette" class="home-action-btn">
|
||||
<i data-lucide="layout-grid" style="width: 14px; height: 14px"></i>
|
||||
<span data-i18n="dashboard.home_palette">Palette de fichiers</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<section id="home-section-todo" data-home-panel="todo" class="home-section" style="display: none">
|
||||
<h2 class="home-section-title" data-i18n="dashboard.home_todo">À traiter</h2>
|
||||
<div id="home-conflicts-container"></div>
|
||||
<div id="home-todo-list"></div>
|
||||
</section>
|
||||
<section id="home-section-resume" data-home-panel="resume" class="home-section">
|
||||
<h2 class="home-section-title" data-i18n="dashboard.home_resume">Reprendre</h2>
|
||||
<div id="home-resume-grid" class="dashboard-recent-grid"></div>
|
||||
<div id="home-resume-empty" class="dashboard-recent-empty" style="display: none">
|
||||
<span data-i18n="dashboard.home_no_resume">Rien à reprendre pour le moment</span>
|
||||
</div>
|
||||
</section>
|
||||
<section id="home-section-vaults" data-home-panel="vaults" class="home-section">
|
||||
<h2 class="home-section-title" data-i18n="dashboard.home_vaults">Mes vaults</h2>
|
||||
<div id="home-vaults-grid" class="home-vaults-grid"></div>
|
||||
</section>
|
||||
<section id="home-section-searches" data-home-panel="searches" class="home-section">
|
||||
<h2 class="home-section-title" data-i18n="dashboard.home_saved_searches">Recherches sauvées</h2>
|
||||
<div id="home-searches-list" class="home-searches-list"></div>
|
||||
<div id="home-searches-empty" class="dashboard-recent-empty" style="display: none">
|
||||
<span data-i18n="dashboard.home_no_saved_searches">Aucune recherche sauvée</span>
|
||||
</div>
|
||||
</section>
|
||||
<section id="home-section-help" data-home-panel="help" class="home-section">
|
||||
<h2 class="home-section-title" data-i18n="help.shortcuts_title">Raccourcis & Astuces</h2>
|
||||
<div class="qh-row"><span class="qh-kbd">Ctrl+Shift+Space</span> <span data-i18n="dashboard.home_sc_palette">Palette de fichiers (nav. rapide)</span></div>
|
||||
<div class="qh-row"><span class="qh-kbd">Ctrl+K</span> <span data-i18n="dashboard.home_sc_search">Focus barre de recherche</span></div>
|
||||
<div class="qh-row"><span class="qh-kbd">Ctrl+S</span> <span data-i18n="dashboard.home_sc_save">Sauvegarder le fichier ouvert</span></div>
|
||||
<div class="qh-row"><span class="qh-kbd">Esc</span> <span data-i18n="dashboard.home_sc_close">Fermer l'éditeur / modale</span></div>
|
||||
</section>
|
||||
<details class="home-customize">
|
||||
<summary data-i18n="dashboard.home_customize">Personnaliser</summary>
|
||||
<label><input type="checkbox" data-home-toggle="resume" checked /> <span data-i18n="dashboard.home_resume">Reprendre</span></label>
|
||||
<label><input type="checkbox" data-home-toggle="todo" checked /> <span data-i18n="dashboard.home_todo">À traiter</span></label>
|
||||
<label><input type="checkbox" data-home-toggle="vaults" checked /> <span data-i18n="dashboard.home_vaults">Mes vaults</span></label>
|
||||
<label><input type="checkbox" data-home-toggle="searches" checked /> <span data-i18n="dashboard.home_saved_searches">Recherches sauvées</span></label>
|
||||
<label><input type="checkbox" data-home-toggle="help" checked /> <span data-i18n="help.shortcuts_title">Raccourcis & Astuces</span></label>
|
||||
</details>
|
||||
</div>
|
||||
|
||||
<!-- Stats Panel -->
|
||||
<div
|
||||
id="dashboard-panel-stats"
|
||||
class="dashboard-panel active"
|
||||
class="dashboard-panel"
|
||||
>
|
||||
<div
|
||||
id="dashboard-stats-grid"
|
||||
|
||||
+256
-1
@@ -493,4 +493,259 @@ const DashboardBookmarkWidget = {
|
||||
}
|
||||
};
|
||||
|
||||
export { DashboardRecentWidget, DashboardStatsWidget, DashboardBookmarkWidget, DashboardSharedWidget, DashboardConflictsWidget };
|
||||
|
||||
// ── Dashboard Home Widget — Accueil « Reprendre » (#247-#249) ─────────────
|
||||
// Nouvel onglet par défaut du dashboard. Les onglets Statistiques /
|
||||
// Bookmarks / Récents / Partagés sont inchangés ; l'Accueil réutilise
|
||||
// leurs données et leurs cartes :
|
||||
// - #247 : bandeau stats (une ligne, /api/dashboard), recherche héros
|
||||
// (focus sur le champ de recherche existant), actions rapides
|
||||
// (Nouveau fichier via la palette de commandes, Téléverser via le
|
||||
// flux d'upload existant, Palette de fichiers), section Reprendre
|
||||
// (bookmarks/épinglés en tête + 6 derniers fichiers ouverts).
|
||||
// - #248 : panneau « À traiter » (conflits via DashboardConflictsWidget,
|
||||
// partages reçus non ouverts et expirations < 7 j via /api/shares) ;
|
||||
// le panneau est masqué quand il n'y a rien à traiter.
|
||||
// - #249 : cartes Mes vaults (clic = onglet de navigation du vault),
|
||||
// Recherches sauvées, Raccourcis & Astuces compact, et
|
||||
// personnalisation (panneaux masquables, choix persisté par
|
||||
// utilisateur dans localStorage — aucun mécanisme de préférences
|
||||
// serveur n'existe pour le dashboard, repli documenté dans la fiche).
|
||||
const DashboardHomeWidget = {
|
||||
_vaults: [],
|
||||
|
||||
_prefsKey() {
|
||||
const user = (AuthManager.getUser() || {}).username || "anon";
|
||||
return `obsigate-home-hidden-panels-${user}`;
|
||||
},
|
||||
|
||||
_hiddenPanels() {
|
||||
try {
|
||||
return new Set(JSON.parse(localStorage.getItem(this._prefsKey()) || "[]"));
|
||||
} catch { return new Set(); }
|
||||
},
|
||||
|
||||
applyPrefs() {
|
||||
const hidden = this._hiddenPanels();
|
||||
// Le panneau « À traiter » est piloté par les données (loadTodo) :
|
||||
// la personnalisation ne fait que l'autoriser, jamais l'afficher vide.
|
||||
document.querySelectorAll('[data-home-panel]:not([data-home-panel="todo"])').forEach((section) => {
|
||||
section.style.display = hidden.has(section.dataset.homePanel) ? "none" : "";
|
||||
});
|
||||
document.querySelectorAll("[data-home-toggle]").forEach((box) => {
|
||||
box.checked = !hidden.has(box.dataset.homeToggle);
|
||||
});
|
||||
},
|
||||
|
||||
bindActions(panel) {
|
||||
if (panel.dataset.homeBound) return;
|
||||
panel.dataset.homeBound = "1";
|
||||
|
||||
const hero = document.getElementById("home-search-input");
|
||||
if (hero) {
|
||||
hero.addEventListener("focus", () => {
|
||||
const input = document.getElementById("search-input");
|
||||
if (input) { input.value = hero.value; input.focus(); input.dispatchEvent(new Event("input")); }
|
||||
});
|
||||
}
|
||||
const newBtn = document.getElementById("home-action-new");
|
||||
if (newBtn) newBtn.addEventListener("click", () => {
|
||||
import("./palette.js").then((m) => m.open("> ")).catch(() => {});
|
||||
});
|
||||
const paletteBtn = document.getElementById("home-action-palette");
|
||||
if (paletteBtn) paletteBtn.addEventListener("click", () => {
|
||||
import("./palette.js").then((m) => m.open("")).catch(() => {});
|
||||
});
|
||||
const uploadBtn = document.getElementById("home-action-upload");
|
||||
if (uploadBtn) uploadBtn.addEventListener("click", () => {
|
||||
const input = document.createElement("input");
|
||||
input.type = "file";
|
||||
input.multiple = true;
|
||||
input.style.display = "none";
|
||||
document.body.appendChild(input);
|
||||
input.addEventListener("change", async () => {
|
||||
const items = Array.from(input.files || []).map((f) => ({ path: f.name, file: f, isDir: false }));
|
||||
input.remove();
|
||||
if (!items.length) return;
|
||||
const vault = (state.selectedContextVault && state.selectedContextVault !== "all")
|
||||
? state.selectedContextVault
|
||||
: (this._vaults[0] && this._vaults[0].name);
|
||||
if (!vault) return;
|
||||
const m = await import("./upload.js");
|
||||
await m.handleVaultDropUpload(vault, null, items);
|
||||
this.load();
|
||||
});
|
||||
input.click();
|
||||
});
|
||||
panel.querySelectorAll("[data-home-toggle]").forEach((box) => {
|
||||
box.addEventListener("change", () => {
|
||||
const hidden = this._hiddenPanels();
|
||||
if (box.checked) hidden.delete(box.dataset.homeToggle);
|
||||
else hidden.add(box.dataset.homeToggle);
|
||||
try { localStorage.setItem(this._prefsKey(), JSON.stringify([...hidden])); } catch {}
|
||||
this.applyPrefs();
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
async load() {
|
||||
const panel = document.getElementById("dashboard-panel-home");
|
||||
if (!panel) return;
|
||||
this.bindActions(panel);
|
||||
this.applyPrefs();
|
||||
await Promise.allSettled([
|
||||
this.loadStatsAndVaults(),
|
||||
this.loadResume(),
|
||||
this.loadTodo(),
|
||||
this.loadSavedSearches(),
|
||||
]);
|
||||
this.applyPrefs();
|
||||
safeCreateIcons();
|
||||
},
|
||||
|
||||
async loadStatsAndVaults() {
|
||||
const strip = document.getElementById("home-stats-strip");
|
||||
const grid = document.getElementById("home-vaults-grid");
|
||||
try {
|
||||
const data = await api("/api/dashboard");
|
||||
this._vaults = data.vaults || [];
|
||||
const fmtSize = (bytes) => bytes < 1024 ? `${bytes}${t('dashboard.size_bytes')}` : bytes < 1048576 ? `${(bytes/1024).toFixed(1)}${t('dashboard.size_kb')}` : bytes < 1073741824 ? `${(bytes/1048576).toFixed(1)}${t('dashboard.size_mb')}` : `${(bytes/1073741824).toFixed(1)}${t('dashboard.size_gb')}`;
|
||||
if (strip) {
|
||||
strip.innerHTML = `
|
||||
<span><i data-lucide="files"></i> ${data.total_files.toLocaleString()} ${t('dashboard.stats_files')}</span>
|
||||
<span><i data-lucide="tags"></i> ${data.total_tags.toLocaleString()} ${t('dashboard.stats_tags')}</span>
|
||||
<span><i data-lucide="hard-drive"></i> ${fmtSize(data.total_size_bytes)}</span>
|
||||
<span><i data-lucide="folder-open"></i> ${data.vaults.length} ${t('dashboard.stats_vaults')}</span>`;
|
||||
}
|
||||
if (grid) {
|
||||
grid.innerHTML = "";
|
||||
// Le vault personnel (home-<user>) d'abord, comme dans l'arborescence (#194).
|
||||
const me = (AuthManager.getUser() || {}).username;
|
||||
const sorted = [...this._vaults].sort((a, b) =>
|
||||
(b.name === `home-${me}`) - (a.name === `home-${me}`) || a.name.localeCompare(b.name));
|
||||
sorted.forEach((v) => {
|
||||
const card = document.createElement("button");
|
||||
card.className = "home-vault-card";
|
||||
card.innerHTML = `<i data-lucide="folder-open"></i>
|
||||
<span class="home-vault-name">${escapeHtml(v.name)}</span>
|
||||
<span class="home-vault-meta">${v.file_count.toLocaleString()} ${t('dashboard.count_files_plural')} · ${fmtSize(v.total_size_bytes)}</span>`;
|
||||
card.addEventListener("click", () => TabManager.openNav(v.name));
|
||||
grid.appendChild(card);
|
||||
});
|
||||
}
|
||||
} catch (err) {
|
||||
if (strip) strip.innerHTML = "";
|
||||
}
|
||||
},
|
||||
|
||||
async loadResume() {
|
||||
const grid = document.getElementById("home-resume-grid");
|
||||
const empty = document.getElementById("home-resume-empty");
|
||||
if (!grid) return;
|
||||
try {
|
||||
const [bookmarks, recent] = await Promise.all([
|
||||
api("/api/bookmarks").catch(() => ({ files: [] })),
|
||||
api("/api/recent?mode=opened").catch(() => ({ files: [] })),
|
||||
]);
|
||||
const pinned = (bookmarks.files || []).map((f) => ({ ...f, bookmarked: true }));
|
||||
const seen = new Set(pinned.map((f) => `${f.vault}:${f.path}`));
|
||||
const fresh = (recent.files || []).filter((f) => !seen.has(`${f.vault}:${f.path}`)).slice(0, 6);
|
||||
const files = [...pinned.slice(0, 6), ...fresh];
|
||||
grid.innerHTML = "";
|
||||
files.forEach((f, idx) => grid.appendChild(DashboardRecentWidget._createCard(f, idx)));
|
||||
if (empty) empty.style.display = files.length ? "none" : "";
|
||||
safeCreateIcons();
|
||||
} catch (err) {
|
||||
if (empty) empty.style.display = "";
|
||||
}
|
||||
},
|
||||
|
||||
async loadTodo() {
|
||||
const section = document.getElementById("home-section-todo");
|
||||
const list = document.getElementById("home-todo-list");
|
||||
const conflictsHost = document.getElementById("home-conflicts-container");
|
||||
if (!section) return;
|
||||
let has = false;
|
||||
|
||||
try {
|
||||
const data = await api("/api/conflicts");
|
||||
if (data && data.total > 0 && conflictsHost) {
|
||||
DashboardConflictsWidget.render(data.conflicts, conflictsHost);
|
||||
has = true;
|
||||
} else if (conflictsHost) {
|
||||
conflictsHost.innerHTML = "";
|
||||
}
|
||||
} catch { /* pas de conflits exposables */ }
|
||||
|
||||
try {
|
||||
const shares = await api("/api/shares");
|
||||
const me = (AuthManager.getUser() || {}).username;
|
||||
const now = Date.now();
|
||||
const week = 7 * 24 * 3600 * 1000;
|
||||
const items = [];
|
||||
(shares || []).forEach((sh) => {
|
||||
const received = me && sh.created_by && sh.created_by !== me
|
||||
&& Array.isArray(sh.shared_with) && sh.shared_with.includes(me);
|
||||
const expiresSoon = sh.expires_at && (new Date(sh.expires_at).getTime() - now) > 0
|
||||
&& (new Date(sh.expires_at).getTime() - now) < week;
|
||||
if (received && !sh.access_count) {
|
||||
items.push({ share: sh, received, label: t('dashboard.home_received_unopened') });
|
||||
} else if (expiresSoon) {
|
||||
items.push({ share: sh, received, label: t('dashboard.home_expiring_soon') });
|
||||
}
|
||||
});
|
||||
if (list) {
|
||||
list.innerHTML = "";
|
||||
items.forEach(({ share: sh, received, label }) => {
|
||||
const row = document.createElement("div");
|
||||
row.className = "home-todo-item";
|
||||
const name = (sh.path || "").split("/").pop().replace(/\.md$/i, "");
|
||||
row.innerHTML = `<i data-lucide="share-2"></i>
|
||||
<span class="home-todo-label">${escapeHtml(label)}</span>
|
||||
<span class="home-todo-name">${escapeHtml(name)}</span>
|
||||
<span class="home-todo-vault">${escapeHtml(sh.vault)}</span>`;
|
||||
const btn = document.createElement("button");
|
||||
btn.className = "shared-open-btn";
|
||||
btn.textContent = t('dashboard.open_btn');
|
||||
btn.addEventListener("click", () => {
|
||||
if (received) TabManager.openPreview(`home-${me}`, `Partage/${(sh.path || "").split("/").pop()}`);
|
||||
else TabManager.openPreview(sh.vault, sh.path);
|
||||
});
|
||||
row.appendChild(btn);
|
||||
list.appendChild(row);
|
||||
});
|
||||
}
|
||||
if (items.length) has = true;
|
||||
} catch { /* pas de partages exposables */ }
|
||||
|
||||
section.style.display = (has && !this._hiddenPanels().has("todo")) ? "" : "none";
|
||||
if (has) safeCreateIcons();
|
||||
},
|
||||
|
||||
async loadSavedSearches() {
|
||||
const list = document.getElementById("home-searches-list");
|
||||
const empty = document.getElementById("home-searches-empty");
|
||||
if (!list) return;
|
||||
try {
|
||||
const searches = await api("/api/saved-searches");
|
||||
list.innerHTML = "";
|
||||
(searches || []).forEach((srch) => {
|
||||
const isDir = (!srch.query || srch.query.trim() === "") && srch.include_paths;
|
||||
const item = document.createElement("button");
|
||||
item.className = "home-search-item";
|
||||
item.innerHTML = `<i data-lucide="${isDir ? "folder-search" : "search"}"></i> ${escapeHtml(isDir ? srch.include_paths : srch.query)}`;
|
||||
item.addEventListener("click", () => {
|
||||
const input = document.getElementById("search-input");
|
||||
if (input) { input.value = srch.query || ""; input.focus(); input.dispatchEvent(new Event("input")); }
|
||||
});
|
||||
list.appendChild(item);
|
||||
});
|
||||
if (empty) empty.style.display = (searches && searches.length) ? "none" : "";
|
||||
safeCreateIcons();
|
||||
} catch {
|
||||
if (empty) empty.style.display = "";
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
export { DashboardRecentWidget, DashboardStatsWidget, DashboardBookmarkWidget, DashboardSharedWidget, DashboardConflictsWidget, DashboardHomeWidget };
|
||||
|
||||
+59
-5
@@ -7,7 +7,7 @@ import { TabManager, closeMobileSidebar, ContextMenuManager, RightSidebarManager
|
||||
import { syncActiveFileTreeItem, searchByTag, TagFilterService, refreshSidebarTreePreservingState, focusPathInSidebar } from './sidebar.js';
|
||||
import { AutocompleteDropdown, performAdvancedSearch } from './search.js';
|
||||
import { initDashboardTabs } from './sync.js';
|
||||
import { DashboardStatsWidget, DashboardRecentWidget, DashboardBookmarkWidget, DashboardSharedWidget, DashboardConflictsWidget } from './dashboard.js';
|
||||
import { DashboardStatsWidget, DashboardRecentWidget, DashboardBookmarkWidget, DashboardSharedWidget, DashboardConflictsWidget, DashboardHomeWidget } from './dashboard.js';
|
||||
import { openShareDialog } from './config.js';
|
||||
import { cacheViewedFile, getCachedFile } from './offline.js';
|
||||
import { t, getLocale } from './i18n.js';
|
||||
@@ -7761,7 +7761,10 @@ export function showWelcome() {
|
||||
<div id="dashboard-home" class="dashboard-home" role="region" aria-label="Tableau de bord">
|
||||
<!-- Dashboard Tabs -->
|
||||
<div class="dashboard-tabs">
|
||||
<button class="dashboard-tab active" data-tab="stats" data-i18n="dashboard.stats">
|
||||
<button class="dashboard-tab active" data-tab="home" data-i18n="dashboard.home_tab">
|
||||
<i data-lucide="home" style="width:14px;height:14px"></i> ${t('dashboard.home_tab')}
|
||||
</button>
|
||||
<button class="dashboard-tab" data-tab="stats" data-i18n="dashboard.stats">
|
||||
<i data-lucide="bar-chart-3" style="width:14px;height:14px"></i> ${t('dashboard.stats')}
|
||||
</button>
|
||||
<button class="dashboard-tab" data-tab="bookmarks" data-i18n="dashboard.bookmarks">
|
||||
@@ -7775,8 +7778,56 @@ export function showWelcome() {
|
||||
</button>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Home Panel — Accueil « Reprendre » (#247-#249) -->
|
||||
<div id="dashboard-panel-home" class="dashboard-panel active">
|
||||
<div id="home-stats-strip" class="home-stats-strip"></div>
|
||||
<div class="home-hero">
|
||||
<input id="home-search-input" class="home-search-input" type="text" placeholder="${t('dashboard.home_search_placeholder')}" />
|
||||
<div class="home-actions">
|
||||
<button id="home-action-new" class="home-action-btn"><i data-lucide="file-plus-2" style="width:14px;height:14px"></i> ${t('dashboard.home_new_file')}</button>
|
||||
<button id="home-action-upload" class="home-action-btn"><i data-lucide="upload" style="width:14px;height:14px"></i> ${t('dashboard.home_upload')}</button>
|
||||
<button id="home-action-palette" class="home-action-btn"><i data-lucide="layout-grid" style="width:14px;height:14px"></i> ${t('dashboard.home_palette')}</button>
|
||||
</div>
|
||||
</div>
|
||||
<section id="home-section-todo" data-home-panel="todo" class="home-section" style="display:none">
|
||||
<h2 class="home-section-title"><i data-lucide="bell-ring" style="width:16px;height:16px"></i> ${t('dashboard.home_todo')}</h2>
|
||||
<div id="home-conflicts-container"></div>
|
||||
<div id="home-todo-list"></div>
|
||||
</section>
|
||||
<section id="home-section-resume" data-home-panel="resume" class="home-section">
|
||||
<h2 class="home-section-title"><i data-lucide="history" style="width:16px;height:16px"></i> ${t('dashboard.home_resume')}</h2>
|
||||
<div id="home-resume-grid" class="dashboard-recent-grid"></div>
|
||||
<div id="home-resume-empty" class="dashboard-recent-empty" style="display:none"><span>${t('dashboard.home_no_resume')}</span></div>
|
||||
</section>
|
||||
<section id="home-section-vaults" data-home-panel="vaults" class="home-section">
|
||||
<h2 class="home-section-title"><i data-lucide="folder-open" style="width:16px;height:16px"></i> ${t('dashboard.home_vaults')}</h2>
|
||||
<div id="home-vaults-grid" class="home-vaults-grid"></div>
|
||||
</section>
|
||||
<section id="home-section-searches" data-home-panel="searches" class="home-section">
|
||||
<h2 class="home-section-title"><i data-lucide="search" style="width:16px;height:16px"></i> ${t('dashboard.home_saved_searches')}</h2>
|
||||
<div id="home-searches-list" class="home-searches-list"></div>
|
||||
<div id="home-searches-empty" class="dashboard-recent-empty" style="display:none"><span>${t('dashboard.home_no_saved_searches')}</span></div>
|
||||
</section>
|
||||
<section id="home-section-help" data-home-panel="help" class="home-section">
|
||||
<h2 class="home-section-title"><i data-lucide="keyboard" style="width:16px;height:16px"></i> ${t('help.shortcuts_title')}</h2>
|
||||
<div class="qh-row"><span class="qh-kbd">Ctrl+Shift+Space</span> <span>${t('dashboard.home_sc_palette')}</span></div>
|
||||
<div class="qh-row"><span class="qh-kbd">Ctrl+K</span> <span>${t('dashboard.home_sc_search')}</span></div>
|
||||
<div class="qh-row"><span class="qh-kbd">Ctrl+S</span> <span>${t('dashboard.home_sc_save')}</span></div>
|
||||
<div class="qh-row"><span class="qh-kbd">Esc</span> <span>${t('dashboard.home_sc_close')}</span></div>
|
||||
</section>
|
||||
<details class="home-customize">
|
||||
<summary>${t('dashboard.home_customize')}</summary>
|
||||
<label><input type="checkbox" data-home-toggle="resume" checked /> ${t('dashboard.home_resume')}</label>
|
||||
<label><input type="checkbox" data-home-toggle="todo" checked /> ${t('dashboard.home_todo')}</label>
|
||||
<label><input type="checkbox" data-home-toggle="vaults" checked /> ${t('dashboard.home_vaults')}</label>
|
||||
<label><input type="checkbox" data-home-toggle="searches" checked /> ${t('dashboard.home_saved_searches')}</label>
|
||||
<label><input type="checkbox" data-home-toggle="help" checked /> ${t('help.shortcuts_title')}</label>
|
||||
</details>
|
||||
</div>
|
||||
|
||||
<!-- Stats Panel -->
|
||||
<div id="dashboard-panel-stats" class="dashboard-panel active">
|
||||
<div id="dashboard-panel-stats" class="dashboard-panel">
|
||||
<div id="dashboard-stats-grid" class="dashboard-stats-grid">
|
||||
<div class="dashboard-stats-loading" data-i18n="common.loading">${t('common.loading')}</div>
|
||||
</div>
|
||||
@@ -7836,13 +7887,16 @@ export function showWelcome() {
|
||||
// Reset tabs to default
|
||||
document.querySelectorAll(".dashboard-tab").forEach(t => t.classList.remove("active"));
|
||||
document.querySelectorAll(".dashboard-panel").forEach(p => p.classList.remove("active"));
|
||||
const defaultTab = document.querySelector('.dashboard-tab[data-tab="stats"]');
|
||||
const defaultPanel = document.getElementById("dashboard-panel-stats");
|
||||
const defaultTab = document.querySelector('.dashboard-tab[data-tab="home"]');
|
||||
const defaultPanel = document.getElementById("dashboard-panel-home");
|
||||
if (defaultTab) defaultTab.classList.add("active");
|
||||
if (defaultPanel) defaultPanel.classList.add("active");
|
||||
}
|
||||
|
||||
// Load all widgets (they handle missing elements gracefully)
|
||||
if (typeof DashboardHomeWidget !== "undefined") {
|
||||
DashboardHomeWidget.load();
|
||||
}
|
||||
if (typeof DashboardStatsWidget !== "undefined") {
|
||||
DashboardStatsWidget.load();
|
||||
}
|
||||
|
||||
@@ -601,6 +601,24 @@
|
||||
"dashboard.size_gb": " GB",
|
||||
"dashboard.size_kb": " KB",
|
||||
"dashboard.size_mb": " MB",
|
||||
"dashboard.home_tab": "Home",
|
||||
"dashboard.home_resume": "Resume",
|
||||
"dashboard.home_todo": "Needs attention",
|
||||
"dashboard.home_vaults": "My vaults",
|
||||
"dashboard.home_search_placeholder": "Search your vaults…",
|
||||
"dashboard.home_new_file": "New file",
|
||||
"dashboard.home_upload": "Upload",
|
||||
"dashboard.home_palette": "File palette",
|
||||
"dashboard.home_saved_searches": "Saved searches",
|
||||
"dashboard.home_no_saved_searches": "No saved searches",
|
||||
"dashboard.home_customize": "Customize",
|
||||
"dashboard.home_no_resume": "Nothing to resume yet",
|
||||
"dashboard.home_received_unopened": "Received share not opened yet",
|
||||
"dashboard.home_expiring_soon": "Share expiring soon",
|
||||
"dashboard.home_sc_palette": "File palette (quick nav)",
|
||||
"dashboard.home_sc_search": "Focus the search bar",
|
||||
"dashboard.home_sc_save": "Save the open file",
|
||||
"dashboard.home_sc_close": "Close the editor / modal",
|
||||
"dashboard.stats": "Statistics",
|
||||
"dashboard.stats_files": "Files",
|
||||
"dashboard.stats_size": "Total size",
|
||||
|
||||
@@ -601,6 +601,24 @@
|
||||
"dashboard.size_gb": " Go",
|
||||
"dashboard.size_kb": " Ko",
|
||||
"dashboard.size_mb": " Mo",
|
||||
"dashboard.home_tab": "Accueil",
|
||||
"dashboard.home_resume": "Reprendre",
|
||||
"dashboard.home_todo": "À traiter",
|
||||
"dashboard.home_vaults": "Mes vaults",
|
||||
"dashboard.home_search_placeholder": "Rechercher dans vos vaults…",
|
||||
"dashboard.home_new_file": "Nouveau fichier",
|
||||
"dashboard.home_upload": "Téléverser",
|
||||
"dashboard.home_palette": "Palette de fichiers",
|
||||
"dashboard.home_saved_searches": "Recherches sauvées",
|
||||
"dashboard.home_no_saved_searches": "Aucune recherche sauvée",
|
||||
"dashboard.home_customize": "Personnaliser",
|
||||
"dashboard.home_no_resume": "Rien à reprendre pour le moment",
|
||||
"dashboard.home_received_unopened": "Partage reçu non ouvert",
|
||||
"dashboard.home_expiring_soon": "Partage qui expire bientôt",
|
||||
"dashboard.home_sc_palette": "Palette de fichiers (nav. rapide)",
|
||||
"dashboard.home_sc_search": "Focus barre de recherche",
|
||||
"dashboard.home_sc_save": "Sauvegarder le fichier ouvert",
|
||||
"dashboard.home_sc_close": "Fermer l'éditeur / modale",
|
||||
"dashboard.stats": "Statistiques",
|
||||
"dashboard.stats_files": "Fichiers",
|
||||
"dashboard.stats_size": "Taille totale",
|
||||
|
||||
@@ -13676,3 +13676,56 @@ body.has-draco-bar .app-container { height: calc(100vh - 60px); }
|
||||
.banniere-hub-texte { flex: 1; overflow-wrap: anywhere; }
|
||||
.banniere-hub-fermer { flex: none; background: transparent; border: none; color: inherit; font-size: 15px; line-height: 1; padding: 4px 6px; cursor: pointer; border-radius: 6px; }
|
||||
.banniere-hub-fermer:hover { background: rgba(255, 255, 255, 0.18); }
|
||||
|
||||
/* ── Accueil « Reprendre » (#247-#249) ─────────────────────────────── */
|
||||
.home-stats-strip {
|
||||
display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center;
|
||||
padding: 10px 14px; margin-bottom: 14px;
|
||||
background: var(--bg-secondary, var(--surface)); border: 1px solid var(--border);
|
||||
border-radius: 10px; color: var(--text-muted); font-size: 0.85rem;
|
||||
}
|
||||
.home-stats-strip span { display: inline-flex; align-items: center; gap: 6px; }
|
||||
.home-stats-strip svg { width: 14px; height: 14px; }
|
||||
.home-hero { margin-bottom: 18px; }
|
||||
.home-search-input {
|
||||
width: 100%; box-sizing: border-box; padding: 12px 16px; font-size: 1rem;
|
||||
background: var(--bg-secondary, var(--surface)); color: var(--text);
|
||||
border: 1px solid var(--border); border-radius: 10px;
|
||||
}
|
||||
.home-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
|
||||
.home-action-btn {
|
||||
display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px;
|
||||
background: var(--bg-secondary, var(--surface)); color: var(--text);
|
||||
border: 1px solid var(--border); border-radius: 8px; cursor: pointer;
|
||||
}
|
||||
.home-action-btn:hover { border-color: var(--accent); }
|
||||
.home-section { margin-bottom: 22px; }
|
||||
.home-section-title {
|
||||
display: flex; align-items: center; gap: 8px;
|
||||
font-size: 1rem; margin: 0 0 10px 0; color: var(--text);
|
||||
}
|
||||
.home-vaults-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
|
||||
.home-vault-card {
|
||||
display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
|
||||
padding: 12px 14px; text-align: left; cursor: pointer;
|
||||
background: var(--bg-secondary, var(--surface)); color: var(--text);
|
||||
border: 1px solid var(--border); border-radius: 10px;
|
||||
}
|
||||
.home-vault-card:hover { border-color: var(--accent); }
|
||||
.home-vault-name { font-weight: 600; }
|
||||
.home-vault-meta { color: var(--text-muted); font-size: 0.8rem; }
|
||||
.home-todo-item {
|
||||
display: flex; align-items: center; gap: 10px; padding: 8px 12px; margin-bottom: 8px;
|
||||
background: var(--bg-secondary, var(--surface)); border: 1px solid var(--border); border-radius: 8px;
|
||||
}
|
||||
.home-todo-label { color: var(--accent-orange, var(--accent)); font-size: 0.8rem; }
|
||||
.home-todo-name { font-weight: 600; }
|
||||
.home-todo-vault { color: var(--text-muted); font-size: 0.8rem; margin-right: auto; }
|
||||
.home-searches-list { display: flex; flex-wrap: wrap; gap: 8px; }
|
||||
.home-search-item {
|
||||
display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; cursor: pointer;
|
||||
background: var(--bg-secondary, var(--surface)); color: var(--text);
|
||||
border: 1px solid var(--border); border-radius: 999px;
|
||||
}
|
||||
.home-customize { color: var(--text-muted); font-size: 0.85rem; }
|
||||
.home-customize label { display: inline-flex; align-items: center; gap: 5px; margin: 6px 14px 0 0; cursor: pointer; }
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "obsigate",
|
||||
"version": "2.98.0",
|
||||
"version": "2.99.0",
|
||||
"description": "**Porte d'entrée web ultra-léger pour vos vaults Obsidian** — Accédez, naviguez et recherchez dans toutes vos notes Obsidian depuis n'importe quel appareil via une interface web moderne et responsive.",
|
||||
"main": "patch.js",
|
||||
"directories": {
|
||||
|
||||
@@ -48,12 +48,16 @@ test.describe('Dashboard & Navigation', () => {
|
||||
|
||||
test('should show Quick Help section', async ({ page }) => {
|
||||
await goHome(page);
|
||||
// Depuis #247, l'onglet par défaut est Accueil ; l'aide rapide vit dans
|
||||
// le panneau Statistiques, il faut donc l'ouvrir explicitement.
|
||||
await page.locator('.dashboard-tab[data-tab="stats"]').click();
|
||||
await expect(page.locator('#quick-help')).toBeVisible();
|
||||
await expect(page.locator('#quick-help .qh-header')).toContainText('Raccourcis');
|
||||
});
|
||||
|
||||
test('should toggle Quick Help collapsed state', async ({ page }) => {
|
||||
await goHome(page);
|
||||
await page.locator('.dashboard-tab[data-tab="stats"]').click();
|
||||
// Wait for JS to initialize
|
||||
await page.waitForTimeout(500);
|
||||
const toggle = page.locator('#qh-toggle');
|
||||
|
||||
@@ -0,0 +1,97 @@
|
||||
#!/usr/bin/env node
|
||||
/**
|
||||
* Accueil « Reprendre » (#247-#249) — structure et branchements.
|
||||
*
|
||||
* Vérifie, sur le DOM réel d'index.html (JSDOM) et les sources :
|
||||
* - l'onglet Accueil existe, premier et actif par défaut ; les onglets
|
||||
* Statistiques / Bookmarks / Récents / Partagés sont toujours là ;
|
||||
* - le panneau Accueil porte toutes les sections (#247 bandeau +
|
||||
* recherche héros + actions, Reprendre ; #248 À traiter ; #249
|
||||
* vaults, recherches sauvées, raccourcis, personnalisation) ;
|
||||
* - le widget DashboardHomeWidget est exporté, chargé par
|
||||
* showWelcome, et branché sur les API existantes ;
|
||||
* - le gabarit de showWelcome (viewer.js) reconstruit le même accueil.
|
||||
*
|
||||
* Usage: node tests/frontend/dashboard-home.test.mjs
|
||||
*/
|
||||
|
||||
import { strict as assert } from "node:assert";
|
||||
import { JSDOM } from "jsdom";
|
||||
import { readFileSync } from "node:fs";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import path from "node:path";
|
||||
|
||||
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
||||
const ROOT = path.resolve(__dirname, "..", "..");
|
||||
const read = (rel) => readFileSync(path.join(ROOT, rel), "utf8");
|
||||
|
||||
let passed = 0;
|
||||
function test(name, fn) {
|
||||
try { fn(); console.log(` ✓ ${name}`); passed++; }
|
||||
catch (e) { console.error(` ✗ ${name}\n ${e.message}`); process.exitCode = 1; }
|
||||
}
|
||||
|
||||
const indexHtml = read("frontend/index.html");
|
||||
const dom = new JSDOM(indexHtml, { url: "http://localhost/" });
|
||||
const doc = dom.window.document;
|
||||
|
||||
test("onglet Accueil premier et actif par défaut", () => {
|
||||
const tabs = [...doc.querySelectorAll(".dashboard-tab")];
|
||||
assert.ok(tabs.length >= 5, "au moins 5 onglets");
|
||||
assert.equal(tabs[0].dataset.tab, "home");
|
||||
assert.ok(tabs[0].classList.contains("active"));
|
||||
const names = tabs.map((t) => t.dataset.tab);
|
||||
for (const kept of ["stats", "bookmarks", "recent", "shared"]) {
|
||||
assert.ok(names.includes(kept), `onglet ${kept} conservé`);
|
||||
}
|
||||
const statsTab = tabs.find((t) => t.dataset.tab === "stats");
|
||||
assert.ok(!statsTab.classList.contains("active"), "stats n'est plus l'onglet actif");
|
||||
});
|
||||
|
||||
test("panneau Accueil actif, statistiques conservé mais inactif", () => {
|
||||
const home = doc.getElementById("dashboard-panel-home");
|
||||
assert.ok(home && home.classList.contains("active"));
|
||||
const stats = doc.getElementById("dashboard-panel-stats");
|
||||
assert.ok(stats && !stats.classList.contains("active"));
|
||||
assert.ok(doc.getElementById("dashboard-stats-grid"), "grille stats intacte");
|
||||
assert.ok(doc.getElementById("quick-help"), "raccourcis de la vue stats intacts");
|
||||
});
|
||||
|
||||
test("sections de l'Accueil présentes (#247-#249)", () => {
|
||||
for (const id of [
|
||||
"home-stats-strip", "home-search-input",
|
||||
"home-action-new", "home-action-upload", "home-action-palette",
|
||||
"home-section-todo", "home-conflicts-container", "home-todo-list",
|
||||
"home-section-resume", "home-resume-grid",
|
||||
"home-section-vaults", "home-vaults-grid",
|
||||
"home-section-searches", "home-searches-list",
|
||||
"home-section-help",
|
||||
]) {
|
||||
assert.ok(doc.getElementById(id), `#${id} présent`);
|
||||
}
|
||||
assert.ok(doc.querySelectorAll("[data-home-toggle]").length >= 5, "personnalisation présente");
|
||||
});
|
||||
|
||||
const dashboard = read("frontend/js/dashboard.js");
|
||||
|
||||
test("DashboardHomeWidget exporté et branché sur les API existantes", () => {
|
||||
assert.match(dashboard, /DashboardHomeWidget/);
|
||||
assert.match(dashboard, /export \{[^}]*DashboardHomeWidget/);
|
||||
for (const endpoint of ["/api/dashboard", "/api/recent?mode=opened", "/api/bookmarks", "/api/conflicts", "/api/shares", "/api/saved-searches"]) {
|
||||
assert.ok(dashboard.includes(endpoint), `endpoint ${endpoint}`);
|
||||
}
|
||||
assert.match(dashboard, /DashboardConflictsWidget\.render\(data\.conflicts/);
|
||||
assert.match(dashboard, /TabManager\.openNav\(v\.name\)/);
|
||||
assert.match(dashboard, /localStorage/);
|
||||
});
|
||||
|
||||
const viewer = read("frontend/js/viewer.js");
|
||||
|
||||
test("showWelcome reconstruit l'Accueil et le charge", () => {
|
||||
assert.ok(viewer.includes('data-tab="home"'), "onglet home dans le gabarit");
|
||||
assert.ok(viewer.includes('id="dashboard-panel-home"'), "panneau home dans le gabarit");
|
||||
assert.match(viewer, /DashboardHomeWidget\.load\(\)/);
|
||||
assert.ok(viewer.includes("dashboard-panel-stats"), "panneau stats toujours reconstruit");
|
||||
});
|
||||
|
||||
console.log(`\n${passed} dashboard-home tests passed`);
|
||||
Reference in New Issue
Block a user