added space to show model/dataset name

This commit is contained in:
samit 2026-02-25 02:32:50 -08:00
commit 4ff7e141fe
5 changed files with 41 additions and 41 deletions

View file

@ -70,20 +70,20 @@ function ModelRow({
type="button"
onClick={onClick}
className={cn(
"flex w-full items-center justify-between gap-2 rounded-md px-2.5 py-1.5 text-left text-sm transition-colors hover:bg-accent",
"flex w-full items-center gap-2 rounded-md px-2.5 py-1.5 text-left text-sm transition-colors hover:bg-accent",
selected && "bg-accent/60",
exceeds && "opacity-50",
)}
>
<span
className={cn(
"min-w-0 flex-1 truncate",
"block min-w-0 flex-1 truncate",
exceeds && "line-through decoration-muted-foreground/50",
)}
>
{label}
</span>
<span className="flex items-center gap-1.5 shrink-0">
<span className="ml-auto flex items-center gap-1.5 shrink-0">
{vramStatus === "exceeds" && (
<span className="text-[9px] font-medium text-red-400">OOM</span>
)}

View file

@ -6,8 +6,8 @@ import { Combobox as ComboboxPrimitive } from "@base-ui/react";
import * as React from "react";
import { createContext, useContext, useState } from "react";
import { Button } from "@/components/ui/button";
import { useDialogPortalContainer } from "@/components/ui/dialog";
import { Button } from "@/components/ui/button";
import { useDialogPortalContainer } from "@/components/ui/dialog";
import {
InputGroup,
InputGroupAddon,
@ -140,28 +140,28 @@ function ComboboxInput({
);
}
function ComboboxContent({
className,
side = "bottom",
sideOffset = 6,
align = "start",
alignOffset = 0,
anchor,
container,
...props
}: ComboboxPrimitive.Popup.Props &
Pick<
ComboboxPrimitive.Positioner.Props,
"side" | "align" | "sideOffset" | "alignOffset" | "anchor"
> & {
container?: HTMLElement | null;
}): React.ReactElement {
const dialogContainer = useDialogPortalContainer();
return (
<ComboboxPrimitive.Portal container={container ?? dialogContainer ?? undefined}>
<ComboboxPrimitive.Positioner
side={side}
sideOffset={sideOffset}
function ComboboxContent({
className,
side = "bottom",
sideOffset = 6,
align = "start",
alignOffset = 0,
anchor,
container,
...props
}: ComboboxPrimitive.Popup.Props &
Pick<
ComboboxPrimitive.Positioner.Props,
"side" | "align" | "sideOffset" | "alignOffset" | "anchor"
> & {
container?: HTMLElement | null;
}): React.ReactElement {
const dialogContainer = useDialogPortalContainer();
return (
<ComboboxPrimitive.Portal container={container ?? dialogContainer ?? undefined}>
<ComboboxPrimitive.Positioner
side={side}
sideOffset={sideOffset}
align={align}
alignOffset={alignOffset}
anchor={anchor}
@ -206,7 +206,7 @@ function ComboboxItem({
<ComboboxPrimitive.Item
data-slot="combobox-item"
className={cn(
"data-highlighted:bg-accent data-highlighted:text-accent-foreground not-data-[variant=destructive]:data-highlighted:**:text-accent-foreground gap-2.5 rounded-xl corner-squircle py-2 pr-8 pl-3 text-sm [&_svg:not([class*='size-'])]:size-4 relative flex w-full cursor-pointer items-center outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",
"data-highlighted:bg-accent data-highlighted:text-accent-foreground not-data-[variant=destructive]:data-highlighted:**:text-accent-foreground gap-2 rounded-xl corner-squircle py-2 pr-3 pl-3 text-sm aria-selected:pr-8 data-[selected]:pr-8 [&_svg:not([class*='size-'])]:size-4 relative flex w-full cursor-pointer items-center outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",
className,
)}
{...props}

View file

@ -259,11 +259,11 @@ export function DatasetStep() {
<ComboboxItem
key={id}
value={id}
className="justify-between"
className="gap-2"
>
<Tooltip>
<TooltipTrigger asChild={true}>
<span className="min-w-0 flex-1 truncate">
<span className="block min-w-0 flex-1 truncate">
{id}
</span>
</TooltipTrigger>
@ -275,11 +275,11 @@ export function DatasetStep() {
</TooltipContent>
</Tooltip>
{detail ? (
<span className="text-[10px] text-muted-foreground shrink-0">
<span className="ml-auto text-[10px] text-muted-foreground shrink-0">
{detail}
</span>
) : r?.downloads != null ? (
<span className="text-[10px] text-muted-foreground shrink-0">
<span className="ml-auto text-[10px] text-muted-foreground shrink-0">
{formatCompact(r.downloads)}
</span>
) : null}

View file

@ -234,11 +234,11 @@ export function DatasetSection() {
<ComboboxItem
key={id}
value={id}
className="justify-between"
className="gap-2"
>
<Tooltip>
<TooltipTrigger asChild={true}>
<span className="min-w-0 flex-1 truncate">
<span className="block min-w-0 flex-1 truncate">
{id}
</span>
</TooltipTrigger>
@ -250,7 +250,7 @@ export function DatasetSection() {
</TooltipContent>
</Tooltip>
{detail && (
<span className="text-[10px] text-muted-foreground shrink-0">
<span className="ml-auto text-[10px] text-muted-foreground shrink-0">
{detail}
</span>
)}

View file

@ -319,10 +319,10 @@ export function ModelSection() {
const source =
model?.source === "hf_cache" ? "HF cache" : "Local dir";
return (
<ComboboxItem key={id} value={id} className="justify-between">
<ComboboxItem key={id} value={id} className="gap-2">
<Tooltip>
<TooltipTrigger asChild={true}>
<span className="min-w-0 flex-1 truncate">
<span className="block min-w-0 flex-1 truncate">
{model?.display_name ?? id}
</span>
</TooltipTrigger>
@ -330,7 +330,7 @@ export function ModelSection() {
{model?.path ?? id}
</TooltipContent>
</Tooltip>
<span className="shrink-0 text-[10px] text-muted-foreground">
<span className="ml-auto shrink-0 text-[10px] text-muted-foreground">
{source}
</span>
</ComboboxItem>
@ -434,11 +434,11 @@ export function ModelSection() {
<ComboboxItem
key={id}
value={id}
className={`justify-between ${exceeds ? "opacity-50" : ""}`}
className={`gap-2 ${exceeds ? "opacity-50" : ""}`}
>
<Tooltip>
<TooltipTrigger asChild={true}>
<span className={`min-w-0 flex-1 truncate ${exceeds ? "line-through decoration-muted-foreground/50" : ""}`}>
<span className={`block min-w-0 flex-1 truncate ${exceeds ? "line-through decoration-muted-foreground/50" : ""}`}>
{id}
</span>
</TooltipTrigger>
@ -458,7 +458,7 @@ export function ModelSection() {
)}
</TooltipContent>
</Tooltip>
<span className="flex items-center gap-1.5 shrink-0">
<span className="ml-auto flex items-center gap-1.5 shrink-0">
{fitStatus === "exceeds" && (
<span className="text-[9px] font-medium text-red-400">
OOM