(displayRecords, columns, view, itemHeight, paddingVertical, verticalGap)
| 19183 | modelId = fullModel.id; |
| 19184 | // Also check if tags are already in the full model |
| 19185 | if (fullModel.tags && Array.isArray(fullModel.tags) && fullModel.tags.length > 0) { |
| 19186 | const tagNames = fullModel.tags.map(t => (typeof t === 'string' ? t : (t.name || t))).filter(Boolean); |
| 19187 | tagNames.sort((a, b) => a.localeCompare(b)); // Sort tags alphabetically |
| 19188 | const tagsText = tagNames.join(', '); |
| 19189 | const tagsValueSpan = tagsItem.querySelector('.tags-info'); |
| 19190 | if (tagsValueSpan) { |
| 19191 | fillTagsWithFilterLinks(tagsValueSpan, tagNames); |
| 19192 | tagsValueSpan.setAttribute('title', tagsText); // Show full tag list on hover |
| 19193 | tagsValueSpan.style.color = '#ccc'; |
| 19194 | } |
| 19195 | return; |
| 19196 | } |
| 19197 | } |
| 19198 | } |
| 19199 | |
| 19200 | // Load tags using model ID |
| 19201 | if (modelId) { |
| 19202 | const tags = await window.electron.getModelTags(modelId); |
| 19203 | if (tags && tags.length > 0) { |
| 19204 | const tagNames = tags.map(t => (typeof t === 'string' ? t : (t.name || t))).filter(Boolean); |
| 19205 | tagNames.sort((a, b) => a.localeCompare(b)); // Sort tags alphabetically |
| 19206 | const tagsText = tagNames.join(', '); |
| 19207 | const tagsValueSpan = tagsItem.querySelector('.tags-info'); |
| 19208 | if (tagsValueSpan) { |
| 19209 | fillTagsWithFilterLinks(tagsValueSpan, tagNames); |
| 19210 | tagsValueSpan.setAttribute('title', tagsText); // Show full tag list on hover |
| 19211 | tagsValueSpan.style.color = '#ccc'; |
| 19212 | } |
| 19213 | } else { |
| 19214 | // Remove the tags item if no tags found |
| 19215 | tagsItem.remove(); |
| 19216 | } |
| 19217 | } else { |
| 19218 | // Remove the tags item if we can't get model ID |
| 19219 | tagsItem.remove(); |
| 19220 | } |
| 19221 | } catch (err) { |
| 19222 | console.error('Error loading tags:', err); |
| 19223 | // Remove the tags item on error |
| 19224 | tagsItem.remove(); |
| 19225 | } |
| 19226 | }; |
| 19227 | |
| 19228 | loadTags(); |
| 19229 | } |
| 19230 | |
| 19231 | // Show file details in detailed view |
| 19232 | fileDetails.appendChild(metadataContainer); |
| 19233 | fileDetails.style.padding = '0'; // Remove all padding |
| 19234 | fileDetails.style.margin = '0'; // Remove all margin |
| 19235 | fileInfo.appendChild(fileDetails); |
| 19236 | } |
| 19237 | |
| 19238 | item.appendChild(fileInfo); |
| 19239 | |
| 19240 | if (view === 'detailed') { |
| 19241 | const engagementBar = createModelEngagementBar(model); |
| 19242 | item.appendChild(engagementBar); |
no test coverage detected