From ddb075d563ebb09c9157602ee32e61ec1355c678 Mon Sep 17 00:00:00 2001 From: Quentin Rouiller Date: Thu, 23 Apr 2026 15:13:04 +0200 Subject: [PATCH] =?UTF-8?q?v2026.5.22=20=E2=80=94=20Stabilit=C3=A9=20popup?= =?UTF-8?q?s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- manifest.json | 2 +- viewer.css | 17 +++++++++++------ viewer.js | 43 ++++++++++++++++--------------------------- 3 files changed, 28 insertions(+), 34 deletions(-) diff --git a/manifest.json b/manifest.json index 0d63aa1..3f52ea1 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 3, "name": "Planification", - "version": "2026.5.21", + "version": "2026.5.22", "description": "Vue claire et rapide du planning des techniciens EasyVista. Regroupe interventions et réservations par tech, affiche horaires, contact, lieu, catégorie et statut en un coup d'œil.", "permissions": ["activeTab", "scripting", "storage", "tabs", "alarms"], "host_permissions": [ diff --git a/viewer.css b/viewer.css index dfa5bd0..15e2ca3 100644 --- a/viewer.css +++ b/viewer.css @@ -2592,18 +2592,23 @@ header.topbar::before { v2026.5.17 : mode Minimisé (popup flottant compact, juste la ref) v2026.5.19 : refonte — élément .pinned-popup-minref créé à la volée v2026.5.21 : agrandi pour que la ref tienne sans déborder + v2026.5.22 : encore agrandi + plus d'espace entre dragbar et topbar ========================================================================== */ .pinned-popup.pinned-popup-minimized { - min-width: 240px !important; - max-width: 320px !important; - width: 260px !important; + min-width: 300px !important; + max-width: 360px !important; + width: 300px !important; height: auto !important; - min-height: 70px !important; - padding: 36px 14px 14px 14px !important; + min-height: 80px !important; + padding: 44px 16px 16px 16px !important; overflow: visible; background: var(--bg-elevated) !important; border: 1px solid var(--border) !important; } +/* Séparer visuellement la dragbar (collée en haut) des boutons topbar */ +.pinned-popup.pinned-popup-minimized .pinned-popup-topbar { + top: 14px !important; /* sous la dragbar (qui fait ~6-8px) */ +} /* Masquer tous les enfants directs du popup minimisé */ .pinned-popup.pinned-popup-minimized > *:not(.pinned-popup-topbar):not(.pinned-popup-dragbar):not(.pinned-popup-minref) { display: none !important; @@ -2612,7 +2617,7 @@ header.topbar::before { .pinned-popup-minref { display: block; text-align: center; - padding: 8px 10px; + padding: 10px 12px; font-family: var(--mono, monospace); font-size: 15px; font-weight: 700; diff --git a/viewer.js b/viewer.js index 5bcc08e..859823b 100644 --- a/viewer.js +++ b/viewer.js @@ -6843,6 +6843,15 @@ function _softUnpinPopup(el) { _ensureDockCloseAllBtn(); } + // v2026.5.22 : si le tooltip hover est actuellement affiché pour la même + // intervention que celle qu'on désépingle, il faut regénérer son HTML pour + // que l'icône passe de 📍 (active rouge) à 📌 (non active) — sinon l'user + // voit l'ancienne icône et croit qu'il est toujours épinglé. + const tip = tooltipEl(); + if (tip && tip.classList.contains("visible") && state.currentTooltipIv) { + tip.innerHTML = buildTooltipHTML(state.currentTooltipIv); + } + // Helper qui joue l'animation de sortie puis supprime le DOM const animateAndRemove = () => { el.classList.add("unpinning"); @@ -7675,34 +7684,14 @@ function bindTooltipInteractions() { e.preventDefault(); const action = btn.dataset.action; if (action === "pin") { - // v2026.5.21 : toggle — si déjà épinglée, désépingle ; sinon épingle + // v2026.5.22 : clic sur 📌/📍 dans le tooltip hover = TOUJOURS réépingler + // à la position actuelle. Si un popup existe déjà pour cette iv+date, + // il est supprimé avant d'en créer un nouveau à côté de la carte survolée. + // (La suppression de l'ancien est faite dans pinTooltip() qui gère + // l'unicité actionId+date — v2026.5.21.) + // Pour désépingler : bouton 📍 dans la topbar du popup, double-Ctrl, ou Échap. if (state.currentTooltipIv) { - const iv = state.currentTooltipIv; - const pinState = _getPinStateForIv(iv); - if (pinState.isPinned && pinState.popup) { - // Désépingle - const idx = pinnedPopups.findIndex(p => p.el === pinState.popup); - if (idx >= 0) pinnedPopups.splice(idx, 1); - if (pinState.popup._linkedPill) { - try { pinState.popup._linkedPill.remove(); } catch (err) {} - } - try { pinState.popup.remove(); } catch (err) {} - const dock = document.getElementById("pinned-popups-dock"); - if (dock && dock.querySelectorAll(".pinned-popup-dock-pill").length === 0) { - dock.classList.remove("visible"); - const closeAllBtn = document.getElementById("pinned-popups-close-all"); - if (closeAllBtn) closeAllBtn.remove(); - } else { - _ensureDockCloseAllBtn(); - } - // Mettre à jour le tooltip (📍 → 📌) - const tip = tooltipEl(); - if (tip && tip.classList.contains("visible")) { - tip.innerHTML = buildTooltipHTML(iv); - } - } else { - pinTooltip(); - } + pinTooltip(); } } else if (action === "reload") { // v4.1.14 : recharger uniquement l'intervention actuellement affichée