Skip to content

Commit a83d4e2

Browse files
committed
ui: tighten extra-labels padding to fit the actual key length
The Extra labels pre-block used padEnd(18) — a fixed width copied from the main-labels block where it makes columns line up with header / follower entries. In the extras block there's typically just one entry (framework_args, 14 chars), so the fixed pad inserts 4 extra spaces between key and value with nothing to align them to. Reads like a formatting bug. Compute the pad from the actual keys present + 1. With framework_args alone, that's padEnd(15) — one space between key and value. If more labels show up later, they self-align.
1 parent 4ebdec0 commit a83d4e2

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

frontend/src/components/ui/ModelCard.svelte

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,8 +272,9 @@
272272
!["launched_by","slurm_job_id","worker_group_id","framework","started_at","expires_at","slurm_partition","served_model_name"].includes(k)
273273
)}
274274
{#if extra.length > 0}
275+
{@const pad = Math.max(...extra.map(([k]) => k.length)) + 1}
275276
<div class="text-xs text-slate-500 dark:text-slate-400 mt-2 mb-1">Extra labels</div>
276-
<pre class="code-block">{extra.map(([k, v]) => `${k.padEnd(18)} ${v}`).join("\n")}</pre>
277+
<pre class="code-block">{extra.map(([k, v]) => `${k.padEnd(pad)} ${v}`).join("\n")}</pre>
277278
{/if}
278279
{/if}
279280
</div>

0 commit comments

Comments
 (0)