Drop expand state for parent groups that no longer have 2+ distinct files.
(models)
| 1363 | if (!path) return ''; |
| 1364 | // Decode URL encoding if present |
| 1365 | let normalized = path; |
| 1366 | try { |
| 1367 | normalized = decodeURIComponent(normalized); |
| 1368 | } catch (e) { |
| 1369 | // If decoding fails, use original path |
| 1370 | } |
| 1371 | // Normalize path separators (both forward and back slashes) |
| 1372 | normalized = normalized.replace(/\\/g, '/'); |
| 1373 | // Trim whitespace |
| 1374 | normalized = normalized.trim(); |
| 1375 | // Windows drive letter: compare case-insensitively (C: vs c:) |
| 1376 | if (/^[a-zA-Z]:\//.test(normalized)) { |
| 1377 | normalized = normalized.charAt(0).toUpperCase() + normalized.slice(1); |
| 1378 | } |
| 1379 | return normalized; |
| 1380 | } |
| 1381 | |
| 1382 | /** Stable identity for grid rows: same file path = one row (handles duplicate DB ids). */ |
| 1383 | function getGridModelDedupeKey(model) { |
| 1384 | if (!model) return ''; |
| 1385 | const pathNorm = normalizePathForComparison(model.filePath || ''); |
| 1386 | if (pathNorm) return `p:${pathNorm}`; |
no test coverage detected