()
| 2747 | if (model.tags && Array.isArray(model.tags) && model.tags.length > 0) { |
| 2748 | const tagNames = model.tags.map(t => |
| 2749 | typeof t === 'string' ? t : (t && (t.name || t)) || '' |
| 2750 | ).filter(Boolean); |
| 2751 | tagNames.sort((a, b) => a.localeCompare(b)); // Sort tags alphabetically |
| 2752 | const tagsDisplay = tagNames.join(', '); |
| 2753 | fillTagsWithFilterLinks(tagsElement, tagNames); |
| 2754 | tagsElement.style.color = '#aaa'; |
| 2755 | tagsElement.setAttribute('title', tagsDisplay); |
| 2756 | } else if (model.id) { |
| 2757 | tagsElement.textContent = '—'; |
| 2758 | tagsElement.style.color = '#666'; |
| 2759 | tagsElement.removeAttribute('title'); |
| 2760 | window.electron.getModelTags(model.id).then(tags => { |
| 2761 | if (tags && tags.length > 0) { |
| 2762 | const tagNames = tags.map(t => |
| 2763 | typeof t === 'string' ? t : (t && (t.name || t)) || '' |
| 2764 | ).filter(Boolean); |
| 2765 | tagNames.sort((a, b) => a.localeCompare(b)); // Sort tags alphabetically |
| 2766 | const tagsText = tagNames.join(', '); |
| 2767 | fillTagsWithFilterLinks(tagsElement, tagNames); |
| 2768 | tagsElement.style.color = '#aaa'; |
| 2769 | tagsElement.setAttribute('title', tagsText); |
| 2770 | } else { |
no test coverage detected