MCPcopy Create free account
hub / github.com/TechJeeper/Printventory / insertDetailedMetadataRowBefore

Function insertDetailedMetadataRowBefore

renderer.js:1421–1441  ·  view source on GitHub ↗

Insert a new detailed-view metadata row in the same order as createModelItem (dir row, designer, source, parent, license, tags).

(metadataContainer, el, selectorList)

Source from the content-addressed store, hash-verified

1419
1420/** Drop expand state for parent groups that no longer have 2+ distinct files. */
1421function pruneParentModelExpandedGroups(models) {
1422 if (!parentModelExpandedGroups.size) return;
1423 const pathSets = new Map();
1424 for (const model of models || []) {
1425 const label = getParentModelGroupLabel(model);
1426 if (!label) continue;
1427 const gk = `parent:${getParentModelGroupKey(label)}`;
1428 const pathKey = normalizePathForComparison(model.filePath || '');
1429 if (!pathKey) continue;
1430 if (!pathSets.has(gk)) pathSets.set(gk, new Set());
1431 pathSets.get(gk).add(pathKey);
1432 }
1433 for (const key of [...parentModelExpandedGroups]) {
1434 const set = pathSets.get(key);
1435 if (!set || set.size < 2) {
1436 parentModelExpandedGroups.delete(key);
1437 }
1438 }
1439}
1440
1441function pruneZipArchiveExpandedGroups(models) {
1442 if (!zipArchiveExpandedGroups.size) return;
1443 const pathSets = new Map();
1444 for (const model of models || []) {

Callers 1

updateModelElementFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected