(files)
| 15591 | } |
| 15592 | } |
| 15593 | |
| 15594 | /** Set tag filter dropdown and refresh the grid (same path as Filter menu; works with getModelsFiltered in Electron and server bridge). */ |
| 15595 | async function applyTagFilterFromModelClick(tagName) { |
| 15596 | const trimmed = (tagName && String(tagName).trim()) || ''; |
| 15597 | if (!trimmed) return; |
| 15598 | if (window.dateAddedFilter) { |
| 15599 | window.dateAddedFilter = null; |
| 15600 | window._lastDateAddedFilter = null; |
| 15601 | } |
| 15602 | window.viewingEntireLibrary = false; |
| 15603 | if (typeof window.resetFilterSelectionAndDetails === 'function') { |
| 15604 | window.resetFilterSelectionAndDetails(); |
| 15605 | } |
| 15606 | const tagSelect = document.getElementById('tag-filter'); |
| 15607 | if (!tagSelect) return; |
| 15608 | const hasOption = Array.from(tagSelect.options).some((o) => o.value === trimmed); |
| 15609 | if (!hasOption) { |
| 15610 | const opt = document.createElement('option'); |
| 15611 | opt.value = trimmed; |
| 15612 | opt.textContent = trimmed; |
| 15613 | tagSelect.appendChild(opt); |
nothing calls this directly
no test coverage detected