feat: keep sidecar badge as MTP in chips and quant select

Reverts the -shared suffix on the chip badge and drops the shared
prefix from the draft quant select options: both MTP variants read as
plain MTP, distinguished only by their file name tooltip and size.

Assisted-by: Claude Sonnet
This commit is contained in:
Aleksander Grygier
2026-09-04 20:07:37 +02:00
parent ce6ff886a2
commit fa07d807dc
5 changed files with 7 additions and 21 deletions
@@ -17,7 +17,7 @@
<Dialog.Root onOpenChange={handleOpenChange} {open}>
<Dialog.Content
class="grid gap-0 p-0 md:h-[calc(100vh-4rem)]! md:max-h-240! md:w-[calc(100vw-4rem)]! md:max-w-360!"
class="grid gap-0 p-0 md:h-[calc(100vh-4rem)]! md:max-h-240! md:w-[calc(100vw-4rem)]! md:max-w-372!"
style="grid-template-columns: auto 1fr;"
>
<ModelsDiscover />
@@ -131,8 +131,7 @@
let draftOptions = $derived(
draftFiles.map((f) => ({
...optionFor(f),
badge: HuggingFaceService.extractQuantMeta(f.path)?.sidecar ?? null,
shared: HuggingFaceService.extractQuantMeta(f.path)?.shared ?? false
badge: HuggingFaceService.extractQuantMeta(f.path)?.sidecar ?? null
}))
);
@@ -9,7 +9,7 @@
/** Full command text, copied to the clipboard as-is. */
command: string;
baseOptions: QuantOption[];
draftOptions: (QuantOption & { badge: ModelSidecar | null; shared: boolean })[];
draftOptions: (QuantOption & { badge: ModelSidecar | null })[];
/** Value of the base quant select, mirrored by the parent. */
basePick: string;
/** Value of the draft quant select; empty when no draft is picked. */
@@ -53,15 +53,6 @@
<div
class="relative flex items-center gap-2 overflow-hidden rounded-lg border border-border/40 bg-background py-2.5 pl-4 pr-10 shadow-xs dark:border-border/35 dark:bg-background/50"
>
<div
aria-hidden="true"
class="pointer-events-none absolute inset-y-0 left-0 w-px bg-primary/20"
></div>
<span aria-hidden="true" class="shrink-0 select-none font-mono text-xs text-muted-foreground/40"
>$</span
>
<!-- Single line: long commands scroll horizontally instead of wrapping. -->
<div
class="flex min-w-0 flex-1 items-center gap-x-2 overflow-x-auto py-0.5 font-mono text-xs whitespace-nowrap text-foreground/90"
@@ -99,16 +90,12 @@
<select
aria-label="Draft model quantization"
class={SELECT_CLASS}
class="{SELECT_CLASS} -ml-2"
onchange={(e) => onDraftPick(e.currentTarget.value)}
value={draftPick}
>
{#each draftOptions as option (option.path)}
<option disabled={option.disabled} value={option.path}>
{#if option.shared}
{option.badge?.toUpperCase()}-SHARED
{/if}
{option.label}
</option>
{/each}
@@ -44,7 +44,7 @@
<span
class="rounded-md bg-primary px-1 py-0.5 text-[10px] font-semibold tracking-wide text-primary-foreground uppercase"
>
{meta.sidecar}{meta.shared ? '-shared' : ''}
{meta.sidecar}
</span>
{/if}
@@ -76,7 +76,7 @@
<span
class="rounded-md bg-primary px-1 py-0.5 text-[10px] font-semibold tracking-wide text-primary-foreground uppercase"
>
{meta.sidecar}{meta.shared ? '-shared' : ''}
{meta.sidecar}
</span>
{/if}
@@ -48,4 +48,4 @@ export function labelFor(path: string): string {
// to its widest option, so an exactly-as-wide value would otherwise let the
// chevron overlap the text (draft selects are all same-width quants).
export const SELECT_CLASS =
'h-6 min-w-18 max-w-40 shrink-0 cursor-pointer rounded border border-primary/15 bg-primary/[0.07] py-0 pr-3 pl-2 font-mono text-xs text-foreground outline-none transition-colors hover:bg-primary/15 focus-visible:border-primary/40 focus-visible:ring-0';
'h-6 min-w-22 max-w-36 shrink-0 cursor-pointer rounded border border-primary/15 bg-primary/[0.07] py-0 pr-3 pl-2 font-mono text-xs text-foreground outline-none transition-colors hover:bg-primary/15 focus-visible:border-primary/40 focus-visible:ring-0';