diff --git a/frontend/src/lib/features/collections/CollectionTree.svelte b/frontend/src/lib/features/collections/CollectionTree.svelte index 03f0d7a33..243cf6492 100644 --- a/frontend/src/lib/features/collections/CollectionTree.svelte +++ b/frontend/src/lib/features/collections/CollectionTree.svelte @@ -407,12 +407,14 @@ : [] ); - // Leading hierarchy track holds indent + expander (+ test case badge). It is - // sized for the deepest visible row so the configured columns stay aligned. - let hierarchyWidth = $derived.by(() => { - const maxLevel = treeData.reduce((max, row) => Math.max(max, row.level), 0); - return maxLevel * 1.5 + 1.5 + (showTestCases ? 3 : 0); - }); + // Leading hierarchy track holds the expander (+ test case badge); the depth + // indent is applied to the title cell so every child row shows its nesting. + let hierarchyWidth = $derived(1.5 + (showTestCases ? 3 : 0)); + let indentColumnId = $derived( + listColumns.some((column) => column.field_identifier === 'title') + ? 'title' + : listColumns[0]?.field_identifier + ); let gridTemplateColumns = $derived(`${hierarchyWidth}rem ${listGridTemplateColumns(listColumns)}`); let gridMinWidth = $derived(`calc(${listGridMinWidth(listColumns)} + ${hierarchyWidth + 1}rem)`); @@ -520,14 +522,17 @@ style="grid-template-columns: {gridTemplateColumns}; min-width: {gridMinWidth};" > -