diff --git a/app/static/js/path-analyzer.js b/app/static/js/path-analyzer.js index 824b5a1..c8f1212 100644 --- a/app/static/js/path-analyzer.js +++ b/app/static/js/path-analyzer.js @@ -849,6 +849,15 @@ function paReadFilters() { paFilters.sender = document.getElementById('paSenderFilter').value.trim().toLowerCase(); paFilters.content = document.getElementById('paContentFilter').value.trim().toLowerCase(); document.getElementById('paClearFiltersBtn').classList.toggle('d-none', !paFiltersActive()); + + // Active-filter count on the mobile Filters toggle, so filters applied + // while the panel is collapsed stay visible + const activeCount = [paFilters.hops !== 'any', paFilters.hashSize !== 'any', + paFilters.token !== '', paFilters.sender !== '', + paFilters.content !== ''].filter(Boolean).length; + const badge = document.getElementById('paFiltersBadge'); + badge.textContent = activeCount; + badge.classList.toggle('d-none', activeCount === 0); } function paApplyFilters() { diff --git a/app/templates/path-analyzer.html b/app/templates/path-analyzer.html index 17b6c05..0af29d5 100644 --- a/app/templates/path-analyzer.html +++ b/app/templates/path-analyzer.html @@ -57,6 +57,38 @@ flex-shrink: 0; } + /* Collapsible filter group. On >=768px it renders as if its children + sat directly in the toolbar (display: contents), so the desktop + layout is unchanged and the collapse state is ignored. Below 768px + it is a Bootstrap collapse spanning the full toolbar width, + toggled by the Filters button. Keep these rules on the class (not + the #id) so Bootstrap's .collapse:not(.show) still wins. */ + .pa-filters { + display: flex; + flex-wrap: wrap; + align-items: center; + gap: 0.5rem; + } + + @media (min-width: 768px) { + .pa-filters { + display: contents !important; + } + } + + @media (max-width: 767.98px) { + .pa-filters { + width: 100%; + order: 10; /* keep the counter on the first toolbar line */ + } + + .pa-filters input.form-control { + flex: 1 1 42%; + width: auto !important; + min-width: 0; + } + } + .pa-content { flex: 1 1 0; min-height: 0; @@ -474,44 +506,52 @@ Map -
- - - - - - - - - -