feat: show the active queue filter count
Add a fixed filter summary that counts sidebar, filename, host, and status constraints, highlighting nonzero counts without changing the toolbar geometry.
This commit is contained in:
+13
-2
@@ -3933,13 +3933,24 @@ function applyQueueDetailFilters() {
|
||||
}
|
||||
|
||||
function _hasActiveQueueFilters() {
|
||||
return uploadSidebarFilter !== 'all' || Boolean(queueSearchQuery || queueHosterFilter || queueStatusFilter);
|
||||
return _activeQueueFilterCount() > 0;
|
||||
}
|
||||
|
||||
function _activeQueueFilterCount() {
|
||||
return Number(uploadSidebarFilter !== 'all') + Number(Boolean(queueSearchQuery)) + Number(Boolean(queueHosterFilter)) + Number(Boolean(queueStatusFilter));
|
||||
}
|
||||
|
||||
function syncQueueFilterResetAction() {
|
||||
const button = document.getElementById('queueFilterResetBtn');
|
||||
const count = document.getElementById('queueActiveFilterCount');
|
||||
const activeCount = _activeQueueFilterCount();
|
||||
const active = activeCount > 0;
|
||||
if (count) {
|
||||
count.textContent = String(activeCount);
|
||||
count.setAttribute('aria-label', String(activeCount));
|
||||
count.classList.toggle('is-active', active);
|
||||
}
|
||||
if (!button) return;
|
||||
const active = _hasActiveQueueFilters();
|
||||
button.disabled = !active;
|
||||
}
|
||||
|
||||
|
||||
@@ -108,6 +108,7 @@
|
||||
['Bereit zum Download', 'Ready to download'],
|
||||
['Abbrechen', 'Cancel'],
|
||||
['Filter zurücksetzen', 'Reset filters'],
|
||||
['Filter', 'Filters'],
|
||||
['Jetzt installieren', 'Install now'],
|
||||
['Jetzt updaten', 'Install now'],
|
||||
['Alle Dateien', 'All files'],
|
||||
|
||||
@@ -290,6 +290,11 @@
|
||||
<svg width="16" height="16" viewBox="0 0 16 16"><path d="M8 7l-4-5h8z" fill="#4caf50"/><path d="M8 11l-4-5h8z" fill="#4caf50"/><rect x="4" y="13" width="8" height="2" rx="0.5" fill="#4caf50"/></svg>
|
||||
</button>
|
||||
<div class="queue-filter-bar" aria-label="Warteschlange filtern">
|
||||
<div class="queue-filter-summary">
|
||||
<span>Filter</span>
|
||||
<strong id="queueActiveFilterCount" aria-label="0">0</strong>
|
||||
</div>
|
||||
<span class="queue-filter-divider" aria-hidden="true"></span>
|
||||
<input class="key-input" id="queueSearchInput" type="search" placeholder="Dateiname suchen" aria-label="Dateiname suchen" style="max-width:260px">
|
||||
<select class="hs-input" id="queueHosterFilter" aria-label="Nach Hoster filtern" style="width:auto;min-width:150px"><option value="">Alle Hoster</option></select>
|
||||
<select class="hs-input" id="queueStatusFilter" aria-label="Nach Status filtern" style="width:auto;min-width:150px">
|
||||
|
||||
@@ -425,6 +425,42 @@ body {
|
||||
.queue-filter-bar .hs-input {
|
||||
height: 30px;
|
||||
}
|
||||
.queue-filter-summary {
|
||||
min-width: 72px;
|
||||
height: 30px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 7px;
|
||||
padding: 0 6px;
|
||||
color: var(--text-dim);
|
||||
font-size: 10px;
|
||||
font-weight: 700;
|
||||
letter-spacing: .05em;
|
||||
text-transform: uppercase;
|
||||
white-space: nowrap;
|
||||
}
|
||||
#queueActiveFilterCount {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
display: grid;
|
||||
place-items: center;
|
||||
border-radius: 999px;
|
||||
background: var(--bg-raised);
|
||||
color: var(--text-muted);
|
||||
font-size: 11px;
|
||||
font-variant-numeric: tabular-nums;
|
||||
transition: background-color .16s ease, color .16s ease;
|
||||
}
|
||||
#queueActiveFilterCount.is-active {
|
||||
background: var(--success);
|
||||
color: #000;
|
||||
}
|
||||
.queue-filter-divider {
|
||||
width: 1px;
|
||||
height: 22px;
|
||||
background: var(--border);
|
||||
}
|
||||
.queue-container {
|
||||
flex: 1 1 0;
|
||||
min-height: 0;
|
||||
|
||||
Reference in New Issue
Block a user