diff --git a/frontend/src/lib/components/DrillPicker.svelte b/frontend/src/lib/components/DrillPicker.svelte index 99f2c3a9b1..a92ef11ddf 100644 --- a/frontend/src/lib/components/DrillPicker.svelte +++ b/frontend/src/lib/components/DrillPicker.svelte @@ -204,6 +204,9 @@ leaves and ignores the current scope. ) ) + /** Whether any row in this list has a second line, which sets every row's height. */ + const entriesTwoLine = $derived(entryList.some((e) => e.type === 'leaf' && !!e.node.secondary)) + // Browse rows annotated with the section header rendered above them. A // header is emitted when a leaf's section differs from the previous LEAF's // section — comparing against the previous entry of any type would insert a @@ -502,7 +505,12 @@ leaves and ignores the current scope. {/if} {/snippet} -{#snippet leafRow(leaf: DrillLeaf, secondary: string | undefined, baseClass: string)} +{#snippet leafRow( + leaf: DrillLeaf, + secondary: string | undefined, + baseClass: string, + twoLineHeight: boolean +)} {@const key = leaf.key} {@const isHl = key === highlightedKey} {@const isCur = !!leaf.current} @@ -541,9 +549,12 @@ leaves and ignores the current scope. onclick={(e) => pick(leaf, e.metaKey || e.ctrlKey)} > {@render defaultLeafIcon(leaf)} - -
+ +
{#if leaf.secondary}
{leaf.label}
@@ -657,6 +668,7 @@ leaves and ignores the current scope.
No matches
{:else} {#each searchResultsByGroup as { key, label, items } (key)} + {@const twoLineHeight = items.some((r) => !!r.leaf.secondary)} {#if label}
{#each items as r (r.leaf.key)} -
  • {@render leafRow(r.leaf, r.leaf.secondary ?? r.leaf.label, 'py-1.5')}
  • +
  • + {@render leafRow(r.leaf, r.leaf.secondary ?? r.leaf.label, 'py-1.5', twoLineHeight)} +
  • {/each} {/each} @@ -692,7 +706,8 @@ leaves and ignores the current scope. {@render leafRow( entry.node, leafSecondary?.(entry.node, scope) ?? entry.node.secondary, - 'py-1.5' + 'py-1.5', + entriesTwoLine )} {:else}