From 6fc1c596640e1169ad0418b04a53e08c69b5518e Mon Sep 17 00:00:00 2001 From: Bruno Charest Date: Fri, 27 Mar 2026 23:09:47 -0400 Subject: [PATCH] feat: initialize ObsiGate frontend with SPA structure, search history, and autocomplete functionality --- frontend/app.js | 25 +++++++++++++++++++++++++ frontend/index.html | 2 +- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/frontend/app.js b/frontend/app.js index bbfdde2..4dc61b6 100644 --- a/frontend/app.js +++ b/frontend/app.js @@ -1895,12 +1895,37 @@ if (recentFilter) recentFilter.value = selectedContextVault === "all" ? "" : selectedContextVault; if (dashboardFilter) dashboardFilter.value = selectedContextVault; + // Mise à jour visuelle des dropdowns personnalisés + updateCustomDropdownVisual("vault-filter-dropdown", selectedContextVault); + updateCustomDropdownVisual("vault-quick-select-dropdown", selectedContextVault); + // Update vault context indicator if (contextText) { contextText.textContent = selectedContextVault === "all" ? "All" : selectedContextVault; } } + /** + * Updates the visual state of a custom dropdown based on its current value. + */ + function updateCustomDropdownVisual(dropdownId, value) { + const dropdown = document.getElementById(dropdownId); + if (!dropdown) return; + + const selectedText = dropdown.querySelector(".custom-dropdown-selected"); + const options = dropdown.querySelectorAll(".custom-dropdown-option"); + + options.forEach((opt) => { + const optValue = opt.getAttribute("data-value"); + if (optValue === value) { + opt.classList.add("selected"); + if (selectedText) selectedText.textContent = opt.textContent; + } else { + opt.classList.remove("selected"); + } + }); + } + function scrollTreeItemIntoView(element, alignToTop) { if (!element) return; const scrollContainer = document.getElementById("sidebar-panel-vaults"); diff --git a/frontend/index.html b/frontend/index.html index 65c1471..58fa8fa 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -375,7 +375,7 @@

Derniers fichiers ouverts

-
+