(label, sortKey, width, options = {})
| 14863 | function clearModelDetailsSidebar() { |
| 14864 | currentModelDetailsPath = null; |
| 14865 | currentModelDetailsAbort = true; |
| 14866 | const pathTreeContainer = document.getElementById('path-tree-container'); |
| 14867 | if (pathTreeContainer) { |
| 14868 | pathTreeContainer.innerHTML = ''; |
| 14869 | pathTreeContainer.removeAttribute('data-file-path'); |
| 14870 | } |
| 14871 | const mn = document.getElementById('model-name'); |
| 14872 | if (mn) mn.value = ''; |
| 14873 | const md = document.getElementById('model-designer'); |
| 14874 | if (md) md.value = ''; |
| 14875 | const ms = document.getElementById('model-source'); |
| 14876 | if (ms) ms.value = ''; |
| 14877 | const mnotes = document.getElementById('model-notes'); |
| 14878 | if (mnotes) mnotes.value = ''; |
| 14879 | const mp = document.getElementById('model-printed'); |
| 14880 | if (mp) mp.checked = false; |
| 14881 | const mparent = document.getElementById('model-parent'); |
| 14882 | if (mparent) mparent.value = ''; |
| 14883 | const mlic = document.getElementById('model-license'); |
| 14884 | if (mlic) mlic.value = ''; |
| 14885 | const mtags = document.getElementById('model-tags'); |
| 14886 | if (mtags) mtags.innerHTML = ''; |
| 14887 | previousSelectionHash = ''; |
| 14888 | } |
| 14889 | |
| 14890 | /** |
| 14891 | * Run when filter/search inputs change the result set — synchronously, before any await. |
| 14892 | * search.js cannot access selectedModels; post-render sync alone loses races to showModelDetails(). |
| 14893 | */ |
| 14894 | function resetFilterSelectionAndDetails() { |
| 14895 | currentModelDetailsAbort = true; |
| 14896 | selectedModels.clear(); |
| 14897 | document.querySelectorAll('.file-item').forEach((item) => item.classList.remove('selected')); |
| 14898 | |
| 14899 | const multiEditPanel = document.getElementById('multi-edit-panel'); |
| 14900 | if (multiEditPanel && !multiEditPanel.classList.contains('hidden')) { |
| 14901 | multiEditPanel.classList.add('hidden'); |
| 14902 | const detailsPanel = document.getElementById('model-details'); |
| 14903 | if (detailsPanel) detailsPanel.classList.remove('hidden'); |
| 14904 | const editModeToggle = document.getElementById('edit-mode-toggle'); |
| 14905 | if (editModeToggle) { |
| 14906 | editModeToggle.textContent = 'Multi-Edit Mode'; |
| 14907 | editModeToggle.classList.remove('active'); |
| 14908 | } |
| 14909 | isMultiSelectMode = false; |
| 14910 | } |
| 14911 | |
| 14912 | clearModelDetailsSidebar(); |
| 14913 | updateSelectedCount(); |
| 14914 | } |
| 14915 | |
| 14916 | /** True if sidebar + selection state is consistent with the current filtered grid rows. */ |
| 14917 | function isSidebarShowingModelInFilteredList(files, filteredSet) { |
| 14918 | const list = Array.isArray(files) ? files : []; |
| 14919 | const paths = [ |
| 14920 | currentModelDetailsPath, |
| 14921 | document.getElementById('path-tree-container')?.getAttribute('data-file-path') |
| 14922 | ].filter(Boolean); |
no outgoing calls
no test coverage detected