Fix légende Binder + persistance vue active au refresh

- Binder en flex column pour que la légende apparaisse
- Vue active sauvegardée dans localStorage, restaurée au chargement

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Etienne Delvarre
2026-05-29 17:49:35 +02:00
parent f715f83918
commit 4a38f4c24c
+8 -2
View File
@@ -342,7 +342,7 @@ window.dispatchEvent(new Event('tiptap-loaded'));
/* ── Vue Rédaction ── */
.redaction-layout { display: flex; height: calc(100vh - 60px); }
.binder { width: 260px; flex-shrink: 0; background: var(--bg-alt); border-right: 1px solid var(--border); overflow-y: auto; padding: 16px 0; }
.binder { width: 260px; flex-shrink: 0; background: var(--bg-alt); border-right: 1px solid var(--border); overflow-y: auto; padding: 16px 0; display: flex; flex-direction: column; }
.binder-acte { padding: 0 12px; margin-bottom: 4px; }
.binder-acte-title { font-family: 'Playfair Display', serif; font-size: 13px; font-weight: 700; color: var(--text-hint); text-transform: uppercase; letter-spacing: 0.5px; padding: 10px 12px 6px; cursor: pointer; user-select: none; }
.binder-acte-title:hover { color: var(--text); }
@@ -424,7 +424,7 @@ window.dispatchEvent(new Event('tiptap-loaded'));
<div class="sidebar">
<div class="sidebar-logo">Tableau de bord</div>
<div class="sidebar-project">Projet RdB</div>
<div class="nav-item active" data-view="vision" onclick="switchView('vision')"><span class="nav-icon">&#9733;</span> Vision</div>
<div class="nav-item" data-view="vision" onclick="switchView('vision')"><span class="nav-icon">&#9733;</span> Vision</div>
<div class="nav-item" data-view="frise" onclick="switchView('frise')"><span class="nav-icon">&#9868;</span> Frise</div>
<div class="nav-item" data-view="redaction" onclick="switchView('redaction')"><span class="nav-icon">&#9998;</span> Rédaction</div>
<div class="sidebar-footer">Etienne & Myriam</div>
@@ -630,6 +630,7 @@ function switchView(name) {
document.querySelectorAll('.view').forEach(v => v.classList.remove('active'));
document.getElementById('view-' + name).classList.add('active');
document.querySelectorAll('.nav-item[data-view]').forEach(n => n.classList.toggle('active', n.dataset.view === name));
try { localStorage.setItem('tdb-rdb-view', name); } catch(e) {}
const topTitle = document.querySelector('.topbar-title');
const btnNew = document.querySelector('.btn-new');
if (name === 'vision') {
@@ -1011,6 +1012,11 @@ async function loadData() {
populateFilterOptions();
renderFrise();
applyFilters();
// Restore last active view
try {
const saved = localStorage.getItem('tdb-rdb-view');
if (saved && document.getElementById('view-' + saved)) switchView(saved);
} catch(e) {}
}
function esc(s) {