diff --git a/ui/src/components/ui/NavBar.vue b/ui/src/components/ui/NavBar.vue index 464b314..2582ec7 100644 --- a/ui/src/components/ui/NavBar.vue +++ b/ui/src/components/ui/NavBar.vue @@ -54,15 +54,26 @@ const hasBadge = (path, op) => { return table && realtime.badges[table]?.[op] } +const hasAnyBadge = (path) => { + const table = tableForPath(path) + if (!table) return false + const b = realtime.badges[table] + return b.INSERT || b.UPDATE || b.DELETE +} + // clases dinĂ¡micas p/ mostrar / ocultar barra const sidebarClasses = computed(() => ui.sidebarOpen ? 'translate-x-0' : '-translate-x-full') -const handleLinkClick = () => { +const handleLinkClick = (path) => { // Close sidebar if desktopNavbarPersistent is false or if it's mobile view (width < 768px) // Assuming 768px is the 'md' breakpoint. if (!ui.desktopNavbarPersistent || window.innerWidth < 768) { ui.closeSidebar() } + // Clear badges for this module when the link is clicked + const table = tableForPath(path) + if (table) realtime.clearBadgesForTable(table) + // Otherwise, (desktopNavbarPersistent is true AND width >= 768px), do nothing to keep sidebar open. } @@ -89,9 +100,9 @@ const handleLinkClick = () => { {{ l.label }} @@ -117,7 +128,7 @@ ul { list-style: none; padding-left: 0; } border: 1px solid var(--accent-color); overflow: hidden; border-radius: 0.375rem; - transition: background-color 0.3s ease, color 0.3s ease; + transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease; z-index: 0; } @@ -159,6 +170,10 @@ ul { list-style: none; padding-left: 0; } box-shadow: 0 1px 3px 0 rgba(0,0,0,0.1), 0 1px 2px 0 rgba(0,0,0,0.06); } +.nav-link.notified { + transform: translateX(10px); +} + /* Scrollbar styling using primary color */ .custom-scroll::-webkit-scrollbar { width: 8px; } .custom-scroll::-webkit-scrollbar-track { background: transparent; }