Skip to content

Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.

feat(hub): full-page redesign with trending feed, search, and persisted state (#6349)

Eyera435cdbc372a9
diff --git a/studio/backend/hub/services/models/gguf_variants.py b/studio/backend/hub/services/models/gguf_variants.py
index 095e3de6419..74c3ad6ce2f 100644
--- a/studio/backend/hub/services/models/gguf_variants.py
+++ b/studio/backend/hub/services/models/gguf_variants.py
@@ -525,33 +525,51 @@ async def get_gguf_variants_response(
return False
def _any_mmproj_cached(filenames: frozenset[str]) -> bool:
- return any(
+ if any(
by_filename.get(name.lower()) is not None
for by_filename in cached_filenames_by_snapshot
for name in filenames
+ ):
+ return True
+ return any(
+ _is_mmproj_filename(name.rsplit("/", 1)[-1])
+ for by_filename in cached_filenames_by_snapshot
+ for name in by_filename
+ )
+
+ def _quant_bytes_present(quant: str, size_bytes: int) -> bool:
+ # Small rounding tolerance for symlinks vs real sizes.
+ if size_bytes <= 0:
+ return False
+ return any(
+ by_quant.get(quant, 0) >= size_bytes * 0.99
+ for by_quant in cached_quant_bytes_by_snapshot
)
def _is_fully_downloaded(variant) -> bool:
- requirement = requirements_by_quant.get(variant.quant.lower())
- if requirement is None:
- if variant.size_bytes == 0:
- return False
- quant = variant.quant.lower()
- # Allow small rounding tolerance (symlinks vs real sizes).
- return any(
- by_quant.get(quant, 0) >= variant.size_bytes * 0.99
- for by_quant in cached_quant_bytes_by_snapshot
+ quant = variant.quant.lower()
+ requirement = requirements_by_quant.get(quant)
+ # Vision repos ship an mmproj adapter; any precision on disk suffices.
+ if (
+ requirement is not None
+ and _filenames_cached(
+ requirement.main_filenames,
+ requirement.main_size_bytes,
+ )
+ and (
+ not requirement.mmproj_filenames
+ or _any_mmproj_cached(requirement.mmproj_filenames)
)
- if not _filenames_cached(
- requirement.main_filenames,
- requirement.main_size_bytes,
):
+ return True
+ # Byte fallback so a present quant isn't demoted by a filename mismatch;
+ # vision repos still need an mmproj cached (any precision).
+ if not _quant_bytes_present(quant, variant.size_bytes):
return False
- # Vision repos ship an mmproj adapter per variant. Any mmproj
- # precision on disk suffices (the loader picks whichever is present);
- # requiring the API-preferred one would falsely demote variants.
- if requirement.mmproj_filenames and not _any_mmproj_cached(
- requirement.mmproj_filenames,
+ if (
+ requirement is not None
+ and requirement.mmproj_filenames
+ and not _any_mmproj_cached(requirement.mmproj_filenames)
):
return False
return True
diff --git a/studio/frontend/src/app/routes/hub.tsx b/studio/frontend/src/app/routes/hub.tsx
index dcd6617ec85..c623ef98482 100644
--- a/studio/frontend/src/app/routes/hub.tsx
+++ b/studio/frontend/src/app/routes/hub.tsx
@@ -14,6 +14,9 @@ const ModelsPage = lazy(() =>
export interface ModelsSearch {
tab?: "discover" | "downloaded";
+ model?: string;
+ section?: "trending" | "latest" | "finetune";
+ kind?: "models" | "datasets";
}
export const Route = createRoute({
@@ -22,8 +25,19 @@ export const Route = createRoute({
beforeLoad: () => requireAuth(),
component: ModelsPage,
validateSearch: (search: Record<string, unknown>): ModelsSearch => {
+ const next: ModelsSearch = {};
const raw = search.tab;
- if (raw === "discover" || raw === "downloaded") return { tab: raw };
- return {};
+ if (raw === "discover" || raw === "downloaded") next.tab = raw;
+ const model = search.model;
+ if (typeof model === "string" && model.length > 0) next.model = model;
+ const section = search.section;
+ if (section === "trending" || section === "latest" || section === "finetune") {
+ next.section = section;
+ }
+ const kind = search.kind;
+ if (kind === "models" || kind === "datasets") {
+ next.kind = kind;
+ }
+ return next;
},
});
diff --git a/studio/frontend/src/components/app-sidebar.tsx b/studio/frontend/src/components/app-sidebar.tsx
index 66accdce3a0..8255d49de81 100644
--- a/studio/frontend/src/components/app-sidebar.tsx
+++ b/studio/frontend/src/components/app-sidebar.tsx
@@ -84,7 +84,7 @@ import {
} from "@/components/ui/tooltip";
import { Tooltip as TooltipPrimitive } from "radix-ui";
import { HugeiconsIcon } from "@hugeicons/react";
-import { ChevronDown, MoreHorizontalIcon, Moon } from "lucide-react";
+import { ChevronDown, Moon } from "lucide-react";
import { Link, useNavigate, useRouterState } from "@tanstack/react-router";
import {
archiveChatItem,
@@ -226,7 +226,7 @@ function NavItem({
onClick={onClick}
isActive={active}
data-tour={dataTour}
- className="sidebar-nav-btn h-[33px] rounded-full gap-[8.5px] pl-3 pr-2.5 font-medium group-data-[collapsible=icon]:px-2.5 group-data-[collapsible=icon]:!w-[32px] group-data-[collapsible=icon]:!rounded-full group-data-[collapsible=icon]:mx-auto"
+ className="sidebar-nav-btn h-[33px] rounded-[14px] gap-[8.5px] pl-3 pr-2.5 font-medium group-data-[collapsible=icon]:px-2.5 group-data-[collapsible=icon]:!w-[32px] group-data-[collapsible=icon]:!rounded-full group-data-[collapsible=icon]:mx-auto"
>
<HugeiconsIcon icon={icon} strokeWidth={1.75} className="size-icon! shrink-0 group-hover/menu-button:animate-icon-pop" />
<span className="text-[14.5px] leading-[19px] tracking-nav">{label}</span>
@@ -293,6 +293,7 @@ export function AppSidebar() {
};
const isRecipesRoute = pathname.startsWith("/data-recipes");
+ const isExportRoute = pathname === "/export" || pathname.startsWith("/export/");
const { displayTitle, avatarDataUrl } = useEffectiveProfile();
const { projects } = useChatProjects();
@@ -334,10 +335,14 @@ export function AppSidebar() {
undefined
: undefined;
- // Training runs
+ // Training runs: surfaced as sidebar "Recents" on Train, Recipes, and Export,
+ // falling back to chat recents when there are no runs yet.
+ const trainingRecentsRoute = isStudioRoute || isRecipesRoute || isExportRoute;
const { items: runItems } = useTrainingHistorySidebarItems(
- !chatOnly && isStudioRoute,
+ !chatOnly && trainingRecentsRoute,
);
+ const showTrainingRecents =
+ !chatOnly && trainingRecentsRoute && runItems.length > 0;
const activeJobId = useTrainingRuntimeStore((s) => s.jobId);
const currentRunViewActive = useTrainingRuntimeStore((s) => s.currentRunViewActive);
const selectedHistoryRunId = useTrainingRuntimeStore((s) => s.selectedHistoryRunId);
@@ -667,7 +672,7 @@ export function AppSidebar() {
? "sidebar-row-action group-hover/project-chat-item:opacity-100 group-hover/project-chat-item:pointer-events-auto focus-visible:opacity-100 focus-visible:pointer-events-auto"
: "sidebar-row-action group-hover/recent-item:opacity-100 group-hover/recent-item:pointer-events-auto focus-visible:opacity-100 focus-visible:pointer-events-auto";
const buttonClass = cn(
- "sidebar-nav-btn h-[33px] cursor-pointer rounded-full pr-4 text-[14.5px] leading-[19px] tracking-nav font-medium",
+ "sidebar-nav-btn h-[33px] cursor-pointer rounded-[14px] pr-4 text-[14.5px] leading-[19px] tracking-nav font-medium",
// pl-3 (12px) over the content's pl-1.5 (6px) = 18px, aligning the
// title with the nav items above.
variant === "project" ? "pl-[39px]" : "pl-3",
@@ -921,7 +926,7 @@ export function AppSidebar() {
<button
type="button"
onClick={togglePinned}
- className="inline-flex h-[33px] w-[32px] cursor-pointer items-center justify-center rounded-[10px] text-nav-icon-idle dark:text-nav-fg-muted transition-colors hover:bg-nav-surface-hover hover:text-black dark:hover:text-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
+ className="inline-flex h-[33px] w-[33px] cursor-pointer items-center justify-center rounded-full text-nav-icon-idle dark:text-nav-fg-muted transition-colors hover:bg-nav-surface-hover hover:text-black dark:hover:text-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
aria-label={t("shell.aria.closeSidebar")}
>
<HugeiconsIcon icon={LayoutAlignLeftIcon} strokeWidth={1.75} className="size-icon" />
@@ -946,7 +951,7 @@ export function AppSidebar() {
<button
type="button"
onClick={togglePinned}
- className="inline-flex h-[33px] w-[32px] cursor-pointer items-center justify-center rounded-[10px] text-nav-fg transition-colors hover:bg-nav-surface-hover hover:text-black dark:hover:text-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
+ className="inline-flex h-[33px] w-[33px] cursor-pointer items-center justify-center rounded-full text-nav-fg transition-colors hover:bg-nav-surface-hover hover:text-black dark:hover:text-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
aria-label={t("shell.aria.openSidebar")}
>
<HugeiconsIcon icon={LayoutAlignLeftIcon} strokeWidth={1.75} className="size-icon" />
@@ -1117,7 +1122,7 @@ export function AppSidebar() {
</Collapsible>
{/* Pinned chats: own section above Recents */}
- {!isStudioRoute && pinnedChatItems.length > 0 && (
+ {!isStudioRoute && !showTrainingRecents && pinnedChatItems.length > 0 && (
<Collapsible open={pinnedOpen} onOpenChange={setPinnedOpen} asChild>
<SidebarGroup className="group-data-[collapsible=icon]:hidden px-0 py-0">
<SidebarGroupLabel className={cn("sidebar-sticky-label sidebar-sticky-label-following", scrolled && "is-scrolled")} asChild>
@@ -1139,7 +1144,7 @@ export function AppSidebar() {
</Collapsible>
)}
- {!isStudioRoute && (
+ {!isStudioRoute && !showTrainingRecents && (
<Collapsible open={chatOpen} onOpenChange={setChatOpen} asChild>
<SidebarGroup className="group-data-[collapsible=icon]:hidden px-0 py-0">
<SidebarGroupLabel className={cn("sidebar-sticky-label sidebar-sticky-label-following", scrolled && "is-scrolled")} asChild>
@@ -1161,7 +1166,7 @@ export function AppSidebar() {
</Collapsible>
)}
- {isStudioRoute && runItems.length > 0 && !chatOnly && (
+ {showTrainingRecents && (
<Collapsible open={runsOpen} onOpenChange={setRunsOpen} asChild>
<SidebarGroup className="group-data-[collapsible=icon]:hidden px-0 py-0">
<SidebarGroupLabel className={cn("sidebar-sticky-label sidebar-sticky-label-following", scrolled && "is-scrolled")} asChild>
@@ -1189,9 +1194,12 @@ export function AppSidebar() {
>
<SidebarMenuButton
isActive={isActiveRun}
- className="sidebar-nav-btn h-auto flex-col items-start gap-0.5 py-[5px] rounded-full pl-3 pr-7 text-[14.5px] tracking-nav font-medium"
+ className="sidebar-nav-btn h-auto flex-col items-start gap-0.5 py-[5px] rounded-[14px] pl-3 pr-7 text-[14.5px] tracking-nav font-medium"
onClick={() => {
setSelectedHistoryRunId(run.id);
+ // From Recipes/Export, jump to Train so the run's
+ // history opens (studio reacts to selectedHistoryRunId).
+ if (!isStudioRoute) navigate({ to: "/studio" });
closeMobileIfOpen();
}}
>
@@ -1206,7 +1214,7 @@ export function AppSidebar() {
<span className="truncate">
{run.display_name ?? run.model_name}
</span>
- <span className="ml-auto shrink-0 text-[10px] text-muted-foreground">
+ <span className="ml-auto mr-0.5 shrink-0 text-[10px] text-muted-foreground">
{formatRelativeShort(run.started_at)}
</span>
</div>
@@ -1223,7 +1231,7 @@ export function AppSidebar() {
className="sidebar-row-action group-hover/run-item:opacity-100 group-hover/run-item:pointer-events-auto focus-visible:opacity-100 focus-visible:pointer-events-auto"
>
<span className="sidebar-row-action-glyph">
- <MoreHorizontalIcon strokeWidth={1.75} className="size-icon" />
+ <HugeiconsIcon icon={MoreVerticalIcon} strokeWidth={1.75} className="size-icon" />
</span>
</button>
</DropdownMenuTrigger>
@@ -1278,14 +1286,14 @@ export function AppSidebar() {
<SidebarMenuButton
size="lg"
aria-label={t("shell.accountMenu", { name: displayTitle })}
- className="sidebar-nav-btn !h-[44px] -my-[3px] gap-[9px] px-2 py-[3px] rounded-[14px]"
+ className="sidebar-nav-btn !h-[44px] -my-[3px] gap-[9px] px-2 py-[3px] rounded-[14px] group-data-[collapsible=icon]:!size-[34px] group-data-[collapsible=icon]:!rounded-full group-data-[collapsible=icon]:!p-0 group-data-[collapsible=icon]:mx-auto group-data-[collapsible=icon]:justify-center"
>
<div className="flex shrink-0 items-center">
<UserAvatar
name={displayTitle}
imageUrl={avatarDataUrl}
size="sm"
- className="!size-[32px]"
+ className="!size-[32px] group-data-[collapsible=icon]:!rounded-full"
/>
</div>
<div className="flex flex-col gap-px leading-tight group-data-[collapsible=icon]:hidden">
diff --git a/studio/frontend/src/components/assistant-ui/reasoning.tsx b/studio/frontend/src/components/assistant-ui/reasoning.tsx
index 3eaa21a19ea..a6c326c64e5 100644
--- a/studio/frontend/src/components/assistant-ui/reasoning.tsx
+++ b/studio/frontend/src/components/assistant-ui/reasoning.tsx
@@ -20,7 +20,9 @@ import {
} from "@assistant-ui/react";
import { copyToClipboard } from "@/lib/copy-to-clipboard";
import { type VariantProps, cva } from "class-variance-authority";
-import { CheckIcon, ChevronDownIcon, CopyIcon, LightbulbIcon } from "lucide-react";
+import { ChevronDownIcon, CopyIcon, LightbulbIcon } from "lucide-react";
+import { Tick02Icon } from "@/lib/tick-icon";
+import { HugeiconsIcon } from "@hugeicons/react";
import {
type CSSProperties,
type ComponentProps,
@@ -293,7 +295,7 @@ function ReasoningCopyButton({ startIndex, endIndex }: { startIndex: number; end
aria-label="Copy reasoning"
>
{copied ? (
- <CheckIcon className="size-3" />
+ <HugeiconsIcon icon={Tick02Icon} strokeWidth={2} className="size-3" />
) : (
<CopyIcon className="size-3" />
)}
diff --git a/studio/frontend/src/components/assistant-ui/tool-fallback.tsx b/studio/frontend/src/components/assistant-ui/tool-fallback.tsx
index 965ad56bfa4..20a22c3a4a0 100644
--- a/studio/frontend/src/components/assistant-ui/tool-fallback.tsx
+++ b/studio/frontend/src/components/assistant-ui/tool-fallback.tsx
@@ -17,11 +17,12 @@ import {
} from "@assistant-ui/react";
import {
AlertCircleIcon,
- CheckIcon,
ChevronDownIcon,
LoaderIcon,
XCircleIcon,
} from "lucide-react";
+import { Tick02Icon } from "@/lib/tick-icon";
+import { HugeiconsIcon } from "@hugeicons/react";
import {
type CSSProperties,
type ComponentProps,
@@ -95,9 +96,15 @@ function ToolFallbackRoot({
type ToolStatus = ToolCallMessagePartStatus["type"];
+// The shared app tick is icon data, not a component; wrap it to slot into the
+// status map alongside the lucide icons.
+function CompleteTickIcon(props: Omit<ComponentProps<typeof HugeiconsIcon>, "icon">) {
+ return <HugeiconsIcon icon={Tick02Icon} strokeWidth={2} {...props} />;
+}
+
const statusIconMap: Record<ToolStatus, ElementType> = {
running: LoaderIcon,
- complete: CheckIcon,
+ complete: CompleteTickIcon,
incomplete: XCircleIcon,
"requires-action": AlertCircleIcon,
};
diff --git a/studio/frontend/src/components/assistant-ui/tool-ui-code-execution.tsx b/studio/frontend/src/components/assistant-ui/tool-ui-code-execution.tsx
index 23a83bc5bac..84309815e5f 100644
--- a/studio/frontend/src/components/assistant-ui/tool-ui-code-execution.tsx
+++ b/studio/frontend/src/components/assistant-ui/tool-ui-code-execution.tsx
@@ -8,12 +8,9 @@ import {
type ToolCallMessagePartComponent,
useAuiState,
} from "@assistant-ui/react";
-import {
- CheckIcon,
- CopyIcon,
- FileTextIcon,
- TerminalIcon,
-} from "lucide-react";
+import { CopyIcon, FileTextIcon, TerminalIcon } from "lucide-react";
+import { Tick02Icon } from "@/lib/tick-icon";
+import { HugeiconsIcon } from "@hugeicons/react";
import { Spinner } from "@/components/ui/spinner";
import { memo, useCallback, useEffect, useMemo, useRef, useState } from "react";
import {
@@ -93,7 +90,7 @@ function CopyBtn({ text }: { text: string }) {
aria-label="Copy to clipboard"
>
{copied ? (
- <CheckIcon className="size-3" />
+ <HugeiconsIcon icon={Tick02Icon} strokeWidth={2} className="size-3" />
) : (
<CopyIcon className="size-3" />
)}
diff --git a/studio/frontend/src/components/assistant-ui/tool-ui-python.tsx b/studio/frontend/src/components/assistant-ui/tool-ui-python.tsx
index d7b0e58f187..1afffaed7d1 100644
--- a/studio/frontend/src/components/assistant-ui/tool-ui-python.tsx
+++ b/studio/frontend/src/components/assistant-ui/tool-ui-python.tsx
@@ -7,7 +7,9 @@ import { copyToClipboard } from "@/lib/copy-to-clipboard";
import { getAuthToken } from "@/features/auth/session";
import type { ToolCallMessagePartComponent } from "@assistant-ui/react";
import { code as codePlugin } from "@streamdown/code";
-import { CheckIcon, CodeIcon, CopyIcon } from "lucide-react";
+import { CodeIcon, CopyIcon } from "lucide-react";
+import { Tick02Icon } from "@/lib/tick-icon";
+import { HugeiconsIcon } from "@hugeicons/react";
import { Spinner } from "@/components/ui/spinner";
import { memo, useCallback, useEffect, useMemo, useRef, useState } from "react";
import { Streamdown } from "streamdown";
@@ -63,7 +65,7 @@ function CopyBtn({ text }: { text: string }) {
aria-label="Copy to clipboard"
>
{copied ? (
- <CheckIcon className="size-3" />
+ <HugeiconsIcon icon={Tick02Icon} strokeWidth={2} className="size-3" />
) : (
<CopyIcon className="size-3" />
)}
diff --git a/studio/frontend/src/components/assistant-ui/tool-ui-terminal.tsx b/studio/frontend/src/components/assistant-ui/tool-ui-terminal.tsx
index 3c12b16e6b9..c088d5cf987 100644
--- a/studio/frontend/src/components/assistant-ui/tool-ui-terminal.tsx
+++ b/studio/frontend/src/components/assistant-ui/tool-ui-terminal.tsx
@@ -5,7 +5,9 @@
import { copyToClipboard } from "@/lib/copy-to-clipboard";
import type { ToolCallMessagePartComponent } from "@assistant-ui/react";
-import { CheckIcon, CopyIcon, TerminalIcon } from "lucide-react";
+import { CopyIcon, TerminalIcon } from "lucide-react";
+import { Tick02Icon } from "@/lib/tick-icon";
+import { HugeiconsIcon } from "@hugeicons/react";
import { Spinner } from "@/components/ui/spinner";
import { memo, useCallback, useEffect, useRef, useState } from "react";
import {
@@ -53,7 +55,7 @@ function CopyBtn({ text }: { text: string }) {
aria-label="Copy to clipboard"
>
{copied ? (
- <CheckIcon className="size-3" />
+ <HugeiconsIcon icon={Tick02Icon} strokeWidth={2} className="size-3" />
) : (
<CopyIcon className="size-3" />
)}
diff --git a/studio/frontend/src/components/ui/combobox.tsx b/studio/frontend/src/components/ui/combobox.tsx
index 7bf0d7bf757..db2d494b6db 100644
--- a/studio/frontend/src/components/ui/combobox.tsx
+++ b/studio/frontend/src/components/ui/combobox.tsx
@@ -7,7 +7,7 @@
import { Combobox as ComboboxPrimitive } from "@base-ui/react";
import * as React from "react";
-import { createContext, useContext, useState } from "react";
+import { createContext, useState } from "react";
import { Button } from "@/components/ui/button";
import { useDialogPortalContainer } from "@/components/ui/dialog";
@@ -18,11 +18,9 @@ import {
InputGroupInput,
} from "@/components/ui/input-group";
import { Tick02Icon } from "@/lib/tick-icon";
+import { ChevronDownStandardIcon } from "@/lib/chevron-icons";
import { cn } from "@/lib/utils";
-import {
- ArrowDown01Icon,
- Cancel01Icon,
-} from "@hugeicons/core-free-icons";
+import { Cancel01Icon } from "@hugeicons/core-free-icons";
import { HugeiconsIcon } from "@hugeicons/react";
const ComboboxOpenContext = createContext(false);
@@ -68,7 +66,7 @@ function ComboboxTrigger({
>
{children}
<HugeiconsIcon
- icon={ArrowDown01Icon}
+ icon={ChevronDownStandardIcon}
strokeWidth={2}
className="text-muted-foreground size-4 pointer-events-none"
/>
@@ -107,18 +105,8 @@ function ComboboxInput({
showTrigger?: boolean;
showClear?: boolean;
}): React.ReactElement {
- const isOpen = useContext(ComboboxOpenContext);
-
return (
- <InputGroup
- className={cn("w-auto", className)}
- style={{
- borderRadius: isOpen ? "12px" : undefined,
- transition: isOpen
- ? "border-radius 0ms"
- : "border-radius 150ms cubic-bezier(0.645, 0.045, 0.355, 1)",
- }}
- >
+ <InputGroup className={cn("w-auto", className)}>
<ComboboxPrimitive.Input
render={<InputGroupInput disabled={disabled} />}
{...props}
@@ -130,7 +118,7 @@ function ComboboxInput({
variant="ghost"
asChild
data-slot="input-group-button"
- className="group-has-data-[slot=combobox-clear]/input-group:hidden data-pressed:bg-transparent"
+ className="group-has-data-[slot=combobox-clear]/input-group:hidden bg-transparent hover:bg-transparent data-pressed:bg-transparent aria-expanded:bg-transparent dark:hover:bg-transparent"
disabled={disabled}
>
<ComboboxTrigger />
@@ -209,7 +197,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 rounded-xl corner-squircle py-2 pr-2 pl-3 text-sm [&[aria-selected=true]]:pr-7 [&_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-[10px] py-2 pr-2 pl-3 text-sm [&[aria-selected=true]]:pr-7 [&_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}
diff --git a/studio/frontend/src/components/ui/select.tsx b/studio/frontend/src/components/ui/select.tsx
index f3a6a41b68f..07f39fa935e 100644
--- a/studio/frontend/src/components/ui/select.tsx
+++ b/studio/frontend/src/components/ui/select.tsx
@@ -8,6 +8,7 @@ import type * as React from "react";
import { createContext, useContext, useState } from "react";
import { Tick02Icon } from "@/lib/tick-icon";
+import { ChevronDownStandardIcon } from "@/lib/chevron-icons";
import { cn } from "@/lib/utils";
import { useDialogPortalContainer } from "@/components/ui/dialog";
import {
@@ -98,7 +99,7 @@ function SelectTrigger({
{children}
<SelectPrimitive.Icon asChild>
<HugeiconsIcon
- icon={icon ?? UnfoldMoreIcon}
+ icon={icon ?? ChevronDownStandardIcon}
strokeWidth={2}
className={cn(
"text-muted-foreground size-4 pointer-events-none",
diff --git a/studio/frontend/src/features/chat/artifacts/artifact-surface.tsx b/studio/frontend/src/features/chat/artifacts/artifact-surface.tsx
index b27acdf6ee1..7c46ab11ba0 100644
--- a/studio/frontend/src/features/chat/artifacts/artifact-surface.tsx
+++ b/studio/frontend/src/features/chat/artifacts/artifact-surface.tsx
@@ -13,14 +13,9 @@ import { MascotImg } from "@/components/mascot-img";
import { Button } from "@/components/ui/button";
import { copyToClipboard } from "@/lib/copy-to-clipboard";
import { cn } from "@/lib/utils";
-import {
- CheckIcon,
- CopyIcon,
- EyeIcon,
- Maximize2Icon,
- XIcon,
-} from "lucide-react";
+import { CopyIcon, EyeIcon, Maximize2Icon, XIcon } from "lucide-react";
import { Download01Icon } from "@hugeicons/core-free-icons";
+import { Tick02Icon } from "@/lib/tick-icon";
import { HugeiconsIcon } from "@hugeicons/react";
import {
type KeyboardEvent,
@@ -285,7 +280,7 @@ export function ArtifactSurface({
aria-label="Copy canvas HTML"
>
{copied ? (
- <CheckIcon className="size-4" />
+ <HugeiconsIcon icon={Tick02Icon} strokeWidth={2} className="size-4" />
) : (
<CopyIcon className="size-4" />
)}
diff --git a/studio/frontend/src/features/chat/chat-page.tsx b/studio/frontend/src/features/chat/chat-page.tsx
index f3cbd2e966d..3b518f83bf8 100644
--- a/studio/frontend/src/features/chat/chat-page.tsx
+++ b/studio/frontend/src/features/chat/chat-page.tsx
@@ -2152,16 +2152,6 @@ export function ChatPage(): ReactElement {
className="max-w-[62vw] !pr-3 sm:max-w-none !h-[34px]"
/>
)}
- {incognito && view.mode === "single" && (
- <div className="flex h-[34px] shrink-0 items-center gap-1.5 self-center rounded-full bg-primary/10 px-2.5 font-medium text-[13px] text-primary">
- <HugeiconsIcon
- icon={BubbleChatTemporaryIcon}
- strokeWidth={2}
- className="size-3.5"
- />
- <span>Temporary</span>
- </div>
- )}
{view.mode !== "compare" && currentProjectId && (
<nav
aria-label="Project location"
@@ -2244,7 +2234,7 @@ export function ChatPage(): ReactElement {
type="button"
onClick={toggleIncognito}
className={cn(
- "flex h-[34px] w-[34px] cursor-pointer items-center justify-center rounded-[12px] transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
+ "flex h-[34px] w-[34px] cursor-pointer items-center justify-center rounded-full transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
incognito
? "bg-primary/10 text-primary hover:bg-primary/15"
: "text-nav-fg hover:bg-nav-surface-hover hover:text-black dark:hover:text-white",
@@ -2274,7 +2264,7 @@ export function ChatPage(): ReactElement {
<button
type="button"
onClick={() => setSettingsOpen(true)}
- className="flex h-[34px] w-[34px] translate-x-[2px] cursor-pointer items-center justify-center rounded-[12px] text-nav-fg transition-colors hover:bg-nav-surface-hover hover:text-black dark:hover:text-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
+ className="flex h-[34px] w-[34px] translate-x-[2px] cursor-pointer items-center justify-center rounded-full text-nav-fg transition-colors hover:bg-nav-surface-hover hover:text-black dark:hover:text-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
aria-label="Open run settings"
data-tour="chat-settings"
>
diff --git a/studio/frontend/src/features/chat/chat-settings-sheet.tsx b/studio/frontend/src/features/chat/chat-settings-sheet.tsx
index d6b5d658da2..74c407fc3bb 100644
--- a/studio/frontend/src/features/chat/chat-settings-sheet.tsx
+++ b/studio/frontend/src/features/chat/chat-settings-sheet.tsx
@@ -816,7 +816,7 @@ export function ChatSettingsPanel({
<button
type="button"
onClick={() => onOpenChange?.(false)}
- className="flex h-[34px] w-[34px] cursor-pointer items-center justify-center rounded-[12px] text-nav-icon-idle dark:text-nav-fg-muted transition-colors hover:bg-nav-surface-hover hover:text-black dark:hover:text-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
+ className="flex h-[34px] w-[34px] cursor-pointer items-center justify-center rounded-full text-nav-icon-idle dark:text-nav-fg-muted transition-colors hover:bg-nav-surface-hover hover:text-black dark:hover:text-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
aria-label="Close run settings"
>
<HugeiconsIcon
diff --git a/studio/frontend/src/features/chat/components/chat-search-dialog.tsx b/studio/frontend/src/features/chat/components/chat-search-dialog.tsx
index cbd02d2bae5..dc3e1aac299 100644
--- a/studio/frontend/src/features/chat/components/chat-search-dialog.tsx
+++ b/studio/frontend/src/features/chat/components/chat-search-dialog.tsx
@@ -84,7 +84,7 @@ export function ChatSearchDialog() {
open={isOpen}
onOpenChange={setOpen}
className="chat-search-surface rounded-3xl! top-1/2 -translate-y-1/2 w-[635px] max-w-[calc(100%-2rem)] gap-0 p-0 ring-0 sm:max-w-[635px]"
- overlayClassName="bg-transparent"
+ overlayClassName="bg-transparent supports-backdrop-filter:backdrop-blur-none"
>
<Command className="rounded-3xl p-0" shouldFilter={false}>
<div className="flex items-center gap-3 border-b border-border/40 px-4 py-3">
diff --git a/studio/frontend/src/features/chat/prompt-storage/prompt-storage-dialog.tsx b/studio/frontend/src/features/chat/prompt-storage/prompt-storage-dialog.tsx
index e68e3c9d246..ee3a49526fe 100644
--- a/studio/frontend/src/features/chat/prompt-storage/prompt-storage-dialog.tsx
+++ b/studio/frontend/src/features/chat/prompt-storage/prompt-storage-dialog.tsx
@@ -15,7 +15,6 @@ import { Search01Icon } from "@hugeicons/core-free-icons";
import { HugeiconsIcon } from "@hugeicons/react";
import {
BookmarkIcon,
- CheckIcon,
DownloadIcon,
GripVerticalIcon,
LayoutListIcon,
@@ -26,6 +25,7 @@ import {
UploadIcon,
XIcon,
} from "lucide-react";
+import { Tick02Icon } from "@/lib/tick-icon";
import {
type ReactElement,
useCallback,
@@ -1276,7 +1276,7 @@ function PromptCard({
<XIcon className="size-3.5 mr-1" />Cancel
</Button>
<Button size="sm" onClick={handleSave}>
- <CheckIcon className="size-3.5 mr-1" />Save
+ <HugeiconsIcon icon={Tick02Icon} strokeWidth={2} className="size-3.5 mr-1" />Save
</Button>
</div>
</div>
@@ -1387,7 +1387,7 @@ function NewPromptForm({ onClose, onRefresh }: { onClose: () => void; onRefresh:
<XIcon className="size-3.5 mr-1" />Cancel
</Button>
<Button size="sm" onClick={handleSave} disabled={!text.trim()}>
- <CheckIcon className="size-3.5 mr-1" />Save Prompt
+ <HugeiconsIcon icon={Tick02Icon} strokeWidth={2} className="size-3.5 mr-1" />Save Prompt
</Button>
</div>
</div>
@@ -1486,7 +1486,7 @@ function PromptListCard({
onClick={handleSave}
disabled={items.filter((t) => t.trim()).length === 0}
>
- <CheckIcon className="size-3.5 mr-1" />Save List
+ <HugeiconsIcon icon={Tick02Icon} strokeWidth={2} className="size-3.5 mr-1" />Save List
</Button>
</div>
</div>
@@ -1637,7 +1637,7 @@ function NewPromptListForm({ onClose, onRefresh }: { onClose: () => void; onRefr
onClick={handleSave}
disabled={items.filter((t) => t.trim()).length === 0}
>
- <CheckIcon className="size-3.5 mr-1" />Save Prompt List
+ <HugeiconsIcon icon={Tick02Icon} strokeWidth={2} className="size-3.5 mr-1" />Save Prompt List
</Button>
</div>
</div>
diff --git a/studio/frontend/src/features/data-recipes/pages/data-recipes-page.tsx b/studio/frontend/src/features/data-recipes/pages/data-recipes-page.tsx
index 76f443afe41..005455cd942 100644
--- a/studio/frontend/src/features/data-recipes/pages/data-recipes-page.tsx
+++ b/studio/frontend/src/features/data-recipes/pages/data-recipes-page.tsx
@@ -41,6 +41,7 @@ import {
} from "@hugeicons/core-free-icons";
import { HugeiconsIcon } from "@hugeicons/react";
import { useNavigate } from "@tanstack/react-router";
+import { RecentTrainingsSection } from "@/features/studio/recent-trainings-section";
import type { ReactElement } from "react";
import { useEffect, useState } from "react";
import {
@@ -528,6 +529,8 @@ export function DataRecipesPage(): ReactElement {
))}
</div>
)}
+
+ <RecentTrainingsSection />
</main>
<Dialog open={learningDialogOpen} onOpenChange={setLearningDialogOpen}>
diff --git a/studio/frontend/src/features/export/export-page.tsx b/studio/frontend/src/features/export/export-page.tsx
index 81808497330..e467b10d241 100644
--- a/studio/frontend/src/features/export/export-page.tsx
+++ b/studio/frontend/src/features/export/export-page.tsx
@@ -2,6 +2,7 @@
// Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0
import { SectionCard } from "@/components/section-card";
+import { RecentTrainingsSection } from "@/features/studio/recent-trainings-section";
import { Button } from "@/components/ui/button";
import {
Combobox,
@@ -1129,6 +1130,8 @@ export function ExportPage() {
</>
)}
</SectionCard>
+
+ <RecentTrainingsSection />
</main>
<ExportDialog
diff --git a/studio/frontend/src/features/hub/catalog/card-carousel.tsx b/studio/frontend/src/features/hub/catalog/card-carousel.tsx
new file mode 100644
index 00000000000..932df88ff68
--- /dev/null
+++ b/studio/frontend/src/features/hub/catalog/card-carousel.tsx
@@ -0,0 +1,149 @@
+// SPDX-License-Identifier: AGPL-3.0-only
+// Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0
+
+import { cn } from "@/lib/utils";
+import { ArrowLeft01Icon, ArrowRight01Icon } from "@hugeicons/core-free-icons";
+import { HugeiconsIcon } from "@hugeicons/react";
+import {
+ type ReactNode,
+ useCallback,
+ useEffect,
+ useRef,
+ useState,
+} from "react";
+
+export const CARD_GAP_PX = 16;
+const CAROUSEL_TOP_PADDING_PX = 8;
+
+export function CarouselArrow({
+ side,
+ visible,
+ centerPx,
+ onClick,
+}: {
+ side: "left" | "right";
+ visible: boolean;
+ centerPx: number;
+ onClick: () => void;
+}) {
+ return (
+ <button
+ type="button"
+ aria-label={side === "left" ? "Scroll left" : "Scroll right"}
+ aria-hidden={!visible}
+ tabIndex={visible ? 0 : -1}
+ onClick={onClick}
+ style={{ top: centerPx }}
+ className={cn(
+ "hub-carousel-arrow absolute z-10 inline-flex size-9 -translate-y-1/2 items-center justify-center rounded-full",
+ side === "left" ? "left-0 -translate-x-1/2" : "right-0 translate-x-1/2",
+ visible
+ ? "opacity-20 group-hover/carousel:opacity-100"
+ : "pointer-events-none opacity-0",
+ )}
+ >
+ <HugeiconsIcon
+ icon={side === "left" ? ArrowLeft01Icon : ArrowRight01Icon}
+ strokeWidth={2}
+ className="size-4"
+ />
+ </button>
+ );
+}
+
+export function CardCarousel<T>({
+ items,
+ getKey,
+ renderItem,
+ itemWidth,
+ itemHeight,
+ ariaLabel,
+}: {
+ items: T[];
+ getKey: (item: T) => string;
+ renderItem: (item: T) => ReactNode;
+ itemWidth: number;
+ itemHeight: number;
+ ariaLabel: string;
+}) {
+ const scrollerRef = useRef<HTMLDivElement>(null);
+ const [canLeft, setCanLeft] = useState(false);
+ const [canRight, setCanRight] = useState(false);
+ const stepPx = itemWidth + CARD_GAP_PX;
+ const arrowCenterPx = CAROUSEL_TOP_PADDING_PX + itemHeight / 2;
+
+ const updateArrows = useCallback(() => {
+ const el = scrollerRef.current;
+ if (!el) return;
+ setCanLeft(el.scrollLeft > 1);
+ setCanRight(el.scrollLeft + el.clientWidth < el.scrollWidth - 1);
+ }, []);
+
+ useEffect(() => {
+ const el = scrollerRef.current;
+ if (!el) return;
+ updateArrows();
+ const observer = new ResizeObserver(updateArrows);
+ observer.observe(el);
+ return () => observer.disconnect();
+ }, [updateArrows]);
+
+ useEffect(() => {
+ updateArrows();
+ }, [updateArrows, items]);
+
+ const scrollByCards = useCallback(
+ (direction: 1 | -1) => {
+ scrollerRef.current?.scrollBy({
+ left: direction * stepPx,
+ behavior: "smooth",
+ });
+ },
+ [stepPx],
+ );
+
+ return (
+ <div className="relative">
+ <div
+ ref={scrollerRef}
+ onScroll={updateArrows}
+ aria-label={ariaLabel}
+ className="hub-carousel flex snap-x gap-4 overflow-x-auto pb-4 pt-2"
+ >
+ {items.map((item) => (
+ <div
+ key={getKey(item)}
+ className="shrink-0 snap-start"
+ style={{ width: itemWidth, height: itemHeight }}
+ >
+ {renderItem(item)}
+ </div>
+ ))}
+ </div>
+ <div
+ aria-hidden="true"
+ data-visible={canLeft || undefined}
+ className="hub-carousel-fade hub-carousel-fade-left"
+ style={{ top: CAROUSEL_TOP_PADDING_PX, height: itemHeight }}
+ />
+ <div
+ aria-hidden="true"
+ data-visible={canRight || undefined}
+ className="hub-carousel-fade hub-carousel-fade-right"
+ style={{ top: CAROUSEL_TOP_PADDING_PX, height: itemHeight }}
+ />
+ <CarouselArrow
+ side="left"
+ visible={canLeft}
+ centerPx={arrowCenterPx}
+ onClick={() => scrollByCards(-1)}
+ />
+ <CarouselArrow
+ side="right"
+ visible={canRight}
+ centerPx={arrowCenterPx}
+ onClick={() => scrollByCards(1)}
+ />
+ </div>
+ );
+}
diff --git a/studio/frontend/src/features/hub/catalog/catalog-states.tsx b/studio/frontend/src/features/hub/catalog/catalog-states.tsx
index 1df85a6f81d..1d9eb63718f 100644
--- a/studio/frontend/src/features/hub/catalog/catalog-states.tsx
+++ b/studio/frontend/src/features/hub/catalog/catalog-states.tsx
@@ -5,7 +5,7 @@ import {
CloudOffIcon,
CubeIcon,
FilterIcon,
- RefreshIcon,
+ Refresh01Icon,
WifiDisconnected02Icon,
} from "@hugeicons/core-free-icons";
import type { IconSvgElement } from "@hugeicons/react";
@@ -50,7 +50,7 @@ export function NetworkErrorState({
<button
type="button"
onClick={onSwitchDevice}
- className="inline-flex h-8 items-center gap-1.5 rounded-[10px] bg-foreground/[0.06] px-3 text-[12px] font-medium text-foreground transition-colors hover:bg-foreground/[0.1] dark:bg-white/[0.06] dark:hover:bg-white/[0.1]"
+ className="inline-flex h-8 items-center gap-1.5 rounded-full bg-foreground/[0.06] px-3 text-[12px] font-medium text-foreground transition-colors hover:bg-foreground/[0.1] dark:bg-white/[0.06] dark:hover:bg-white/[0.1]"
>
On Device
</button>
@@ -58,10 +58,10 @@ export function NetworkErrorState({
<button
type="button"
onClick={onRetry}
- className="inline-flex h-8 items-center gap-1.5 rounded-[10px] bg-transparent px-3 text-[12px] font-medium text-foreground transition-colors hover:bg-foreground/[0.04] dark:hover:bg-white/[0.1]"
+ className="inline-flex h-8 items-center gap-1.5 rounded-full bg-transparent px-3 text-[12px] font-medium text-foreground transition-colors hover:bg-foreground/[0.04] dark:hover:bg-white/[0.05]"
>
<HugeiconsIcon
- icon={RefreshIcon}
+ icon={Refresh01Icon}
strokeWidth={1.75}
className="size-3.5"
/>
@@ -104,7 +104,7 @@ export function DiscoverFetchMoreState({
<button
type="button"
onClick={onClearFilters}
- className="inline-flex h-8 items-center gap-1.5 rounded-[10px] bg-foreground/[0.06] px-3 text-[12px] font-medium text-foreground transition-colors hover:bg-foreground/[0.1] dark:bg-white/[0.06] dark:hover:bg-white/[0.1]"
+ className="inline-flex h-8 items-center gap-1.5 rounded-full bg-foreground/[0.06] px-3 text-[12px] font-medium text-foreground transition-colors hover:bg-foreground/[0.1] dark:bg-white/[0.06] dark:hover:bg-white/[0.1]"
>
Clear filters
</button>
@@ -113,10 +113,10 @@ export function DiscoverFetchMoreState({
type="button"
onClick={onFetchMore}
disabled={isLoadingMore}
- className="inline-flex h-8 items-center gap-1.5 rounded-[10px] bg-transparent px-3 text-[12px] font-medium text-foreground transition-colors hover:bg-foreground/[0.04] disabled:cursor-not-allowed disabled:opacity-50 dark:hover:bg-white/[0.1]"
+ className="inline-flex h-8 items-center gap-1.5 rounded-full bg-transparent px-3 text-[12px] font-medium text-foreground transition-colors hover:bg-foreground/[0.04] disabled:cursor-not-allowed disabled:opacity-50 dark:hover:bg-white/[0.05]"
>
<HugeiconsIcon
- icon={RefreshIcon}
+ icon={Refresh01Icon}
strokeWidth={1.75}
className="size-3.5"
/>
@@ -128,35 +128,30 @@ export function DiscoverFetchMoreState({
}
export function DiscoverFetchMoreFooter({
- scannedCount,
- manualFetchAvailable,
hasActiveFilters,
isLoadingMore,
onFetchMore,
}: {
- scannedCount: number;
- manualFetchAvailable: boolean;
hasActiveFilters: boolean;
isLoadingMore: boolean;
onFetchMore: () => void;
}) {
return (
- <div className="relative z-10 flex flex-col items-center gap-2 bg-card px-4 py-4 text-center">
- <p className="text-[11.5px] leading-4 text-muted-foreground">
- {hasActiveFilters
- ? "Some results may be hidden by your filters."
- : manualFetchAvailable
- ? `Scanned ${scannedCount.toLocaleString()} results. Load more to continue.`
- : "More results are available."}
- </p>
+ <div className="relative z-10 flex flex-col items-center gap-2 rounded-[16px] bg-card px-4 py-4 text-center">
+ {/* Only warn about hidden results when a filter is actually narrowing them. */}
+ {hasActiveFilters && (
+ <p className="text-[11.5px] leading-4 text-muted-foreground">
+ Some results may be hidden by your filters.
+ </p>
+ )}
<button
type="button"
onClick={onFetchMore}
disabled={isLoadingMore}
- className="inline-flex h-8 items-center gap-1.5 rounded-[10px] bg-foreground/[0.06] px-3 text-[12px] font-medium text-foreground transition-colors hover:bg-foreground/[0.1] disabled:cursor-not-allowed disabled:opacity-50 dark:bg-white/[0.06] dark:hover:bg-white/[0.1]"
+ className="inline-flex h-8 items-center gap-1.5 rounded-full bg-foreground/[0.06] px-3 text-[12px] font-medium text-foreground transition-colors hover:bg-foreground/[0.1] disabled:cursor-not-allowed disabled:opacity-50 dark:bg-white/[0.06] dark:hover:bg-white/[0.1]"
>
<HugeiconsIcon
- icon={RefreshIcon}
+ icon={Refresh01Icon}
strokeWidth={1.75}
className="size-3.5"
/>
@@ -191,9 +186,9 @@ export function InventoryErrorState({
<button
type="button"
onClick={onRetry}
- className="inline-flex h-8 items-center gap-1.5 rounded-[10px] bg-transparent px-3 text-[12px] font-medium text-foreground transition-colors hover:bg-foreground/[0.04] dark:hover:bg-white/[0.1]"
+ className="inline-flex h-8 items-center gap-1.5 rounded-full bg-transparent px-3 text-[12px] font-medium text-foreground transition-colors hover:bg-foreground/[0.04] dark:hover:bg-white/[0.05]"
>
- <HugeiconsIcon icon={RefreshIcon} strokeWidth={1.75} className="size-3.5" />
+ <HugeiconsIcon icon={Refresh01Icon} strokeWidth={1.75} className="size-3.5" />
Try again
</button>
</div>
diff --git a/studio/frontend/src/features/hub/catalog/dataset-download-section.tsx b/studio/frontend/src/features/hub/catalog/dataset-download-section.tsx
index 253d8181161..d4075176634 100644
--- a/studio/frontend/src/features/hub/catalog/dataset-download-section.tsx
+++ b/studio/frontend/src/features/hub/catalog/dataset-download-section.tsx
@@ -160,7 +160,7 @@ export function DatasetDownloadSection({
)}
</div>
</div>
- {/* Train CTA hidden until Hub->train picker ships; divider pairs with it. */}
+ {/* Train CTA hidden until Hub→train picker ships; divider pairs with it. */}
{(!isDownloaded || downloading || HUB_POST_DOWNLOAD_ACTIONS_VISIBLE) && (
<CardDivider />
)}
diff --git a/studio/frontend/src/features/hub/catalog/download-cancel-indicator.tsx b/studio/frontend/src/features/hub/catalog/download-cancel-indicator.tsx
index d1b8671bfed..48bb9c1bce1 100644
--- a/studio/frontend/src/features/hub/catalog/download-cancel-indicator.tsx
+++ b/studio/frontend/src/features/hub/catalog/download-cancel-indicator.tsx
@@ -8,7 +8,8 @@ import { HugeiconsIcon } from "@hugeicons/react";
/**
* Inspector action-button affordance during a download: spinner that cross-fades
* to a cancel glyph on `.hub-action-btn` hover, in the same 16x16 slot so the
- * percentage label never shifts. The swap is pure CSS; the component only carries
+ * percentage label never shifts. The swap is pure CSS
+ * (`.hub-action-btn:hover .hub-cta-indicator-*`); the component only carries
* the marker classes.
*/
export function DownloadCancelIndicator() {
diff --git a/studio/frontend/src/features/hub/catalog/download-card.tsx b/studio/frontend/src/features/hub/catalog/download-card.tsx
index e5253526ab4..5083fb2f840 100644
--- a/studio/frontend/src/features/hub/catalog/download-card.tsx
+++ b/studio/frontend/src/features/hub/catalog/download-card.tsx
@@ -34,8 +34,9 @@ import {
} from "./use-download-card-state";
/**
- * Shared shell for every download surface (safetensors, GGUF, dataset): card frame,
- * progress bar, transport-conflict dialog, plus card-specific `dialogs` and children.
+ * Shared shell for every download surface (safetensors, GGUF, dataset): card
+ * frame, progress bar, transport-conflict dialog, plus card-specific `dialogs`
+ * and children.
*/
export function DownloadCard({
job,
@@ -94,7 +95,7 @@ export function CardDeleteButton({
e.stopPropagation();
onClick();
}}
- className="inline-flex size-7 shrink-0 cursor-pointer items-center justify-center rounded-[8px] text-muted-foreground opacity-0 transition-[opacity,background-color,color] duration-150 hover:bg-rose-500/10 hover:text-rose-600 focus-visible:opacity-100 group-hover/dl:opacity-100 dark:hover:bg-rose-500/15 dark:hover:text-rose-400"
+ className="inline-flex size-7 shrink-0 cursor-pointer items-center justify-center rounded-full text-muted-foreground opacity-0 transition-[opacity,background-color,color] duration-150 hover:bg-rose-500/10 hover:text-rose-600 focus-visible:opacity-100 group-hover/dl:opacity-100 dark:hover:bg-rose-500/15 dark:hover:text-rose-400"
>
<HugeiconsIcon
icon={Delete02Icon}
@@ -110,10 +111,7 @@ export function CardDeleteButton({
);
}
-/**
- * Download / Cancel / Resume button for the safetensors and dataset cards
- * (the GGUF card folds Run/Chat into its own bespoke CTA).
- */
+/** Download / Cancel / Resume button for the safetensors and dataset cards. */
export function DownloadActionButton({
downloading,
cancelling,
diff --git a/studio/frontend/src/features/hub/catalog/external-link-confirm-dialog.tsx b/studio/frontend/src/features/hub/catalog/external-link-confirm-dialog.tsx
index fcd2bd6b013..5a661467fc4 100644
--- a/studio/frontend/src/features/hub/catalog/external-link-confirm-dialog.tsx
+++ b/studio/frontend/src/features/hub/catalog/external-link-confirm-dialog.tsx
@@ -39,11 +39,11 @@ export function ExternalLinkConfirmDialog() {
>
<AlertDialogContent>
<AlertDialogHeader>
- <AlertDialogMedia className="size-12">
+ <AlertDialogMedia>
<HugeiconsIcon
icon={LinkSquare02Icon}
strokeWidth={1.75}
- className="size-5 text-muted-foreground"
+ className="text-muted-foreground"
/>
</AlertDialogMedia>
<AlertDialogTitle>Open external link</AlertDialogTitle>
diff --git a/studio/frontend/src/features/hub/catalog/gguf-download-card.tsx b/studio/frontend/src/features/hub/catalog/gguf-download-card.tsx
index 8633bda6fa8..ea3f158aa6f 100644
--- a/studio/frontend/src/features/hub/catalog/gguf-download-card.tsx
+++ b/studio/frontend/src/features/hub/catalog/gguf-download-card.tsx
@@ -26,7 +26,6 @@ import {
normalizeGgufVariantIdentity,
} from "../lib/model-identity";
import { cn } from "@/lib/utils";
-import { ChevronDownStandardIcon } from "@/lib/chevron-icons";
import { useHfTokenStore } from "../stores/hf-token-store";
import {
Delete02Icon,
@@ -35,6 +34,7 @@ import {
PencilEdit02Icon,
PlayIcon,
} from "@hugeicons/core-free-icons";
+import { ChevronDownStandardIcon } from "@/lib/chevron-icons";
import { HugeiconsIcon } from "@hugeicons/react";
import {
memo,
@@ -588,7 +588,7 @@ export function GgufDownloadCard({
const variantListUnavailable = !sortedVariants || sortedVariants.length === 0;
const showVariantLoadingState = loading && variantListUnavailable;
- // Keep showing download progress even when the variant list is unavailable, so a
+ // Keep showing download progress while the variant list is unavailable, so a
// remount never hides an in-flight download behind the variant status card.
if (progress && variantListUnavailable) {
return (
@@ -666,7 +666,7 @@ export function GgufDownloadCard({
e.preventDefault();
setOpen((o) => !o);
}}
- className="hub-menu-trigger flex h-9 min-w-0 flex-1 cursor-pointer items-center gap-2.5 rounded-full px-3 text-left transition-colors hover:bg-foreground/[0.04] data-[state=open]:bg-foreground/[0.06] dark:hover:bg-white/[0.1] dark:data-[state=open]:bg-white/[0.06]"
+ className="hub-menu-trigger flex h-9 min-w-0 flex-1 cursor-pointer items-center gap-2.5 rounded-full px-3 text-left transition-colors hover:bg-foreground/[0.04] data-[state=open]:bg-foreground/[0.06] dark:hover:bg-white/[0.04] dark:data-[state=open]:bg-white/[0.06]"
>
{selected ? (
<QuantBadge
@@ -714,7 +714,6 @@ export function GgufDownloadCard({
)}
<HugeiconsIcon
icon={ChevronDownStandardIcon}
- strokeWidth={1.25}
className="ml-0.5 size-3.5 shrink-0"
/>
</span>
@@ -723,7 +722,7 @@ export function GgufDownloadCard({
<PopoverContent
align="start"
side="bottom"
- sideOffset={0}
+ sideOffset={8}
avoidCollisions={false}
className="hub-menu-instant menu-soft-surface w-[var(--radix-popover-trigger-width)] min-w-[200px] gap-0 overflow-hidden p-0 py-2 ring-0"
>
@@ -831,11 +830,7 @@ export function GgufDownloadCard({
</>
) : selected?.downloaded ? (
<>
- <HugeiconsIcon
- icon={PlayIcon}
- strokeWidth={1.75}
- className="translate-x-px"
- />
+ <HugeiconsIcon icon={PlayIcon} strokeWidth={1.75} />
Run
</>
) : (
diff --git a/studio/frontend/src/features/hub/catalog/hub-detail-view.tsx b/studio/frontend/src/features/hub/catalog/hub-detail-view.tsx
new file mode 100644
index 00000000000..460dba96131
--- /dev/null
+++ b/studio/frontend/src/features/hub/catalog/hub-detail-view.tsx
@@ -0,0 +1,81 @@
+// SPDX-License-Identifier: AGPL-3.0-only
+// Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0
+
+import { ArrowLeft01Icon } from "@hugeicons/core-free-icons";
+import { HugeiconsIcon } from "@hugeicons/react";
+import { cn } from "@/lib/utils";
+import { type ComponentProps, useEffect, useRef, useState } from "react";
+import { ModelInspector } from "./model-inspector";
+
+type InspectorProps = ComponentProps<typeof ModelInspector>;
+
+export function HubDetailView({
+ onBack,
+ compact = false,
+ ...inspectorProps
+}: InspectorProps & { onBack: () => void; compact?: boolean }) {
+ const scrollRef = useRef<HTMLDivElement | null>(null);
+ const [scrolled, setScrolled] = useState(false);
+ // Split pane is narrower than the full-page overlay; tighter measure reads better.
+ const measure = compact
+ ? "mx-auto w-full max-w-[860px] px-5 sm:px-5"
+ : "mx-auto w-full max-w-[1100px] px-5 sm:px-8";
+
+ useEffect(() => {
+ const el = scrollRef.current;
+ if (!el) return;
+ const onScroll = () => {
+ const next = el.scrollTop > 0;
+ setScrolled((current) => (current === next ? current : next));
+ };
+ onScroll();
+ el.addEventListener("scroll", onScroll, { passive: true });
+ return () => el.removeEventListener("scroll", onScroll);
+ }, []);
+
+ return (
+ <div className="relative flex min-h-0 flex-1 flex-col">
+ {/* Same top scroll fade as the left column. The sticky back-bar, when
+ shown, sits above and hides it. */}
+ <div
+ aria-hidden="true"
+ data-scrolled={scrolled || undefined}
+ className="hub-scroll-fade pointer-events-none absolute inset-x-0 top-0 z-10 h-7"
+ />
+ <div
+ ref={scrollRef}
+ data-hub-scroll="true"
+ // Right margin nudges the scrollbar in from the pane's edge.
+ className="min-h-0 flex-1 overflow-x-hidden overflow-y-auto [overflow-anchor:none] mr-2 [scrollbar-gutter:stable] [scrollbar-width:thin]"
+ >
+ <div
+ className={cn(
+ "hub-detail-bar sticky top-0 z-20",
+ // In split view on large screens the list sits alongside, so "Back
+ // to Hub" is redundant; keep it only for the overlay where it's hidden.
+ compact && "lg:hidden",
+ )}
+ data-scrolled={scrolled || undefined}
+ >
+ <div className={`${measure} py-3`}>
+ <button
+ type="button"
+ onClick={onBack}
+ className="-ml-1.5 inline-flex h-8 cursor-pointer select-none items-center gap-1.5 rounded-full pl-1.5 pr-2.5 text-[12.5px] font-medium text-muted-foreground transition-colors hover:bg-foreground/[0.05] hover:text-foreground dark:hover:bg-white/[0.06]"
+ >
+ <HugeiconsIcon
+ icon={ArrowLeft01Icon}
+ strokeWidth={1.75}
+ className="size-3.5"
+ />
+ Back to Hub
+ </button>
+ </div>
+ </div>
+ <div className={cn(measure, "pb-20", compact && "lg:pt-4")}>
+ <ModelInspector {...inspectorProps} />
+ </div>
+ </div>
+ </div>
+ );
+}
diff --git a/studio/frontend/src/features/hub/catalog/hub-feed.tsx b/studio/frontend/src/features/hub/catalog/hub-feed.tsx
new file mode 100644
index 00000000000..db39e31b7b0
--- /dev/null
+++ b/studio/frontend/src/features/hub/catalog/hub-feed.tsx
@@ -0,0 +1,40 @@
+// SPDX-License-Identifier: AGPL-3.0-only
+// Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0
+
+import { memo } from "react";
+import { HUB_SECTION_TITLE, type HubSection } from "../lib/channels";
+import type { DiscoverRow } from "../types";
+import { HubSectionRow } from "./hub-section-row";
+
+export interface HubFeedSectionData {
+ rows: DiscoverRow[];
+ isLoading: boolean;
+}
+
+export const HubFeed = memo(function HubFeed({
+ trending,
+ deviceType,
+ isDataset,
+ onSelect,
+ onOpenChannel,
+}: {
+ trending: HubFeedSectionData;
+ deviceType: string | null;
+ isDataset: boolean;
+ onSelect: (id: string) => void;
+ onOpenChannel: (section: HubSection) => void;
+}) {
+ return (
+ <div className="flex flex-col gap-10">
+ <HubSectionRow
+ title={HUB_SECTION_TITLE.trending}
+ rows={trending.rows}
+ isLoading={trending.isLoading}
+ onSelect={onSelect}
+ onOpenList={() => onOpenChannel("trending")}
+ deviceType={deviceType}
+ isDataset={isDataset}
+ />
+ </div>
+ );
+});
diff --git a/studio/frontend/src/features/hub/catalog/hub-option-menu.tsx b/studio/frontend/src/features/hub/catalog/hub-option-menu.tsx
index db1332f03ac..ed83e46b364 100644
--- a/studio/frontend/src/features/hub/catalog/hub-option-menu.tsx
+++ b/studio/frontend/src/features/hub/catalog/hub-option-menu.tsx
@@ -6,9 +6,9 @@ import {
PopoverContent,
PopoverTrigger,
} from "@/components/ui/popover";
+import { cn } from "@/lib/utils";
import { Tick02Icon } from "@/lib/tick-icon";
import { ChevronDownStandardIcon } from "@/lib/chevron-icons";
-import { cn } from "@/lib/utils";
import { HugeiconsIcon } from "@hugeicons/react";
import {
type KeyboardEvent,
@@ -167,18 +167,13 @@ export function HubOptionMenu<T extends string>({
}
}}
>
- <span className="flex min-w-0 items-center gap-2">
- {triggerContent ?? (
- <span className="min-w-0 truncate">
- {selected?.triggerLabel ?? selected?.label ?? value}
- </span>
- )}
+ <span className="min-w-0 flex-1 truncate text-left">
+ {triggerContent ?? selected?.triggerLabel ?? selected?.label ?? value}
</span>
{showChevron && (
<HugeiconsIcon
icon={ChevronDownStandardIcon}
- strokeWidth={1.5}
- className="size-3 shrink-0 text-muted-foreground"
+ className="size-3.5 shrink-0 text-muted-foreground"
/>
)}
</button>
@@ -186,11 +181,11 @@ export function HubOptionMenu<T extends string>({
<PopoverContent
align={align}
side="bottom"
- sideOffset={0}
+ sideOffset={8}
collisionPadding={12}
onCloseAutoFocus={(event) => event.preventDefault()}
className={cn(
- "hub-menu-instant menu-soft-surface w-max min-w-[var(--radix-popover-trigger-width)] max-w-[min(var(--radix-popover-content-available-width),calc(100vw-1rem))] rounded-[21px] px-[9px] py-2 ring-0",
+ "hub-menu-instant menu-soft-surface w-max min-w-[var(--radix-popover-trigger-width)] max-w-[min(var(--radix-popover-content-available-width),calc(100vw-1rem))] rounded-[14px] p-1 ring-0",
contentClassName,
)}
>
@@ -219,14 +214,14 @@ export function HubOptionMenu<T extends string>({
}}
onPointerEnter={() => activateIndex(index)}
className={cn(
- "relative flex w-full min-w-0 cursor-pointer select-none items-center gap-2.5 rounded-[12px] py-2 px-3 text-left text-sm leading-snug outline-none transition-colors",
+ "relative flex w-full min-w-0 cursor-pointer select-none items-center rounded-[12px] py-2 pr-8 pl-3 text-left text-sm leading-snug outline-none transition-colors",
)}
>
<span className="flex min-w-0 flex-1 items-center gap-2.5 overflow-hidden whitespace-normal break-words">
{option.label}
</span>
{selectedOption && (
- <span className="pointer-events-none flex size-4 shrink-0 items-center justify-center">
+ <span className="pointer-events-none absolute right-2 flex size-4 items-center justify-center">
<HugeiconsIcon
icon={Tick02Icon}
strokeWidth={2}
diff --git a/studio/frontend/src/features/hub/catalog/hub-section-row.tsx b/studio/frontend/src/features/hub/catalog/hub-section-row.tsx
new file mode 100644
index 00000000000..70049f16e3b
--- /dev/null
+++ b/studio/frontend/src/features/hub/catalog/hub-section-row.tsx
@@ -0,0 +1,92 @@
+// SPDX-License-Identifier: AGPL-3.0-only
+// Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0
+
+import { Skeleton } from "@/components/ui/skeleton";
+import { ArrowRight01Icon } from "@hugeicons/core-free-icons";
+import { HugeiconsIcon } from "@hugeicons/react";
+import { memo } from "react";
+import type { DiscoverRow } from "../types";
+import { CardCarousel } from "./card-carousel";
+import {
+ MODEL_CARD_HEIGHT_PX,
+ MODEL_CARD_WIDTH_PX,
+ ModelCard,
+} from "./model-card";
+
+const SKELETON_KEYS = ["s0", "s1", "s2", "s3", "s4"] as const;
+
+function HubSectionRowSkeleton() {
+ return (
+ <div className="flex gap-4 overflow-hidden pb-4 pt-2">
+ {SKELETON_KEYS.map((key) => (
+ <Skeleton
+ key={key}
+ className="shrink-0 rounded-[20px]"
+ style={{ width: MODEL_CARD_WIDTH_PX, height: MODEL_CARD_HEIGHT_PX }}
+ />
+ ))}
+ </div>
+ );
+}
+
+export const HubSectionRow = memo(function HubSectionRow({
+ title,
+ rows,
+ onSelect,
+ onOpenList,
+ deviceType,
+ isDataset,
+ isLoading,
+}: {
+ title: string;
+ rows: DiscoverRow[];
+ onSelect: (id: string) => void;
+ onOpenList: () => void;
+ deviceType: string | null;
+ isDataset: boolean;
+ isLoading: boolean;
+}) {
+ const showSkeleton = isLoading && rows.length === 0;
+ if (!showSkeleton && rows.length === 0) {
+ return null;
+ }
+
+ return (
+ <section aria-label={title} className="group/carousel">
+ <h2 className="mb-3">
+ <button
+ type="button"
+ onClick={onOpenList}
+ aria-label={`See all ${title}`}
+ className="hub-section-title group/section -mx-1 inline-flex cursor-pointer items-center gap-1.5 rounded-md px-1 text-[18px] font-semibold tracking-[-0.02em] text-foreground outline-none focus-visible:ring-2 focus-visible:ring-ring"
+ >
+ {title}
+ <HugeiconsIcon
+ icon={ArrowRight01Icon}
+ strokeWidth={2}
+ className="hub-section-chevron size-4 text-muted-foreground"
+ />
+ </button>
+ </h2>
+ {showSkeleton ? (
+ <HubSectionRowSkeleton />
+ ) : (
+ <CardCarousel
+ items={rows}
+ getKey={(row) => row.id}
+ itemWidth={MODEL_CARD_WIDTH_PX}
+ itemHeight={MODEL_CARD_HEIGHT_PX}
+ ariaLabel={title}
+ renderItem={(row) => (
+ <ModelCard
+ row={row}
+ deviceType={deviceType}
+ isDataset={isDataset}
+ onSelect={onSelect}
+ />
+ )}
+ />
+ )}
+ </section>
+ );
+});
diff --git a/studio/frontend/src/features/hub/catalog/hub-top-bar.tsx b/studio/frontend/src/features/hub/catalog/hub-top-bar.tsx
new file mode 100644
index 00000000000..f706dd1ff2a
--- /dev/null
+++ b/studio/frontend/src/features/hub/catalog/hub-top-bar.tsx
@@ -0,0 +1,14 @@
+// SPDX-License-Identifier: AGPL-3.0-only
+// Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0
+
+import type { ReactNode } from "react";
+
+export function HubTopBar({ children }: { children: ReactNode }) {
+ return (
+ <div className="hub-canvas shrink-0">
+ <div className="mx-auto flex w-full max-w-[1100px] flex-col gap-4 px-5 pb-3 pt-6 sm:px-8">
+ {children}
+ </div>
+ </div>
+ );
+}
diff --git a/studio/frontend/src/features/hub/catalog/local-dataset-card.tsx b/studio/frontend/src/features/hub/catalog/local-dataset-card.tsx
index 5b9ca6b1dec..ddda1247459 100644
--- a/studio/frontend/src/features/hub/catalog/local-dataset-card.tsx
+++ b/studio/frontend/src/features/hub/catalog/local-dataset-card.tsx
@@ -47,7 +47,7 @@ export function LocalDatasetCard({
className="ml-1 mr-0 h-5 w-px shrink-0 bg-foreground/[0.06] opacity-100 transition-opacity duration-150 group-hover/dl:opacity-0 dark:bg-white/[0.04]"
/>
)}
- {/* Train CTA hidden until Hub->train picker ships. */}
+ {/* Train CTA hidden until Hub→train picker ships. */}
{onTrain && HUB_POST_DOWNLOAD_ACTIONS_VISIBLE && (
<button
type="button"
diff --git a/studio/frontend/src/features/hub/catalog/local-on-device-card.tsx b/studio/frontend/src/features/hub/catalog/local-on-device-card.tsx
index 9aec9930b8e..7edae555d8f 100644
--- a/studio/frontend/src/features/hub/catalog/local-on-device-card.tsx
+++ b/studio/frontend/src/features/hub/catalog/local-on-device-card.tsx
@@ -28,7 +28,6 @@ import { ggufVariantsMatch } from "../lib/model-identity";
import { cn } from "@/lib/utils";
import { confirmExternalLink } from "../stores/external-link-confirm";
import { useHfTokenStore } from "../stores/hf-token-store";
-import { ChevronDownStandardIcon } from "@/lib/chevron-icons";
import {
Alert02Icon,
CubeIcon,
@@ -36,6 +35,7 @@ import {
PlayIcon,
Share05Icon,
} from "@hugeicons/core-free-icons";
+import { ChevronDownStandardIcon } from "@/lib/chevron-icons";
import { HugeiconsIcon } from "@hugeicons/react";
import { useMemo, useState } from "react";
import {
@@ -143,7 +143,7 @@ function BaseModelReference({
target="_blank"
rel="noopener noreferrer"
aria-label={`Open ${baseModelHubId} on Hugging Face`}
- className="inline-flex size-7 shrink-0 items-center justify-center rounded-[8px] text-muted-foreground transition-colors hover:bg-background hover:text-foreground"
+ className="inline-flex size-7 shrink-0 items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-background hover:text-foreground"
onClick={(event) => {
event.stopPropagation();
if (confirmExternalLink(`https://huggingface.co/${baseModelHubId}`)) {
@@ -350,7 +350,6 @@ export function LocalOnDeviceCard({
)}
<HugeiconsIcon
icon={ChevronDownStandardIcon}
- strokeWidth={1.5}
className="size-3 shrink-0"
/>
</button>
@@ -358,7 +357,7 @@ export function LocalOnDeviceCard({
<PopoverContent
align="start"
side="bottom"
- sideOffset={0}
+ sideOffset={8}
avoidCollisions={false}
className="hub-menu-instant menu-soft-surface w-[var(--radix-popover-trigger-width)] min-w-[220px] gap-0 overflow-hidden p-0 py-2 ring-0"
>
@@ -452,7 +451,7 @@ export function LocalOnDeviceCard({
!runActionsVisible && "hidden",
)}
>
- {onTrain && (
+ {onTrain && HUB_POST_DOWNLOAD_ACTIONS_VISIBLE && (
<button
type="button"
onClick={() => onTrain()}
diff --git a/studio/frontend/src/features/hub/catalog/model-card.tsx b/studio/frontend/src/features/hub/catalog/model-card.tsx
new file mode 100644
index 00000000000..358a3409b56
--- /dev/null
+++ b/studio/frontend/src/features/hub/catalog/model-card.tsx
@@ -0,0 +1,362 @@
+// SPDX-License-Identifier: AGPL-3.0-only
+// Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0
+
+import {
+ Tooltip,
+ TooltipContent,
+ TooltipTrigger,
+} from "@/components/ui/tooltip";
+import { classifyUnslothSupport } from "@/features/hub/hooks/use-hub-model-search";
+import { ownerPaletteColor } from "@/features/hub/lib/avatar-theme";
+import { buildAdaptiveCardAccentStyle } from "@/features/hub/lib/card-accent";
+import { useDominantColor } from "@/features/hub/lib/use-dominant-color";
+import { formatModelParamLabel } from "@/features/hub/lib/view-models";
+import { formatCompact } from "@/lib/utils";
+import { Download01Icon, FavouriteIcon } from "@hugeicons/core-free-icons";
+import { type CSSProperties, memo, useMemo } from "react";
+import type { DiscoverRow } from "../types";
+import { StatChip, buildRowStatusTooltip } from "./models-catalog-rows";
+import { OwnerAvatar, useAvatarImageUrl } from "./owner-avatar";
+import { AccessGlyphs, CapabilityPill } from "./shared";
+
+export const MODEL_CARD_WIDTH_PX = 204;
+export const MODEL_CARD_HEIGHT_PX = 128;
+
+export type TrendingCardStyle = CSSProperties & {
+ "--hub-card-art-accent"?: string;
+ "--hub-trending-glow"?: string;
+ "--hub-trending-glow-x"?: string;
+ "--hub-trending-glow-y"?: string;
+ "--hub-trending-glow-size"?: string;
+ "--hub-trending-sheen-angle"?: string;
+ "--hub-trending-scrim-angle"?: string;
+ "--hub-trending-secondary-glow"?: string;
+ "--hub-trending-secondary-x"?: string;
+ "--hub-trending-secondary-y"?: string;
+ "--hub-trending-secondary-size"?: string;
+};
+
+const DEFAULT_TRENDING_AURA_LAYOUT = {
+ x: 24,
+ y: 16,
+ size: 48,
+ secondaryX: 82,
+ secondaryY: 12,
+ secondarySize: 24,
+ sheenAngle: 145,
+ scrimAngle: 320,
+} as const;
+
+const TRENDING_AURA_LAYOUTS = [
+ DEFAULT_TRENDING_AURA_LAYOUT,
+ {
+ x: 72,
+ y: 15,
+ size: 47,
+ secondaryX: 18,
+ secondaryY: 28,
+ secondarySize: 25,
+ sheenAngle: 220,
+ scrimAngle: 45,
+ },
+ {
+ x: 50,
+ y: 8,
+ size: 45,
+ secondaryX: 78,
+ secondaryY: 36,
+ secondarySize: 23,
+ sheenAngle: 260,
+ scrimAngle: 110,
+ },
+ {
+ x: 18,
+ y: 36,
+ size: 52,
+ secondaryX: 72,
+ secondaryY: 10,
+ secondarySize: 24,
+ sheenAngle: 115,
+ scrimAngle: 285,
+ },
+ {
+ x: 84,
+ y: 34,
+ size: 50,
+ secondaryX: 22,
+ secondaryY: 12,
+ secondarySize: 24,
+ sheenAngle: 245,
+ scrimAngle: 70,
+ },
+ {
+ x: 36,
+ y: 50,
+ size: 52,
+ secondaryX: 82,
+ secondaryY: 18,
+ secondarySize: 23,
+ sheenAngle: 35,
+ scrimAngle: 205,
+ },
+ {
+ x: 66,
+ y: 48,
+ size: 51,
+ secondaryX: 18,
+ secondaryY: 16,
+ secondarySize: 24,
+ sheenAngle: 325,
+ scrimAngle: 145,
+ },
+ {
+ x: 42,
+ y: 22,
+ size: 46,
+ secondaryX: 86,
+ secondaryY: 44,
+ secondarySize: 22,
+ sheenAngle: 75,
+ scrimAngle: 255,
+ },
+] as const;
+
+function hashString(value: string): number {
+ let hash = 0;
+ for (let index = 0; index < value.length; index += 1) {
+ hash = (hash * 31 + value.charCodeAt(index)) | 0;
+ }
+ return hash >>> 0;
+}
+
+function clamp(value: number, min: number, max: number): number {
+ return Math.min(max, Math.max(min, value));
+}
+
+function resolveTrendingGlow(row: DiscoverRow): Pick<
+ TrendingCardStyle,
+ "--hub-trending-glow" | "--hub-trending-secondary-glow"
+> {
+ const signature = `${row.owner} ${row.repo} ${row.result.id}`.toLowerCase();
+ if (signature.includes("gemma") || signature.includes("google")) {
+ return {
+ "--hub-trending-glow": "rgba(62, 125, 255, 0.52)",
+ "--hub-trending-secondary-glow": "rgba(120, 180, 255, 0.18)",
+ };
+ }
+ if (signature.includes("qwen") || signature.includes("qwq")) {
+ return {
+ "--hub-trending-glow": "rgba(150, 92, 255, 0.52)",
+ "--hub-trending-secondary-glow": "rgba(196, 140, 255, 0.18)",
+ };
+ }
+ if (signature.includes("llama") || signature.includes("meta")) {
+ return {
+ "--hub-trending-glow": "rgba(20, 184, 166, 0.5)",
+ "--hub-trending-secondary-glow": "rgba(72, 222, 196, 0.16)",
+ };
+ }
+ if (signature.includes("mistral") || signature.includes("mixtral")) {
+ return {
+ "--hub-trending-glow": "rgba(255, 138, 64, 0.5)",
+ "--hub-trending-secondary-glow": "rgba(255, 206, 92, 0.16)",
+ };
+ }
+ if (signature.includes("deepseek")) {
+ return {
+ "--hub-trending-glow": "rgba(104, 96, 255, 0.52)",
+ "--hub-trending-secondary-glow": "rgba(150, 130, 255, 0.16)",
+ };
+ }
+ if (signature.includes("phi") || signature.includes("microsoft")) {
+ return {
+ "--hub-trending-glow": "rgba(34, 176, 224, 0.5)",
+ "--hub-trending-secondary-glow": "rgba(96, 214, 244, 0.16)",
+ };
+ }
+ if (
+ signature.includes("unsloth") ||
+ signature.includes("lfm") ||
+ signature.includes("liquid")
+ ) {
+ return {
+ "--hub-trending-glow": "rgba(0, 198, 150, 0.48)",
+ "--hub-trending-secondary-glow": "rgba(64, 226, 196, 0.16)",
+ };
+ }
+ return {
+ "--hub-trending-glow":
+ "color-mix(in srgb, var(--hub-card-art-accent) 46%, transparent)",
+ "--hub-trending-secondary-glow":
+ "color-mix(in srgb, var(--hub-card-art-accent) 14%, transparent)",
+ };
+}
+
+export function buildTrendingAuraStyle(row: DiscoverRow): TrendingCardStyle {
+ const hash = hashString(`${row.id}:${row.owner}:${row.repo}`);
+ const layout =
+ TRENDING_AURA_LAYOUTS[hash % TRENDING_AURA_LAYOUTS.length] ??
+ DEFAULT_TRENDING_AURA_LAYOUT;
+ const glowX = clamp(layout.x + ((hash >>> 4) % 11) - 5, 12, 88);
+ const glowY = clamp(layout.y + ((hash >>> 8) % 9) - 4, 6, 56);
+ const secondaryX = clamp(
+ layout.secondaryX + ((hash >>> 12) % 11) - 5,
+ 10,
+ 90,
+ );
+ const secondaryY = clamp(
+ layout.secondaryY + ((hash >>> 16) % 9) - 4,
+ 6,
+ 58,
+ );
+ const sheenAngle = layout.sheenAngle + ((hash >>> 20) % 17) - 8;
+ const scrimAngle = layout.scrimAngle + ((hash >>> 24) % 19) - 9;
+ return {
+ ...resolveTrendingGlow(row),
+ "--hub-trending-glow-x": `${glowX}%`,
+ "--hub-trending-glow-y": `${glowY}%`,
+ "--hub-trending-glow-size": `${layout.size}%`,
+ "--hub-trending-sheen-angle": `${sheenAngle}deg`,
+ "--hub-trending-scrim-angle": `${scrimAngle}deg`,
+ "--hub-trending-secondary-x": `${secondaryX}%`,
+ "--hub-trending-secondary-y": `${secondaryY}%`,
+ "--hub-trending-secondary-size": `${layout.secondarySize}%`,
+ };
+}
+
+export const ModelCard = memo(function ModelCard({
+ row,
+ deviceType,
+ isDataset,
+ onSelect,
+}: {
+ row: DiscoverRow;
+ deviceType: string | null;
+ isDataset: boolean;
+ onSelect: (id: string) => void;
+}) {
+ const support = useMemo(
+ () =>
+ isDataset
+ ? null
+ : classifyUnslothSupport({
+ modelId: row.id,
+ pipelineTag: row.result.pipelineTag,
+ tags: row.result.tags,
+ libraryName: row.result.libraryName,
+ deviceType,
+ quantMethod: row.result.quantMethod,
+ }),
+ [isDataset, row.id, row.result, deviceType],
+ );
+ const unsupported = support?.status === "unsupported";
+ const partial = row.isAvailableOnDevice && row.isPartialOnDevice;
+ const onDevice = row.isAvailableOnDevice && !row.isPartialOnDevice;
+ const topCapability = row.capabilities[0] ?? null;
+ const sizeLabel = formatModelParamLabel(row.repo, row.result.totalParams);
+ const hasSize = sizeLabel !== "N/A";
+ const tip = buildRowStatusTooltip({
+ partialRepoId: partial ? row.result.id : undefined,
+ unsupported,
+ unsupportedReason: support?.reason ?? null,
+ resourceLabel: isDataset ? "dataset" : "model",
+ });
+ const iconUrl = useAvatarImageUrl(row.owner, row.repo);
+ const dominant = useDominantColor(iconUrl);
+ const cardAccentStyle = useMemo(
+ () => ({
+ "--hub-card-art-accent": ownerPaletteColor(`${row.owner}/${row.repo}`),
+ ...buildTrendingAuraStyle(row),
+ ...buildAdaptiveCardAccentStyle(dominant),
+ }),
+ [dominant, row],
+ );
+ const card = (
+ <button
+ type="button"
+ aria-label={row.repo}
+ onClick={() => onSelect(row.id)}
+ style={cardAccentStyle}
+ className="hub-model-card hub-trending-card group/card flex h-full w-full cursor-pointer flex-col overflow-hidden px-3 py-3.5 text-left outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset"
+ >
+ <div className="flex min-w-0 items-start gap-2.5">
+ <OwnerAvatar
+ owner={row.owner}
+ repoName={row.repo}
+ className="size-11 shrink-0 rounded-[14px] text-[17px] ring-1 ring-white/10"
+ remote={false}
+ />
+ <div className="min-w-0 flex-1 space-y-0.5">
+ <p className="hub-trending-title line-clamp-2 text-[13.5px] font-semibold leading-[16px] text-foreground">
+ {row.repo}
+ </p>
+ <span className="hub-trending-owner flex min-w-0 items-center gap-1 text-[11.5px] leading-[15px] text-muted-foreground/80">
+ <span className="truncate">{row.owner}</span>
+ {row.owner.toLowerCase() === "unsloth" && (
+ <span
+ aria-label="Verified Unsloth"
+ className="hub-verified-badge size-3.5 shrink-0 text-primary"
+ />
+ )}
+ </span>
+ </div>
+ <div className="mt-[3px] flex shrink-0 items-center gap-1">
+ <AccessGlyphs
+ gated={row.result.gated}
+ isPrivate={row.result.private}
+ />
+ {partial && (
+ <span
+ role="img"
+ aria-label="Partial download"
+ className="inline-block size-[5px] rounded-full bg-status-warning"
+ />
+ )}
+ {unsupported && (
+ <span
+ role="img"
+ aria-label="May not be supported yet"
+ className="inline-block size-[5px] rounded-full bg-status-danger"
+ />
+ )}
+ {onDevice && (
+ <span
+ role="img"
+ aria-label="On device"
+ className="inline-block size-[5px] rounded-full bg-status-success"
+ />
+ )}
+ </div>
+ </div>
+ <div className="mt-auto flex items-end justify-between gap-2 pt-2.5">
+ <div className="hub-trending-stats flex min-w-0 items-center gap-2.5 pb-[3px]">
+ <StatChip
+ icon={Download01Icon}
+ value={formatCompact(row.result.downloads)}
+ />
+ <StatChip
+ icon={FavouriteIcon}
+ value={formatCompact(row.result.likes)}
+ />
+ </div>
+ {hasSize ? (
+ <span className="hub-chip shrink-0">{sizeLabel}</span>
+ ) : topCapability ? (
+ <CapabilityPill capability={topCapability} iconOnly={true} />
+ ) : null}
+ </div>
+ </button>
+ );
+
+ if (!tip) {
+ return card;
+ }
+ return (
+ <Tooltip>
+ <TooltipTrigger asChild={true}>{card}</TooltipTrigger>
+ <TooltipContent side="top" className="tooltip-compact max-w-[240px]">
+ {tip}
+ </TooltipContent>
+ </Tooltip>
+ );
+});
diff --git a/studio/frontend/src/features/hub/catalog/model-inspector.tsx b/studio/frontend/src/features/hub/catalog/model-inspector.tsx
index 24909b38aa9..371d595ddca 100644
--- a/studio/frontend/src/features/hub/catalog/model-inspector.tsx
+++ b/studio/frontend/src/features/hub/catalog/model-inspector.tsx
@@ -12,13 +12,17 @@ import {
classifyUnslothSupport,
} from "@/features/hub/hooks/use-hub-model-search";
import { useOnlineStatus } from "@/features/hub/hooks/use-online-status";
-import { formatBytes, formatRelativeShort } from "@/features/hub/lib/format";
-import { Tick02Icon } from "@/lib/tick-icon";
+import {
+ formatBytes,
+ formatRelativeShort,
+ formatShortDate,
+} from "@/features/hub/lib/format";
import { cn, formatCompact } from "@/lib/utils";
import { confirmExternalLink } from "../stores/external-link-confirm";
import { useHfTokenStore } from "@/features/hub/stores/hf-token-store";
import {
Calendar03Icon,
+ CalendarAdd01Icon,
Copy01Icon,
CpuIcon,
CubeIcon,
@@ -27,40 +31,33 @@ import {
FavouriteIcon,
Globe02Icon,
LayersLogoIcon,
+ LibraryIcon,
LicenseIcon,
PackageIcon,
RamMemoryIcon,
Share05Icon,
} from "@hugeicons/core-free-icons";
+import { Tick02Icon } from "@/lib/tick-icon";
import type { IconSvgElement } from "@hugeicons/react";
import { HugeiconsIcon } from "@hugeicons/react";
-import {
- memo,
- useDeferredValue,
- useEffect,
- useMemo,
- useRef,
- useState,
-} from "react";
+import { memo, useDeferredValue, useMemo } from "react";
import { useCopyFeedback } from "../hooks/use-copy-feedback";
import { useDatasetSize } from "../hooks/use-dataset-size";
import {
+ formatLibrary,
formatLocalUpdated,
formatPipelineTag,
parseLanguageTags,
} from "../lib/view-models";
import type { SelectedModelView } from "../types";
-import {
- selectActiveJob,
- useDownloadManagerStore,
-} from "../download-manager";
+import { selectActiveJob, useDownloadManagerStore } from "../download-manager";
import { DatasetDownloadSection } from "./dataset-download-section";
import { DownloadSection } from "./download-section";
import { LocalDatasetCard } from "./local-dataset-card";
import { LocalOnDeviceCard } from "./local-on-device-card";
import { ModelReadme } from "./model-readme";
import { OwnerAvatar } from "./owner-avatar";
-import { CapabilityPill } from "./shared";
+import { AccessChip, CapabilityPill } from "./shared";
function ViewRepositoryButton({
repoId,
@@ -72,9 +69,13 @@ function ViewRepositoryButton({
const online = useOnlineStatus();
const url = `https://huggingface.co/${isDataset ? "datasets/" : ""}${repoId}`;
const baseClass =
- "inline-flex size-7 shrink-0 items-center justify-center rounded-[8px] text-muted-foreground transition-colors";
+ "inline-flex size-6 shrink-0 items-center justify-center rounded-full text-muted-foreground transition-colors";
const icon = (
- <HugeiconsIcon icon={Share05Icon} strokeWidth={1.75} className="size-4" />
+ <HugeiconsIcon
+ icon={Share05Icon}
+ strokeWidth={1.75}
+ className="size-[13px]"
+ />
);
return (
<Tooltip>
@@ -128,12 +129,12 @@ function CopyRepoButton({ repoId }: { repoId: string }) {
type="button"
aria-label="Copy repository ID"
onClick={handleCopy}
- className="inline-flex size-7 shrink-0 cursor-pointer items-center justify-center rounded-[8px] text-muted-foreground transition-colors hover:bg-muted hover:text-foreground"
+ className="inline-flex size-6 shrink-0 cursor-pointer items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-muted hover:text-foreground"
>
<HugeiconsIcon
icon={copied ? Tick02Icon : Copy01Icon}
strokeWidth={1.75}
- className="size-4"
+ className="size-[13px]"
/>
</button>
</TooltipTrigger>
@@ -148,10 +149,12 @@ function StatRow({
label,
value,
icon,
+ tooltip,
}: {
label: string;
value: string;
icon: IconSvgElement;
+ tooltip?: React.ReactNode;
}) {
return (
<Tooltip>
@@ -165,7 +168,9 @@ function StatRow({
<span className="font-medium tabular-nums">{value}</span>
</span>
</TooltipTrigger>
- <TooltipContent className="tooltip-compact">{label}</TooltipContent>
+ <TooltipContent className="tooltip-compact">
+ {tooltip ?? label}
+ </TooltipContent>
</Tooltip>
);
}
@@ -175,11 +180,7 @@ function StatGrid({ children }: { children: React.ReactNode }) {
}
function InspectorDownloadSlot({ children }: { children: React.ReactNode }) {
- return (
- <div className="shrink-0 pl-6 pr-10 pt-3 sm:pr-14 lg:pr-[4.5rem] xl:pr-[5.5rem]">
- {children}
- </div>
- );
+ return <div className="max-w-[680px] pt-3">{children}</div>;
}
function StatusChip({
@@ -200,7 +201,7 @@ function StatusChip({
return (
<span
className={cn(
- "inline-flex h-5 shrink-0 items-center whitespace-nowrap rounded-full border bg-transparent px-2 text-[11px] font-medium leading-none",
+ "inline-flex h-5 shrink-0 items-center whitespace-nowrap rounded-[7px] border bg-transparent px-1.5 text-[11px] font-medium leading-none",
toneClass,
className,
)}
@@ -210,6 +211,53 @@ function StatusChip({
);
}
+function BaseModelSearchChip({
+ baseModel,
+ searchTerm,
+ onSearchHub,
+}: {
+ baseModel: string;
+ searchTerm: string;
+ onSearchHub?: (query: string) => void;
+}) {
+ const content = (
+ <>
+ <HugeiconsIcon
+ icon={LayersLogoIcon}
+ strokeWidth={1.75}
+ className="size-3.5 shrink-0 text-muted-foreground"
+ />
+ <span className="shrink-0 text-muted-foreground">Base</span>
+ <span className="min-w-0 truncate font-medium text-foreground">
+ {baseModel}
+ </span>
+ </>
+ );
+
+ return (
+ <Tooltip>
+ <TooltipTrigger asChild={true}>
+ {onSearchHub ? (
+ <button
+ type="button"
+ onClick={() => onSearchHub(searchTerm)}
+ className="inline-flex h-6 max-w-full cursor-pointer items-center gap-1.5 rounded-full bg-muted px-2.5 text-[11.5px] transition-colors hover:bg-muted/80 dark:bg-[rgba(255,255,255,0.04)]"
+ >
+ {content}
+ </button>
+ ) : (
+ <span className="inline-flex h-6 max-w-full items-center gap-1.5 rounded-full bg-muted px-2.5 text-[11.5px] dark:bg-[rgba(255,255,255,0.04)]">
+ {content}
+ </span>
+ )}
+ </TooltipTrigger>
+ <TooltipContent side="bottom" className="tooltip-compact">
+ Search this base model in Hub
+ </TooltipContent>
+ </Tooltip>
+ );
+}
+
type VramInfo = { est: number; status: "fits" | "tight" | "exceeds" } | null;
function ModelStatusChips({
@@ -270,8 +318,7 @@ function ModelStatusChips({
</span>
)}
<span className="mt-1 block text-[10.5px] font-normal text-white/75">
- Still downloadable to your Hugging Face cache, shared with every
- framework that reads it.
+ Still downloadable to your Hugging Face cache.
</span>
</TooltipContent>
</Tooltip>
@@ -322,6 +369,7 @@ export type ModelInspectorActions = {
onUseInChat: () => void;
onTrain?: () => void;
onInventoryChange?: () => void;
+ onSearchHub?: (query: string) => void;
};
export const ModelInspector = memo(function ModelInspector({
@@ -349,17 +397,23 @@ export const ModelInspector = memo(function ModelInspector({
gpuGb,
systemRamGb,
} = runtime;
- const { onLoad, onLoadLocal, onUseInChat, onTrain, onInventoryChange } =
- actions;
+ const {
+ onLoad,
+ onLoadLocal,
+ onUseInChat,
+ onTrain,
+ onInventoryChange,
+ onSearchHub,
+ } = actions;
const deviceType = usePlatformStore((s) => s.deviceType);
const hfToken = useHfTokenStore((s) => s.token);
const datasetRepoId = isDataset && model?.hubRepoId ? model.hubRepoId : null;
const datasetSize = useDatasetSize(datasetRepoId, {
token: hfToken || undefined,
});
- // Inventory rows are snapshots; the download manager is the live source of truth.
- // When a download is in flight, route through the download-aware section so
- // progress/cancel stays visible across refreshes.
+ // Inventory rows are snapshots; the download manager is the live source of
+ // truth. When a download is in flight, route through the download-aware section
+ // so progress/cancel stays visible across refreshes.
const activeDownloadRepoId = model?.hubRepoId ?? null;
const hasActiveHubDownload = useDownloadManagerStore((state) =>
activeDownloadRepoId
@@ -403,35 +457,12 @@ export const ModelInspector = memo(function ModelInspector({
supportTagsKey,
]);
- const descScrollRef = useRef<HTMLDivElement | null>(null);
- const descScrollKey = `${model?.id ?? ""}\0${readmeRepoId ?? ""}`;
const deferredReadmeRepoId = useDeferredValue(readmeRepoId);
const readmeReady = deferredReadmeRepoId === readmeRepoId;
- const [descScrollState, setDescScrollState] = useState({
- key: descScrollKey,
- scrolled: false,
- });
- const descScrolled =
- descScrollState.key === descScrollKey && descScrollState.scrolled;
- useEffect(() => {
- const el = descScrollRef.current;
- if (!el) return;
- el.scrollTop = 0;
- const onScroll = () => {
- const scrolled = el.scrollTop > 0;
- setDescScrollState((current) =>
- current.key === descScrollKey && current.scrolled === scrolled
- ? current
- : { key: descScrollKey, scrolled },
- );
- };
- el.addEventListener("scroll", onScroll, { passive: true });
- return () => el.removeEventListener("scroll", onScroll);
- }, [descScrollKey]);
if (!model) {
return (
- <div className="flex h-full min-h-0 flex-1 flex-col items-center justify-center gap-3 px-6 py-10 text-center">
+ <div className="flex min-h-[60vh] flex-col items-center justify-center gap-3 py-16 text-center">
<div className="inline-flex size-12 items-center justify-center rounded-[14px] bg-muted text-muted-foreground">
<HugeiconsIcon icon={CubeIcon} strokeWidth={1.5} className="size-5" />
</div>
@@ -453,8 +484,23 @@ export const ModelInspector = memo(function ModelInspector({
? formatRelativeShort(model.updatedAt)
: formatLocalUpdated(model.localUpdatedAt);
const updatedLabel = updatedRaw === "Unknown update" ? "N/A" : updatedRaw;
+ const createdLabel = model.createdAt ? formatShortDate(model.createdAt) : null;
+ const libraryLabel = isDataset ? null : formatLibrary(model.libraryName);
+ const gatedAccess = model.gated !== false && model.gated !== undefined;
+ const downloadsTooltip =
+ model.downloadsAllTime != null ? (
+ <>
+ Downloads (30 days)
+ <span className="mt-1 block text-[10.5px] font-normal text-white/75">
+ {formatCompact(model.downloadsAllTime)} all time
+ </span>
+ </>
+ ) : (
+ "Downloads"
+ );
const taskLabel = formatPipelineTag(model.pipelineTag) ?? "General";
const licenseLabel = model.license ?? "N/A";
+ const baseModelSearchTerm = model.baseModelHubId ?? model.baseModel ?? null;
const paramsLabel = model.totalParams
? formatCompact(model.totalParams)
: "N/A";
@@ -473,17 +519,17 @@ export const ModelInspector = memo(function ModelInspector({
datasetSize?.numBytesParquet ?? datasetSize?.numBytesOriginal ?? null;
return (
- <div className="flex h-full min-h-0 flex-1 flex-col">
- <div className="shrink-0 px-6 pb-2 pt-0">
- <div className="flex items-center gap-3.5">
+ <div className="flex flex-col">
+ <div className="pb-2 pt-1">
+ <div className="flex items-center gap-4">
<OwnerAvatar
owner={model.owner}
repoName={model.title}
- className="size-[52px] rounded-[14px] text-[16px]"
+ className="size-[60px] rounded-[18px] text-[19px]"
/>
<div className="min-w-0 flex-1">
<div className="flex min-w-0 items-center gap-1.5">
- <h2 className="truncate text-[22px] font-semibold leading-[28px] tracking-[-0.025em] text-foreground">
+ <h2 className="truncate text-[25px] font-semibold leading-[31px] tracking-normal text-foreground">
{model.title}
</h2>
{model.hubRepoId && (
@@ -496,12 +542,12 @@ export const ModelInspector = memo(function ModelInspector({
</div>
)}
</div>
- <div className="mt-0.5 flex min-w-0 items-center gap-1 text-[14px] leading-[22px] text-muted-foreground">
+ <div className="mt-0.5 flex min-w-0 items-center gap-1 text-[15px] leading-[24px] text-muted-foreground">
<span className="truncate">{model.owner}</span>
{model.owner.toLowerCase() === "unsloth" && (
<span
aria-label="Verified Unsloth"
- className="hub-verified-badge size-4 shrink-0 text-primary"
+ className="hub-verified-badge size-[18px] shrink-0 text-primary"
/>
)}
</div>
@@ -524,9 +570,18 @@ export const ModelInspector = memo(function ModelInspector({
{taskLabel}
</span>
)}
+ {model.private && <AccessChip label="Private" />}
+ {gatedAccess && <AccessChip label="Gated" />}
{model.capabilities.map((capability) => (
<CapabilityPill key={capability.key} capability={capability} />
))}
+ {!isDataset && model.baseModel && baseModelSearchTerm && (
+ <BaseModelSearchChip
+ baseModel={model.baseModel}
+ searchTerm={baseModelSearchTerm}
+ onSearchHub={onSearchHub}
+ />
+ )}
</div>
</div>
@@ -620,7 +675,7 @@ export const ModelInspector = memo(function ModelInspector({
</InspectorDownloadSlot>
)}
- <div className="shrink-0 px-6 pb-5 pt-5">
+ <div className="pb-5 pt-5">
{selectionHiddenByFilters && (
<p className="mb-3 rounded-[8px] border border-amber-500/30 bg-amber-500/10 px-3 py-2 text-[11.5px] leading-snug text-muted-foreground">
Current selection is hidden by the active filters or search.
@@ -634,8 +689,16 @@ export const ModelInspector = memo(function ModelInspector({
)}
<StatGrid>
<StatRow label="Updated" value={updatedLabel} icon={Calendar03Icon} />
+ {createdLabel && (
+ <StatRow
+ label="Created"
+ value={createdLabel}
+ icon={CalendarAdd01Icon}
+ />
+ )}
<StatRow
label="Downloads"
+ tooltip={downloadsTooltip}
value={
model.downloads !== undefined
? formatCompact(model.downloads)
@@ -653,6 +716,9 @@ export const ModelInspector = memo(function ModelInspector({
{!isDataset && (
<StatRow label="Parameters" value={paramsLabel} icon={CpuIcon} />
)}
+ {libraryLabel && (
+ <StatRow label="Library" value={libraryLabel} icon={LibraryIcon} />
+ )}
{!isDataset && (
<StatRow
label="Memory"
@@ -683,7 +749,7 @@ export const ModelInspector = memo(function ModelInspector({
icon={LayersLogoIcon}
/>
)}
- {isDataset && languages.length > 0 && (
+ {languages.length > 0 && (
<StatRow
label="Languages"
value={
@@ -704,19 +770,7 @@ export const ModelInspector = memo(function ModelInspector({
/>
</div>
- <div
- aria-hidden="true"
- className={cn(
- "mx-6 shrink-0 border-t transition-colors",
- descScrolled ? "border-border" : "border-transparent",
- )}
- />
-
- <div
- ref={descScrollRef}
- data-hub-scroll="true"
- className="min-h-0 flex-1 space-y-4 overflow-y-auto pl-6 pr-4 pt-5 pb-0 [scrollbar-gutter:stable] [scrollbar-width:thin]"
- >
+ <div className="max-w-[860px] space-y-4 pt-4">
{readmeReady && readmeRepoId && (
<ModelReadme
repoId={readmeRepoId}
diff --git a/studio/frontend/src/features/hub/catalog/models-catalog-lists.tsx b/studio/frontend/src/features/hub/catalog/models-catalog-lists.tsx
index b506f6a02d8..355c38a91ed 100644
--- a/studio/frontend/src/features/hub/catalog/models-catalog-lists.tsx
+++ b/studio/frontend/src/features/hub/catalog/models-catalog-lists.tsx
@@ -2,7 +2,6 @@
// Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0
import { Spinner } from "@/components/ui/spinner";
-import { modelIdsMatch } from "@/features/hub/lib/model-identity";
import {
CubeIcon,
DownloadCircle02Icon,
@@ -10,7 +9,10 @@ import {
} from "@hugeicons/core-free-icons";
import type { RefObject } from "react";
import { useMemo } from "react";
-import { inventoryRowMatches, scoreInventoryRow } from "../lib/inventory-search";
+import {
+ inventoryRowMatches,
+ scoreInventoryRow,
+} from "../lib/inventory-search";
import type {
CachedInventoryRow,
DiscoverRow,
@@ -24,16 +26,33 @@ import {
NetworkErrorState,
SkeletonList,
} from "./catalog-states";
+import { InventoryRow, VirtualRows } from "./models-catalog-rows";
import {
- DiscoverModelRow,
- InventoryRow,
- VirtualRows,
-} from "./models-catalog-rows";
+ type AllModelsView,
+ type InventorySort,
+ RESULT_CARD_HEIGHT_PX,
+ RESULT_GRID_HEIGHT_PX,
+ RESULT_GRID_ROW_HEIGHT_PX,
+ RESULT_ROW_HEIGHT_PX,
+ RESULT_SPLIT_HEIGHT_PX,
+ RESULT_SPLIT_ROW_HEIGHT_PX,
+ ResultCard,
+ ResultGridRow,
+ ResultSplitRow,
+} from "./models-table";
type InventoryItem =
| { variant: "cached"; row: CachedInventoryRow }
| { variant: "local"; row: LocalInventoryRow };
+function inventoryItemTitle(item: InventoryItem): string {
+ return item.variant === "cached" ? item.row.repo : item.row.title;
+}
+
+function inventoryItemSize(item: InventoryItem): number {
+ return item.variant === "cached" ? item.row.bytes : 0;
+}
+
export function InventoryWarningRow({
isDataset,
onRetry,
@@ -62,13 +81,13 @@ export function InventoryWarningRow({
export function DiscoverList({
discoverRows,
- selectedId,
onSelect,
isLoading,
query,
scrollElement,
+ scrollMargin = 0,
+ suppressEmptyState = false,
sentinelRef,
- activeCheckpoint,
searchError,
online,
isDataset,
@@ -76,21 +95,23 @@ export function DiscoverList({
scannedCount,
isLoadingMore,
hasMore,
- manualFetchAvailable,
hasActiveFilters,
onFetchMore,
onClearFilters,
onRetry,
onSwitchDevice,
+ view,
+ selectedId,
}: {
discoverRows: DiscoverRow[];
- selectedId: string | null;
onSelect: (id: string) => void;
+ selectedId?: string | null;
isLoading: boolean;
query: string;
scrollElement: HTMLDivElement | null;
+ scrollMargin?: number;
+ suppressEmptyState?: boolean;
sentinelRef: RefObject<HTMLDivElement | null>;
- activeCheckpoint: string | null;
searchError: string | null;
online: boolean;
isDataset: boolean;
@@ -98,24 +119,84 @@ export function DiscoverList({
scannedCount: number;
isLoadingMore: boolean;
hasMore: boolean;
- manualFetchAvailable: boolean;
hasActiveFilters: boolean;
onFetchMore: () => void;
onClearFilters: () => void;
onRetry: () => void;
onSwitchDevice?: () => void;
+ view: AllModelsView;
}) {
+ // "two" = two cards per row; "grid" = compact table rows; "split" = one card
+ // per row in the master pane alongside an inline detail view.
+ const isSplit = view === "split";
+ const isCardLike = view === "two" || view === "split";
+ const rowHeight = isSplit
+ ? RESULT_SPLIT_ROW_HEIGHT_PX
+ : isCardLike
+ ? RESULT_ROW_HEIGHT_PX
+ : RESULT_GRID_ROW_HEIGHT_PX;
+ const cellHeight = isSplit
+ ? RESULT_SPLIT_HEIGHT_PX
+ : isCardLike
+ ? RESULT_CARD_HEIGHT_PX
+ : RESULT_GRID_HEIGHT_PX;
+ const columns = view === "two" ? 2 : 1;
+
return (
<>
{online ? (
- searchError && discoverRows.length === 0 ? (
+ discoverRows.length > 0 ? (
+ <>
+ <VirtualRows
+ items={discoverRows}
+ scrollElement={scrollElement}
+ scrollMargin={scrollMargin}
+ columns={columns}
+ rowHeight={rowHeight}
+ cellHeight={cellHeight}
+ getKey={(row) => row.id}
+ renderRow={(row) =>
+ view === "split" ? (
+ <ResultSplitRow
+ row={row}
+ deviceType={deviceType}
+ isDataset={isDataset}
+ selected={row.id === selectedId}
+ onSelect={onSelect}
+ />
+ ) : isCardLike ? (
+ <ResultCard
+ row={row}
+ deviceType={deviceType}
+ isDataset={isDataset}
+ onSelect={onSelect}
+ />
+ ) : (
+ <ResultGridRow
+ row={row}
+ deviceType={deviceType}
+ isDataset={isDataset}
+ onSelect={onSelect}
+ />
+ )
+ }
+ />
+ {hasMore && (
+ <DiscoverFetchMoreFooter
+ hasActiveFilters={hasActiveFilters}
+ isLoadingMore={isLoadingMore}
+ onFetchMore={onFetchMore}
+ />
+ )}
+ </>
+ ) : suppressEmptyState ? null : searchError ? (
<NetworkErrorState
online={online}
message={searchError}
onRetry={onRetry}
resourceLabel={isDataset ? "datasets" : "models"}
/>
- ) : hasMore && discoverRows.length === 0 ? (
+ ) : hasMore ? (
<DiscoverFetchMoreState
scannedCount={scannedCount}
hasActiveFilters={hasActiveFilters}
@@ -123,9 +204,9 @@ export function DiscoverList({
onFetchMore={onFetchMore}
onClearFilters={onClearFilters}
/>
- ) : discoverRows.length === 0 && isLoading ? (
+ ) : isLoading ? (
<SkeletonList />
- ) : discoverRows.length === 0 ? (
+ ) : (
<EmptyState
icon={query.trim() ? FolderSearchIcon : CubeIcon}
title={
@@ -139,35 +220,8 @@ export function DiscoverList({
: "The current filters are excluding every result."
}
/>
- ) : (
- <>
- <VirtualRows
- items={discoverRows}
- scrollElement={scrollElement}
- getKey={(row) => row.id}
- renderRow={(row) => (
- <DiscoverModelRow
- row={row}
- selected={selectedId === row.id}
- active={modelIdsMatch(activeCheckpoint, row.id)}
- deviceType={deviceType}
- isDataset={isDataset}
- onSelect={onSelect}
- />
- )}
- />
- {hasMore && (
- <DiscoverFetchMoreFooter
- scannedCount={scannedCount}
- manualFetchAvailable={manualFetchAvailable}
- hasActiveFilters={hasActiveFilters}
- isLoadingMore={isLoadingMore}
- onFetchMore={onFetchMore}
- />
- )}
- </>
)
- ) : (
+ ) : suppressEmptyState ? null : (
<NetworkErrorState
online={online}
message="Discovery is unavailable while offline."
@@ -191,11 +245,14 @@ export function DownloadedList({
inventoryError,
query,
scrollElement,
+ columns = 1,
activeCheckpoint,
activeGgufVariant,
isDataset,
inventoryTokens,
deviceType,
+ compact = false,
+ sort,
onInventoryChange,
}: {
cachedRows: CachedInventoryRow[];
@@ -206,11 +263,15 @@ export function DownloadedList({
inventoryError: boolean;
query: string;
scrollElement: HTMLDivElement | null;
+ columns?: number;
activeCheckpoint: string | null;
activeGgufVariant: string | null;
isDataset: boolean;
inventoryTokens: readonly string[];
deviceType: string | null;
+ /** Narrow split master pane: render compact inventory rows. */
+ compact?: boolean;
+ sort: InventorySort;
onInventoryChange?: () => void;
}) {
const inventoryItems = useMemo<InventoryItem[]>(() => {
@@ -218,16 +279,31 @@ export function DownloadedList({
...cachedRows.map((row) => ({ variant: "cached" as const, row })),
...localRows.map((row) => ({ variant: "local" as const, row })),
];
- if (inventoryTokens.length === 0) return merged;
+ if (inventoryTokens.length > 0) {
+ return merged
+ .map((item, index) => ({
+ item,
+ index,
+ score: scoreInventoryRow(item.row, inventoryTokens),
+ }))
+ .sort((a, b) => b.score - a.score || a.index - b.index)
+ .map((entry) => entry.item);
+ }
+ if (sort === "recent") {
+ return merged;
+ }
return merged
- .map((item, index) => ({
- item,
- index,
- score: scoreInventoryRow(item.row, inventoryTokens),
- }))
- .sort((a, b) => b.score - a.score || a.index - b.index)
+ .map((item, index) => ({ item, index }))
+ .sort((a, b) =>
+ sort === "name"
+ ? inventoryItemTitle(a.item).localeCompare(
+ inventoryItemTitle(b.item),
+ ) || a.index - b.index
+ : inventoryItemSize(b.item) - inventoryItemSize(a.item) ||
+ a.index - b.index,
+ )
.map((entry) => entry.item);
- }, [cachedRows, localRows, inventoryTokens]);
+ }, [cachedRows, localRows, inventoryTokens, sort]);
const hasInventoryRows = cachedRows.length > 0 || localRows.length > 0;
if (!downloadedReady && !hasInventoryRows) {
@@ -268,6 +344,9 @@ export function DownloadedList({
<VirtualRows
items={inventoryItems}
scrollElement={scrollElement}
+ columns={columns}
+ rowHeight={compact ? RESULT_SPLIT_ROW_HEIGHT_PX : RESULT_GRID_ROW_HEIGHT_PX}
+ cellHeight={compact ? RESULT_SPLIT_HEIGHT_PX : RESULT_GRID_HEIGHT_PX}
getKey={(item) => `${item.variant}-${item.row.id}`}
renderRow={(item) => (
<InventoryRow
@@ -278,6 +357,7 @@ export function DownloadedList({
isDataset={isDataset}
dimmed={!inventoryRowMatches(item.row, inventoryTokens)}
deviceType={deviceType}
+ compact={compact}
onSelect={onSelect}
onChange={onInventoryChange}
/>
diff --git a/studio/frontend/src/features/hub/catalog/models-catalog-rows.tsx b/studio/frontend/src/features/hub/catalog/models-catalog-rows.tsx
index 0eada7e0466..4199755ba7b 100644
--- a/studio/frontend/src/features/hub/catalog/models-catalog-rows.tsx
+++ b/studio/frontend/src/features/hub/catalog/models-catalog-rows.tsx
@@ -45,16 +45,19 @@ import type {
LocalInventoryRow,
} from "../types";
import { OwnerAvatar } from "./owner-avatar";
+import { AccessGlyphs } from "./shared";
+import { paramLabelFromId } from "../lib/view-models";
const COARSE_POINTER =
typeof window !== "undefined" &&
typeof window.matchMedia === "function" &&
window.matchMedia("(pointer: coarse)").matches;
-// Defer the cached-size chip (a Radix Tooltip + two store subscriptions) until the
-// row is hovered/focused so flicking the list doesn't pay that cost per row. The
-// placeholder renders an identical StatChip, so the swap shifts nothing. Coarse
-// pointers have no hover, so arm immediately; default true so out-of-row usage works.
+// Defer the cached-size chip (Radix Tooltip + two store subscriptions) until a
+// row is first hovered/focused so scrolling the virtualized list doesn't pay
+// that cost per row; an identical StatChip placeholder makes the swap invisible.
+// Coarse pointers have no hover, so they arm immediately. Default true so any
+// out-of-row usage stays functional.
const CatalogRowInteractiveContext = createContext(true);
function CachedSizeChip(props: {
@@ -66,7 +69,9 @@ function CachedSizeChip(props: {
}) {
const interactive = useContext(CatalogRowInteractiveContext);
if (!interactive) {
- return <StatChip icon={PackageIcon} value={formatBytes(props.totalBytes)} />;
+ return (
+ <StatChip icon={PackageIcon} value={formatBytes(props.totalBytes)} />
+ );
}
return <CachedSizeChipLive {...props} />;
}
@@ -172,9 +177,11 @@ function CachedSizeChipLive({
>
<span className="min-w-0 truncate">{row.label}</span>
<span className="ml-auto">
+ {/* Brightened for the dark tooltip: muted grey reads poorly there. */}
<StatChip
icon={PackageIcon}
value={formatBytes(row.size_bytes)}
+ className="text-[11px] text-white/70"
/>
</span>
</li>
@@ -190,15 +197,31 @@ function CachedSizeChipLive({
);
}
+// Thin "·" separator for inline meta lines (owner · format · params).
+function MetaDivider() {
+ return (
+ <span aria-hidden="true" className="shrink-0 text-muted-foreground/35">
+ ·
+ </span>
+ );
+}
+
export function StatChip({
icon,
value,
+ className,
}: {
icon: IconSvgElement;
value: string;
+ className?: string;
}) {
return (
- <span className="inline-flex shrink-0 items-center gap-1 whitespace-nowrap text-[10px] font-medium leading-none tabular-nums text-muted-foreground/75">
+ <span
+ className={cn(
+ "inline-flex shrink-0 items-center gap-1 whitespace-nowrap text-[10px] font-medium leading-none tabular-nums text-muted-foreground/75",
+ className,
+ )}
+ >
<HugeiconsIcon
icon={icon}
strokeWidth={1.75}
@@ -216,6 +239,7 @@ function CatalogRow({
tooltip,
label,
children,
+ variant = "flat",
}: {
selected: boolean;
active?: boolean;
@@ -223,25 +247,37 @@ function CatalogRow({
onClick: () => void;
label: string;
children: ReactNode;
+ variant?: "flat" | "card";
}) {
const [interactive, setInteractive] = useState(COARSE_POINTER);
const arm = useCallback(() => setInteractive(true), []);
+ const card = variant === "card";
const button = (
<div
data-selected={selected || undefined}
data-active={active || undefined}
onPointerEnter={arm}
onFocusCapture={arm}
- className="catalog-row group/row relative block w-full select-none overflow-hidden rounded-[14px] pl-3 pr-4 py-2.5 text-left"
+ className={cn(
+ "group/row relative w-full select-none overflow-hidden text-left",
+ card
+ ? "hub-result-row flex h-full items-center rounded-[16px] px-4"
+ : "catalog-row block rounded-[14px] pl-3 pr-2.5 py-2.5",
+ )}
>
<button
type="button"
aria-label={label}
onClick={onClick}
- className="absolute inset-0 cursor-pointer rounded-[14px] outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset"
+ className={cn(
+ "absolute inset-0 cursor-pointer outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset",
+ card ? "rounded-[16px]" : "rounded-[14px]",
+ )}
/>
<CatalogRowInteractiveContext.Provider value={interactive}>
- <div className="pointer-events-none relative">{children}</div>
+ <div className={cn("pointer-events-none relative", card && "z-[1] w-full")}>
+ {children}
+ </div>
</CatalogRowInteractiveContext.Provider>
</div>
);
@@ -250,9 +286,9 @@ function CatalogRow({
<Tooltip>
<TooltipTrigger asChild={true}>{button}</TooltipTrigger>
<TooltipContent
- side="right"
- align="center"
- sideOffset={8}
+ side={card ? "top" : "right"}
+ align="start"
+ sideOffset={card ? 6 : 8}
className="tooltip-compact max-w-xs"
>
{tooltip}
@@ -304,7 +340,7 @@ function TooltipLegendRow({
);
}
-function buildRowStatusTooltip({
+export function buildRowStatusTooltip({
isGguf,
isAdapter,
isAvailableOnDevice,
@@ -365,8 +401,7 @@ function buildRowStatusTooltip({
</span>
)}
<span className="mt-0.5 block text-white/75">
- Still downloadable to your Hugging Face cache, shared with every
- framework that reads it.
+ Still downloadable to your Hugging Face cache.
</span>
</TooltipLegendRow>,
);
@@ -432,14 +467,20 @@ export const DiscoverModelRow = memo(function DiscoverModelRow({
<OwnerAvatar
owner={row.owner}
repoName={row.repo}
- className="size-8 rounded-[9px]"
+ className="size-8 rounded-[11px]"
+ remote={false}
/>
<div className="flex min-w-0 flex-1 flex-col gap-[3px]">
<div className="flex h-[18px] min-w-0 items-center justify-between gap-2">
- <div className="flex min-w-0 items-center gap-1.5 pr-2">
+ <div className="flex min-w-0 items-center gap-2 pr-2">
<p className="truncate text-[12px] font-medium leading-[18px] tracking-[-0.005em] text-foreground">
{row.repo}
</p>
+ <AccessGlyphs
+ gated={row.result.gated}
+ isPrivate={row.result.private}
+ tooltip={false}
+ />
{row.result.isGguf && (
<span
role="img"
@@ -520,6 +561,7 @@ export const InventoryRow = memo(function InventoryRow({
isDataset,
dimmed,
deviceType,
+ compact = false,
onSelect,
onChange,
}: {
@@ -530,6 +572,8 @@ export const InventoryRow = memo(function InventoryRow({
isDataset: boolean;
dimmed: boolean;
deviceType: string | null;
+ /** Narrow split master pane: drop the capability column so the name fits. */
+ compact?: boolean;
onSelect: (id: string) => void;
onChange?: () => void;
}) {
@@ -591,9 +635,200 @@ export const InventoryRow = memo(function InventoryRow({
unsupported,
resourceLabel: isDataset ? "dataset" : "model",
});
+ // Always-derivable stats so on-device rows don't show empty placeholder cells:
+ // format badge, parameter count from the repo name, and GGUF quant variant.
+ const formatLabel =
+ row.modelFormat === "gguf"
+ ? "GGUF"
+ : row.modelFormat === "adapter"
+ ? "Adapter"
+ : row.modelFormat === "safetensors" || row.modelFormat === "checkpoint"
+ ? "Safetensors"
+ : null;
+ const paramLabel = useMemo(() => paramLabelFromId(title), [title]);
+ const quantLabel = row.formatVariant?.trim() || null;
+
+ const metaChips =
+ !isDataset && (formatLabel || paramLabel || quantLabel) ? (
+ <div className="hidden shrink-0 items-center gap-1.5 sm:flex">
+ {/* Format already shows as the status dot, so the pill stays neutral. */}
+ {formatLabel && <span className="hub-chip">{formatLabel}</span>}
+ {paramLabel && <span className="hub-chip tabular-nums">{paramLabel}</span>}
+ {quantLabel && (
+ <span className="hub-chip font-mono text-[10.5px] uppercase">
+ {quantLabel}
+ </span>
+ )}
+ </div>
+ ) : null;
+
+ // On-disk size for cached repos, else local source or last-modified date.
+ const sourceLabel = row.kind === "local" ? row.sourceLabel : null;
+
+ const statusMarkers = (
+ <>
+ {row.isGguf && (
+ <span
+ role="img"
+ aria-label="GGUF"
+ className="inline-block size-[5px] shrink-0 rounded-full bg-format-gguf"
+ />
+ )}
+ {row.modelFormat === "adapter" && (
+ <span
+ role="img"
+ aria-label="Adapter"
+ className="inline-block size-[5px] shrink-0 rounded-full bg-format-adapter"
+ />
+ )}
+ {partialRepoId ? (
+ <StatusDot tone="warning" label="Partial download" />
+ ) : (
+ <StatusDot tone="success" label="On device" />
+ )}
+ {unsupported && (
+ <StatusDot tone="danger" label="May not be supported yet" />
+ )}
+ </>
+ );
+
+ // Compact rows are all on-device, so the format dots are noise: surface only
+ // exceptional states; format + params move to the meta line.
+ const compactMarkers =
+ partialRepoId || unsupported ? (
+ <span className="flex shrink-0 items-center gap-1">
+ {partialRepoId && (
+ <StatusDot tone="warning" label="Partial download" />
+ )}
+ {unsupported && (
+ <StatusDot tone="danger" label="May not be supported yet" />
+ )}
+ </span>
+ ) : null;
+
+ const ownerLine = (
+ <span className="mt-0.5 flex min-w-0 items-center gap-1 text-[11.5px] leading-[15px] text-muted-foreground/80">
+ <span className="truncate">{subLabel}</span>
+ {subLabel.toLowerCase() === "unsloth" && (
+ <span
+ aria-label="Verified Unsloth"
+ className="hub-verified-badge size-3.5 shrink-0 text-primary"
+ />
+ )}
+ </span>
+ );
+
+ const deleteAction =
+ canDelete && cacheDeletableRepoId ? (
+ <ModelDeleteAction
+ ariaLabel={`Delete ${cacheDeletableRepoId}`}
+ title={isDataset ? "Delete cached dataset?" : "Delete cached model?"}
+ description={
+ <>
+ This will remove{" "}
+ <span className="font-medium text-foreground">
+ {cacheDeletableRepoId}
+ </span>{" "}
+ {isDataset
+ ? "and its downloaded files"
+ : row.isGguf
+ ? "and all of its downloaded quantizations"
+ : "and all of its downloaded files"}
+ {row.kind === "cache" ? ` (${formatBytes(row.bytes)})` : ""} from
+ disk. You can re-download it later.
+ </>
+ }
+ successMessage={`Deleted ${cacheDeletableRepoId}`}
+ buttonClassName="pointer-events-auto hub-modal-pe-guard p-2 opacity-0 transition-opacity group-hover/row:opacity-100 focus-visible:opacity-100 data-[state=open]:opacity-100 [@media(pointer:coarse)]:opacity-100"
+ iconClassName="size-4"
+ onConfirm={async () => {
+ if (isDataset) {
+ await deleteCachedDataset(cacheDeletableRepoId);
+ } else {
+ await deleteCachedModel(cacheDeletableRepoId);
+ }
+ }}
+ onDeleted={onChange}
+ />
+ ) : null;
+
+ // Compact master pane: drop the capability column and collapse size + date
+ // into one trailing group so the name keeps the whole middle.
+ if (compact) {
+ return (
+ <CatalogRow
+ variant="flat"
+ selected={selected}
+ active={active}
+ tooltip={tooltip}
+ label={title}
+ onClick={handleClick}
+ >
+ <div
+ className={cn(
+ "flex w-full items-center gap-2.5 transition-opacity",
+ dimmed && "opacity-25 group-hover/row:opacity-60",
+ )}
+ >
+ <OwnerAvatar
+ owner={row.owner}
+ repoName={title}
+ className="size-8 shrink-0 rounded-[9px] text-[12px]"
+ remote={false}
+ />
+ <div className="min-w-0 flex-1">
+ <div className="flex min-w-0 items-center gap-1.5">
+ <span className="truncate text-[12.5px] font-semibold leading-[16px] text-foreground">
+ {title}
+ </span>
+ {compactMarkers}
+ </div>
+ <span className="mt-0.5 flex min-w-0 items-center gap-1.5 text-[10.5px] leading-[14px] text-muted-foreground/75">
+ <span className="flex min-w-0 items-center gap-1">
+ <span className="truncate">{subLabel}</span>
+ {subLabel.toLowerCase() === "unsloth" && (
+ <span
+ aria-label="Verified Unsloth"
+ className="hub-verified-badge size-3 shrink-0 text-primary"
+ />
+ )}
+ </span>
+ {formatLabel && (
+ <>
+ <MetaDivider />
+ <span className="shrink-0">{formatLabel}</span>
+ </>
+ )}
+ {paramLabel && (
+ <>
+ <MetaDivider />
+ <span className="shrink-0 tabular-nums">{paramLabel}</span>
+ </>
+ )}
+ </span>
+ </div>
+ <div className="flex shrink-0 items-center gap-2 text-[10.5px] tabular-nums text-muted-foreground/70">
+ {row.kind === "cache" ? (
+ <CachedSizeChip
+ repoId={row.repoId}
+ totalBytes={row.bytes}
+ isGguf={row.isGguf}
+ isDataset={isDataset}
+ cachePath={row.cachePath}
+ />
+ ) : trailing ? (
+ <span>{trailing}</span>
+ ) : null}
+ {deleteAction}
+ </div>
+ </div>
+ </CatalogRow>
+ );
+ }
return (
<CatalogRow
+ variant="card"
selected={selected}
active={active}
tooltip={tooltip}
@@ -602,110 +837,52 @@ export const InventoryRow = memo(function InventoryRow({
>
<div
className={cn(
- "flex items-center gap-3 transition-opacity",
+ "flex w-full items-center gap-3 transition-opacity",
dimmed && "opacity-25 group-hover/row:opacity-60",
)}
>
- <OwnerAvatar
- owner={row.owner}
- repoName={title}
- className="size-8 rounded-[9px]"
- />
- <div className="flex min-w-0 flex-1 flex-col gap-[3px]">
- <div className="flex h-[18px] min-w-0 items-center justify-between gap-2">
- <div className="flex min-w-0 items-center gap-1.5 pr-2">
- <p className="truncate text-[12px] font-medium leading-[18px] tracking-[-0.005em] text-foreground">
+ <div className="flex min-w-0 flex-1 items-center gap-3">
+ <OwnerAvatar
+ owner={row.owner}
+ repoName={title}
+ className="size-9 rounded-[12px]"
+ remote={false}
+ />
+ <div className="min-w-0 flex-1">
+ <div className="flex min-w-0 items-center gap-1.5">
+ <span className="truncate text-[13.5px] font-semibold leading-[17px] text-foreground">
{title}
- </p>
- {row.isGguf && (
- <span
- role="img"
- aria-label="GGUF"
- className="inline-block size-[5px] shrink-0 rounded-full bg-format-gguf"
- />
- )}
- {row.modelFormat === "adapter" && (
- <span
- role="img"
- aria-label="Adapter"
- className="inline-block size-[5px] shrink-0 rounded-full bg-format-adapter"
- />
- )}
- {partialRepoId ? (
- <StatusDot tone="warning" label="Partial download" />
- ) : (
- <StatusDot tone="success" label="On device" />
- )}
- {unsupported && (
- <StatusDot tone="danger" label="May not be supported yet" />
- )}
- </div>
- <div className="flex shrink-0 items-center gap-1">
- {canDelete && cacheDeletableRepoId && (
- <ModelDeleteAction
- ariaLabel={`Delete ${cacheDeletableRepoId}`}
- title={
- isDataset
- ? "Delete cached dataset?"
- : "Delete cached model?"
- }
- description={
- <>
- This will remove{" "}
- <span className="font-medium text-foreground">
- {cacheDeletableRepoId}
- </span>{" "}
- {isDataset
- ? "and its downloaded files"
- : row.isGguf
- ? "and all of its downloaded quantizations"
- : "and all of its downloaded files"}
- {row.kind === "cache"
- ? ` (${formatBytes(row.bytes)})`
- : ""}{" "}
- from disk. You can re-download it later.
- </>
- }
- successMessage={`Deleted ${cacheDeletableRepoId}`}
- buttonClassName="pointer-events-auto hub-modal-pe-guard opacity-0 transition-opacity group-hover/row:opacity-100 focus-visible:opacity-100 data-[state=open]:opacity-100 [@media(pointer:coarse)]:opacity-100"
- iconClassName="size-3.5"
- onConfirm={async () => {
- if (isDataset) {
- await deleteCachedDataset(cacheDeletableRepoId);
- } else {
- await deleteCachedModel(cacheDeletableRepoId);
- }
- }}
- onDeleted={onChange}
- />
- )}
- {row.kind === "cache" && (
- <CachedSizeChip
- repoId={row.repoId}
- totalBytes={row.bytes}
- isGguf={row.isGguf}
- isDataset={isDataset}
- cachePath={row.cachePath}
- />
- )}
+ </span>
+ {statusMarkers}
</div>
+ {ownerLine}
</div>
- <div className="flex h-[16px] min-w-0 items-center justify-between gap-2 text-[11.5px] leading-[16px] text-muted-foreground/85">
- <span className="flex min-w-0 items-center gap-1">
- <span className="truncate">{subLabel}</span>
- {subLabel.toLowerCase() === "unsloth" && (
- <span
- aria-label="Verified Unsloth"
- className="hub-verified-badge size-3.5 shrink-0 text-primary"
- />
- )}
+ </div>
+
+ {metaChips}
+
+ <div className="flex w-[96px] shrink-0 items-center justify-end text-right">
+ {row.kind === "cache" ? (
+ <CachedSizeChip
+ repoId={row.repoId}
+ totalBytes={row.bytes}
+ isGguf={row.isGguf}
+ isDataset={isDataset}
+ cachePath={row.cachePath}
+ />
+ ) : trailing ? (
+ <span className="truncate text-[11.5px] tabular-nums text-muted-foreground/70">
+ {trailing}
</span>
- {trailing && (
- <span className="shrink-0 text-[10.5px] tabular-nums">
- {trailing}
- </span>
- )}
- </div>
+ ) : sourceLabel ? (
+ <span className="truncate text-[11.5px] text-muted-foreground/55">
+ {sourceLabel}
+ </span>
+ ) : null}
+ </div>
+
+ <div className="flex w-9 shrink-0 items-center justify-end">
+ {deleteAction}
</div>
</div>
</CatalogRow>
@@ -719,19 +896,35 @@ export function VirtualRows<T>({
scrollElement,
getKey,
renderRow,
+ scrollMargin = 0,
+ columns = 1,
+ rowHeight = CATALOG_ROW_HEIGHT_PX,
+ cellHeight = rowHeight,
+ columnGap = 12,
}: {
items: readonly T[];
scrollElement: HTMLDivElement | null;
getKey: (item: T, index: number) => string;
renderRow: (item: T) => ReactNode;
+ scrollMargin?: number;
+ columns?: number;
+ rowHeight?: number;
+ cellHeight?: number;
+ columnGap?: number;
}) {
+ const lanes = Math.max(1, columns);
+ const rowCount = Math.ceil(items.length / lanes);
// eslint-disable-next-line react-hooks/incompatible-library
const virtualizer = useVirtualizer({
- count: items.length,
+ count: rowCount,
getScrollElement: () => scrollElement,
- estimateSize: () => CATALOG_ROW_HEIGHT_PX,
+ estimateSize: () => rowHeight,
overscan: 10,
- getItemKey: (index) => getKey(items[index], index),
+ scrollMargin,
+ getItemKey: (rowIndex) => {
+ const item = items[rowIndex * lanes];
+ return item ? getKey(item, rowIndex * lanes) : `row-${rowIndex}`;
+ },
});
return (
@@ -743,26 +936,51 @@ export function VirtualRows<T>({
overflowAnchor: "none",
}}
>
- {virtualizer.getVirtualItems().map((virtualRow) => (
- <li
- key={virtualRow.key}
- data-index={virtualRow.index}
- style={{
- position: "absolute",
- top: 0,
- left: 0,
- width: "100%",
- transform: `translateY(${virtualRow.start}px)`,
- // Lock rows to estimateSize with no measureElement ref: per-mount
- // measurement churns the virtualizer (re-renders + offset recompute)
- // that reads as a jump. A fixed matching height keeps appends stable.
- height: `${CATALOG_ROW_HEIGHT_PX}px`,
- contain: "layout paint",
- }}
- >
- {renderRow(items[virtualRow.index])}
- </li>
- ))}
+ {virtualizer.getVirtualItems().map((virtualRow) => {
+ const startIndex = virtualRow.index * lanes;
+ return (
+ <li
+ key={virtualRow.key}
+ data-index={virtualRow.index}
+ style={{
+ position: "absolute",
+ top: 0,
+ left: 0,
+ width: "100%",
+ transform: `translateY(${virtualRow.start - scrollMargin}px)`,
+ // Fixed height matching estimateSize (no measureElement ref):
+ // dynamic per-row measurement churns virtualizer state and causes
+ // visible jumps as new rows arrive.
+ height: `${rowHeight}px`,
+ contain: "layout",
+ }}
+ >
+ <div
+ style={{
+ display: "grid",
+ gridTemplateColumns: `repeat(${lanes}, minmax(0, 1fr))`,
+ columnGap: `${columnGap}px`,
+ height: `${cellHeight}px`,
+ }}
+ >
+ {Array.from({ length: lanes }, (_, lane) => {
+ const item = items[startIndex + lane];
+ if (item === undefined) {
+ return <div key={`empty-${lane}`} />;
+ }
+ return (
+ <div
+ key={getKey(item, startIndex + lane)}
+ className="min-w-0"
+ >
+ {renderRow(item)}
+ </div>
+ );
+ })}
+ </div>
+ </li>
+ );
+ })}
</ul>
);
}
diff --git a/studio/frontend/src/features/hub/catalog/models-catalog.tsx b/studio/frontend/src/features/hub/catalog/models-catalog.tsx
index c0338374684..344f5deb492 100644
--- a/studio/frontend/src/features/hub/catalog/models-catalog.tsx
+++ b/studio/frontend/src/features/hub/catalog/models-catalog.tsx
@@ -4,6 +4,7 @@
import { usePlatformStore } from "@/config/env";
import { cn } from "@/lib/utils";
import {
+ type ReactNode,
type RefObject,
memo,
useCallback,
@@ -23,7 +24,13 @@ import {
DownloadedList,
InventoryWarningRow,
} from "./models-catalog-lists";
-import { CATALOG_ROW_HEIGHT_PX } from "./models-catalog-rows";
+import {
+ type AllModelsView,
+ type InventorySort,
+ RESULT_GRID_ROW_HEIGHT_PX,
+ RESULT_ROW_HEIGHT_PX,
+ RESULT_SPLIT_ROW_HEIGHT_PX,
+} from "./models-table";
export interface ModelsCatalogState {
tab: ModelsTab;
@@ -72,10 +79,22 @@ export const ModelsCatalog = memo(function ModelsCatalog({
state,
pagination,
handlers,
+ header,
+ downloadedHeader,
+ suppressEmptyState = false,
+ resetScrollKey,
+ discoverView,
+ inventorySort,
}: {
state: ModelsCatalogState;
pagination: ModelsCatalogPagination;
handlers: ModelsCatalogHandlers;
+ header?: ReactNode;
+ downloadedHeader?: ReactNode;
+ suppressEmptyState?: boolean;
+ resetScrollKey?: string;
+ discoverView: AllModelsView;
+ inventorySort: InventorySort;
}) {
const {
tab,
@@ -97,7 +116,6 @@ export const ModelsCatalog = memo(function ModelsCatalog({
scannedCount,
loadingIntentCount,
hasMore,
- manualFetchAvailable,
hasActiveFilters,
} = state;
const { scrollRef, sentinelRef, isLoadingMore } = pagination;
@@ -111,18 +129,21 @@ export const ModelsCatalog = memo(function ModelsCatalog({
} = handlers;
const [scrolled, setScrolled] = useState(false);
const [streamingActive, setStreamingActive] = useState(false);
+ const [discoverHeaderHeight, setDiscoverHeaderHeight] = useState(0);
+ const headerRef = useRef<HTMLDivElement>(null);
+ const lastHeaderHeightRef = useRef(0);
+ const previousResetScrollKeyRef = useRef(resetScrollKey);
const previousScannedCountRef = useRef(scannedCount);
const previousLoadingIntentRef = useRef(loadingIntentCount);
const discoverScrollRef = useRef<HTMLDivElement>(null);
const downloadedScrollRef = useRef<HTMLDivElement>(null);
- const [discoverScrollEl, setDiscoverScrollEl] = useState<HTMLDivElement | null>(
- null,
- );
+ const [discoverScrollEl, setDiscoverScrollEl] =
+ useState<HTMLDivElement | null>(null);
const [downloadedScrollEl, setDownloadedScrollEl] =
useState<HTMLDivElement | null>(null);
const activeTabRef = useRef(tab);
- // Per-tab scroll positions. Some browsers drop the hidden pane's scrollTop, so
- // mirror it live via the scroll listener and restore on tab entry.
+ // Per-tab scroll positions: some browsers drop the hidden pane's scrollTop,
+ // so mirror it live via the scroll listener and restore on tab entry.
const savedScrollTopsRef = useRef<Record<ModelsTab, number>>({
discover: 0,
downloaded: 0,
@@ -143,9 +164,9 @@ export const ModelsCatalog = memo(function ModelsCatalog({
setDownloadedScrollEl(node);
}, []);
- // Restore the incoming pane's scrollTop and rebind scrollRef. Don't read scrollTop
- // off the outgoing pane: overflow toggling can clamp it to 0 before this runs, so
- // trust the live listener mirror instead and avoid that race.
+ // Restore the incoming pane's scrollTop and rebind scrollRef. Don't read
+ // scrollTop off the outgoing pane: overflow toggling can clamp it to 0 before
+ // this runs, so trust the live listener mirror instead and avoid that race.
useLayoutEffect(() => {
let restoreFrame: number | null = null;
const previousTab = activeTabRef.current;
@@ -178,7 +199,9 @@ export const ModelsCatalog = memo(function ModelsCatalog({
activeTabRef.current = tab;
assignRef(scrollRef, nextEl);
const nextScrolled = (nextEl?.scrollTop ?? 0) > 0;
- setScrolled((current) => (current === nextScrolled ? current : nextScrolled));
+ setScrolled((current) =>
+ current === nextScrolled ? current : nextScrolled,
+ );
return () => {
if (restoreFrame !== null) {
window.cancelAnimationFrame(restoreFrame);
@@ -235,6 +258,57 @@ export const ModelsCatalog = memo(function ModelsCatalog({
[scrollRef],
);
+ useLayoutEffect(() => {
+ if (resetScrollKey === previousResetScrollKeyRef.current) {
+ return;
+ }
+ previousResetScrollKeyRef.current = resetScrollKey;
+ const el = discoverScrollRef.current;
+ if (el) {
+ el.scrollTop = 0;
+ }
+ savedScrollTopsRef.current.discover = 0;
+ }, [resetScrollKey]);
+
+ useLayoutEffect(() => {
+ if (tab !== "discover") {
+ return;
+ }
+ const node = headerRef.current;
+ if (!node) {
+ lastHeaderHeightRef.current = 0;
+ setDiscoverHeaderHeight((current) => (current === 0 ? current : 0));
+ return;
+ }
+ let frame: number | null = null;
+ const measure = () => {
+ frame = null;
+ const next = node.offsetHeight;
+ if (next !== lastHeaderHeightRef.current) {
+ lastHeaderHeightRef.current = next;
+ setDiscoverHeaderHeight(next);
+ }
+ };
+ const schedule = () => {
+ if (frame !== null) {
+ return;
+ }
+ frame = window.requestAnimationFrame(measure);
+ };
+ measure();
+ let observer: ResizeObserver | null = null;
+ if (typeof ResizeObserver !== "undefined") {
+ observer = new ResizeObserver(schedule);
+ observer.observe(node);
+ }
+ return () => {
+ if (frame !== null) {
+ window.cancelAnimationFrame(frame);
+ }
+ observer?.disconnect();
+ };
+ }, [tab, header]);
+
useEffect(() => {
// Only the Discover tab drives the streaming loading bar.
if (tab !== "discover") {
@@ -257,7 +331,9 @@ export const ModelsCatalog = memo(function ModelsCatalog({
nextActive = true;
linger = true;
}
- setStreamingActive((current) => (current === nextActive ? current : nextActive));
+ setStreamingActive((current) =>
+ current === nextActive ? current : nextActive,
+ );
const timer = linger
? window.setTimeout(() => setStreamingActive(false), 1400)
: null;
@@ -269,31 +345,47 @@ export const ModelsCatalog = memo(function ModelsCatalog({
}, [tab, isLoading, isLoadingMore, scannedCount, loadingIntentCount]);
const showDiscoverLoading = tab === "discover" && streamingActive;
- // overflow-y stays `auto` on BOTH panes: toggling to `hidden` would clamp the
- // inactive pane's scrollTop to 0 and corrupt our mirror. Visibility +
+ // overflow-y stays `auto` on BOTH panes: toggling to `hidden` clamps the
+ // inactive pane's scrollTop to 0 and corrupts the mirror; visibility +
// pointer-events-none hides it while preserving native scroll state.
+ // Non-split reserves an equal `both-edges` gutter so the centered 1100px
+ // column stays symmetric and aligned with the top bar; split mode pins a
+ // narrow master left, so it reserves only the right (divider) gutter.
const scrollPaneClassName =
- "absolute inset-0 min-h-0 overflow-y-auto pb-6 pl-4 pr-3 pt-0 [overflow-anchor:none] [scrollbar-gutter:stable] [scrollbar-width:thin]";
+ "absolute inset-0 min-h-0 overflow-x-hidden overflow-y-auto pb-6 pt-0 [overflow-anchor:none] [scrollbar-width:thin] " +
+ (discoverView === "split"
+ ? "[scrollbar-gutter:stable]"
+ : "[scrollbar-gutter:stable_both-edges]");
+ // Split mode keeps the top bar's left padding to align the list header but
+ // tightens the right padding so compact rows run wider toward the divider.
+ const splitView = discoverView === "split";
+ const discoverColumnClassName = splitView
+ ? "mx-auto w-full max-w-[1100px] pl-5 pr-2 sm:pl-8"
+ : "mx-auto w-full max-w-[1100px] px-5 sm:px-8";
+ const downloadedColumnClassName = splitView
+ ? "mx-auto w-full max-w-[1100px] pl-5 pr-2 sm:pl-8"
+ : "mx-auto w-full max-w-[1100px] px-5 sm:px-8";
const discoverActive = tab === "discover";
const downloadedActive = tab === "downloaded";
const discoverInactiveHeight = Math.max(
savedScrollHeightsRef.current.discover,
- discoverRows.length * CATALOG_ROW_HEIGHT_PX,
+ (discoverView === "two"
+ ? Math.ceil(discoverRows.length / 2)
+ : discoverRows.length) *
+ (discoverView === "grid"
+ ? RESULT_GRID_ROW_HEIGHT_PX
+ : discoverView === "split"
+ ? RESULT_SPLIT_ROW_HEIGHT_PX
+ : RESULT_ROW_HEIGHT_PX) +
+ lastHeaderHeightRef.current,
);
const downloadedInactiveHeight = Math.max(
savedScrollHeightsRef.current.downloaded,
- (cachedRows.length + localRows.length) * CATALOG_ROW_HEIGHT_PX,
+ (cachedRows.length + localRows.length) * RESULT_GRID_ROW_HEIGHT_PX,
);
return (
<div className="relative flex h-full min-h-0 flex-1 flex-col overflow-hidden">
- <div
- aria-hidden="true"
- className={cn(
- "mx-5 shrink-0 border-t transition-colors",
- scrolled ? "border-border" : "border-transparent",
- )}
- />
{/* Banner sits outside the scroll container so toggling it never shifts virtualized rows. */}
{downloadedActive && inventoryWarning && (
<InventoryWarningRow
@@ -302,6 +394,11 @@ export const ModelsCatalog = memo(function ModelsCatalog({
/>
)}
<div className="relative min-h-0 flex-1">
+ <div
+ aria-hidden="true"
+ data-scrolled={scrolled || undefined}
+ className="hub-scroll-fade pointer-events-none absolute inset-x-0 top-0 z-10 h-7"
+ />
<div
ref={setDiscoverScrollNode}
data-hub-scroll="true"
@@ -313,29 +410,33 @@ export const ModelsCatalog = memo(function ModelsCatalog({
)}
>
{discoverActive ? (
- <DiscoverList
- discoverRows={discoverRows}
- selectedId={selectedId}
- onSelect={onSelect}
- isLoading={isLoading}
- query={query}
- scrollElement={discoverScrollEl}
- sentinelRef={sentinelRef}
- activeCheckpoint={activeCheckpoint}
- searchError={searchError}
- online={online}
- isDataset={isDataset}
- deviceType={deviceType}
- scannedCount={scannedCount}
- isLoadingMore={isLoadingMore}
- hasMore={hasMore}
- manualFetchAvailable={manualFetchAvailable}
- hasActiveFilters={hasActiveFilters}
- onFetchMore={onFetchMore}
- onClearFilters={onClearFilters}
- onRetry={onRetry}
- onSwitchDevice={onSwitchDevice}
- />
+ <div className={discoverColumnClassName}>
+ {header ? <div ref={headerRef}>{header}</div> : null}
+ <DiscoverList
+ discoverRows={discoverRows}
+ onSelect={onSelect}
+ isLoading={isLoading}
+ query={query}
+ scrollElement={discoverScrollEl}
+ scrollMargin={discoverHeaderHeight}
+ suppressEmptyState={suppressEmptyState}
+ sentinelRef={sentinelRef}
+ searchError={searchError}
+ online={online}
+ isDataset={isDataset}
+ deviceType={deviceType}
+ scannedCount={scannedCount}
+ isLoadingMore={isLoadingMore}
+ hasMore={hasMore}
+ hasActiveFilters={hasActiveFilters}
+ onFetchMore={onFetchMore}
+ onClearFilters={onClearFilters}
+ onRetry={onRetry}
+ onSwitchDevice={onSwitchDevice}
+ view={discoverView}
+ selectedId={selectedId}
+ />
+ </div>
) : (
<div
aria-hidden="true"
@@ -354,22 +455,32 @@ export const ModelsCatalog = memo(function ModelsCatalog({
)}
>
{downloadedActive ? (
- <DownloadedList
- cachedRows={cachedRows}
- localRows={localRows}
- selectedId={selectedId}
- onSelect={onSelect}
- downloadedReady={downloadedReady}
- inventoryError={inventoryError}
- query={query}
- scrollElement={downloadedScrollEl}
- activeCheckpoint={activeCheckpoint}
- activeGgufVariant={activeGgufVariant}
- isDataset={isDataset}
- inventoryTokens={inventoryTokens}
- deviceType={deviceType}
- onInventoryChange={onInventoryChange}
- />
+ <div className={downloadedColumnClassName}>
+ {downloadedHeader ? (
+ <div className="flex flex-col gap-3 pt-6">
+ {downloadedHeader}
+ </div>
+ ) : null}
+ <DownloadedList
+ cachedRows={cachedRows}
+ localRows={localRows}
+ selectedId={selectedId}
+ onSelect={onSelect}
+ downloadedReady={downloadedReady}
+ inventoryError={inventoryError}
+ query={query}
+ scrollElement={downloadedScrollEl}
+ activeCheckpoint={activeCheckpoint}
+ activeGgufVariant={activeGgufVariant}
+ isDataset={isDataset}
+ inventoryTokens={inventoryTokens}
+ deviceType={deviceType}
+ compact={splitView}
+ columns={discoverView === "two" ? 2 : 1}
+ sort={inventorySort}
+ onInventoryChange={onInventoryChange}
+ />
+ </div>
) : (
<div
aria-hidden="true"
diff --git a/studio/frontend/src/features/hub/catalog/models-header.tsx b/studio/frontend/src/features/hub/catalog/models-header.tsx
index 04a6e6c718c..f5afce5c59f 100644
--- a/studio/frontend/src/features/hub/catalog/models-header.tsx
+++ b/studio/frontend/src/features/hub/catalog/models-header.tsx
@@ -9,13 +9,12 @@ import {
TooltipContent,
TooltipTrigger,
} from "@/components/ui/tooltip";
-import { cn } from "@/lib/utils";
import {
ChipIcon,
Database02Icon,
- RemoveCircleIcon,
PackageIcon,
RamMemoryIcon,
+ RemoveCircleIcon,
} from "@hugeicons/core-free-icons";
import type { IconSvgElement } from "@hugeicons/react";
import { HugeiconsIcon } from "@hugeicons/react";
@@ -24,30 +23,17 @@ function StatPill({
icon,
label,
value,
- tone = "default",
}: {
icon: IconSvgElement;
label: string;
value: string;
- tone?: "default" | "active";
}) {
return (
- <Tooltip>
- <TooltipTrigger asChild>
- <div
- className={cn(
- "inline-flex cursor-default items-center gap-1.5 px-2.5 py-1 text-[11.5px] transition-colors duration-150",
- tone === "active"
- ? "rounded-full bg-emerald-500/10 text-emerald-700 ring-1 ring-inset ring-emerald-500/20 dark:text-emerald-300"
- : "hub-tag-soft text-muted-foreground hover:text-foreground/80",
- )}
- >
- <HugeiconsIcon icon={icon} strokeWidth={1.75} className="size-3.5" />
- <span className="font-medium tabular-nums">{value}</span>
- </div>
- </TooltipTrigger>
- <TooltipContent className="tooltip-compact">{label}</TooltipContent>
- </Tooltip>
+ <span className="hub-stat-pill">
+ <HugeiconsIcon icon={icon} strokeWidth={1.75} className="size-3.5" />
+ <span className="hub-stat-pill-value">{value}</span>
+ <span>{label}</span>
+ </span>
);
}
@@ -59,6 +45,7 @@ export function ModelsHeader({
ramLabel,
activeCheckpoint,
activeGgufVariant,
+ onTitleClick,
onEject,
}: {
cachedCount: number;
@@ -68,20 +55,22 @@ export function ModelsHeader({
ramLabel: string;
activeCheckpoint: string | null;
activeGgufVariant: string | null;
+ onTitleClick: () => void;
onEject: () => void;
}) {
return (
<header className="font-heading flex flex-col gap-3 sm:flex-row sm:flex-wrap sm:items-center sm:justify-between">
<PageHeading
title="Hub"
+ onTitleClick={onTitleClick}
subtitle={
isDataset
? "Discover, download, and train on datasets locally."
- : "Discover, download, and run models locally."
+ : "Discover, download, and run inference models locally."
}
/>
- <div className="flex flex-wrap items-center gap-1.5">
+ <div className="flex min-w-0 flex-wrap items-center justify-end gap-1.5 sm:flex-1">
<HfTokenIndicator />
<TransportToggle />
<StatPill
diff --git a/studio/frontend/src/features/hub/catalog/models-table.tsx b/studio/frontend/src/features/hub/catalog/models-table.tsx
new file mode 100644
index 00000000000..a62806dcb62
--- /dev/null
+++ b/studio/frontend/src/features/hub/catalog/models-table.tsx
@@ -0,0 +1,894 @@
+// SPDX-License-Identifier: AGPL-3.0-only
+// Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0
+
+import {
+ DropdownMenu,
+ DropdownMenuContent,
+ DropdownMenuItem,
+ DropdownMenuTrigger,
+} from "@/components/ui/dropdown-menu";
+import {
+ Tooltip,
+ TooltipContent,
+ TooltipTrigger,
+} from "@/components/ui/tooltip";
+import { classifyUnslothSupport } from "@/features/hub/hooks/use-hub-model-search";
+import {
+ formatRelativeLong,
+ formatRelativeShort,
+} from "@/features/hub/lib/format";
+import {
+ formatModelParamLabel,
+ formatPipelineTag,
+} from "@/features/hub/lib/view-models";
+import { copyToClipboard } from "@/lib/copy-to-clipboard";
+import { cn, formatCompact } from "@/lib/utils";
+import {
+ ArrowLeft01Icon,
+ Copy01Icon,
+ Download01Icon,
+ FavouriteIcon,
+ LayoutTwoColumnIcon,
+ LeftToRightListBulletIcon,
+ LinkSquare02Icon,
+ MoreVerticalIcon,
+ Refresh01Icon,
+ ViewSidebarLeftIcon,
+} from "@hugeicons/core-free-icons";
+import type { IconSvgElement } from "@hugeicons/react";
+import { HugeiconsIcon } from "@hugeicons/react";
+import { Fragment, type ReactNode, memo, useMemo } from "react";
+import { confirmExternalLink } from "../stores/external-link-confirm";
+import type { DiscoverRow } from "../types";
+import { HubOptionMenu } from "./hub-option-menu";
+import { buildRowStatusTooltip } from "./models-catalog-rows";
+import { OwnerAvatar } from "./owner-avatar";
+import { AccessGlyphs, CapabilityPill } from "./shared";
+
+export const RESULT_CARD_HEIGHT_PX = 78;
+export const RESULT_ROW_GAP_PX = 8;
+export const RESULT_ROW_HEIGHT_PX = RESULT_CARD_HEIGHT_PX + RESULT_ROW_GAP_PX;
+export const RESULT_GRID_HEIGHT_PX = 64;
+export const RESULT_GRID_ROW_GAP_PX = 8;
+export const RESULT_GRID_ROW_HEIGHT_PX =
+ RESULT_GRID_HEIGHT_PX + RESULT_GRID_ROW_GAP_PX;
+// Compact rows for the split-view master pane.
+export const RESULT_SPLIT_HEIGHT_PX = 56;
+export const RESULT_SPLIT_ROW_HEIGHT_PX =
+ RESULT_SPLIT_HEIGHT_PX + RESULT_ROW_GAP_PX;
+
+export type AllModelsView = "grid" | "two" | "split";
+
+// Shared column widths so header and rows align: two flexible lead columns
+// (Model, Capabilities) plus fixed metric columns that drop on narrow viewports.
+const LIST_COLS = {
+ model: "flex min-w-0 flex-[2.4] items-center gap-3",
+ caps: "hidden min-w-0 flex-[1.7] items-center gap-1.5 md:flex",
+ capsModel: "hidden w-[132px] shrink-0 items-center gap-1.5 md:flex",
+ size: "hidden w-[60px] shrink-0 lg:block",
+ updated: "hidden w-[82px] shrink-0 xl:block",
+ downloads: "hidden w-[104px] shrink-0 items-center gap-1.5 sm:flex",
+ likes: "hidden w-[76px] shrink-0 items-center gap-1.5 sm:flex",
+ actions: "flex w-[64px] shrink-0 items-center justify-end gap-0.5",
+} as const;
+
+function ViewToggleButton({
+ active,
+ label,
+ icon,
+ onClick,
+}: {
+ active: boolean;
+ label: string;
+ icon: IconSvgElement;
+ onClick: () => void;
+}) {
+ return (
+ <Tooltip>
+ <TooltipTrigger asChild={true}>
+ <button
+ type="button"
+ aria-pressed={active}
+ aria-label={label}
+ onClick={onClick}
+ className={cn(
+ "relative z-10 inline-flex size-8 cursor-pointer items-center justify-center rounded-full transition-colors",
+ active
+ ? "text-foreground"
+ : "text-muted-foreground hover:text-foreground",
+ )}
+ >
+ <HugeiconsIcon icon={icon} strokeWidth={1.75} className="size-3.5" />
+ </button>
+ </TooltipTrigger>
+ <TooltipContent side="bottom" className="tooltip-compact">
+ {label}
+ </TooltipContent>
+ </Tooltip>
+ );
+}
+
+export type InventorySort = "recent" | "name" | "size";
+
+const INVENTORY_SORTS: { value: InventorySort; label: string }[] = [
+ { value: "recent", label: "Recent" },
+ { value: "name", label: "Name" },
+ { value: "size", label: "Size" },
+];
+
+// Sort picker as a compact dropdown pill so it sits beside the view-mode tabs.
+export function InventorySortControl({
+ value,
+ onChange,
+}: {
+ value: InventorySort;
+ onChange: (value: InventorySort) => void;
+}) {
+ return (
+ <HubOptionMenu<InventorySort>
+ value={value}
+ options={INVENTORY_SORTS}
+ onValueChange={onChange}
+ ariaLabel="Sort downloads"
+ align="end"
+ className="h-8 text-[11.5px]"
+ />
+ );
+}
+
+export function HubListHeader({
+ title,
+ subtitle,
+ count,
+ view,
+ onViewChange,
+ onBack,
+ onRefresh,
+ isRefreshing,
+ actions,
+}: {
+ title: string;
+ subtitle?: string;
+ count?: number;
+ view?: AllModelsView;
+ onViewChange?: (view: AllModelsView) => void;
+ onBack?: () => void;
+ onRefresh?: () => void;
+ isRefreshing?: boolean;
+ actions?: ReactNode;
+}) {
+ const accessibleLabel =
+ count && count > 0 ? `${title} (${count.toLocaleString()})` : undefined;
+
+ return (
+ <div
+ className="flex items-center justify-between gap-4 pb-3"
+ aria-label={accessibleLabel}
+ >
+ <div className="flex min-w-0 items-center gap-1.5">
+ {onBack && (
+ <button
+ type="button"
+ onClick={onBack}
+ aria-label="Back to feed"
+ // Pull the button left so the inset chevron lines up with the
+ // avatars below, just inside the row hover's left edge.
+ className="hub-section-chevron -ml-3 inline-flex size-8 shrink-0 cursor-pointer items-center justify-center rounded-full text-muted-foreground"
+ >
+ <HugeiconsIcon
+ icon={ArrowLeft01Icon}
+ strokeWidth={2}
+ className="size-4"
+ />
+ </button>
+ )}
+ <div className="min-w-0 space-y-0.5">
+ <h2 className="text-[18px] font-semibold tracking-[-0.02em] text-foreground">
+ {title}
+ </h2>
+ {subtitle && (
+ <p className="text-[12.5px] leading-tight text-muted-foreground">
+ {subtitle}
+ </p>
+ )}
+ </div>
+ {onRefresh && (
+ <Tooltip>
+ <TooltipTrigger asChild={true}>
+ <button
+ type="button"
+ aria-label="Refresh"
+ onClick={onRefresh}
+ // Tiny drop so the icon aligns with the heading text.
+ className="inline-flex size-7 shrink-0 translate-y-px cursor-pointer items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-muted hover:text-foreground"
+ >
+ <HugeiconsIcon
+ icon={Refresh01Icon}
+ strokeWidth={1.75}
+ className={cn("size-[11px]", isRefreshing && "animate-spin")}
+ />
+ </button>
+ </TooltipTrigger>
+ <TooltipContent side="bottom" className="tooltip-compact">
+ Refresh from Hugging Face
+ </TooltipContent>
+ </Tooltip>
+ )}
+ </div>
+ {(actions || onViewChange) && (
+ <div className="flex shrink-0 items-center gap-2">
+ {actions}
+ {onViewChange && (
+ <div
+ className="hub-tab-toggle relative inline-flex h-8 shrink-0 items-center rounded-full"
+ aria-label="Results layout"
+ >
+ <span
+ aria-hidden="true"
+ className="hub-tab-toggle-pill pointer-events-none absolute inset-y-0 left-0 w-8 rounded-full transition-transform duration-200 ease-out"
+ style={{
+ transform: `translateX(${
+ (view === "split" ? 1 : view === "grid" ? 2 : 0) * 100
+ }%)`,
+ }}
+ />
+ <ViewToggleButton
+ active={view === "two"}
+ label="Two columns"
+ icon={LayoutTwoColumnIcon}
+ onClick={() => onViewChange("two")}
+ />
+ <ViewToggleButton
+ active={view === "split"}
+ label="Split view"
+ icon={ViewSidebarLeftIcon}
+ onClick={() => onViewChange("split")}
+ />
+ <ViewToggleButton
+ active={view === "grid"}
+ label="Compact"
+ icon={LeftToRightListBulletIcon}
+ onClick={() => onViewChange("grid")}
+ />
+ </div>
+ )}
+ </div>
+ )}
+ </div>
+ );
+}
+
+export function ResultListHeader({ isDataset }: { isDataset: boolean }) {
+ return (
+ <div className="flex w-full items-center gap-3 px-4 pb-2 text-[11px] font-medium text-muted-foreground/55">
+ <span className={LIST_COLS.model}>{isDataset ? "Dataset" : "Model"}</span>
+ <span className={isDataset ? LIST_COLS.caps : LIST_COLS.capsModel}>
+ {isDataset ? "Details" : "Capabilities"}
+ </span>
+ <span className={LIST_COLS.size}>Size</span>
+ <span className={LIST_COLS.updated}>Updated</span>
+ <span className={LIST_COLS.downloads}>Downloads</span>
+ <span className={LIST_COLS.likes}>Likes</span>
+ <span className={LIST_COLS.actions} aria-hidden="true" />
+ </div>
+ );
+}
+
+const STATUS_DOT_CLASS = "inline-block size-[6px] shrink-0 rounded-full";
+
+function TitleMarkers({
+ format,
+ gated,
+ isPrivate,
+ partial,
+ unsupported,
+ onDevice,
+}: {
+ format?: "gguf" | "checkpoint" | null;
+ gated?: false | "auto" | "manual";
+ isPrivate?: boolean;
+ partial: boolean;
+ unsupported: boolean;
+ onDevice: boolean;
+}) {
+ return (
+ <span className="flex shrink-0 items-center gap-1.5">
+ {format === "gguf" && (
+ <span
+ role="img"
+ aria-label="GGUF"
+ className={cn(STATUS_DOT_CLASS, "bg-format-gguf")}
+ />
+ )}
+ {format === "checkpoint" && (
+ <span
+ role="img"
+ aria-label="Safetensors"
+ className={cn(STATUS_DOT_CLASS, "bg-format-checkpoint")}
+ />
+ )}
+ <AccessGlyphs gated={gated} isPrivate={isPrivate} tooltip={false} />
+ {partial && (
+ <span
+ role="img"
+ aria-label="Partial download"
+ className={cn(STATUS_DOT_CLASS, "bg-status-warning")}
+ />
+ )}
+ {unsupported && (
+ <span
+ role="img"
+ aria-label="May not be supported yet"
+ className={cn(STATUS_DOT_CLASS, "bg-status-danger")}
+ />
+ )}
+ {onDevice && (
+ <span
+ role="img"
+ aria-label="On device"
+ className={cn(STATUS_DOT_CLASS, "bg-status-success")}
+ />
+ )}
+ </span>
+ );
+}
+
+function VerifiedOwner({ owner }: { owner: string }) {
+ return (
+ <span className="flex min-w-0 items-center gap-1">
+ <span className="truncate">{owner}</span>
+ {owner.toLowerCase() === "unsloth" && (
+ <span
+ aria-label="Verified Unsloth"
+ className="hub-verified-badge size-3.5 shrink-0 text-primary"
+ />
+ )}
+ </span>
+ );
+}
+
+function StatItem({ icon, value }: { icon: IconSvgElement; value: string }) {
+ return (
+ <span className="flex shrink-0 items-center gap-1.5">
+ <HugeiconsIcon
+ icon={icon}
+ strokeWidth={1.75}
+ className="size-3.5 shrink-0"
+ />
+ {value}
+ </span>
+ );
+}
+
+function CapabilitiesCell({
+ row,
+ taskLabel,
+ onSelect,
+}: {
+ row: DiscoverRow;
+ taskLabel: string | null;
+ onSelect: (id: string) => void;
+}) {
+ const caps = row.capabilities;
+ if (caps.length === 0 && !taskLabel) {
+ return null;
+ }
+ const max = 3;
+ const shown = caps.slice(0, max);
+ const extra = caps.length - shown.length;
+ return (
+ <Tooltip>
+ <TooltipTrigger asChild={true}>
+ <div
+ className="pointer-events-auto flex w-full min-w-0 cursor-pointer items-center gap-1.5"
+ onClick={(event) => {
+ event.stopPropagation();
+ onSelect(row.id);
+ }}
+ >
+ {shown.map((capability) => (
+ <CapabilityPill
+ key={capability.key}
+ capability={capability}
+ iconOnly={true}
+ tooltip={false}
+ />
+ ))}
+ {extra > 0 && <span className="hub-chip shrink-0">+{extra}</span>}
+ {shown.length === 0 && taskLabel && (
+ <span className="truncate text-[12px] text-muted-foreground/75">
+ {taskLabel}
+ </span>
+ )}
+ </div>
+ </TooltipTrigger>
+ <TooltipContent side="top" align="start" className="tooltip-compact">
+ <div className="flex flex-col items-start gap-1">
+ {taskLabel && (
+ <span className="text-[11px] font-medium text-muted-foreground">
+ {taskLabel}
+ </span>
+ )}
+ {caps.map((capability) => (
+ <CapabilityPill key={capability.key} capability={capability} />
+ ))}
+ </div>
+ </TooltipContent>
+ </Tooltip>
+ );
+}
+
+function RowActions({
+ row,
+ isDataset,
+ onSelect,
+}: {
+ row: DiscoverRow;
+ isDataset: boolean;
+ onSelect: (id: string) => void;
+}) {
+ const hfUrl = `https://huggingface.co/${isDataset ? "datasets/" : ""}${row.result.id}`;
+ const actionClass =
+ "pointer-events-auto inline-flex size-7 shrink-0 cursor-pointer items-center justify-center rounded-full text-muted-foreground/70 transition-colors hover:bg-foreground/[0.07] hover:text-foreground focus-visible:text-foreground data-[state=open]:bg-foreground/[0.07] data-[state=open]:text-foreground";
+ return (
+ <>
+ <Tooltip>
+ <TooltipTrigger asChild={true}>
+ <button
+ type="button"
+ aria-label={`Get ${row.repo}`}
+ onClick={(event) => {
+ event.stopPropagation();
+ onSelect(row.id);
+ }}
+ className={actionClass}
+ >
+ <HugeiconsIcon
+ icon={Download01Icon}
+ strokeWidth={1.75}
+ className="size-4"
+ />
+ </button>
+ </TooltipTrigger>
+ <TooltipContent side="top" className="tooltip-compact">
+ {isDataset ? "View dataset" : "View and download"}
+ </TooltipContent>
+ </Tooltip>
+ <DropdownMenu>
+ <DropdownMenuTrigger asChild={true}>
+ <button
+ type="button"
+ aria-label={`More options for ${row.repo}`}
+ onClick={(event) => event.stopPropagation()}
+ className={actionClass}
+ >
+ <HugeiconsIcon
+ icon={MoreVerticalIcon}
+ strokeWidth={1.75}
+ className="size-4"
+ />
+ </button>
+ </DropdownMenuTrigger>
+ <DropdownMenuContent align="end" className="min-w-[184px]">
+ <DropdownMenuItem
+ onClick={async (event) => {
+ event.stopPropagation();
+ await copyToClipboard(row.result.id);
+ }}
+ >
+ <HugeiconsIcon
+ icon={Copy01Icon}
+ strokeWidth={1.75}
+ className="size-4"
+ />
+ Copy ID
+ </DropdownMenuItem>
+ <DropdownMenuItem
+ onClick={(event) => {
+ event.stopPropagation();
+ if (!confirmExternalLink(hfUrl)) {
+ window.open(hfUrl, "_blank", "noopener,noreferrer");
+ }
+ }}
+ >
+ <HugeiconsIcon
+ icon={LinkSquare02Icon}
+ strokeWidth={1.75}
+ className="size-4"
+ />
+ Open on Hugging Face
+ </DropdownMenuItem>
+ </DropdownMenuContent>
+ </DropdownMenu>
+ </>
+ );
+}
+
+function useResultRowModel(
+ row: DiscoverRow,
+ deviceType: string | null,
+ isDataset: boolean,
+) {
+ const support = useMemo(
+ () =>
+ isDataset
+ ? null
+ : classifyUnslothSupport({
+ modelId: row.id,
+ pipelineTag: row.result.pipelineTag,
+ tags: row.result.tags,
+ libraryName: row.result.libraryName,
+ deviceType,
+ quantMethod: row.result.quantMethod,
+ }),
+ [isDataset, row.id, row.result, deviceType],
+ );
+ const sizeLabel = formatModelParamLabel(row.repo, row.result.totalParams);
+ const taskLabel = isDataset ? null : formatPipelineTag(row.result.pipelineTag);
+ const unsupported = support?.status === "unsupported";
+ return {
+ support,
+ unsupported,
+ partial: row.isAvailableOnDevice && row.isPartialOnDevice,
+ onDevice: row.isAvailableOnDevice && !row.isPartialOnDevice,
+ sizeLabel: sizeLabel !== "N/A" ? sizeLabel : null,
+ taskLabel,
+ };
+}
+
+export const ResultCard = memo(function ResultCard({
+ row,
+ deviceType,
+ isDataset,
+ onSelect,
+}: {
+ row: DiscoverRow;
+ deviceType: string | null;
+ isDataset: boolean;
+ onSelect: (id: string) => void;
+}) {
+ const { support, unsupported, partial, onDevice, sizeLabel, taskLabel } =
+ useResultRowModel(row, deviceType, isDataset);
+ const format = isDataset ? null : row.result.isGguf ? "gguf" : "checkpoint";
+ const tip = buildRowStatusTooltip({
+ partialRepoId: partial ? row.result.id : undefined,
+ unsupported,
+ unsupportedReason: support?.reason ?? null,
+ resourceLabel: isDataset ? "dataset" : "model",
+ });
+
+ const textParts: Array<{ key: string; node: ReactNode }> = [];
+ if (taskLabel) {
+ textParts.push({
+ key: "task",
+ node: <span className="min-w-0 truncate">{taskLabel}</span>,
+ });
+ }
+ if (sizeLabel) {
+ textParts.push({
+ key: "size",
+ node: <span className="shrink-0">{sizeLabel}</span>,
+ });
+ }
+ if (row.result.updatedAt) {
+ textParts.push({
+ key: "updated",
+ node: (
+ <span className="shrink-0">
+ Updated {formatRelativeLong(row.result.updatedAt)}
+ </span>
+ ),
+ });
+ }
+
+ const card = (
+ <button
+ type="button"
+ aria-label={row.repo}
+ onClick={() => onSelect(row.id)}
+ className="hub-result-row hub-result-card group/row flex h-full w-full cursor-pointer items-center gap-3.5 px-4 text-left outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset"
+ >
+ <OwnerAvatar
+ owner={row.owner}
+ repoName={row.repo}
+ className="size-[52px] shrink-0 rounded-[16px] text-[16px] ring-1 ring-black/5 dark:ring-white/10"
+ remote={false}
+ />
+ <div className="flex min-w-0 flex-1 flex-col">
+ <div className="flex min-w-0 items-center gap-2">
+ <span className="truncate text-[15px] font-semibold leading-[18px] text-foreground">
+ {row.repo}
+ </span>
+ <TitleMarkers
+ format={format}
+ gated={row.result.gated}
+ isPrivate={row.result.private}
+ partial={partial}
+ unsupported={unsupported}
+ onDevice={onDevice}
+ />
+ </div>
+ <span className="flex min-w-0 items-center gap-1 text-[12.5px] leading-[16px] text-muted-foreground/80">
+ <VerifiedOwner owner={row.owner} />
+ </span>
+ <div className="flex min-w-0 items-center gap-2 overflow-hidden text-[11.5px] leading-[16px] tabular-nums text-muted-foreground/65">
+ {textParts.map((part, index) => (
+ <Fragment key={part.key}>
+ {index > 0 && (
+ <span
+ aria-hidden="true"
+ className="shrink-0 text-muted-foreground/35"
+ >
+ •
+ </span>
+ )}
+ {part.node}
+ </Fragment>
+ ))}
+ <span className="hub-meta-tag">
+ <HugeiconsIcon
+ icon={Download01Icon}
+ strokeWidth={1.75}
+ className="size-3 shrink-0"
+ />
+ {formatCompact(row.result.downloads)}
+ </span>
+ <span className="hub-meta-tag">
+ <HugeiconsIcon
+ icon={FavouriteIcon}
+ strokeWidth={1.75}
+ className="size-3 shrink-0"
+ />
+ {formatCompact(row.result.likes)}
+ </span>
+ </div>
+ </div>
+ </button>
+ );
+
+ if (!tip) {
+ return card;
+ }
+ return (
+ <Tooltip>
+ <TooltipTrigger asChild={true}>{card}</TooltipTrigger>
+ <TooltipContent side="top" className="tooltip-compact max-w-[260px]">
+ {tip}
+ </TooltipContent>
+ </Tooltip>
+ );
+});
+
+export const ResultGridRow = memo(function ResultGridRow({
+ row,
+ deviceType,
+ isDataset,
+ onSelect,
+}: {
+ row: DiscoverRow;
+ deviceType: string | null;
+ isDataset: boolean;
+ onSelect: (id: string) => void;
+}) {
+ const { support, unsupported, partial, onDevice, sizeLabel, taskLabel } =
+ useResultRowModel(row, deviceType, isDataset);
+ const sizeDisplay = isDataset ? null : sizeLabel;
+ const format = isDataset ? null : row.result.isGguf ? "gguf" : "checkpoint";
+ const tip = buildRowStatusTooltip({
+ partialRepoId: partial ? row.result.id : undefined,
+ unsupported,
+ unsupportedReason: support?.reason ?? null,
+ resourceLabel: isDataset ? "dataset" : "model",
+ });
+ const overlayButton = (
+ <button
+ type="button"
+ aria-label={row.repo}
+ onClick={() => onSelect(row.id)}
+ className="absolute inset-0 z-0 cursor-pointer rounded-[inherit] outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset"
+ />
+ );
+
+ return (
+ <div className="hub-result-row group/row relative flex h-full w-full items-center gap-3 px-4">
+ {tip ? (
+ <Tooltip>
+ <TooltipTrigger asChild={true}>{overlayButton}</TooltipTrigger>
+ <TooltipContent
+ side="top"
+ align="start"
+ className="tooltip-compact max-w-[280px]"
+ >
+ {tip}
+ </TooltipContent>
+ </Tooltip>
+ ) : (
+ overlayButton
+ )}
+ <div className="pointer-events-none relative z-[1] flex w-full items-center gap-3">
+ <div className={LIST_COLS.model}>
+ <OwnerAvatar
+ owner={row.owner}
+ repoName={row.repo}
+ className="size-9 shrink-0 rounded-[12px] text-[13px] ring-1 ring-black/5 dark:ring-white/10"
+ remote={false}
+ />
+ <div className="min-w-0 flex-1">
+ <div className="flex min-w-0 items-center gap-1.5">
+ <span className="truncate text-[13.5px] font-semibold leading-[17px] text-foreground">
+ {row.repo}
+ </span>
+ <TitleMarkers
+ format={format}
+ gated={row.result.gated}
+ isPrivate={row.result.private}
+ partial={partial}
+ unsupported={unsupported}
+ onDevice={onDevice}
+ />
+ </div>
+ <span className="mt-0.5 flex min-w-0 items-center gap-1 text-[11.5px] leading-[15px] text-muted-foreground/80">
+ <VerifiedOwner owner={row.owner} />
+ </span>
+ </div>
+ </div>
+ <div className={isDataset ? LIST_COLS.caps : LIST_COLS.capsModel}>
+ {isDataset ? (
+ row.summary ? (
+ <span className="truncate text-[12px] text-muted-foreground/75">
+ {row.summary}
+ </span>
+ ) : null
+ ) : (
+ <CapabilitiesCell
+ row={row}
+ taskLabel={taskLabel}
+ onSelect={onSelect}
+ />
+ )}
+ </div>
+ <div
+ className={cn(
+ LIST_COLS.size,
+ "truncate text-[12px] tabular-nums text-muted-foreground",
+ )}
+ >
+ {sizeDisplay ?? "—"}
+ </div>
+ <div
+ className={cn(
+ LIST_COLS.updated,
+ "truncate text-[12px] tabular-nums text-muted-foreground",
+ )}
+ >
+ {formatRelativeShort(row.result.updatedAt)}
+ </div>
+ <div
+ className={cn(
+ LIST_COLS.downloads,
+ "text-[12px] tabular-nums text-muted-foreground",
+ )}
+ >
+ <StatItem
+ icon={Download01Icon}
+ value={formatCompact(row.result.downloads)}
+ />
+ </div>
+ <div
+ className={cn(
+ LIST_COLS.likes,
+ "text-[12px] tabular-nums text-muted-foreground",
+ )}
+ >
+ <StatItem
+ icon={FavouriteIcon}
+ value={formatCompact(row.result.likes)}
+ />
+ </div>
+ <div className={LIST_COLS.actions}>
+ <RowActions row={row} isDataset={isDataset} onSelect={onSelect} />
+ </div>
+ </div>
+ </div>
+ );
+});
+
+// Compact master-pane row for split view: avatar + name/owner left, stats right,
+// with a selected highlight for the model shown in the detail pane.
+export const ResultSplitRow = memo(function ResultSplitRow({
+ row,
+ deviceType,
+ isDataset,
+ selected,
+ onSelect,
+}: {
+ row: DiscoverRow;
+ deviceType: string | null;
+ isDataset: boolean;
+ selected: boolean;
+ onSelect: (id: string) => void;
+}) {
+ const { support, unsupported, partial, onDevice } = useResultRowModel(
+ row,
+ deviceType,
+ isDataset,
+ );
+ const format = isDataset ? null : row.result.isGguf ? "gguf" : "checkpoint";
+ const tip = buildRowStatusTooltip({
+ partialRepoId: partial ? row.result.id : undefined,
+ unsupported,
+ unsupportedReason: support?.reason ?? null,
+ resourceLabel: isDataset ? "dataset" : "model",
+ });
+ const node = (
+ <button
+ type="button"
+ aria-label={row.repo}
+ aria-current={selected || undefined}
+ data-selected={selected || undefined}
+ onClick={() => onSelect(row.id)}
+ className="group/row flex h-full w-full cursor-pointer items-center gap-2.5 rounded-[12px] px-2.5 text-left outline-none transition-colors hover:bg-foreground/[0.04] data-[selected]:bg-foreground/[0.07] focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset dark:hover:bg-white/[0.05] dark:data-[selected]:bg-white/[0.08]"
+ >
+ <OwnerAvatar
+ owner={row.owner}
+ repoName={row.repo}
+ className="size-8 shrink-0 rounded-[9px] text-[12px]"
+ remote={false}
+ />
+ <div className="flex min-w-0 flex-1 flex-col">
+ <div className="flex min-w-0 items-center gap-1.5">
+ <span className="truncate text-[12.5px] font-semibold leading-[16px] text-foreground">
+ {row.repo}
+ </span>
+ <TitleMarkers
+ format={format}
+ gated={row.result.gated}
+ isPrivate={row.result.private}
+ partial={partial}
+ unsupported={unsupported}
+ onDevice={onDevice}
+ />
+ </div>
+ <span className="mt-0.5 flex min-w-0 items-center gap-1 text-[10.5px] leading-[14px] text-muted-foreground/80">
+ <VerifiedOwner owner={row.owner} />
+ </span>
+ </div>
+ <div className="flex shrink-0 flex-col items-end gap-0.5 text-[10.5px] tabular-nums text-muted-foreground/70">
+ <div className="flex items-center gap-2">
+ <span className="inline-flex items-center gap-1">
+ <HugeiconsIcon
+ icon={FavouriteIcon}
+ strokeWidth={1.75}
+ className="size-[11px] shrink-0"
+ />
+ {formatCompact(row.result.likes)}
+ </span>
+ <span className="inline-flex items-center gap-1">
+ <HugeiconsIcon
+ icon={Download01Icon}
+ strokeWidth={1.75}
+ className="size-[11px] shrink-0"
+ />
+ {formatCompact(row.result.downloads)}
+ </span>
+ </div>
+ {row.result.updatedAt && (
+ <span className="text-muted-foreground/60">
+ {formatRelativeShort(row.result.updatedAt)}
+ </span>
+ )}
+ </div>
+ </button>
+ );
+ if (!tip) {
+ return node;
+ }
+ return (
+ <Tooltip>
+ <TooltipTrigger asChild={true}>{node}</TooltipTrigger>
+ <TooltipContent side="top" className="tooltip-compact max-w-[260px]">
+ {tip}
+ </TooltipContent>
+ </Tooltip>
+ );
+});
diff --git a/studio/frontend/src/features/hub/catalog/models-toolbar.tsx b/studio/frontend/src/features/hub/catalog/models-toolbar.tsx
index 87188f3447b..7c9071daad7 100644
--- a/studio/frontend/src/features/hub/catalog/models-toolbar.tsx
+++ b/studio/frontend/src/features/hub/catalog/models-toolbar.tsx
@@ -11,10 +11,11 @@ import {
import { cn } from "@/lib/utils";
import {
AiChipIcon,
+ CancelCircleIcon,
Database02Icon,
FolderSearchIcon,
- Refresh01Icon,
Search01Icon,
+ SlidersHorizontalIcon,
} from "@hugeicons/core-free-icons";
import { HugeiconsIcon } from "@hugeicons/react";
import type { HfSortKey } from "@/features/hub/hooks/use-hub-model-search";
@@ -24,17 +25,23 @@ import type {
ModelsTab,
ResourceTypeFilter,
} from "../types";
-import {
- CHANNEL_PRESETS,
- type ChannelId,
- findChannel,
-} from "../lib/channels";
import {
CAPABILITY_FILTER_OPTIONS,
FORMAT_FILTER_OPTIONS,
} from "../lib/view-models";
import { HubOptionMenu, type HubOption } from "./hub-option-menu";
-import { memo, useMemo } from "react";
+import {
+ clearRecentSearches,
+ recordRecentSearch,
+ removeRecentSearch,
+ useRecentSearches,
+} from "../lib/recent-searches";
+import { RecentSearches } from "./recent-searches";
+import { memo, useMemo, useState } from "react";
+
+// Widened so the format dropdown can carry the "Fine-tune ready" pseudo-option,
+// which opens the curated channel instead of becoming the active format filter.
+type FormatMenuValue = ModelFormatFilter | "finetune";
const SORT_OPTIONS: ReadonlyArray<{
value: HfSortKey;
@@ -47,8 +54,6 @@ const SORT_OPTIONS: ReadonlyArray<{
{ value: "createdAt", label: "Newest" },
];
-type ChannelOptionValue = "all" | ChannelId;
-
export const ModelsToolbar = memo(function ModelsToolbar({
tab,
onTabChange,
@@ -63,17 +68,14 @@ export const ModelsToolbar = memo(function ModelsToolbar({
onFormatFilterChange,
capabilityFilter,
onCapabilityFilterChange,
- activeChannelId,
- onChannelSelect,
- onRefresh,
onManageLocalFolders,
+ onOpenFineTune,
}: {
tab: ModelsTab;
onTabChange: (tab: ModelsTab) => void;
query: string;
onQueryChange: (value: string) => void;
isLoading: boolean;
- onRefresh: () => void;
sortBy: HfSortKey;
onSortChange: (value: HfSortKey) => void;
resourceType: ResourceTypeFilter;
@@ -82,39 +84,67 @@ export const ModelsToolbar = memo(function ModelsToolbar({
onFormatFilterChange: (value: ModelFormatFilter) => void;
capabilityFilter: CapabilityFilter;
onCapabilityFilterChange: (value: CapabilityFilter) => void;
- activeChannelId: ChannelId | null;
- onChannelSelect: (id: ChannelId | null) => void;
onManageLocalFolders: () => void;
+ /** Opens the curated "Fine-tune ready" channel (discover only). Exposed as a
+ * format-dropdown option rather than a standalone feed section. */
+ onOpenFineTune: () => void;
}) {
- const activeChannel = findChannel(activeChannelId);
+ // Recent searches surface while the empty search field is focused, only on
+ // Discover (on-device search is a local filter and isn't recorded).
+ const recentSearches = useRecentSearches();
+ const [searchFocused, setSearchFocused] = useState(false);
+ const isDiscover = tab === "discover";
+ const showRecentSearches =
+ isDiscover &&
+ searchFocused &&
+ query.trim() === "" &&
+ recentSearches.length > 0;
+
const isDataset = resourceType === "datasets";
- const channelValue: ChannelOptionValue = activeChannelId ?? "all";
- const formatOptions = useMemo<HubOption<ModelFormatFilter>[]>(
- () =>
- FORMAT_FILTER_OPTIONS.filter(
- // Downloaded inventory rows are never tagged mlx, so only Discover can
- // match the MLX filter; hide it elsewhere to avoid an empty list.
- (option) => option.value !== "mlx" || tab === "discover",
- ).map((option) => ({
- value: option.value,
- triggerLabel: option.label,
- label: (
- <>
+ const hasTrailing = Boolean(query) || (isDiscover && isLoading);
+ const formatOptions = useMemo<HubOption<FormatMenuValue>[]>(() => {
+ const options: HubOption<FormatMenuValue>[] = FORMAT_FILTER_OPTIONS.filter(
+ (option) => option.value !== "mlx" || tab === "discover",
+ ).map((option) => ({
+ value: option.value,
+ triggerLabel: option.label,
+ label: (
+ <>
+ <span className="flex size-3.5 shrink-0 items-center justify-center">
{option.value === "gguf" && (
- <span className="inline-block size-1.5 shrink-0 rounded-full bg-format-gguf" />
+ <span className="size-1.5 rounded-full bg-format-gguf" />
)}
{option.value === "checkpoint" && (
- <span className="inline-block size-1.5 shrink-0 rounded-full bg-format-checkpoint" />
+ <span className="size-1.5 rounded-full bg-format-checkpoint" />
)}
{option.value === "mlx" && (
- <span className="inline-block size-1.5 shrink-0 rounded-full bg-format-mlx" />
+ <span className="size-1.5 rounded-full bg-format-mlx" />
)}
- {option.label}
+ </span>
+ {option.label}
+ </>
+ ),
+ }));
+ // "Fine-tune ready" is a curated channel (bnb-4bit checkpoints), not a
+ // format: it opens the channel rather than setting the filter (onValueChange).
+ if (tab === "discover") {
+ options.push({
+ value: "finetune",
+ triggerLabel: "Fine-tune ready",
+ label: (
+ <>
+ <HugeiconsIcon
+ icon={SlidersHorizontalIcon}
+ strokeWidth={1.75}
+ className="size-3.5 shrink-0 text-muted-foreground"
+ />
+ Fine-tune ready
</>
),
- })),
- [tab],
- );
+ });
+ }
+ return options;
+ }, [tab]);
const capabilityOptions = useMemo<HubOption<CapabilityFilter>[]>(
() =>
CAPABILITY_FILTER_OPTIONS.map((option) => ({
@@ -131,31 +161,6 @@ export const ModelsToolbar = memo(function ModelsToolbar({
})),
[],
);
- const channelOptions = useMemo<HubOption<ChannelOptionValue>[]>(
- () => [
- { value: "all", label: "All models" },
- ...CHANNEL_PRESETS.map((preset) => ({
- value: preset.id,
- checkClassName: "text-primary",
- label: (
- <span className="flex w-full min-w-0 items-start gap-2">
- <HugeiconsIcon
- icon={preset.icon}
- strokeWidth={1.75}
- className="mt-0.5 size-4 shrink-0 text-muted-foreground"
- />
- <span className="flex min-w-0 flex-1 flex-col gap-0.5">
- <span className="min-w-0 truncate">{preset.label}</span>
- <span className="min-w-0 whitespace-normal break-words text-[11px] leading-snug text-muted-foreground">
- {preset.hint}
- </span>
- </span>
- </span>
- ),
- })),
- ],
- [],
- );
const triggerBase = cn(
"field-trigger hub-menu-trigger field-soft transition-colors",
"focus-visible:ring-0 focus-visible:ring-offset-0 focus-visible:border-border",
@@ -164,7 +169,7 @@ export const ModelsToolbar = memo(function ModelsToolbar({
<div className="flex min-w-0 flex-col gap-2 lg:flex-row lg:flex-nowrap lg:items-center">
<div
className={cn(
- "hub-menu-trigger hub-tab-toggle relative inline-flex h-9 w-full shrink-0 items-center rounded-full lg:w-[220px]",
+ "hub-menu-trigger hub-tab-toggle relative inline-flex h-9 w-full shrink-0 items-center rounded-full lg:w-[240px]",
)}
role="radiogroup"
aria-label="View"
@@ -207,97 +212,86 @@ export const ModelsToolbar = memo(function ModelsToolbar({
</button>
</div>
- <div className="flex min-w-0 items-center gap-2 lg:flex-[1_1_280px]">
- <div
- className="hub-menu-trigger hub-tab-toggle relative inline-flex h-9 shrink-0 items-center rounded-full"
- role="radiogroup"
- aria-label="Resource type"
- >
- <span
- aria-hidden="true"
- className={cn(
- "hub-tab-toggle-pill",
- "pointer-events-none absolute inset-y-0 left-0 w-1/2 rounded-full transition-transform duration-200 ease-out",
- resourceType === "datasets" ? "translate-x-full" : "translate-x-0",
- )}
- />
- <Tooltip>
- <TooltipTrigger asChild>
- <button
- type="button"
- role="radio"
- aria-checked={resourceType === "models"}
- aria-label="Models"
- onClick={() => onResourceTypeChange("models")}
- className={cn(
- "relative z-10 inline-flex h-9 w-9 items-center justify-center rounded-full transition-colors",
- resourceType === "models"
- ? "text-foreground"
- : "text-muted-foreground hover:text-foreground",
- )}
- >
- <HugeiconsIcon
- icon={AiChipIcon}
- strokeWidth={1.75}
- className="size-4"
- />
- </button>
- </TooltipTrigger>
- <TooltipContent side="bottom" sideOffset={6}>
- Models
- </TooltipContent>
- </Tooltip>
- <Tooltip>
- <TooltipTrigger asChild>
- <button
- type="button"
- role="radio"
- aria-checked={resourceType === "datasets"}
- aria-label="Datasets"
- onClick={() => onResourceTypeChange("datasets")}
- className={cn(
- "relative z-10 inline-flex h-9 w-9 items-center justify-center rounded-full transition-colors",
- resourceType === "datasets"
- ? "text-foreground"
- : "text-muted-foreground hover:text-foreground",
- )}
- >
- <HugeiconsIcon
- icon={Database02Icon}
- strokeWidth={1.75}
- className="size-4"
- />
- </button>
- </TooltipTrigger>
- <TooltipContent side="bottom" sideOffset={6}>
- Datasets
- </TooltipContent>
- </Tooltip>
- </div>
-
- <div className="relative min-w-0 flex-1">
+ <div className="relative min-w-0 flex-1 lg:flex-[1_1_360px]">
<HugeiconsIcon
icon={Search01Icon}
strokeWidth={1.8}
- className="pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-muted-foreground"
+ className="pointer-events-none absolute left-3.5 top-1/2 size-4 -translate-y-1/2 text-muted-foreground"
/>
<Input
+ // `type="search"` plus these flags stop password managers and noisy
+ // text assistance from acting on this field.
+ type="search"
+ name="hub-search"
+ autoComplete="off"
+ autoCorrect="off"
+ autoCapitalize="off"
+ spellCheck={false}
+ enterKeyHint="search"
+ data-1p-ignore={true}
+ data-lpignore={true}
+ data-form-type="other"
value={query}
onChange={(event) => onQueryChange(event.target.value)}
+ onFocus={() => setSearchFocused(true)}
+ onBlur={() => {
+ setSearchFocused(false);
+ if (isDiscover) {
+ recordRecentSearch(query);
+ }
+ }}
+ onKeyDown={(event) => {
+ if (event.key === "Enter" && isDiscover) {
+ recordRecentSearch(query);
+ } else if (event.key === "Escape" && showRecentSearches) {
+ event.currentTarget.blur();
+ }
+ }}
placeholder={
tab === "downloaded"
? `Search on-device ${isDataset ? "datasets" : "models"}`
- : "Search Hugging Face"
+ : isDataset
+ ? "Search datasets"
+ : "Search models"
}
- className="field-soft h-9 rounded-full pl-10 pr-10 text-[12.5px] placeholder:text-muted-foreground/80"
+ className={cn(
+ "field-soft h-9 rounded-full !border-0 pl-10 text-[13px] placeholder:text-muted-foreground/80 focus-visible:!ring-0",
+ hasTrailing ? "pr-10" : "pr-4",
+ )}
/>
- {tab === "discover" && isLoading && (
- <Spinner className="pointer-events-none absolute right-3 top-1/2 size-4 -translate-y-1/2 text-muted-foreground" />
+ {query ? (
+ <button
+ type="button"
+ aria-label="Clear search"
+ // Keep focus on the input so clearing reveals recent searches
+ // rather than dismissing the field.
+ onMouseDown={(event) => event.preventDefault()}
+ onClick={() => onQueryChange("")}
+ className="absolute right-2.5 top-1/2 inline-flex size-6 -translate-y-1/2 items-center justify-center rounded-full text-muted-foreground/70 transition-colors hover:text-foreground"
+ >
+ <HugeiconsIcon
+ icon={CancelCircleIcon}
+ strokeWidth={1.75}
+ className="size-[18px]"
+ />
+ </button>
+ ) : isDiscover && isLoading ? (
+ <Spinner className="pointer-events-none absolute right-3.5 top-1/2 size-4 -translate-y-1/2 text-muted-foreground" />
+ ) : null}
+ {showRecentSearches && (
+ <RecentSearches
+ searches={recentSearches}
+ onSelect={(value) => {
+ recordRecentSearch(value);
+ onQueryChange(value);
+ }}
+ onRemove={removeRecentSearch}
+ onClear={clearRecentSearches}
+ />
)}
</div>
- </div>
- <div className="flex min-w-0 flex-wrap items-center gap-2 lg:flex-none lg:flex-nowrap lg:justify-end">
+ <div className="flex min-w-0 flex-wrap items-center gap-2 lg:flex-[0_0_auto] lg:flex-nowrap lg:justify-end">
{tab === "downloaded" && !isDataset && (
<Tooltip>
<TooltipTrigger asChild>
@@ -324,10 +318,16 @@ export const ModelsToolbar = memo(function ModelsToolbar({
)}
{!isDataset && (
- <HubOptionMenu
+ <HubOptionMenu<FormatMenuValue>
value={formatFilter}
options={formatOptions}
- onValueChange={onFormatFilterChange}
+ onValueChange={(value) => {
+ if (value === "finetune") {
+ onOpenFineTune();
+ } else {
+ onFormatFilterChange(value);
+ }
+ }}
ariaLabel="Format filter"
className={cn(triggerBase, "w-[128px]")}
/>
@@ -353,59 +353,74 @@ export const ModelsToolbar = memo(function ModelsToolbar({
/>
)}
- {tab === "discover" && !isDataset && (
- <HubOptionMenu
- value={channelValue}
- options={channelOptions}
- onValueChange={(next) =>
- onChannelSelect(next === "all" ? null : next)
- }
- ariaLabel="Curated channels"
- title={activeChannel ? activeChannel.label : "Curated channels"}
- align="end"
- showChevron={false}
- triggerContent={
- <span
- aria-hidden="true"
- className={cn(
- "hub-verified-badge size-4",
- activeChannel ? "text-primary" : "text-muted-foreground",
- )}
- />
- }
+ <div
+ className="hub-menu-trigger hub-tab-toggle relative inline-flex h-8 shrink-0 items-center rounded-full"
+ role="radiogroup"
+ aria-label="Resource type"
+ >
+ <span
+ aria-hidden="true"
className={cn(
- triggerBase,
- "field-filter inline-flex size-9 shrink-0 items-center justify-center rounded-full p-0",
+ "hub-tab-toggle-pill",
+ // Height-filling circle (matches the 3-view-tab toggle) that slides
+ // one button-width (w-8 = 32px) between the two options.
+ "pointer-events-none absolute inset-y-0 left-0 w-8 rounded-full transition-transform duration-200 ease-out",
+ resourceType === "datasets" ? "translate-x-8" : "translate-x-0",
)}
- contentClassName="w-[calc(100vw-1.5rem)] sm:w-[320px]"
/>
- )}
-
- {tab === "discover" && (
<Tooltip>
<TooltipTrigger asChild>
<button
type="button"
- aria-label="Refresh from Hugging Face"
- onClick={onRefresh}
+ role="radio"
+ aria-checked={resourceType === "models"}
+ aria-label="Models"
+ onClick={() => onResourceTypeChange("models")}
className={cn(
- triggerBase,
- "field-filter inline-flex size-9 shrink-0 items-center justify-center rounded-full p-0",
+ "relative z-10 inline-flex size-8 items-center justify-center rounded-full transition-colors",
+ resourceType === "models"
+ ? "text-foreground"
+ : "text-muted-foreground hover:text-foreground",
)}
>
<HugeiconsIcon
- icon={Refresh01Icon}
+ icon={AiChipIcon}
strokeWidth={1.75}
- className={cn("size-4", isLoading && "animate-spin")}
+ className="size-4"
/>
</button>
</TooltipTrigger>
<TooltipContent side="bottom" sideOffset={6}>
- Refresh from Hugging Face
+ Models
</TooltipContent>
</Tooltip>
- )}
-
+ <Tooltip>
+ <TooltipTrigger asChild>
+ <button
+ type="button"
+ role="radio"
+ aria-checked={resourceType === "datasets"}
+ aria-label="Datasets"
+ onClick={() => onResourceTypeChange("datasets")}
+ className={cn(
+ "relative z-10 inline-flex size-8 items-center justify-center rounded-full transition-colors",
+ resourceType === "datasets"
+ ? "text-foreground"
+ : "text-muted-foreground hover:text-foreground",
+ )}
+ >
+ <HugeiconsIcon
+ icon={Database02Icon}
+ strokeWidth={1.75}
+ className="size-4"
+ />
+ </button>
+ </TooltipTrigger>
+ <TooltipContent side="bottom" sideOffset={6}>
+ Datasets
+ </TooltipContent>
+ </Tooltip>
+ </div>
</div>
</div>
);
diff --git a/studio/frontend/src/features/hub/catalog/on-device-folders-dialog.tsx b/studio/frontend/src/features/hub/catalog/on-device-folders-dialog.tsx
index d0d7d201b31..1769f8861aa 100644
--- a/studio/frontend/src/features/hub/catalog/on-device-folders-dialog.tsx
+++ b/studio/frontend/src/features/hub/catalog/on-device-folders-dialog.tsx
@@ -28,7 +28,7 @@ import {
Delete02Icon,
FileSearchIcon,
FolderAddIcon,
- Folder02Icon,
+ FolderOpenIcon,
FolderSearchIcon,
PlusSignIcon,
RefreshIcon,
@@ -270,7 +270,7 @@ export function OnDeviceFoldersDialog({
aria-label="Refresh locations"
onClick={refreshFolders}
disabled={loading}
- className="inline-flex size-7 items-center justify-center rounded-[8px] text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:opacity-50"
+ className="inline-flex size-7 items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:opacity-50"
>
<HugeiconsIcon
icon={RefreshIcon}
@@ -294,7 +294,7 @@ export function OnDeviceFoldersDialog({
) : sortedFolders.length === 0 ? (
<div className="flex h-28 flex-col items-center justify-center gap-2 px-4 text-center text-[12px] text-muted-foreground">
<HugeiconsIcon
- icon={Folder02Icon}
+ icon={FolderOpenIcon}
strokeWidth={1.75}
className="size-5 text-muted-foreground/60"
/>
@@ -310,7 +310,7 @@ export function OnDeviceFoldersDialog({
>
<div className="flex size-8 shrink-0 items-center justify-center rounded-[9px] bg-muted text-muted-foreground">
<HugeiconsIcon
- icon={Folder02Icon}
+ icon={FolderOpenIcon}
strokeWidth={1.75}
className="size-4"
/>
@@ -319,12 +319,19 @@ export function OnDeviceFoldersDialog({
<p className="truncate text-[12.5px] font-medium text-foreground">
{pathTail(folder.path)}
</p>
- <p
- title={folder.path}
- className="truncate font-mono text-[10.5px] text-muted-foreground"
- >
- {folder.path}
- </p>
+ <Tooltip>
+ <TooltipTrigger asChild={true}>
+ <p className="truncate font-mono text-[10.5px] text-muted-foreground">
+ {folder.path}
+ </p>
+ </TooltipTrigger>
+ <TooltipContent
+ side="bottom"
+ className="tooltip-compact max-w-xs break-all"
+ >
+ {folder.path}
+ </TooltipContent>
+ </Tooltip>
</div>
<Tooltip>
<TooltipTrigger asChild={true}>
@@ -333,7 +340,7 @@ export function OnDeviceFoldersDialog({
aria-label={`Remove ${folder.path}`}
onClick={() => void handleRemove(folder)}
disabled={pending !== null}
- className="inline-flex size-8 shrink-0 items-center justify-center rounded-[9px] text-muted-foreground transition-colors hover:bg-destructive/10 hover:text-destructive disabled:opacity-50"
+ className="inline-flex size-8 shrink-0 items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-destructive/10 hover:text-destructive disabled:opacity-50"
>
{removing ? (
<Spinner className="size-3.5" />
diff --git a/studio/frontend/src/features/hub/catalog/owner-avatar.tsx b/studio/frontend/src/features/hub/catalog/owner-avatar.tsx
index cb2adc0b051..852c09ab5f2 100644
--- a/studio/frontend/src/features/hub/catalog/owner-avatar.tsx
+++ b/studio/frontend/src/features/hub/catalog/owner-avatar.tsx
@@ -3,40 +3,20 @@
import { cn } from "@/lib/utils";
import { useEffect, useState } from "react";
+import { ownerPaletteColor } from "../lib/avatar-theme";
import { useHfOwnerAvatar } from "../lib/hf-owner-avatar";
import {
type ProviderLogo,
resolveOwnerProviderLogo,
} from "../lib/provider-logos";
-const PALETTE = [
- "hsl(214 42% 42%)",
- "hsl(172 32% 36%)",
- "hsl(30 42% 42%)",
- "hsl(348 36% 44%)",
- "hsl(198 38% 40%)",
- "hsl(140 26% 38%)",
- "hsl(222 24% 46%)",
- "hsl(16 34% 44%)",
- "hsl(260 22% 48%)",
- "hsl(44 44% 40%)",
-];
-
-function hashOwner(owner: string): number {
- let h = 0;
- for (let i = 0; i < owner.length; i++) {
- h = (h * 31 + owner.charCodeAt(i)) | 0;
- }
- return Math.abs(h);
-}
-
type AvatarSize = "xs" | "sm" | "md" | "lg";
const SIZES: Record<AvatarSize, string> = {
- xs: "size-5 rounded-[6px] text-[9px]",
- sm: "size-7 rounded-[8px] text-[11px]",
- md: "size-9 rounded-[10px] text-[13px]",
- lg: "size-12 rounded-[13px] text-[16px]",
+ xs: "size-5 rounded-[8px] text-[9px]",
+ sm: "size-7 rounded-[10px] text-[11px]",
+ md: "size-9 rounded-[12px] text-[13px]",
+ lg: "size-12 rounded-[15px] text-[16px]",
};
const AVATAR_IMAGE_RETRY_BASE_MS = 60_000;
@@ -60,13 +40,23 @@ export function OwnerAvatar({
repoName,
size = "md",
className,
+ remote = true,
}: {
owner: string;
- // For an eligible owner (currently "unsloth"), match a known upstream provider
- // and render its logo (e.g. an Unsloth Qwen2.5 re-upload shows the Qwen logo).
+ /**
+ * Repo name (after `owner/`). For an eligible owner (currently "unsloth"),
+ * renders the matched upstream provider's logo instead of the HF profile pic
+ * (e.g. an Unsloth Qwen2.5 re-upload shows the Qwen logo).
+ */
repoName?: string;
size?: AvatarSize;
className?: string;
+ /**
+ * When false, never fetch the owner's HF profile picture; show a local
+ * provider logo or colored-initial tile instantly. Virtualized list rows pass
+ * `false` to avoid a per-row request storm; the inspector keeps `true`.
+ */
+ remote?: boolean;
}) {
const providerLogo = resolveOwnerProviderLogo(owner, repoName);
if (providerLogo) {
@@ -78,7 +68,26 @@ export function OwnerAvatar({
/>
);
}
- return <DefaultAvatar owner={owner} size={size} className={className} />;
+ return (
+ <DefaultAvatar
+ owner={owner}
+ size={size}
+ className={className}
+ remote={remote}
+ />
+ );
+}
+
+export function useAvatarImageUrl(
+ owner: string,
+ repoName?: string,
+): string | null {
+ const provider = resolveOwnerProviderLogo(owner, repoName);
+ const remoteUrl = useHfOwnerAvatar(owner.trim() || "?");
+ if (provider) {
+ return provider.treatment === "original" ? provider.logoPath : null;
+ }
+ return remoteUrl;
}
function ProviderLogoTile({
@@ -110,9 +119,11 @@ function ProviderLogoTile({
<img
src={provider.logoPath}
alt=""
- loading="lazy"
+ decoding="async"
className={cn(
- fit === "cover" ? "size-full object-cover" : "size-3/4 object-contain",
+ fit === "cover"
+ ? "size-full object-cover"
+ : "size-3/4 object-contain",
)}
/>
</span>
@@ -150,15 +161,17 @@ function DefaultAvatar({
owner,
size,
className,
+ remote = true,
}: {
owner: string;
size: AvatarSize;
className?: string;
+ remote?: boolean;
}) {
const owned = owner.trim() || "?";
const initial = owned[0]?.toUpperCase() ?? "?";
- const color = PALETTE[hashOwner(owned) % PALETTE.length];
- const remoteUrl = useHfOwnerAvatar(owned);
+ const color = ownerPaletteColor(owned);
+ const remoteUrl = useHfOwnerAvatar(owned, remote);
const [failedImage, setFailedImage] = useState<FailedAvatarImage | null>(
null,
);
@@ -199,7 +212,7 @@ function DefaultAvatar({
<img
src={remoteUrl ?? ""}
alt=""
- loading="lazy"
+ decoding="async"
className="size-full object-cover"
onLoad={() => setFailedImage(null)}
onError={() => {
diff --git a/studio/frontend/src/features/hub/catalog/owner-scope-toggle.tsx b/studio/frontend/src/features/hub/catalog/owner-scope-toggle.tsx
new file mode 100644
index 00000000000..17c3f2ba342
--- /dev/null
+++ b/studio/frontend/src/features/hub/catalog/owner-scope-toggle.tsx
@@ -0,0 +1,34 @@
+// SPDX-License-Identifier: AGPL-3.0-only
+// Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0
+
+import { HubOptionMenu } from "./hub-option-menu";
+
+export type OwnerScope = "unsloth" | "all";
+
+const OPTIONS: { value: OwnerScope; label: string }[] = [
+ { value: "unsloth", label: "Unsloth" },
+ { value: "all", label: "All" },
+];
+
+/**
+ * "Unsloth / All" publisher scope as a compact dropdown pill beside the
+ * view-mode tabs. Only shown while browsing a model list, never on the hub feed.
+ */
+export function OwnerScopeToggle({
+ value,
+ onChange,
+}: {
+ value: OwnerScope;
+ onChange: (value: OwnerScope) => void;
+}) {
+ return (
+ <HubOptionMenu<OwnerScope>
+ value={value}
+ options={OPTIONS}
+ onValueChange={onChange}
+ ariaLabel="Publisher scope"
+ align="end"
+ className="h-8 text-[11.5px]"
+ />
+ );
+}
diff --git a/studio/frontend/src/features/hub/catalog/path-info-button.tsx b/studio/frontend/src/features/hub/catalog/path-info-button.tsx
index ac97d7a582c..0d5ca6e00e8 100644
--- a/studio/frontend/src/features/hub/catalog/path-info-button.tsx
+++ b/studio/frontend/src/features/hub/catalog/path-info-button.tsx
@@ -13,12 +13,9 @@ import {
TooltipContent,
TooltipTrigger,
} from "@/components/ui/tooltip";
-import { Tick02Icon } from "@/lib/tick-icon";
import { cn } from "@/lib/utils";
-import {
- Copy01Icon,
- FolderSearchIcon,
-} from "@hugeicons/core-free-icons";
+import { Copy01Icon, FolderSearchIcon } from "@hugeicons/core-free-icons";
+import { Tick02Icon } from "@/lib/tick-icon";
import { HugeiconsIcon } from "@hugeicons/react";
import type { MouseEvent } from "react";
import { useState } from "react";
@@ -56,7 +53,7 @@ export function PathInfoButton({
setOpen(true);
}}
className={cn(
- "inline-flex size-7 shrink-0 cursor-pointer items-center justify-center rounded-[8px] text-muted-foreground opacity-0 transition-[opacity,background-color,color] duration-150 hover:bg-muted hover:text-foreground focus-visible:opacity-100 group-hover/dl:opacity-100",
+ "inline-flex size-7 shrink-0 cursor-pointer items-center justify-center rounded-full text-muted-foreground opacity-0 transition-[opacity,background-color,color] duration-150 hover:bg-muted hover:text-foreground focus-visible:opacity-100 group-hover/dl:opacity-100",
className,
)}
>
diff --git a/studio/frontend/src/features/hub/catalog/recent-searches.tsx b/studio/frontend/src/features/hub/catalog/recent-searches.tsx
new file mode 100644
index 00000000000..28f4d715102
--- /dev/null
+++ b/studio/frontend/src/features/hub/catalog/recent-searches.tsx
@@ -0,0 +1,80 @@
+// SPDX-License-Identifier: AGPL-3.0-only
+// Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0
+
+import { Cancel01Icon, Clock01Icon } from "@hugeicons/core-free-icons";
+import { HugeiconsIcon } from "@hugeicons/react";
+
+/**
+ * Recent-searches suggestion panel beneath the search field. Presentational only
+ * (parent owns visibility and store). Suppresses its own mousedown so clicks fire
+ * without blurring the focused input and closing the panel.
+ */
+export function RecentSearches({
+ searches,
+ onSelect,
+ onRemove,
+ onClear,
+}: {
+ searches: string[];
+ onSelect: (query: string) => void;
+ onRemove: (query: string) => void;
+ onClear: () => void;
+}) {
+ if (searches.length === 0) {
+ return null;
+ }
+ return (
+ <div
+ className="hub-recent-panel menu-soft-surface absolute inset-x-0 top-full z-50 mt-2 overflow-hidden rounded-[16px] p-1.5"
+ aria-label="Recent searches"
+ onMouseDown={(event) => event.preventDefault()}
+ >
+ <div className="flex items-center justify-between gap-2 px-2.5 pb-1.5 pt-1">
+ <span className="text-[11px] font-semibold uppercase tracking-[0.04em] text-muted-foreground/70">
+ Recent searches
+ </span>
+ <button
+ type="button"
+ onClick={onClear}
+ className="hub-recent-clear rounded-full px-2 py-0.5 text-[11.5px] font-medium text-muted-foreground transition-colors hover:text-foreground"
+ >
+ Clear all
+ </button>
+ </div>
+ <ul className="flex flex-col">
+ {searches.map((query) => (
+ <li key={query}>
+ <div className="hub-recent-item group/recent flex items-center rounded-[10px] pr-1.5">
+ <button
+ type="button"
+ onClick={() => onSelect(query)}
+ className="flex min-w-0 flex-1 items-center gap-2.5 rounded-l-[10px] py-2 pl-2.5 text-left"
+ >
+ <HugeiconsIcon
+ icon={Clock01Icon}
+ strokeWidth={1.75}
+ className="size-4 shrink-0 text-muted-foreground/70"
+ />
+ <span className="truncate text-[13px] text-foreground">
+ {query}
+ </span>
+ </button>
+ <button
+ type="button"
+ aria-label={`Remove “${query}” from recent searches`}
+ onClick={() => onRemove(query)}
+ className="hub-recent-remove ml-1 inline-flex size-6 shrink-0 items-center justify-center rounded-full text-muted-foreground opacity-0 transition-[opacity,color,background-color] hover:text-foreground focus-visible:opacity-100 group-hover/recent:opacity-100"
+ >
+ <HugeiconsIcon
+ icon={Cancel01Icon}
+ strokeWidth={1.75}
+ className="size-3.5"
+ />
+ </button>
+ </div>
+ </li>
+ ))}
+ </ul>
+ </div>
+ );
+}
diff --git a/studio/frontend/src/features/hub/catalog/safetensors-download-card.tsx b/studio/frontend/src/features/hub/catalog/safetensors-download-card.tsx
index 5c5d3901168..ccd61c5f04b 100644
--- a/studio/frontend/src/features/hub/catalog/safetensors-download-card.tsx
+++ b/studio/frontend/src/features/hub/catalog/safetensors-download-card.tsx
@@ -244,7 +244,7 @@ export function SafetensorsDownloadCard({
<div
className={cn(
"group/pair flex h-9 shrink-0 items-stretch gap-1.5",
- // Run + Train pair hidden until Hub->chat/train pickers ship.
+ // Run+Train pair hidden until Hub→chat / Hub→train pickers ship.
!HUB_POST_DOWNLOAD_ACTIONS_VISIBLE && "hidden",
)}
>
diff --git a/studio/frontend/src/features/hub/catalog/shared.tsx b/studio/frontend/src/features/hub/catalog/shared.tsx
index d8e53fdb14e..c435afcfe64 100644
--- a/studio/frontend/src/features/hub/catalog/shared.tsx
+++ b/studio/frontend/src/features/hub/catalog/shared.tsx
@@ -3,15 +3,24 @@
import {
BrainIcon,
+ Chat01Icon,
CodeIcon,
GlobeIcon,
HeadphonesIcon,
+ LockIcon,
+ LockKeyIcon,
SparklesIcon,
ViewIcon,
Wrench01Icon,
} from "@hugeicons/core-free-icons";
import type { IconSvgElement } from "@hugeicons/react";
import { HugeiconsIcon } from "@hugeicons/react";
+import {
+ Tooltip,
+ TooltipContent,
+ TooltipTrigger,
+} from "@/components/ui/tooltip";
+import { cn } from "@/lib/utils";
import type { Capability, CapabilityKey } from "../lib/model-capabilities";
const CAPABILITY_ICON: Record<CapabilityKey, IconSvgElement> = {
@@ -22,13 +31,13 @@ const CAPABILITY_ICON: Record<CapabilityKey, IconSvgElement> = {
code: CodeIcon,
embedding: SparklesIcon,
multilingual: GlobeIcon,
+ conversational: Chat01Icon,
};
const CAPABILITY_TONE: Record<CapabilityKey, string> = {
vision:
"bg-indigo-500/10 text-indigo-700 dark:bg-indigo-400/20 dark:text-indigo-300",
- audio:
- "bg-rose-500/10 text-rose-700 dark:bg-rose-400/20 dark:text-rose-300",
+ audio: "bg-rose-500/10 text-rose-700 dark:bg-rose-400/20 dark:text-rose-300",
tools:
"bg-amber-500/10 text-amber-800 dark:bg-amber-400/20 dark:text-amber-300",
reasoning:
@@ -38,19 +47,121 @@ const CAPABILITY_TONE: Record<CapabilityKey, string> = {
"bg-emerald-500/10 text-emerald-700 dark:bg-emerald-400/20 dark:text-emerald-300",
multilingual:
"bg-sky-500/10 text-sky-700 dark:bg-sky-400/20 dark:text-sky-300",
+ conversational:
+ "bg-fuchsia-500/10 text-fuchsia-700 dark:bg-fuchsia-400/20 dark:text-fuchsia-300",
};
-export function CapabilityPill({ capability }: { capability: Capability }) {
+export function AccessChip({ label }: { label: string }) {
return (
+ <span className="inline-flex h-6 shrink-0 items-center rounded-full border border-amber-500/30 bg-amber-500/8 px-2 text-[11px] font-medium leading-none text-amber-700 dark:text-amber-300">
+ {label}
+ </span>
+ );
+}
+
+function isGatedAccess(
+ gated: false | "auto" | "manual" | undefined,
+): boolean {
+ return gated !== false && gated !== undefined;
+}
+
+function AccessGlyph({
+ icon,
+ label,
+ tooltip,
+ className,
+}: {
+ icon: IconSvgElement;
+ label: string;
+ tooltip: boolean;
+ className: string;
+}) {
+ const glyph = (
<span
- className={`inline-flex h-6 items-center gap-1.5 rounded-full px-2.5 text-[11.5px] font-medium ${CAPABILITY_TONE[capability.key]}`}
+ role="img"
+ aria-label={label}
+ className={cn("inline-flex shrink-0", className)}
+ >
+ <HugeiconsIcon icon={icon} strokeWidth={1.75} className="size-3" />
+ </span>
+ );
+ if (!tooltip) return glyph;
+ return (
+ <Tooltip>
+ <TooltipTrigger asChild={true}>{glyph}</TooltipTrigger>
+ <TooltipContent side="top" className="tooltip-compact">
+ {label}
+ </TooltipContent>
+ </Tooltip>
+ );
+}
+
+export function AccessGlyphs({
+ gated,
+ isPrivate,
+ tooltip = true,
+}: {
+ gated?: false | "auto" | "manual";
+ isPrivate?: boolean;
+ tooltip?: boolean;
+}) {
+ const gatedAccess = isGatedAccess(gated);
+ if (!gatedAccess && !isPrivate) return null;
+ return (
+ <>
+ {isPrivate && (
+ <AccessGlyph
+ icon={LockIcon}
+ label="Private"
+ tooltip={tooltip}
+ className="text-muted-foreground/70"
+ />
+ )}
+ {gatedAccess && (
+ <AccessGlyph
+ icon={LockKeyIcon}
+ label="Gated"
+ tooltip={tooltip}
+ className="text-amber-600 dark:text-amber-400"
+ />
+ )}
+ </>
+ );
+}
+
+export function CapabilityPill({
+ capability,
+ iconOnly = false,
+ tooltip = true,
+}: {
+ capability: Capability;
+ iconOnly?: boolean;
+ tooltip?: boolean;
+}) {
+ const pill = (
+ <span
+ aria-label={iconOnly ? capability.label : undefined}
+ className={cn(
+ "inline-flex h-6 shrink-0 items-center rounded-full text-[11.5px] font-medium",
+ iconOnly ? "w-6 justify-center px-0" : "gap-1.5 px-2.5",
+ CAPABILITY_TONE[capability.key],
+ )}
>
<HugeiconsIcon
icon={CAPABILITY_ICON[capability.key]}
strokeWidth={1.75}
className="size-3"
/>
- {capability.label}
+ {!iconOnly && capability.label}
</span>
);
+ if (!iconOnly || !tooltip) return pill;
+ return (
+ <Tooltip>
+ <TooltipTrigger asChild={true}>{pill}</TooltipTrigger>
+ <TooltipContent side="top" className="tooltip-compact">
+ {capability.label}
+ </TooltipContent>
+ </Tooltip>
+ );
}
diff --git a/studio/frontend/src/features/hub/catalog/transport-toggle.tsx b/studio/frontend/src/features/hub/catalog/transport-toggle.tsx
index 1fb06221eef..9202b88f45d 100644
--- a/studio/frontend/src/features/hub/catalog/transport-toggle.tsx
+++ b/studio/frontend/src/features/hub/catalog/transport-toggle.tsx
@@ -54,16 +54,18 @@ export function TransportToggle() {
<TooltipTrigger asChild={true}>
<button
type="button"
- disabled={disabled}
- onClick={() => setMode(opt.value)}
+ aria-disabled={disabled || undefined}
aria-pressed={active}
+ onClick={() => {
+ if (!disabled) setMode(opt.value);
+ }}
className={cn(
- "inline-flex h-[22px] cursor-pointer items-center justify-center rounded-full px-2 font-medium tracking-tight transition-colors",
- active
- ? "hub-tab-toggle-pill text-foreground"
- : disabled
- ? "cursor-not-allowed text-muted-foreground/45"
- : "text-muted-foreground hover:text-foreground/80",
+ "inline-flex h-[22px] items-center justify-center rounded-full px-2 font-medium tracking-tight transition-colors",
+ disabled
+ ? "cursor-not-allowed text-muted-foreground/45"
+ : active
+ ? "hub-tab-toggle-pill cursor-pointer text-foreground"
+ : "cursor-pointer text-muted-foreground hover:text-foreground/80",
)}
>
{opt.label}
diff --git a/studio/frontend/src/features/hub/components/hf-token-indicator.tsx b/studio/frontend/src/features/hub/components/hf-token-indicator.tsx
index 58de2039227..e3aa8163be7 100644
--- a/studio/frontend/src/features/hub/components/hf-token-indicator.tsx
+++ b/studio/frontend/src/features/hub/components/hf-token-indicator.tsx
@@ -13,12 +13,12 @@ import { AiSecurity03Icon } from "@hugeicons/core-free-icons";
import { HugeiconsIcon } from "@hugeicons/react";
interface HfTokenIndicatorProps {
- // true: chip with label (Train wizard); false: icon-only pill (Hub header).
+ /** true: chip with "HF Token" label (Train wizard); false: icon-only pill (Hub header). */
showLabel?: boolean;
}
-// Compact "set / not set" indicator for the app-wide Hugging Face token; click
-// opens Settings -> General. Shared by the Hub header and Train wizard.
+// Compact "set / not set" indicator for the app-wide HF token; click opens
+// Settings -> General. Shared by the Hub header and Train wizard (same store).
export function HfTokenIndicator({ showLabel = false }: HfTokenIndicatorProps = {}) {
const hfToken = useHfTokenStore((s) => s.token);
const openDialog = useSettingsDialogStore((s) => s.openDialog);
@@ -87,7 +87,9 @@ export function HfTokenIndicator({ showLabel = false }: HfTokenIndicatorProps =
onClick={() => openDialog("general")}
aria-label={ariaLabel}
className={cn(
- "inline-flex size-[26px] items-center justify-center rounded-full text-[11.5px] transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
+ // Solid circle reads optically larger than the flat HTTP/Xet box, so
+ // keep it 22px to sit within the row rather than bulging above it.
+ "inline-flex h-[22px] w-[22px] items-center justify-center rounded-full text-[11.5px] transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
hasToken
? "hub-tag-soft text-muted-foreground hover:text-foreground/80"
: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
@@ -96,7 +98,8 @@ export function HfTokenIndicator({ showLabel = false }: HfTokenIndicatorProps =
<HugeiconsIcon
icon={AiSecurity03Icon}
strokeWidth={1.75}
- className="size-4"
+ // Shield ink leans right; nudge left to optically centre it.
+ className="block size-[13px] shrink-0 -translate-x-[0.5px]"
/>
</button>
</TooltipTrigger>
diff --git a/studio/frontend/src/features/hub/components/page-heading.tsx b/studio/frontend/src/features/hub/components/page-heading.tsx
index 0b9c3d27286..b2e4a06fb4b 100644
--- a/studio/frontend/src/features/hub/components/page-heading.tsx
+++ b/studio/frontend/src/features/hub/components/page-heading.tsx
@@ -9,14 +9,34 @@ type PageHeadingProps = {
title: ReactNode;
subtitle?: ReactNode;
className?: string;
+ onTitleClick?: () => void;
};
-export function PageHeading({ title, subtitle, className }: PageHeadingProps) {
+const TITLE_CLASS =
+ "text-[30px] font-semibold leading-[1.04] tracking-[-0.028em] text-foreground sm:text-[34px]";
+
+export function PageHeading({
+ title,
+ subtitle,
+ className,
+ onTitleClick,
+}: PageHeadingProps) {
return (
<div className={cn("page-title-halo min-w-0", className)}>
- <h1 className="text-[30px] font-semibold leading-[1.04] tracking-[-0.028em] text-foreground sm:text-[34px]">
- {title}
- </h1>
+ {onTitleClick ? (
+ <button
+ type="button"
+ onClick={onTitleClick}
+ className={cn(
+ TITLE_CLASS,
+ "cursor-pointer rounded-md text-left outline-none transition-opacity hover:opacity-80 focus-visible:ring-2 focus-visible:ring-ring",
+ )}
+ >
+ {title}
+ </button>
+ ) : (
+ <h1 className={TITLE_CLASS}>{title}</h1>
+ )}
{subtitle ? (
<p className="mt-2 text-[13px] leading-[19px] text-muted-foreground">
{subtitle}
diff --git a/studio/frontend/src/features/hub/components/train-icon.ts b/studio/frontend/src/features/hub/components/train-icon.ts
index 1b59bc4835f..ecd02e7dca1 100644
--- a/studio/frontend/src/features/hub/components/train-icon.ts
+++ b/studio/frontend/src/features/hub/components/train-icon.ts
@@ -3,6 +3,6 @@
import { TestTube01Icon } from "@hugeicons/core-free-icons";
-// Slice to the first three paths to drop TestTube01Icon's two interior bubbles,
-// keeping the outline + cap + liquid line. Shared so the Train icon stays identical app-wide.
+// Slice to the first 3 paths to drop TestTube01Icon's two interior bubbles,
+// keeping the outline + cap + liquid line. Shared so Train stays identical app-wide.
export const TrainIcon = TestTube01Icon.slice(0, 3) as typeof TestTube01Icon;
diff --git a/studio/frontend/src/features/hub/download-manager/api.ts b/studio/frontend/src/features/hub/download-manager/api.ts
index 2c55b90edd0..ca987f1643b 100644
--- a/studio/frontend/src/features/hub/download-manager/api.ts
+++ b/studio/frontend/src/features/hub/download-manager/api.ts
@@ -12,14 +12,14 @@ function parseErrorText(status: number, body: unknown): string {
const detail = (body as { detail?: unknown }).detail;
const formatted = formatFastApiDetail(detail);
if (status === 405) {
- return `${formatted || "Method Not Allowed"} - the Unsloth backend did not accept this API method. Restart Unsloth so the frontend and backend are on the same build.`;
+ return `${formatted || "Method Not Allowed"} - the Studio backend did not accept this API method. Restart Studio so the frontend and backend are on the same build.`;
}
if (formatted) return formatted;
const message = (body as { message?: unknown }).message;
if (typeof message === "string" && message) return message;
}
if (status === 405) {
- return "Method Not Allowed - the Unsloth backend did not accept this API method. Restart Unsloth so the frontend and backend are on the same build.";
+ return "Method Not Allowed - the Studio backend did not accept this API method. Restart Studio so the frontend and backend are on the same build.";
}
return `Request failed (${status})`;
}
@@ -137,7 +137,7 @@ const DOWNLOAD_TRANSPORT_CAPABILITIES_FALLBACK: DownloadTransportCapabilities =
http: { available: true, reason: null },
xet: {
available: null,
- reason: "Couldn't verify Xet support with the Unsloth backend.",
+ reason: "Couldn't verify Xet support with the Studio backend.",
},
};
let downloadTransportCapabilitiesCache: DownloadTransportCapabilities | null =
diff --git a/studio/frontend/src/features/hub/download-manager/download-api-adapter.ts b/studio/frontend/src/features/hub/download-manager/download-api-adapter.ts
index a6518ec6564..6942dfbbb9b 100644
--- a/studio/frontend/src/features/hub/download-manager/download-api-adapter.ts
+++ b/studio/frontend/src/features/hub/download-manager/download-api-adapter.ts
@@ -184,7 +184,7 @@ export async function effectiveTransportMode(
return preferred;
}
const reason =
- capabilities.xet.reason ?? "Unsloth will use HTTP downloads instead.";
+ capabilities.xet.reason ?? "Studio will use HTTP downloads instead.";
if (lastXetUnavailableWarningReason !== reason) {
lastXetUnavailableWarningReason = reason;
toast.warning("Xet download transport unavailable", {
diff --git a/studio/frontend/src/features/hub/download-manager/download-manager-panel.tsx b/studio/frontend/src/features/hub/download-manager/download-manager-panel.tsx
index 7dde3a12591..023cc50947b 100644
--- a/studio/frontend/src/features/hub/download-manager/download-manager-panel.tsx
+++ b/studio/frontend/src/features/hub/download-manager/download-manager-panel.tsx
@@ -9,9 +9,9 @@ import {
import { hasAuthToken, mustChangePassword } from "@/features/auth/session";
import { isTauri } from "@/lib/api-base";
import { cn } from "@/lib/utils";
-import { ChevronDownStandardIcon } from "@/lib/chevron-icons";
import {
Alert02Icon,
+ ArrowDown01Icon,
Cancel01Icon,
CheckmarkCircle02Icon,
Download01Icon,
@@ -138,8 +138,8 @@ function DownloadRow({ jobKey }: { jobKey: string }) {
: downloadManager.dismiss(job.key)
}
className={cn(
- "inline-flex size-6 shrink-0 cursor-pointer items-center justify-center rounded-[7px] text-muted-foreground transition-colors",
- "hover:bg-foreground/[0.06] hover:text-foreground disabled:cursor-default disabled:opacity-50 dark:hover:bg-white/[0.1]",
+ "inline-flex size-6 shrink-0 cursor-pointer items-center justify-center rounded-full text-muted-foreground transition-colors",
+ "hover:bg-foreground/[0.06] hover:text-foreground disabled:cursor-default disabled:opacity-50 dark:hover:bg-white/[0.06]",
)}
>
<HugeiconsIcon
@@ -220,13 +220,8 @@ export function DownloadManagerPanel() {
</TooltipContent>
</Tooltip>
) : (
- <div className="hub-download-panel pointer-events-auto w-[min(360px,calc(100vw-2rem))] overflow-hidden">
+ <div className="hub-download-panel pointer-events-auto w-[min(400px,calc(100vw-2rem))] overflow-hidden">
<div className="flex items-center gap-2 border-b border-foreground/[0.07] px-3 py-2">
- <HugeiconsIcon
- icon={Download01Icon}
- strokeWidth={1.75}
- className="size-4 shrink-0 text-muted-foreground"
- />
<span className="min-w-0 flex-1 truncate text-[12.5px] font-semibold text-foreground">
{headerLabel}
</span>
@@ -234,10 +229,10 @@ export function DownloadManagerPanel() {
type="button"
aria-label="Collapse downloads"
onClick={() => setCollapsed(true)}
- className="inline-flex size-6 shrink-0 cursor-pointer items-center justify-center rounded-[7px] text-muted-foreground transition-colors hover:bg-foreground/[0.06] hover:text-foreground dark:hover:bg-white/[0.1]"
+ className="inline-flex size-6 shrink-0 cursor-pointer items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-foreground/[0.06] hover:text-foreground dark:hover:bg-white/[0.06]"
>
<HugeiconsIcon
- icon={ChevronDownStandardIcon}
+ icon={ArrowDown01Icon}
strokeWidth={1.75}
className="size-3.5"
/>
diff --git a/studio/frontend/src/features/hub/download-manager/download-manager-state.ts b/studio/frontend/src/features/hub/download-manager/download-manager-state.ts
index 5699fd62fb2..c24bb1e1544 100644
--- a/studio/frontend/src/features/hub/download-manager/download-manager-state.ts
+++ b/studio/frontend/src/features/hub/download-manager/download-manager-state.ts
@@ -1,25 +1,22 @@
// SPDX-License-Identifier: AGPL-3.0-only
// Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0
+import { create } from "zustand";
+import { createJSONStorage, persist } from "zustand/middleware";
import { INVENTORY_HINT_KIND } from "../inventory/constants";
import { inventoryHintKey } from "../inventory/inventory-hints";
import type { InventoryHint } from "../inventory/types";
-import { create } from "zustand";
-import {
- type StateStorage,
- createJSONStorage,
- persist,
-} from "zustand/middleware";
+import { createThrottledStorage, noopStorage } from "../stores/persist-storage";
import type { DownloadJobState } from "./api";
-import {
- ACTIVE_STATES,
- MAX_PROGRESS_FRACTION,
-} from "./download-manager-config";
import {
DOWNLOAD_KIND,
type DownloadKind,
isDownloadKind,
} from "./constants";
+import {
+ ACTIVE_STATES,
+ MAX_PROGRESS_FRACTION,
+} from "./download-manager-config";
import {
type DownloadManagerState,
type JobListeners,
@@ -36,48 +33,6 @@ const PERSIST_KEY = "unsloth.studio.downloads";
const PERSIST_VERSION = 1;
const PERSIST_THROTTLE_MS = 1_000;
-const noopStorage: StateStorage = {
- getItem: () => null,
- setItem: () => undefined,
- removeItem: () => undefined,
-};
-
-function createThrottledStorage(
- base: StateStorage,
- delayMs: number,
-): StateStorage {
- let timer: ReturnType<typeof setTimeout> | null = null;
- let pending: { name: string; value: string } | null = null;
- const flush = (): void => {
- if (timer !== null) {
- clearTimeout(timer);
- timer = null;
- }
- if (pending) {
- base.setItem(pending.name, pending.value);
- pending = null;
- }
- };
- if (typeof window !== "undefined") {
- window.addEventListener("pagehide", flush);
- }
- return {
- getItem: (name) => base.getItem(name),
- setItem: (name, value) => {
- pending = { name, value };
- if (timer === null) timer = setTimeout(flush, delayMs);
- },
- removeItem: (name) => {
- pending = null;
- if (timer !== null) {
- clearTimeout(timer);
- timer = null;
- }
- base.removeItem(name);
- },
- };
-}
-
function isRecord(value: unknown): value is Record<string, unknown> {
return value !== null && typeof value === "object" && !Array.isArray(value);
}
@@ -158,7 +113,7 @@ function toPersistedJob(
}
// Mirrors the backend's normalize_repo_key (strip().lower()) so two casings of
-// one repo share a key (else duplicate jobs / mismatched listeners). Keys only —
+// one repo share a key (else duplicate jobs / mismatched listeners). Keys only;
// `repoId` keeps original casing for display and API calls.
function normalizeRepoIdentity(repoId: string): string {
return repoId.trim().toLowerCase();
@@ -330,8 +285,8 @@ function hasRuntimePeerForRepo(
}
// Shared rule for what blocks a fresh GGUF variant start. Peer guard passes
-// includeOwnRuntime:false (runs after this start made its own runtime); requestStart
-// passes both true (runs before any runtime or job exists).
+// includeOwnRuntime:false (runs after this start made its own runtime);
+// requestStart passes both true (runs before any runtime or job exists).
export function hasVariantRepoActivity(
kind: DownloadKind,
repoId: string,
diff --git a/studio/frontend/src/features/hub/download-manager/download-manager-types.ts b/studio/frontend/src/features/hub/download-manager/download-manager-types.ts
index 27b8161eab1..9851734f278 100644
--- a/studio/frontend/src/features/hub/download-manager/download-manager-types.ts
+++ b/studio/frontend/src/features/hub/download-manager/download-manager-types.ts
@@ -14,8 +14,8 @@ export interface ManagedDownload {
state: DownloadJobState;
downloadedBytes: number;
// Finalized bytes on disk (excludes the in-progress `.incomplete` portion in
- // `downloadedBytes`). The idle/registry-loss completion fallback keys off this
- // so a partial can't be marked complete.
+ // `downloadedBytes`). The completion fallback keys off this so a partial can't
+ // be marked complete.
completedBytes: number;
// Server-verified completion; not trusted across reloads (hydration re-probes).
completeOnDisk: boolean;
diff --git a/studio/frontend/src/features/hub/download-manager/download-progress-bar.tsx b/studio/frontend/src/features/hub/download-manager/download-progress-bar.tsx
index 66293056094..f28fa0c5258 100644
--- a/studio/frontend/src/features/hub/download-manager/download-progress-bar.tsx
+++ b/studio/frontend/src/features/hub/download-manager/download-progress-bar.tsx
@@ -29,7 +29,7 @@ export function DownloadProgressBar({
? formatEta(remainingBytes / bytesPerSec)
: "";
return (
- <div className="flex flex-col gap-1.5 px-3 pb-1">
+ <div className="flex flex-col gap-1.5 pb-1">
<div className="relative h-[3px] overflow-hidden rounded-full bg-foreground/[0.06] dark:bg-white/[0.06]">
<div
className="h-full rounded-full bg-status-warning/80 transition-[width] duration-500 ease-linear"
diff --git a/studio/frontend/src/features/hub/download-manager/hydration.ts b/studio/frontend/src/features/hub/download-manager/hydration.ts
index a222fc4574b..eb5fdee74ca 100644
--- a/studio/frontend/src/features/hub/download-manager/hydration.ts
+++ b/studio/frontend/src/features/hub/download-manager/hydration.ts
@@ -129,8 +129,8 @@ const BACKEND_ADOPTERS: Record<BackendAdoptionSide, () => Promise<void>> = {
dataset: adoptActiveDatasetDownloads,
};
-// Adopt backend-running downloads this client doesn't know about. Retry only the
-// failed side(s) so transient backend readiness settles without duplicating jobs.
+// Adopt backend-running downloads this client doesn't know about. Retry only
+// the failed side(s) so backend readiness settles without duplicating jobs.
async function hydrateBackendActiveDownloads(
attempt = 0,
sides: readonly BackendAdoptionSide[] = ["model", "dataset"],
diff --git a/studio/frontend/src/features/hub/download-manager/poll-loop.ts b/studio/frontend/src/features/hub/download-manager/poll-loop.ts
index 95df4afd31f..c01abf6840a 100644
--- a/studio/frontend/src/features/hub/download-manager/poll-loop.ts
+++ b/studio/frontend/src/features/hub/download-manager/poll-loop.ts
@@ -124,8 +124,8 @@ function withDownloadTimeout<T>(
}
export function hasObservedExpectedBytes(job: ManagedDownload): boolean {
- // Finalized bytes only: a partial whose `.incomplete` blob merely reached the
- // expected size must not count as finished; the backend must also verify it on disk.
+ // Finalized bytes only: an `.incomplete` blob hitting expected size isn't
+ // finished until the backend verifies it's usable on disk.
return (
job.expectedBytes > 0 &&
job.completedBytes >= job.expectedBytes &&
@@ -149,9 +149,9 @@ export function resolveProgressUpdate(
const isGgufVariantJob =
job.kind === DOWNLOAD_KIND.MODEL && job.variant !== null;
const backendOwnsGgufProgress = isGgufVariantJob && reported > 0;
- // GGUF totals are backend-owned (non-monotonic). Snapshots keep the displayed
- // total monotonic to absorb jitter, but a fresh attempt (generation changed:
- // XET redownload, restart, re-adoption) drops the stale high-water mark.
+ // GGUF totals are backend-owned (non-monotonic); snapshots stay monotonic to
+ // absorb jitter, but a generation bump (XET redownload, restart, re-adoption)
+ // must drop the stale high-water mark and snap to the new run's bytes.
const trustBackend = backendOwnsGgufProgress || opts.resetMonotonic === true;
const expected = trustBackend
? reported > 0
@@ -177,9 +177,9 @@ export function resolveProgressUpdate(
? downloadedBytes / expected
: 0;
const cappedFraction = Math.min(rawFraction, MAX_PROGRESS_FRACTION);
- // Keep the GGUF variant bar monotonic: its backend progress is recomputed from
- // the shared per-repo blobs/ dir each poll, so a sibling quant or generation
- // bump can make one reading dip. A fresh download resets via startJob's seed.
+ // Keep the GGUF variant bar monotonic: backend progress is recomputed from the
+ // shared per-repo blobs/ dir, so a sibling quant, generation bump, or
+ // no-metadata poll can dip one reading. Resets via startJob's seed fraction.
const fraction = isGgufVariantJob
? Math.max(cappedFraction, job.fraction)
: cappedFraction;
@@ -257,9 +257,9 @@ export function finalize(
notify(job, "onCancelled", 0);
removeJob(key);
} else if (outcome === "complete") {
- // Reconcile to the largest known figure so a terminal status arriving before
- // the final progress poll doesn't leave a stale sub-total: downloaded ==
- // completed >= expected, fraction 1, and report that figure to listeners.
+ // A terminal "complete" arriving before the final progress poll must not
+ // leave a stale sub-total. Reconcile to the largest known figure so
+ // downloaded == completed >= expected, fraction 1, and report that.
const bytes = Math.max(
opts.bytes ?? 0,
job.downloadedBytes,
@@ -690,7 +690,7 @@ export async function startJob(
});
return;
}
- // A cancel pressed during this apiStart round-trip can land before the job is
+ // A cancel during this apiStart round-trip can land before the job is
// claimable; re-issue against the accepted generation.
if (rt.cancelRequested && result.accepted) {
reissueDroppedStartCancel(req, result.generation);
diff --git a/studio/frontend/src/features/hub/download-manager/transport-conflict.ts b/studio/frontend/src/features/hub/download-manager/transport-conflict.ts
index 684ef544a2b..9125abed702 100644
--- a/studio/frontend/src/features/hub/download-manager/transport-conflict.ts
+++ b/studio/frontend/src/features/hub/download-manager/transport-conflict.ts
@@ -152,8 +152,8 @@ export async function requestStart(req: DownloadRequest): Promise<void> {
"Transport status check failed; starting without partial-conflict preflight.",
err,
);
- // Fail safe: Xet purges any partial unconditionally, so when we couldn't
- // verify the partial we downgrade this one start to HTTP (resumes an HTTP
+ // Fail safe: Xet purges any partial unconditionally, so when the partial
+ // can't be verified we downgrade this one start to HTTP (resumes an HTTP
// partial, harmless for a fresh download); the Xet preference is kept for
// next time. Only downgrade once we confirmed no sibling variant is
// downloading, since a live sibling may be mid-transfer on Xet.
diff --git a/studio/frontend/src/features/hub/download-manager/transport-preference.ts b/studio/frontend/src/features/hub/download-manager/transport-preference.ts
index a1af2a24703..3d9c0d54cd7 100644
--- a/studio/frontend/src/features/hub/download-manager/transport-preference.ts
+++ b/studio/frontend/src/features/hub/download-manager/transport-preference.ts
@@ -64,9 +64,10 @@ export function useTransportMode(): [
}, []);
const set = useCallback((next: TransportMode) => {
- // Persist first, reflect after: the engine reads getTransportMode() fresh from
- // localStorage at download time, so an optimistic setMode() before a failed
- // write would show the new transport while downloads still used the old one.
+ // Persist first, reflect after: the engine reads getTransportMode() fresh
+ // from localStorage at download time, so an optimistic setMode() before a
+ // failed write (private mode / quota) would show the new transport while
+ // downloads still used the old one. On failure leave everything untouched.
try {
window.localStorage.setItem(STORAGE_KEY, next);
} catch {
diff --git a/studio/frontend/src/features/hub/download-manager/use-repo-download.ts b/studio/frontend/src/features/hub/download-manager/use-repo-download.ts
index 374e6b1f449..46b5fae6bb3 100644
--- a/studio/frontend/src/features/hub/download-manager/use-repo-download.ts
+++ b/studio/frontend/src/features/hub/download-manager/use-repo-download.ts
@@ -52,8 +52,8 @@ export interface RepoDownloadConfig {
/**
* Binds a single download surface (one repo, optionally per GGUF variant) to the
- * global download manager. Job state and polling live in the store, so a download
- * keeps running and stays visible after the card unmounts.
+ * global download manager. Job state and polling live in the store, so a
+ * download keeps running and stays visible after the card unmounts.
*/
export function useRepoDownload(config: RepoDownloadConfig): DownloadJob {
const {
diff --git a/studio/frontend/src/features/hub/hooks/use-discover-search.ts b/studio/frontend/src/features/hub/hooks/use-discover-search.ts
index 6c11ca8dc4d..a11a40ee9b2 100644
--- a/studio/frontend/src/features/hub/hooks/use-discover-search.ts
+++ b/studio/frontend/src/features/hub/hooks/use-discover-search.ts
@@ -1,10 +1,11 @@
// SPDX-License-Identifier: AGPL-3.0-only
// Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0
-import { useCallback, useEffect, useMemo, useRef } from "react";
+import { useCallback, useEffect, useRef } from "react";
import { toast } from "@/lib/toast";
import {
type HfModelResult,
+ type HfModelSearchChannel,
type HfSortDirection,
type HfSortKey,
useHubModelSearch,
@@ -13,7 +14,6 @@ import {
type HfDatasetResult,
useHubDatasetSearch,
} from "./use-hub-dataset-search";
-import type { ChannelPreset } from "../lib/channels";
export interface DiscoverSearch {
results: HfModelResult[];
@@ -86,7 +86,8 @@ export function useDiscoverSearch({
isDatasetMode,
sortBy,
direction,
- activeChannel,
+ channel,
+ ownerScope,
online,
}: {
debouncedQuery: string;
@@ -95,31 +96,19 @@ export function useDiscoverSearch({
isDatasetMode: boolean;
sortBy: HfSortKey;
direction: HfSortDirection;
- activeChannel: ChannelPreset | null;
+ channel: HfModelSearchChannel | null;
+ ownerScope: "unsloth" | "all";
online: boolean;
}): DiscoverSearch {
- const channelOption = useMemo(
- () =>
- activeChannel
- ? {
- owner: activeChannel.owner,
- tags: activeChannel.tags,
- query: activeChannel.query,
- idSuffix: activeChannel.idSuffix,
- }
- : null,
- [activeChannel],
- );
-
const modelSearch = useHubModelSearch(debouncedQuery, {
accessToken,
sortBy,
sortDirection: direction,
- pinUnslothFirst:
- sortBy === "trendingScore" && direction === "desc" && !activeChannel,
+ pinUnslothFirst: true,
+ ownerScope,
enabled: online && isDiscoverTab && !isDatasetMode,
keepUnsupportedTags: true,
- channel: channelOption,
+ channel,
});
const datasetSearch = useHubDatasetSearch(debouncedQuery, {
accessToken,
diff --git a/studio/frontend/src/features/hub/hooks/use-feed-write-back.ts b/studio/frontend/src/features/hub/hooks/use-feed-write-back.ts
new file mode 100644
index 00000000000..815a17edd66
--- /dev/null
+++ b/studio/frontend/src/features/hub/hooks/use-feed-write-back.ts
@@ -0,0 +1,31 @@
+// SPDX-License-Identifier: AGPL-3.0-only
+// Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0
+
+import { useEffect, useMemo, useRef } from "react";
+import type { ChannelId } from "../lib/channels";
+import { fingerprintToken } from "../lib/token-fingerprint";
+import { useHubFeedStore } from "../stores/hub-feed-store";
+import type { HfModelResult } from "./use-hub-model-search";
+
+export function useFeedWriteBack(opts: {
+ channelId: ChannelId | null;
+ results: HfModelResult[];
+ isLoading: boolean;
+ accessToken: string | undefined;
+}): void {
+ const { channelId, results, isLoading, accessToken } = opts;
+ const setChannelEntry = useHubFeedStore((s) => s.setChannelEntry);
+ const tokenFingerprint = useMemo(
+ () => fingerprintToken(accessToken),
+ [accessToken],
+ );
+ const writtenKeyRef = useRef<string | null>(null);
+
+ useEffect(() => {
+ if (!channelId || isLoading || results.length === 0) return;
+ const key = `${channelId}:${tokenFingerprint}`;
+ if (writtenKeyRef.current === key) return;
+ writtenKeyRef.current = key;
+ setChannelEntry(channelId, results, tokenFingerprint);
+ }, [channelId, isLoading, results, tokenFingerprint, setChannelEntry]);
+}
diff --git a/studio/frontend/src/features/hub/hooks/use-hub-dataset-search.ts b/studio/frontend/src/features/hub/hooks/use-hub-dataset-search.ts
index a232c0730af..40e1696decb 100644
--- a/studio/frontend/src/features/hub/hooks/use-hub-dataset-search.ts
+++ b/studio/frontend/src/features/hub/hooks/use-hub-dataset-search.ts
@@ -50,6 +50,12 @@ export interface HfDatasetResult {
id: string;
downloads: number;
likes: number;
+ private?: boolean;
+ gated?: false | "auto" | "manual";
+ updatedAt?: string;
+ createdAt?: string;
+ downloadsAllTime?: number;
+ prettyName?: string;
totalExamples?: number;
sizeCategory?: string;
taskCategories: string[];
@@ -60,7 +66,12 @@ function mapDataset(raw: unknown): HfDatasetResult {
const ds = raw as {
name: string;
downloads?: number;
+ downloadsAllTime?: number;
likes?: number;
+ private?: boolean;
+ gated?: false | "auto" | "manual";
+ updatedAt?: Date | string;
+ createdAt?: Date | string;
tags?: string[];
cardData?: unknown;
};
@@ -70,10 +81,28 @@ function mapDataset(raw: unknown): HfDatasetResult {
.filter((t) => t.startsWith("task_categories:"))
.map((t) => t.slice("task_categories:".length));
const plainTags = tags.filter((t) => !t.includes(":"));
+ const updatedAt =
+ ds.updatedAt instanceof Date
+ ? ds.updatedAt.toISOString()
+ : typeof ds.updatedAt === "string"
+ ? ds.updatedAt
+ : undefined;
+ const createdAt =
+ ds.createdAt instanceof Date
+ ? ds.createdAt.toISOString()
+ : typeof ds.createdAt === "string"
+ ? ds.createdAt
+ : undefined;
return {
id: ds.name,
downloads: ds.downloads ?? 0,
likes: ds.likes ?? 0,
+ private: ds.private,
+ gated: ds.gated,
+ updatedAt,
+ createdAt,
+ downloadsAllTime: ds.downloadsAllTime,
+ prettyName: card?.pretty_name,
totalExamples: extractTotalExamples(card),
sizeCategory: card?.size_categories?.[0],
taskCategories,
@@ -392,7 +421,7 @@ export function useHubDatasetSearch(
}
return listDatasets({
search: hasQuery ? { query } : {},
- additionalFields: ["cardData", "tags"],
+ additionalFields: ["cardData", "tags", "createdAt", "downloadsAllTime"],
fetch: makeDatasetSortFetch(sortBy, sortDirection, signal),
...(accessToken ? { credentials: { accessToken } } : {}),
}) as AsyncGenerator<unknown>;
diff --git a/studio/frontend/src/features/hub/hooks/use-hub-feed.ts b/studio/frontend/src/features/hub/hooks/use-hub-feed.ts
new file mode 100644
index 00000000000..353685baaf8
--- /dev/null
+++ b/studio/frontend/src/features/hub/hooks/use-hub-feed.ts
@@ -0,0 +1,258 @@
+// SPDX-License-Identifier: AGPL-3.0-only
+// Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0
+
+import { useCallback, useEffect, useMemo, useRef, useState } from "react";
+import { type ChannelId, findChannel } from "../lib/channels";
+import { fingerprintToken } from "../lib/token-fingerprint";
+import { isChannelEntryFresh, useHubFeedStore } from "../stores/hub-feed-store";
+import {
+ type HfModelResult,
+ fetchChannelFirstPage,
+} from "./use-hub-model-search";
+
+export type FeedStatus = "idle" | "loading" | "refreshing" | "ready" | "error";
+
+export interface HubFeedSection {
+ channelId: ChannelId;
+ results: HfModelResult[];
+ status: FeedStatus;
+ isLoading: boolean;
+ isRefreshing: boolean;
+ error: string | null;
+}
+
+export interface UseHubFeedResult {
+ trending: HubFeedSection;
+ refetch: (id: ChannelId) => void;
+}
+
+// Only the trending row is rendered in the feed now; "Fine-tune ready" moved
+// into the format dropdown and loads its channel on demand (channel-list mode).
+const CHANNEL_IDS: readonly ChannelId[] = ["unsloth-trending"];
+const FEED_PAGE_SIZE = 20;
+const MAX_RETRIES = 5;
+const BACKOFF_BASE_MS = 800;
+const BACKOFF_CAP_MS = 15_000;
+
+function backoffDelay(attempt: number): number {
+ const base = Math.min(BACKOFF_CAP_MS, BACKOFF_BASE_MS * 2 ** attempt);
+ return Math.round(base * (0.5 + Math.random() * 0.5));
+}
+
+function isAbortError(err: unknown): boolean {
+ return err instanceof DOMException && err.name === "AbortError";
+}
+
+function channelRecord<T>(value: T): Record<ChannelId, T> {
+ return {
+ "unsloth-trending": value,
+ "unsloth-latest": value,
+ "unsloth-safetensors": value,
+ };
+}
+
+export function useHubFeed(opts: {
+ accessToken: string | undefined;
+ online: boolean;
+ enabled: boolean;
+ deviceType: string | null;
+}): UseHubFeedResult {
+ const { accessToken, online, enabled, deviceType } = opts;
+ const tokenFingerprint = useMemo(
+ () => fingerprintToken(accessToken),
+ [accessToken],
+ );
+
+ const channels = useHubFeedStore((s) => s.channels);
+ const setChannelEntry = useHubFeedStore((s) => s.setChannelEntry);
+ const clearForToken = useHubFeedStore((s) => s.clearForToken);
+
+ const [statuses, setStatuses] = useState<Record<ChannelId, FeedStatus>>(() =>
+ channelRecord<FeedStatus>("idle"),
+ );
+ const [errors, setErrors] = useState<Record<ChannelId, string | null>>(() =>
+ channelRecord<string | null>(null),
+ );
+
+ const abortRefs = useRef<Record<ChannelId, AbortController | null>>(
+ channelRecord<AbortController | null>(null),
+ );
+ const timerRefs = useRef<
+ Record<ChannelId, ReturnType<typeof setTimeout> | null>
+ >(channelRecord<ReturnType<typeof setTimeout> | null>(null));
+ const inFlightRefs = useRef<Record<ChannelId, boolean>>(
+ channelRecord<boolean>(false),
+ );
+ const versionRefs = useRef<Record<ChannelId, number>>(
+ channelRecord<number>(0),
+ );
+ const onlineRef = useRef(online);
+
+ const setStatus = useCallback((id: ChannelId, status: FeedStatus) => {
+ setStatuses((prev) =>
+ prev[id] === status ? prev : { ...prev, [id]: status },
+ );
+ }, []);
+ const setError = useCallback((id: ChannelId, error: string | null) => {
+ setErrors((prev) => (prev[id] === error ? prev : { ...prev, [id]: error }));
+ }, []);
+
+ const runChannel = useCallback(
+ (id: ChannelId) => {
+ if (inFlightRefs.current[id]) return;
+ const preset = findChannel(id);
+ if (!preset) return;
+
+ const hadCache =
+ (useHubFeedStore.getState().channels[id]?.results.length ?? 0) > 0;
+ const version = (versionRefs.current[id] += 1);
+ inFlightRefs.current[id] = true;
+ abortRefs.current[id]?.abort();
+ const controller = new AbortController();
+ abortRefs.current[id] = controller;
+
+ const isStale = () =>
+ controller.signal.aborted || versionRefs.current[id] !== version;
+
+ const settle = (status: FeedStatus, message: string | null) => {
+ inFlightRefs.current[id] = false;
+ setStatus(id, status);
+ if (status === "error") setError(id, message);
+ };
+
+ const scheduleRetry = (attempt: number, message: string | null) => {
+ if (isStale()) {
+ inFlightRefs.current[id] = false;
+ return;
+ }
+ if (attempt >= MAX_RETRIES) {
+ settle(hadCache ? "ready" : "error", message ?? "No results");
+ return;
+ }
+ if (!onlineRef.current) {
+ inFlightRefs.current[id] = false;
+ return;
+ }
+ timerRefs.current[id] = setTimeout(() => {
+ timerRefs.current[id] = null;
+ void attemptFetch(attempt + 1);
+ }, backoffDelay(attempt));
+ };
+
+ const attemptFetch = async (attempt: number): Promise<void> => {
+ if (isStale()) {
+ inFlightRefs.current[id] = false;
+ return;
+ }
+ if (!onlineRef.current) {
+ inFlightRefs.current[id] = false;
+ return;
+ }
+ if (attempt === 0) {
+ setStatus(id, hadCache ? "refreshing" : "loading");
+ setError(id, null);
+ }
+ try {
+ const { results } = await fetchChannelFirstPage({
+ channel: {
+ owner: preset.owner,
+ tags: preset.tags,
+ query: preset.query,
+ idSuffix: preset.idSuffix,
+ },
+ sortBy: preset.sort,
+ sortDirection: "desc",
+ accessToken,
+ signal: controller.signal,
+ pageSize: FEED_PAGE_SIZE,
+ deviceType,
+ keepUnsupportedTags: true,
+ });
+ if (isStale()) return;
+ if (results.length > 0) {
+ setChannelEntry(id, results, tokenFingerprint);
+ settle("ready", null);
+ return;
+ }
+ settle("ready", null);
+ } catch (err) {
+ if (isStale() || isAbortError(err)) return;
+ scheduleRetry(
+ attempt,
+ err instanceof Error ? err.message : "Failed to load",
+ );
+ }
+ };
+
+ queueMicrotask(() => void attemptFetch(0));
+ },
+ [
+ accessToken,
+ tokenFingerprint,
+ deviceType,
+ setChannelEntry,
+ setStatus,
+ setError,
+ ],
+ );
+
+ useEffect(() => {
+ onlineRef.current = online;
+ const cleanup = () => {
+ for (const id of CHANNEL_IDS) {
+ abortRefs.current[id]?.abort();
+ abortRefs.current[id] = null;
+ const timer = timerRefs.current[id];
+ if (timer) clearTimeout(timer);
+ timerRefs.current[id] = null;
+ inFlightRefs.current[id] = false;
+ versionRefs.current[id] += 1;
+ }
+ };
+ if (!enabled) return cleanup;
+ if (useHubFeedStore.getState().tokenFingerprint !== tokenFingerprint) {
+ clearForToken(tokenFingerprint);
+ }
+ if (!online) return cleanup;
+ for (const id of CHANNEL_IDS) {
+ const entry = useHubFeedStore.getState().channels[id];
+ if (isChannelEntryFresh(entry, id, tokenFingerprint)) continue;
+ runChannel(id);
+ }
+ return cleanup;
+ }, [enabled, online, tokenFingerprint, clearForToken, runChannel]);
+
+ const refetch = useCallback(
+ (id: ChannelId) => {
+ const timer = timerRefs.current[id];
+ if (timer) {
+ clearTimeout(timer);
+ timerRefs.current[id] = null;
+ }
+ inFlightRefs.current[id] = false;
+ runChannel(id);
+ },
+ [runChannel],
+ );
+
+ const buildSection = useCallback(
+ (id: ChannelId): HubFeedSection => {
+ const results = channels[id]?.results ?? [];
+ const status = statuses[id];
+ return {
+ channelId: id,
+ results,
+ status,
+ isLoading: status === "loading" && results.length === 0,
+ isRefreshing: status === "refreshing",
+ error: results.length === 0 ? errors[id] : null,
+ };
+ },
+ [channels, statuses, errors],
+ );
+
+ return {
+ trending: buildSection("unsloth-trending"),
+ refetch,
+ };
+}
diff --git a/studio/frontend/src/features/hub/hooks/use-hub-infinite-scroll.ts b/studio/frontend/src/features/hub/hooks/use-hub-infinite-scroll.ts
index 2f37e2e713e..82840f71df4 100644
--- a/studio/frontend/src/features/hub/hooks/use-hub-infinite-scroll.ts
+++ b/studio/frontend/src/features/hub/hooks/use-hub-infinite-scroll.ts
@@ -6,10 +6,14 @@ import { useCallback, useEffect, useRef, useState } from "react";
/**
* IntersectionObserver sentinel for infinite scroll, plus a ResizeObserver
* fallback that auto-fetches while the scroll container doesn't yet overflow.
- * `signal` (typically results.length) is a dep so the fit check re-runs after a
- * fetch even when the page filter rejected every new row and the DOM didn't change.
+ * Fallback firings are coalesced to one `scrollHeight` read (forced layout) per
+ * frame; concurrency is gated at the data-source layer.
+ *
+ * `signal` (typically `results.length`) is a dep so the fit check re-runs after
+ * a fetch even when the page filter rejected every new row and the DOM didn't
+ * change. `DEFAULT_MAX_AUTO_FILL_FETCHES` caps a runaway sweep of the full
+ * listing; callers with a manual continuation UI can lower it.
*/
-// Hard backstop on no-overflow auto-fetches, capping a runaway sweep of the full listing.
const DEFAULT_MAX_AUTO_FILL_FETCHES = 40;
export interface InfiniteScrollOptions {
@@ -190,7 +194,7 @@ export function useHubInfiniteScroll(
const sentinel = sentinelRef.current;
if (!sentinel?.isConnected) return;
if (manualFetchAvailableRef.current) return;
- // Once content overflows, the IntersectionObserver takes over — stop polling.
+ // Once content overflows, the IntersectionObserver takes over - stop polling.
if (hasScrollableOverflow(root)) {
setManualFetchAvailable(false);
return;
diff --git a/studio/frontend/src/features/hub/hooks/use-hub-model-search.ts b/studio/frontend/src/features/hub/hooks/use-hub-model-search.ts
index ebce58e9d84..647c9adb5ee 100644
--- a/studio/frontend/src/features/hub/hooks/use-hub-model-search.ts
+++ b/studio/frontend/src/features/hub/hooks/use-hub-model-search.ts
@@ -16,12 +16,10 @@ import {
useMemo,
useState,
} from "react";
-import { useHubPaginatedSearch } from "./use-hub-paginated-search";
+import { pullBatch, useHubPaginatedSearch } from "./use-hub-paginated-search";
import { usePlatformStore } from "@/config/env";
-import {
- EMBEDDING_TAGS,
- estimateSizeFromDtypes,
-} from "../lib/hf-model-meta";
+import { EMBEDDING_TAGS, estimateSizeFromDtypes } from "../lib/hf-model-meta";
+import { detectBaseModel } from "../lib/model-capabilities";
import { isGgufLike } from "../lib/model-identifiers";
import {
classifyUnslothSupport,
@@ -30,7 +28,21 @@ import {
type UnslothSupportStatus,
} from "../lib/unsloth-support";
-const ALL_FIELDS: ("safetensors" | "tags")[] = ["safetensors", "tags"];
+const ALL_FIELDS: (
+ | "safetensors"
+ | "tags"
+ | "library_name"
+ | "config"
+ | "createdAt"
+ | "downloadsAllTime"
+)[] = [
+ "safetensors",
+ "tags",
+ "library_name",
+ "config",
+ "createdAt",
+ "downloadsAllTime",
+];
export { classifyUnslothSupport };
export type { UnslothSupport, UnslothSupportStatus };
@@ -84,12 +96,17 @@ export interface HfModelResult {
id: string;
downloads: number;
likes: number;
+ private?: boolean;
+ gated?: false | "auto" | "manual";
totalParams?: number;
estimatedSizeBytes?: number;
isGguf: boolean;
+ baseModel?: string | null;
tags?: string[];
pipelineTag?: string;
updatedAt?: string;
+ createdAt?: string;
+ downloadsAllTime?: number;
libraryName?: string;
quantMethod?: string;
}
@@ -152,10 +169,14 @@ function makeMapModel(
name: string;
downloads?: number;
likes?: number;
+ private?: boolean;
+ gated?: false | "auto" | "manual";
task?: string;
pipeline_tag?: string;
library_name?: string;
updatedAt?: Date | string;
+ createdAt?: Date | string;
+ downloadsAllTime?: number;
safetensors?: { total: number; parameters?: Record<string, number> };
gguf?: { total?: number; architecture?: string };
tags?: string[];
@@ -180,7 +201,7 @@ function makeMapModel(
}
const pipelineTag = m.task ?? m.pipeline_tag;
const quantMethod = m.config?.quantization_config?.quant_method;
- // Drops runtime-unloadable models before they reach the row list. Discover
+ // Drop runtime-unloadable models before they reach the row list. Discover
// opts out via keepUnsupportedTags to render them with a "may not be supported"
// dot. Embeddings skip the gate: their pipeline tag is unsupported for chat but trainable.
if (!keepUnsupportedTags && !isEmbedding) {
@@ -200,16 +221,27 @@ function makeMapModel(
: typeof m.updatedAt === "string"
? m.updatedAt
: undefined;
+ const createdAtIso =
+ m.createdAt instanceof Date
+ ? m.createdAt.toISOString()
+ : typeof m.createdAt === "string"
+ ? m.createdAt
+ : undefined;
return {
id: m.name,
downloads: m.downloads ?? 0,
likes: m.likes ?? 0,
+ private: m.private,
+ gated: m.gated,
totalParams: m.safetensors?.total ?? m.gguf?.total,
estimatedSizeBytes: estimateSizeFromDtypes(m.safetensors?.parameters),
isGguf,
+ baseModel: detectBaseModel(m.tags),
tags: m.tags,
pipelineTag,
updatedAt: updatedAtIso,
+ createdAt: createdAtIso,
+ downloadsAllTime: m.downloadsAllTime,
libraryName: m.library_name,
quantMethod,
};
@@ -222,6 +254,7 @@ const UNSLOTH_PREFETCH = 20;
const UNSLOTH_QUERY_PREFETCH = 3;
/** With a publisher query, fewer unsloth results before the pinned publisher model. */
const UNSLOTH_PINNED_PREFETCH = 4;
+/** Matches a valid "owner/repo" identifier (exactly two non-empty segments). */
const PUBLISHER_RE = /^([^/\s]+)\/([^/\s]+)$/;
/**
@@ -259,17 +292,21 @@ async function* mergedModelIterator(
...(accessToken ? { credentials: { accessToken } } : {}),
};
- const unslothIter = mergeTaskIterators(tasks, (task) =>
- listModels({
- search: { query, owner: "unsloth", ...(task ? { task } : {}) },
- ...common,
- }) as AsyncGenerator<unknown>,
+ const unslothIter = mergeTaskIterators(
+ tasks,
+ (task) =>
+ listModels({
+ search: { query, owner: "unsloth", ...(task ? { task } : {}) },
+ ...common,
+ }) as AsyncGenerator<unknown>,
);
- const generalIter = mergeTaskIterators(tasks, (task) =>
- listModels({
- search: { query, ...(task ? { task } : {}) },
- ...common,
- }) as AsyncGenerator<unknown>,
+ const generalIter = mergeTaskIterators(
+ tasks,
+ (task) =>
+ listModels({
+ search: { query, ...(task ? { task } : {}) },
+ ...common,
+ }) as AsyncGenerator<unknown>,
);
// Start the pinned lookup now so it runs in parallel with Phase 1 instead of blocking Phase 2.
@@ -364,11 +401,13 @@ async function* priorityThenListingIterator(
}
}
- const generalIter = mergeTaskIterators(tasks, (task) =>
- listModels({
- search: { owner: "unsloth", ...(task ? { task } : {}) },
- ...common,
- }) as AsyncGenerator<unknown>,
+ const generalIter = mergeTaskIterators(
+ tasks,
+ (task) =>
+ listModels({
+ search: { owner: "unsloth", ...(task ? { task } : {}) },
+ ...common,
+ }) as AsyncGenerator<unknown>,
);
for await (const model of generalIter) {
const m = model as { name?: string };
@@ -389,6 +428,146 @@ export interface HfModelSearchChannel {
idSuffix?: string;
}
+function createChannelIterator(
+ channel: HfModelSearchChannel,
+ opts: {
+ query?: string;
+ sortBy: HfSortKey;
+ sortDirection: HfSortDirection;
+ accessToken?: string;
+ signal: AbortSignal;
+ },
+): AsyncGenerator<unknown> {
+ const channelTags =
+ channel.tags && channel.tags.length ? [...channel.tags] : undefined;
+ const queryString = opts.query || channel.query || undefined;
+ return listModels({
+ search: {
+ ...(queryString ? { query: queryString } : {}),
+ ...(channel.owner ? { owner: channel.owner } : {}),
+ ...(channelTags ? { tags: channelTags } : {}),
+ },
+ additionalFields: ALL_FIELDS,
+ fetch: makeSortFetch(opts.sortBy, opts.sortDirection, opts.signal),
+ sort: opts.sortBy,
+ ...(opts.accessToken ? { credentials: { accessToken: opts.accessToken } } : {}),
+ }) as AsyncGenerator<unknown>;
+}
+
+// Bound the unsloth pass so a huge unsloth slice can't starve the general listing under scroll.
+const UNSLOTH_CHANNEL_PREFETCH = 60;
+
+// For tag/format channels without a fixed owner (e.g. GGUF filter), yield unsloth
+// models first (in sort order), then the rest with already-seen unsloth repos removed,
+// floating unsloth to the top even when sorting by downloads/likes.
+async function* channelUnslothFirstIterator(
+ channel: { tags?: string[]; query?: string },
+ opts: {
+ query?: string;
+ sortBy: HfSortKey;
+ sortDirection: HfSortDirection;
+ accessToken?: string;
+ signal: AbortSignal;
+ },
+): AsyncGenerator<unknown> {
+ const queryString = opts.query || channel.query || undefined;
+ const creds = opts.accessToken
+ ? { credentials: { accessToken: opts.accessToken } }
+ : {};
+ const seen = new Set<string>();
+
+ const unslothIter = listModels({
+ search: {
+ ...(queryString ? { query: queryString } : {}),
+ owner: "unsloth",
+ ...(channel.tags ? { tags: channel.tags } : {}),
+ },
+ additionalFields: ALL_FIELDS,
+ fetch: makeSortFetch(opts.sortBy, opts.sortDirection, opts.signal),
+ sort: opts.sortBy,
+ ...creds,
+ }) as AsyncGenerator<unknown>;
+ let count = 0;
+ for await (const model of unslothIter) {
+ const name = (model as { name?: string }).name;
+ if (name) seen.add(name);
+ yield model;
+ if (++count >= UNSLOTH_CHANNEL_PREFETCH) break;
+ }
+
+ const generalIter = listModels({
+ search: {
+ ...(queryString ? { query: queryString } : {}),
+ ...(channel.tags ? { tags: channel.tags } : {}),
+ },
+ additionalFields: ALL_FIELDS,
+ fetch: makeSortFetch(opts.sortBy, opts.sortDirection, opts.signal),
+ sort: opts.sortBy,
+ ...creds,
+ }) as AsyncGenerator<unknown>;
+ for await (const model of generalIter) {
+ const name = (model as { name?: string }).name;
+ if (name && seen.has(name)) continue;
+ yield model;
+ }
+}
+
+export interface FetchChannelFirstPageOptions {
+ channel: HfModelSearchChannel;
+ sortBy: HfSortKey;
+ sortDirection?: HfSortDirection;
+ accessToken?: string;
+ signal: AbortSignal;
+ pageSize?: number;
+ deviceType: string | null;
+ excludeGguf?: boolean;
+ keepUnsupportedTags?: boolean;
+}
+
+export interface FetchChannelFirstPageResult {
+ results: HfModelResult[];
+ scanned: number;
+ done: boolean;
+}
+
+export async function fetchChannelFirstPage(
+ options: FetchChannelFirstPageOptions,
+): Promise<FetchChannelFirstPageResult> {
+ const {
+ channel,
+ sortBy,
+ sortDirection = "desc",
+ accessToken,
+ signal,
+ pageSize = 20,
+ deviceType,
+ excludeGguf = false,
+ keepUnsupportedTags = true,
+ } = options;
+ const mapModel = makeMapModel(
+ excludeGguf,
+ excludedFormatTagsForDevice(deviceType),
+ keepUnsupportedTags,
+ channel.idSuffix ?? "",
+ deviceType,
+ );
+ async function* primed(): AsyncGenerator<unknown> {
+ const iter = createChannelIterator(channel, {
+ sortBy,
+ sortDirection,
+ accessToken,
+ signal,
+ });
+ for await (const model of iter) {
+ const name = (model as { name?: string }).name;
+ if (name) primeFromListing(name, accessToken, model);
+ yield model;
+ }
+ }
+ const { items, done, scanned } = await pullBatch(primed(), mapModel, pageSize);
+ return { results: items, scanned, done };
+}
+
export function useHubModelSearch(
query: string,
options?: {
@@ -399,6 +578,11 @@ export function useHubModelSearch(
sortBy?: HfSortKey;
sortDirection?: HfSortDirection;
pinUnslothFirst?: boolean;
+ /**
+ * "unsloth" restricts listings to the unsloth org; "all" surfaces the whole
+ * Hub with unsloth floated to the top. Owner-fixed channel presets ignore this.
+ */
+ ownerScope?: "unsloth" | "all";
enabled?: boolean;
keepUnsupportedTags?: boolean;
channel?: HfModelSearchChannel | null;
@@ -412,10 +596,12 @@ export function useHubModelSearch(
sortBy = "downloads",
sortDirection = "desc",
pinUnslothFirst = true,
+ ownerScope = "all",
enabled = true,
keepUnsupportedTags = false,
channel = null,
} = options ?? {};
+ const unslothOnly = ownerScope === "unsloth";
const channelOwner = channel?.owner ?? null;
const channelTagsKey = channel?.tags ? channel.tags.join("|") : "";
@@ -443,26 +629,61 @@ export function useHubModelSearch(
const createIter = useCallback(
(signal: AbortSignal) => {
// Channel scoping bypasses the unsloth-merge iterator: a hard owner/tag
- // filter shows just that curated slice, with the user's text query forwarded into it.
+ // filter shows just that curated slice, with the user's text query forwarded in.
if (channelOwner || channelTagsKey || channelQuery) {
- const channelTags = channelTagsKey ? channelTagsKey.split("|") : undefined;
+ const channelTags = channelTagsKey
+ ? channelTagsKey.split("|")
+ : undefined;
+ // Unsloth-only scope on an ownerless tag/format channel (e.g. GGUF filter):
+ // hard-restrict the slice to unsloth-owned repos.
+ if (unslothOnly && !channelOwner) {
+ return createChannelIterator(
+ {
+ owner: "unsloth",
+ tags: channelTags,
+ query: channelQuery || undefined,
+ },
+ {
+ query: trimmed || undefined,
+ sortBy,
+ sortDirection,
+ accessToken,
+ signal,
+ },
+ );
+ }
+ // Ownerless tag/format channels (e.g. GGUF filter): float unsloth-owned models first.
+ if (pinUnslothFirst && channelTagsKey && !channelOwner) {
+ return channelUnslothFirstIterator(
+ { tags: channelTags, query: channelQuery || undefined },
+ {
+ query: trimmed || undefined,
+ sortBy,
+ sortDirection,
+ accessToken,
+ signal,
+ },
+ );
+ }
// User text query takes precedence over channel.query; without it, the
// channel's own query (e.g. "bnb-4bit") narrows the listing server-side.
- const queryString = trimmed || channelQuery || undefined;
- return listModels({
- search: {
- ...(queryString ? { query: queryString } : {}),
- ...(channelOwner ? { owner: channelOwner } : {}),
- ...(channelTags ? { tags: channelTags } : {}),
+ return createChannelIterator(
+ {
+ owner: channelOwner ?? undefined,
+ tags: channelTags,
+ query: channelQuery || undefined,
},
- additionalFields: ALL_FIELDS,
- fetch: makeSortFetch(sortBy, sortDirection, signal),
- sort: sortBy,
- ...(accessToken ? { credentials: { accessToken } } : {}),
- }) as AsyncGenerator<unknown>;
+ {
+ query: trimmed || undefined,
+ sortBy,
+ sortDirection,
+ accessToken,
+ signal,
+ },
+ );
}
if (!trimmed) {
- // No query: priority models first (full metadata), then the general unsloth listing.
+ // No query: show priority models first (with full metadata), then general unsloth listing
if (stablePriorityIds && stablePriorityIds.length > 0) {
return priorityThenListingIterator(
stablePriorityIds,
@@ -473,16 +694,33 @@ export function useHubModelSearch(
signal,
) as AsyncGenerator<unknown>;
}
- return mergeTaskIterators(normalizeTaskFilter(task), (task) =>
- listModels({
- search: { ...(task ? { task } : {}) },
- additionalFields: ALL_FIELDS,
- fetch: makeSortFetch(sortBy, sortDirection, signal),
- sort: sortBy,
- ...(accessToken ? { credentials: { accessToken } } : {}),
- }) as AsyncGenerator<unknown>,
+ return mergeTaskIterators(
+ normalizeTaskFilter(task),
+ (task) =>
+ listModels({
+ // Unsloth-only scope restricts the plain sort browse to the org.
+ search: {
+ ...(unslothOnly ? { owner: "unsloth" } : {}),
+ ...(task ? { task } : {}),
+ },
+ additionalFields: ALL_FIELDS,
+ fetch: makeSortFetch(sortBy, sortDirection, signal),
+ sort: sortBy,
+ ...(accessToken ? { credentials: { accessToken } } : {}),
+ }) as AsyncGenerator<unknown>,
);
}
+ // Unsloth-only typed query: search within the org rather than floating
+ // a few unsloth hits above the global relevance ranking.
+ if (unslothOnly) {
+ return listModels({
+ search: { query: searchQuery, owner: "unsloth" },
+ additionalFields: ALL_FIELDS,
+ fetch: makeSortFetch(sortBy, sortDirection, signal),
+ sort: sortBy,
+ ...(accessToken ? { credentials: { accessToken } } : {}),
+ }) as AsyncGenerator<unknown>;
+ }
// Typed query: drop the task filter so searched models appear despite
// wrong/missing HF task metadata. For an "owner/repo" query, strip the org
// prefix so unsloth variants surface, then pin the original publisher model.
@@ -509,6 +747,8 @@ export function useHubModelSearch(
channelOwner,
channelTagsKey,
channelQuery,
+ pinUnslothFirst,
+ unslothOnly,
],
);
@@ -523,7 +763,13 @@ export function useHubModelSearch(
channelIdSuffix,
deviceType,
),
- [excludeGguf, excludedTags, keepUnsupportedTags, channelIdSuffix, deviceType],
+ [
+ excludeGguf,
+ excludedTags,
+ keepUnsupportedTags,
+ channelIdSuffix,
+ deviceType,
+ ],
);
const search = useHubPaginatedSearch(createIter, mapModel, { enabled });
@@ -535,7 +781,6 @@ export function useHubModelSearch(
// a late unsloth/* repo jump to an earlier index and bump the viewport during
// infinite scroll, so we only sort when the listing resets (length shrinks or
// zeros), where re-ordering is safe.
- const channelActive = Boolean(channelOwner || channelTagsKey);
const [stableCache, setStableCache] = useState<{
source: HfModelResult[] | null;
length: number;
@@ -544,8 +789,10 @@ export function useHubModelSearch(
}>({ source: null, length: 0, results: [], sorted: false });
const incoming = search.results;
+ // Owner-scoped channels return a single owner, so re-sorting is a no-op there;
+ // tag/format channels (e.g. GGUF) and plain browsing still float unsloth first.
const sortingDisabled =
- !pinUnslothFirst || isPublisherQuery || trimmed || channelActive;
+ !pinUnslothFirst || isPublisherQuery || trimmed || Boolean(channelOwner);
const { results, nextCache } = useMemo(() => {
let results: HfModelResult[];
let nextCache = stableCache;
@@ -578,7 +825,8 @@ export function useHubModelSearch(
!stableCache.sorted ||
stableCache.length === 0 ||
incoming.length < stableCache.length ||
- (incoming.length === stableCache.length && stableCache.source !== incoming)
+ (incoming.length === stableCache.length &&
+ stableCache.source !== incoming)
) {
const sorted = [...incoming].sort((a, b) => {
const aFirst = a.id.startsWith("unsloth/") ? 0 : 1;
diff --git a/studio/frontend/src/features/hub/hooks/use-hub-paginated-search.ts b/studio/frontend/src/features/hub/hooks/use-hub-paginated-search.ts
index 2d6214d4427..882c5307820 100644
--- a/studio/frontend/src/features/hub/hooks/use-hub-paginated-search.ts
+++ b/studio/frontend/src/features/hub/hooks/use-hub-paginated-search.ts
@@ -20,23 +20,26 @@ const INITIAL: HfPaginatedState<never> = {
hasMore: false,
error: null,
};
-const BATCH = 20;
+// listModels returns up to 500 models per fetch, so a bigger batch just walks
+// the in-memory page (essentially free) and fills the viewport in one commit.
+const BATCH = 48;
const MAX_RAW_ITEMS_PER_BATCH = BATCH * 4;
type BusyKind = "initial" | "more";
/**
- * Min gap between fetchMore() calls. Two observers can fire in one tick and React
- * commits the in-flight flag asynchronously, so this caps the worst case at one
- * request per window. Pairs with a trailing-edge schedule: a blocked call queues
- * one fire at the window end so filters that starve the visible list keep paginating.
+ * Min gap between fetchMore() calls. Sibling observers can fire in one tick and
+ * React commits the in-flight flag asynchronously, so this caps the worst case
+ * at one request per window. A blocked call queues a trailing-edge fire so
+ * filters that starve the visible list keep paginating instead of dead-locking.
*/
-const MIN_FETCH_INTERVAL_MS = 1000;
+const MIN_FETCH_INTERVAL_MS = 350;
-// Preserved results older than this are refetched on re-enable so the feed can't
-// lag the Hub. Reset by every successful pull (idle time only). Mirrors hf-cache TTL.
+// Preserved results older than this refetch on re-enable so the feed can't lag
+// the Hub. Reset by every successful pull (idle time only). Mirrors the
+// modelInfo TTL in hf-cache.ts.
const STALE_AFTER_MS = 5 * 60 * 1000;
-async function pullBatch<T>(
+export async function pullBatch<T>(
iter: AsyncGenerator<unknown>,
mapItem: (raw: unknown) => T | null,
size: number,
@@ -82,19 +85,21 @@ export function useHubPaginatedSearch<T>(
const iterRef = useRef<AsyncGenerator<unknown> | null>(null);
const versionRef = useRef(0);
- // Aborts the live iterator's in-flight fetches; replaced when a new query
- // supersedes the feed so the abandoned listing stops fetching/priming.
+ // Aborts the live iterator's in-flight fetches; the prior one is aborted and
+ // replaced when a new query supersedes the feed so the abandoned listing stops
+ // fetching and priming the cache.
const abortRef = useRef<AbortController | null>(null);
// Identity of the last-fetched query. A fetch (re)starts only when one of these
- // changes, never just on `enabled` toggling — keeps tab switches instant.
+ // changes, never just on `enabled` toggling, which keeps tab switches instant.
const loadedFactoryRef = useRef<typeof createIter | null>(null);
const loadedMapItemRef = useRef<typeof mapItem | null>(null);
const loadedNonceRef = useRef(-1);
const loadedAtRef = useRef(0);
- // Synchronous in-flight guard, set before any setState so back-to-back
+ // Synchronous in-flight guard. Set before any setState so back-to-back
// fetchMore() calls can't both pass the gate while React batches the commit.
+ // Cleared in finally() of the matching pull.
const busyRef = useRef(false);
const busyKindRef = useRef<BusyKind | null>(null);
const busyTokenRef = useRef(0);
@@ -233,8 +238,9 @@ export function useHubPaginatedSearch<T>(
queuedWhileHiddenRef.current = false;
return false;
}
- // Synchronous in-flight gate before any setState, so concurrent fires from
- // sibling observers all see the same truth and only one proceeds.
+ // Synchronous in-flight gate before any setState so concurrent fires from
+ // sibling observers all see the same truth and only one proceeds, closing
+ // the race window React's batched commit opens.
if (busyRef.current) {
if (busyKindRef.current === "more" && stateRef.current.isLoadingMore) {
if (queuedAfterBusyRef.current) return false;
@@ -310,8 +316,9 @@ export function useHubPaginatedSearch<T>(
setState((prev) => ({
...prev,
isLoadingMore: false,
- // Keep results and hasMore=true: the iterator is still valid, so the next
- // fetchMore() resumes the failed page without discarding the list (retry() restarts from page 1).
+ // Keep results and hasMore=true: the iterator is still valid, so the
+ // next fetchMore() resumes the failed page without discarding the list
+ // (retry() restarts from page 1).
error: err instanceof Error ? err.message : "Failed to load more",
}));
})
diff --git a/studio/frontend/src/features/hub/hooks/use-models-selection.ts b/studio/frontend/src/features/hub/hooks/use-models-selection.ts
index ad86e454e0c..ebbd8baae1d 100644
--- a/studio/frontend/src/features/hub/hooks/use-models-selection.ts
+++ b/studio/frontend/src/features/hub/hooks/use-models-selection.ts
@@ -17,6 +17,8 @@ import {
resolveDiscoverSelection,
resolveDownloadedSelection,
} from "../lib/selection-resolution";
+import { ownerOf, repoOf } from "@/features/hub/lib/format";
+import { buildDiscoverRows, isGgufLike } from "../lib/view-models";
import type {
CachedInventoryRow,
DiscoverRow,
@@ -28,12 +30,25 @@ import { useSelectedModelView } from "./use-selected-model-view";
export interface ModelsSelection {
selectedId: string | null;
- setSelected: (id: string) => void;
+ setSelected: (id: string | null) => void;
selectedModel: SelectedModelView | null;
metadataUnavailable: boolean;
selectionHiddenByFilters: boolean;
}
+function stubDiscoverRow(id: string): DiscoverRow {
+ return {
+ id,
+ owner: ownerOf(id),
+ repo: repoOf(id),
+ result: { id, downloads: 0, likes: 0, isGguf: isGgufLike(id) },
+ isAvailableOnDevice: false,
+ isPartialOnDevice: false,
+ summary: "",
+ capabilities: [],
+ };
+}
+
function preferredLocalRow(
rows: readonly LocalInventoryRow[],
): LocalInventoryRow | null {
@@ -160,10 +175,12 @@ export function useModelsSelection({
: downloadedResolution.hiddenByFilters;
const detailSelectedId = useDeferredValue(selectedId);
const setSelected = useCallback(
- (id: string) => {
+ (id: string | null) => {
if (isDiscoverTab) {
setDiscoverSelectedId(id);
- setDiscoverSelectedSnapshot(discoverRowById.get(id) ?? null);
+ setDiscoverSelectedSnapshot(
+ id ? (discoverRowById.get(id) ?? stubDiscoverRow(id)) : null,
+ );
} else {
setDownloadedSelectedId(id);
}
@@ -265,8 +282,31 @@ export function useModelsSelection({
!!selectedHubRepoId &&
selectedRepoMetadata.error;
- const selectedModel = useSelectedModelView({
+ const selectedDiscoverRowForView = useMemo(() => {
+ if (!selectedDiscoverRow) return null;
+ if (discoverRowById.has(selectedDiscoverRow.id)) return selectedDiscoverRow;
+ if (
+ !isDatasetMode &&
+ selectedHfResult &&
+ selectedHfResult.id.toLowerCase() === selectedDiscoverRow.id.toLowerCase()
+ ) {
+ return (
+ buildDiscoverRows([selectedHfResult], cachedRows, localRows)[0] ??
+ selectedDiscoverRow
+ );
+ }
+ return selectedDiscoverRow;
+ }, [
selectedDiscoverRow,
+ discoverRowById,
+ isDatasetMode,
+ selectedHfResult,
+ cachedRows,
+ localRows,
+ ]);
+
+ const selectedModel = useSelectedModelView({
+ selectedDiscoverRow: selectedDiscoverRowForView,
selectedCachedRow,
selectedLocalRow,
selectedHfResult,
diff --git a/studio/frontend/src/features/hub/hooks/use-selected-model-view.ts b/studio/frontend/src/features/hub/hooks/use-selected-model-view.ts
index 4616aba4bd9..171dd88d3c2 100644
--- a/studio/frontend/src/features/hub/hooks/use-selected-model-view.ts
+++ b/studio/frontend/src/features/hub/hooks/use-selected-model-view.ts
@@ -3,7 +3,11 @@
import { useMemo } from "react";
import { detectCapabilities, detectLicense } from "../lib/model-capabilities";
-import { buildSummary, localSourceLabel, toHfModelResult } from "../lib/view-models";
+import {
+ buildSummary,
+ localSourceLabel,
+ toHfModelResult,
+} from "../lib/view-models";
import type {
CachedInventoryRow,
DiscoverRow,
@@ -121,6 +125,11 @@ export function useSelectedModelView({
: selectedDiscoverRow.result.isGguf
? "gguf"
: null,
+ baseModel: selectedDiscoverRow.result.baseModel ?? null,
+ baseModelSource: selectedDiscoverRow.result.baseModel
+ ? "huggingface"
+ : null,
+ baseModelHubId: selectedDiscoverRow.result.baseModel ?? null,
isDownloaded: !selectedLocalRow.partial,
isPartial: selectedLocalRow.partial ?? false,
partialTransport: selectedLocalRow.partialTransport ?? null,
@@ -129,11 +138,15 @@ export function useSelectedModelView({
license: detectLicense(selectedDiscoverRow.result.tags),
pipelineTag: selectedDiscoverRow.result.pipelineTag,
libraryName: selectedDiscoverRow.result.libraryName,
+ gated: selectedDiscoverRow.result.gated,
+ private: selectedDiscoverRow.result.private,
downloads: selectedDiscoverRow.result.downloads,
+ downloadsAllTime: selectedDiscoverRow.result.downloadsAllTime,
likes: selectedDiscoverRow.result.likes,
totalParams: selectedDiscoverRow.result.totalParams,
estimatedSizeBytes: selectedDiscoverRow.result.estimatedSizeBytes,
updatedAt: selectedDiscoverRow.result.updatedAt,
+ createdAt: selectedDiscoverRow.result.createdAt,
localUpdatedAt: selectedLocalRow.updatedAt,
tags: selectedDiscoverRow.result.tags,
quantMethod: selectedDiscoverRow.result.quantMethod,
@@ -146,13 +159,14 @@ export function useSelectedModelView({
? cachedResource(selectedCachedRow)
: selectedLocalRow?.source === "hf_cache"
? localResource(selectedLocalRow, selectedDiscoverRow.result.id)
- : remoteResource(selectedDiscoverRow);
+ : remoteResource(selectedDiscoverRow);
const isResolvedPartial = resource.cacheState === "partial";
const isResolvedOnDevice =
resource.cacheState === "cached" || resource.cacheState === "local";
const resolvedModelFormat =
selectedCachedRow?.modelFormat ??
- (selectedLocalRow?.modelFormat && selectedLocalRow.modelFormat !== "unknown"
+ (selectedLocalRow?.modelFormat &&
+ selectedLocalRow.modelFormat !== "unknown"
? selectedLocalRow.modelFormat
: selectedDiscoverRow.result.isGguf
? "gguf"
@@ -182,6 +196,11 @@ export function useSelectedModelView({
selectedLocalRow?.capabilities.requiresVariant ??
selectedDiscoverRow.result.isGguf,
modelFormat: resolvedModelFormat,
+ baseModel: selectedDiscoverRow.result.baseModel ?? null,
+ baseModelSource: selectedDiscoverRow.result.baseModel
+ ? "huggingface"
+ : null,
+ baseModelHubId: selectedDiscoverRow.result.baseModel ?? null,
isDownloaded: isResolvedOnDevice,
isPartial: isResolvedPartial,
partialTransport:
@@ -194,12 +213,16 @@ export function useSelectedModelView({
license: detectLicense(selectedDiscoverRow.result.tags),
pipelineTag: selectedDiscoverRow.result.pipelineTag,
libraryName: selectedDiscoverRow.result.libraryName,
+ gated: selectedDiscoverRow.result.gated,
+ private: selectedDiscoverRow.result.private,
downloads: selectedDiscoverRow.result.downloads,
+ downloadsAllTime: selectedDiscoverRow.result.downloadsAllTime,
likes: selectedDiscoverRow.result.likes,
totalParams: selectedDiscoverRow.result.totalParams,
estimatedSizeBytes: selectedDiscoverRow.result.estimatedSizeBytes,
cachedBytes: selectedCachedRow?.bytes,
updatedAt: selectedDiscoverRow.result.updatedAt,
+ createdAt: selectedDiscoverRow.result.createdAt,
tags: selectedDiscoverRow.result.tags,
quantMethod: selectedDiscoverRow.result.quantMethod,
};
@@ -214,11 +237,18 @@ export function useSelectedModelView({
: "Cached checkpoint repository ready for local inference.";
const mergedTags = selectedHfResult?.tags ?? selectedCachedRow.tags;
const mergedPipelineTag =
- selectedHfResult?.pipelineTag ?? selectedCachedRow.pipelineTag ?? undefined;
+ selectedHfResult?.pipelineTag ??
+ selectedCachedRow.pipelineTag ??
+ undefined;
const mergedLibraryName =
- selectedHfResult?.libraryName ?? selectedCachedRow.libraryName ?? undefined;
+ selectedHfResult?.libraryName ??
+ selectedCachedRow.libraryName ??
+ undefined;
const mergedQuantMethod =
- selectedHfResult?.quantMethod ?? selectedCachedRow.quantMethod ?? undefined;
+ selectedHfResult?.quantMethod ??
+ selectedCachedRow.quantMethod ??
+ undefined;
+ const mergedBaseModel = selectedHfResult?.baseModel ?? null;
return {
id: selectedCachedRow.repoId,
kind: "cache",
@@ -236,6 +266,9 @@ export function useSelectedModelView({
isGguf: selectedCachedRow.isGguf,
requiresVariant: selectedCachedRow.capabilities.requiresVariant,
modelFormat: selectedCachedRow.modelFormat,
+ baseModel: mergedBaseModel,
+ baseModelSource: mergedBaseModel ? "huggingface" : null,
+ baseModelHubId: mergedBaseModel,
isDownloaded: !selectedCachedRow.partial,
isPartial: selectedCachedRow.partial ?? false,
partialTransport: selectedCachedRow.partialTransport ?? null,
@@ -250,12 +283,16 @@ export function useSelectedModelView({
license: detectLicense(mergedTags),
pipelineTag: mergedPipelineTag,
libraryName: mergedLibraryName,
+ gated: selectedHfResult?.gated,
+ private: selectedHfResult?.private,
downloads: selectedHfResult?.downloads,
+ downloadsAllTime: selectedHfResult?.downloadsAllTime,
likes: selectedHfResult?.likes,
totalParams: selectedHfResult?.totalParams,
estimatedSizeBytes: selectedHfResult?.estimatedSizeBytes,
cachedBytes: selectedCachedRow.bytes,
updatedAt: selectedHfResult?.updatedAt,
+ createdAt: selectedHfResult?.createdAt,
tags: mergedTags,
quantMethod: mergedQuantMethod,
};
@@ -283,9 +320,10 @@ export function useSelectedModelView({
selectedHfResult?.quantMethod ??
selectedLocalRow.quantMethod ??
undefined;
- const baseModelSummary = selectedLocalRow.baseModel && selectedHfResult
- ? buildSummary(selectedHfResult)
- : null;
+ const baseModelSummary =
+ selectedLocalRow.baseModel && selectedHfResult
+ ? buildSummary(selectedHfResult)
+ : null;
const localHubMetadata = localHubRepoId ? selectedHfResult : null;
if (isPartialHubCache && selectedLocalRow.repoId) {
@@ -321,11 +359,15 @@ export function useSelectedModelView({
license: detectLicense(mergedTags),
pipelineTag: mergedPipelineTag,
libraryName: mergedLibraryName,
+ gated: selectedHfResult?.gated,
+ private: selectedHfResult?.private,
downloads: selectedHfResult?.downloads,
+ downloadsAllTime: selectedHfResult?.downloadsAllTime,
likes: selectedHfResult?.likes,
totalParams: selectedHfResult?.totalParams,
estimatedSizeBytes: selectedHfResult?.estimatedSizeBytes,
updatedAt: selectedHfResult?.updatedAt,
+ createdAt: selectedHfResult?.createdAt,
localUpdatedAt: selectedLocalRow.updatedAt,
tags: mergedTags,
quantMethod: mergedQuantMethod,
@@ -369,11 +411,15 @@ export function useSelectedModelView({
license: detectLicense(mergedTags),
pipelineTag: mergedPipelineTag,
libraryName: mergedLibraryName,
+ gated: localHubMetadata?.gated,
+ private: localHubMetadata?.private,
downloads: localHubMetadata?.downloads,
+ downloadsAllTime: localHubMetadata?.downloadsAllTime,
likes: localHubMetadata?.likes,
totalParams: localHubMetadata?.totalParams,
estimatedSizeBytes: localHubMetadata?.estimatedSizeBytes,
updatedAt: localHubMetadata?.updatedAt,
+ createdAt: localHubMetadata?.createdAt,
localUpdatedAt: selectedLocalRow.updatedAt,
tags: mergedTags,
quantMethod: mergedQuantMethod,
diff --git a/studio/frontend/src/features/hub/hub-page.tsx b/studio/frontend/src/features/hub/hub-page.tsx
index 3de57a31f16..dc9a640cd7d 100644
--- a/studio/frontend/src/features/hub/hub-page.tsx
+++ b/studio/frontend/src/features/hub/hub-page.tsx
@@ -5,14 +5,15 @@ import { useHubInventory } from "@/features/hub/inventory";
import { useDebouncedValue } from "@/hooks/use-debounced-value";
import { useGpuInfo } from "@/hooks/use-gpu-info";
import {
+ type HfModelSearchChannel,
type HfSortDirection,
type HfSortKey,
} from "@/features/hub/hooks/use-hub-model-search";
import { useOnlineStatus } from "@/features/hub/hooks/use-online-status";
-import { useIsHubDesktop } from "@/features/hub/hooks/use-is-hub-desktop";
import { useHubInfiniteScroll } from "@/features/hub/hooks/use-hub-infinite-scroll";
import { ggufVariantsMatch, modelIdsMatch } from "@/features/hub/lib/model-identity";
import { cn } from "@/lib/utils";
+import { usePlatformStore } from "@/config/env";
import { useHfTokenStore } from "@/features/hub/stores/hf-token-store";
import {
getInferenceStatus,
@@ -20,17 +21,26 @@ import {
useChatModelRuntime,
useChatRuntimeStore,
} from "@/features/chat";
-import { ArrowLeft01Icon } from "@hugeicons/core-free-icons";
-import { HugeiconsIcon } from "@hugeicons/react";
import { useNavigate, useSearch } from "@tanstack/react-router";
import {
useCallback,
useDeferredValue,
useEffect,
useMemo,
+ useRef,
useState,
} from "react";
-import { ModelInspector } from "./catalog/model-inspector";
+import { HubDetailView } from "./catalog/hub-detail-view";
+import { HubTopBar } from "./catalog/hub-top-bar";
+import { HubFeed } from "./catalog/hub-feed";
+import { OwnerScopeToggle } from "./catalog/owner-scope-toggle";
+import {
+ type AllModelsView,
+ HubListHeader,
+ type InventorySort,
+ InventorySortControl,
+ ResultListHeader,
+} from "./catalog/models-table";
import {
ModelsCatalog,
type ModelsCatalogHandlers,
@@ -42,11 +52,17 @@ import { ModelsToolbar } from "./catalog/models-toolbar";
import { ExternalLinkConfirmDialog } from "./catalog/external-link-confirm-dialog";
import { OnDeviceFoldersDialog } from "./catalog/on-device-folders-dialog";
import { useDiscoverSearch } from "./hooks/use-discover-search";
+import { useFeedWriteBack } from "./hooks/use-feed-write-back";
+import { useHubFeed } from "./hooks/use-hub-feed";
import { useHubModelVram } from "./hooks/use-hub-model-vram";
import { useModelsSelection } from "./hooks/use-models-selection";
import {
+ CHANNEL_TO_SECTION,
type ChannelId,
type ChannelPreset,
+ HUB_SECTION_TITLE,
+ type HubSection,
+ SECTION_TO_CHANNEL,
findChannel,
} from "./lib/channels";
import { inventoryRowMatches, tokenizeQuery } from "./lib/inventory-search";
@@ -69,11 +85,60 @@ import type {
} from "./types";
const MODELS_TAB_STORAGE_KEY = "unsloth.hub.modelsTab";
+const ALL_MODELS_VIEW_STORAGE_KEY = "unsloth.hub.allModelsView";
+const INVENTORY_SORT_STORAGE_KEY = "unsloth.hub.inventorySort";
+const OWNER_SCOPE_STORAGE_KEY = "unsloth.hub.ownerScope";
+
+/** Discover browsing scope: only the unsloth org (default) or the whole Hub. */
+export type OwnerScope = "unsloth" | "all";
+
+function readOwnerScopePreference(): OwnerScope {
+ if (typeof window === "undefined") {
+ return "unsloth";
+ }
+ try {
+ const value = window.localStorage.getItem(OWNER_SCOPE_STORAGE_KEY);
+ return value === "all" ? "all" : "unsloth";
+ } catch {
+ return "unsloth";
+ }
+}
+
+function writeOwnerScopePreference(scope: OwnerScope): void {
+ if (typeof window === "undefined") {
+ return;
+ }
+ try {
+ window.localStorage.setItem(OWNER_SCOPE_STORAGE_KEY, scope);
+ } catch {
+ return;
+ }
+}
const DEFAULT_DISCOVER_CHANNEL: ChannelId = "unsloth-trending";
+const FEED_LIST_CHANNEL_ID: ChannelId = "unsloth-latest";
+
+type DiscoverMode = "feed" | "channel-list" | "search";
type ModelLoadOptions = { ggufVariant?: string; expectedBytes?: number };
+// Focused list heading stays "Models"/"Datasets" regardless of filters; only
+// search changes the label.
+function buildFocusedHeading({
+ query,
+ channel,
+ isDataset,
+}: {
+ query: string;
+ channel: ChannelPreset | null;
+ isDataset: boolean;
+}): string {
+ const trimmed = query.trim();
+ if (trimmed) return `Results for "${trimmed}"`;
+ if (channel && channel.id !== DEFAULT_DISCOVER_CHANNEL) return channel.label;
+ return isDataset ? "Datasets" : "Models";
+}
+
function discoveryInventorySignature(
cachedRows: readonly CachedInventoryRow[],
localRows: readonly LocalInventoryRow[],
@@ -115,6 +180,57 @@ function writeModelsTabPreference(tab: ModelsTab): void {
}
}
+// "All models" defaults to list layout; list-vs-grid choice persists across sessions.
+function readAllModelsViewPreference(): AllModelsView {
+ if (typeof window === "undefined") {
+ return "split";
+ }
+ try {
+ const value = window.localStorage.getItem(ALL_MODELS_VIEW_STORAGE_KEY);
+ return value === "grid" || value === "two" || value === "split"
+ ? value
+ : "split";
+ } catch {
+ return "split";
+ }
+}
+
+function readInventorySortPreference(): InventorySort {
+ if (typeof window === "undefined") {
+ return "recent";
+ }
+ try {
+ const value = window.localStorage.getItem(INVENTORY_SORT_STORAGE_KEY);
+ return value === "name" || value === "size" || value === "recent"
+ ? value
+ : "recent";
+ } catch {
+ return "recent";
+ }
+}
+
+function writeInventorySortPreference(sort: InventorySort): void {
+ if (typeof window === "undefined") {
+ return;
+ }
+ try {
+ window.localStorage.setItem(INVENTORY_SORT_STORAGE_KEY, sort);
+ } catch {
+ return;
+ }
+}
+
+function writeAllModelsViewPreference(view: AllModelsView): void {
+ if (typeof window === "undefined") {
+ return;
+ }
+ try {
+ window.localStorage.setItem(ALL_MODELS_VIEW_STORAGE_KEY, view);
+ } catch {
+ return;
+ }
+}
+
function useModelsTabState(): {
tab: ModelsTab;
setTab: (tab: ModelsTab) => void;
@@ -122,19 +238,21 @@ function useModelsTabState(): {
const navigate = useNavigate();
const search = useSearch({ from: "/hub" });
const urlTab: ModelsTab | null = search.tab ?? null;
+ const hasModelDeepLink =
+ typeof search.model === "string" && search.model.length > 0;
const [fallbackTab, setFallbackTab] = useState<ModelsTab>(
- () => readModelsTabPreference() ?? "downloaded",
+ () => readModelsTabPreference() ?? "discover",
);
- const tab = urlTab ?? fallbackTab;
+ const tab = urlTab ?? (hasModelDeepLink ? "discover" : fallbackTab);
useEffect(() => {
if (urlTab !== null) return;
void navigate({
to: "/hub",
- search: (prev) => ({ ...prev, tab: fallbackTab }),
+ search: (prev) => ({ ...prev, tab }),
replace: true,
});
- }, [urlTab, fallbackTab, navigate]);
+ }, [urlTab, tab, navigate]);
const setTab = useCallback(
(next: ModelsTab) => {
@@ -142,7 +260,12 @@ function useModelsTabState(): {
writeModelsTabPreference(next);
void navigate({
to: "/hub",
- search: (prev) => ({ ...prev, tab: next }),
+ search: (prev) => ({
+ ...prev,
+ tab: next,
+ section: undefined,
+ model: undefined,
+ }),
replace: true,
});
},
@@ -185,6 +308,9 @@ export function ModelsPage() {
const navigate = useNavigate();
const gpu = useGpuInfo();
const online = useOnlineStatus();
+ const deviceType = usePlatformStore((s) => s.deviceType);
+ const hubSearch = useSearch({ from: "/hub" });
+ const urlModel = hubSearch.model ?? null;
const { selectModel, loadingModel, loadProgress, ejectModel } =
useChatModelRuntime();
@@ -222,15 +348,23 @@ export function ModelsPage() {
() => findChannel(DEFAULT_DISCOVER_CHANNEL)?.sort ?? "trendingScore",
);
const [direction, setDirection] = useState<HfSortDirection>("desc");
- const [resourceType, setResourceType] =
- useState<ResourceTypeFilter>("models");
- const [activeChannelId, setActiveChannelId] = useState<ChannelId | null>(
- DEFAULT_DISCOVER_CHANNEL,
- );
- const activeChannel: ChannelPreset | null = useMemo(
- () => findChannel(activeChannelId),
- [activeChannelId],
+ const [ownerScope, setOwnerScopeState] = useState<OwnerScope>(
+ readOwnerScopePreference,
);
+ const setOwnerScope = useCallback((scope: OwnerScope) => {
+ setOwnerScopeState(scope);
+ writeOwnerScopePreference(scope);
+ }, []);
+ const urlResourceType: ResourceTypeFilter =
+ hubSearch.kind === "datasets" ? "datasets" : "models";
+ const [resourceType, setResourceType] =
+ useState<ResourceTypeFilter>(urlResourceType);
+ // Resync on URL kind change (back/forward); it is only seeded on mount.
+ useEffect(() => {
+ setResourceType((current) =>
+ current === urlResourceType ? current : urlResourceType,
+ );
+ }, [urlResourceType]);
const [discoverFormat, setDiscoverFormat] = useState<ModelFormatFilter>(
() => findChannel(DEFAULT_DISCOVER_CHANNEL)?.format ?? "gguf",
);
@@ -238,27 +372,73 @@ export function ModelsPage() {
useState<ModelFormatFilter>("all");
const isDiscoverTab = tab === "discover";
const isDatasetMode = resourceType === "datasets";
+ const urlSection = hubSearch.section ?? null;
+ const isModelDiscover = isDiscoverTab && !isDatasetMode;
+ const sectionChannelId: ChannelId | null = urlSection
+ ? SECTION_TO_CHANNEL[urlSection]
+ : null;
+ const activeChannelId: ChannelId | null = isModelDiscover
+ ? sectionChannelId
+ : null;
+ const activeChannel: ChannelPreset | null = useMemo(
+ () => findChannel(activeChannelId),
+ [activeChannelId],
+ );
const formatFilter = isDiscoverTab ? discoverFormat : downloadedFormat;
const setFormatFilter = useCallback(
(next: ModelFormatFilter) => {
if (isDiscoverTab) {
setDiscoverFormat(next);
+ if (urlSection) {
+ // Exit the section so its preset does not re-impose its own format.
+ void navigate({
+ to: "/hub",
+ search: (prev) => ({ ...prev, section: undefined }),
+ });
+ }
} else {
setDownloadedFormat(next);
}
},
- [isDiscoverTab],
+ [isDiscoverTab, urlSection, navigate],
);
const [capabilityFilter, setCapabilityFilter] =
useState<CapabilityFilter>("all");
- const [mobileInspectorOpen, setMobileInspectorOpen] = useState(false);
- const isHubDesktop = useIsHubDesktop();
+ const [allModelsView, setAllModelsViewState] = useState<AllModelsView>(
+ readAllModelsViewPreference,
+ );
+ // Remembers the last non-split view so "Back to Hub" can drop out of split
+ // mode into the prior browsing layout (defaults to the two-column grid).
+ const lastNonSplitViewRef = useRef<AllModelsView>("two");
+ const setAllModelsView = useCallback(
+ (view: AllModelsView) => {
+ setAllModelsViewState(view);
+ writeAllModelsViewPreference(view);
+ // Leaving split view drops the inline preview so the user lands on the
+ // full hub list, not the model detail overlay.
+ if (view !== "split") {
+ void navigate({
+ to: "/hub",
+ search: (prev) => ({ ...prev, model: undefined }),
+ });
+ }
+ },
+ [navigate],
+ );
+ const [inventorySort, setInventorySortState] = useState<InventorySort>(
+ readInventorySortPreference,
+ );
+ const setInventorySort = useCallback((sort: InventorySort) => {
+ setInventorySortState(sort);
+ writeInventorySortPreference(sort);
+ }, []);
const [foldersDialogOpen, setFoldersDialogOpen] = useState(false);
const [discoverFetchIntent, setDiscoverFetchIntent] = useState(0);
+ const [sortBrowseActive, setSortBrowseActive] = useState(false);
const handleTabChange = useCallback(
(next: ModelsTab) => {
- setMobileInspectorOpen(false);
+ setSortBrowseActive(false);
setModelsTab(next);
},
[setModelsTab],
@@ -270,44 +450,146 @@ export function ModelsPage() {
setResourceType(next);
setDownloadedFormat("all");
setCapabilityFilter("all");
+ setSortBrowseActive(false);
if (next === "models") {
const preset = findChannel(DEFAULT_DISCOVER_CHANNEL);
- setActiveChannelId(DEFAULT_DISCOVER_CHANNEL);
setDiscoverFormat(preset?.format ?? "gguf");
setSortBy(preset?.sort ?? "trendingScore");
setDirection("desc");
- } else {
- setActiveChannelId(null);
}
+ void navigate({
+ to: "/hub",
+ search: (prev) => ({
+ ...prev,
+ kind: next === "datasets" ? "datasets" : undefined,
+ section: undefined,
+ model: undefined,
+ }),
+ replace: true,
+ });
},
- [resourceType],
+ [resourceType, navigate],
);
- const handleChannelSelect = useCallback((next: ChannelId | null) => {
- setActiveChannelId(next);
+ const handleOpenList = useCallback(
+ (section: HubSection) => {
+ if (urlSection === section) return;
+ const preset = findChannel(SECTION_TO_CHANNEL[section]);
+ if (preset) {
+ setDiscoverFormat(preset.format);
+ setSortBy(preset.sort);
+ setDirection("desc");
+ }
+ setCapabilityFilter("all");
+ setSortBrowseActive(false);
+ // Clear search: an active query outranks the section in `mode`, hiding
+ // the curated list behind global results otherwise.
+ setQuery("");
+ void navigate({
+ to: "/hub",
+ search: (prev) => ({ ...prev, section, model: undefined }),
+ });
+ },
+ [urlSection, navigate],
+ );
+ const handleBackToFeed = useCallback(() => {
+ const preset = findChannel(DEFAULT_DISCOVER_CHANNEL);
+ setDiscoverFormat(preset?.format ?? "gguf");
+ setSortBy(preset?.sort ?? "trendingScore");
+ setDirection("desc");
setCapabilityFilter("all");
+ setSortBrowseActive(false);
+ void navigate({
+ to: "/hub",
+ search: (prev) => ({ ...prev, section: undefined }),
+ });
+ }, [navigate]);
+ const handleResetToDiscover = useCallback(() => {
+ const preset = findChannel(DEFAULT_DISCOVER_CHANNEL);
+ setModelsTab("discover");
+ setResourceType("models");
setQuery("");
- const preset = findChannel(next);
- if (preset) {
- setDiscoverFormat(preset.format);
- setSortBy(preset.sort);
- setDirection("desc");
- }
- }, []);
+ setCapabilityFilter("all");
+ setDownloadedFormat("all");
+ setDiscoverFormat(preset?.format ?? "gguf");
+ setSortBy(preset?.sort ?? "trendingScore");
+ setDirection("desc");
+ setSortBrowseActive(false);
+ void navigate({
+ to: "/hub",
+ // Assert the tab here too: fires alongside setModelsTab's navigation, and
+ // spreading prev could otherwise restore the old tab.
+ search: (prev) => ({
+ ...prev,
+ tab: "discover",
+ section: undefined,
+ model: undefined,
+ kind: undefined,
+ }),
+ });
+ }, [navigate, setModelsTab]);
- const handleSortChange = useCallback((next: HfSortKey) => {
- setSortBy(next);
- if (next === "trendingScore") setDirection("desc");
- }, []);
+ const handleSortChange = useCallback(
+ (next: HfSortKey) => {
+ setSortBy(next);
+ if (next === "trendingScore") setDirection("desc");
+ setSortBrowseActive(true);
+ if (urlSection) {
+ void navigate({
+ to: "/hub",
+ search: (prev) => ({ ...prev, section: undefined }),
+ replace: true,
+ });
+ }
+ },
+ [urlSection, navigate],
+ );
const debouncedQuery = useDebouncedValue(query);
const deferredDebouncedQuery = useDeferredValue(debouncedQuery);
const hfToken = useHfTokenStore((s) => s.token);
const debouncedHfToken = useDebouncedValue(hfToken, 500);
- const effectiveSort: HfSortKey = sortBy;
const deferredFormatFilter = useDeferredValue(formatFilter);
const deferredCapabilityFilter = useDeferredValue(capabilityFilter);
+ const hasQuery = deferredDebouncedQuery.trim() !== "";
+ const mode: DiscoverMode = !isModelDiscover
+ ? "search"
+ : hasQuery
+ ? "search"
+ : urlSection != null
+ ? "channel-list"
+ : sortBrowseActive
+ ? "search"
+ : "feed";
+ const isFeedMode = mode === "feed";
+ const isChannelListMode = mode === "channel-list";
+ const isSortBrowseMode =
+ sortBrowseActive && isModelDiscover && !hasQuery && urlSection == null;
+
+ const liveListChannel = useMemo<ChannelPreset | null>(() => {
+ if (isChannelListMode) return activeChannel;
+ if (isFeedMode) return findChannel(FEED_LIST_CHANNEL_ID);
+ return null;
+ }, [isChannelListMode, isFeedMode, activeChannel]);
+
+ const effectiveSort: HfSortKey =
+ isFeedMode && liveListChannel ? liveListChannel.sort : sortBy;
+ const effectiveDirection: HfSortDirection = isFeedMode ? "desc" : direction;
+ // Feed mode uses the live channel format so it does not hide non-matching rows.
+ const effectiveDiscoverFormat: ModelFormatFilter =
+ isFeedMode && liveListChannel ? liveListChannel.format : deferredFormatFilter;
+
+ const listChannel = useMemo<HfModelSearchChannel | null>(() => {
+ if (!liveListChannel) return null;
+ return {
+ owner: liveListChannel.owner,
+ tags: liveListChannel.tags,
+ query: liveListChannel.query,
+ idSuffix: liveListChannel.idSuffix,
+ };
+ }, [liveListChannel]);
+
const {
results,
datasetResults,
@@ -324,11 +606,19 @@ export function ModelsPage() {
isDiscoverTab,
isDatasetMode,
sortBy: effectiveSort,
- direction,
- activeChannel,
+ direction: effectiveDirection,
+ channel: listChannel,
+ ownerScope,
online,
});
+ useFeedWriteBack({
+ channelId: isChannelListMode ? activeChannelId : null,
+ results,
+ isLoading,
+ accessToken: debouncedHfToken || undefined,
+ });
+
const {
cachedRows: effectiveCachedRows,
localRows: effectiveLocalRows,
@@ -341,8 +631,7 @@ export function ModelsPage() {
} = useHubInventory({ kind: isDatasetMode ? "datasets" : "models" });
const modelDiscoveryInventorySignature = useMemo(
- () =>
- discoveryInventorySignature(effectiveCachedRows, effectiveLocalRows),
+ () => discoveryInventorySignature(effectiveCachedRows, effectiveLocalRows),
[effectiveCachedRows, effectiveLocalRows],
);
const modelDiscoverRows = useMemo<DiscoverRow[]>(
@@ -372,12 +661,17 @@ export function ModelsPage() {
id: ds.id,
downloads: ds.downloads,
likes: ds.likes,
+ private: ds.private,
+ gated: ds.gated,
+ updatedAt: ds.updatedAt,
+ createdAt: ds.createdAt,
+ downloadsAllTime: ds.downloadsAllTime,
isGguf: false,
tags: ds.plainTags,
},
isAvailableOnDevice: availableSet.has(lower),
isPartialOnDevice: partialSet.has(lower),
- summary: summaryParts.join(" · ") || "Dataset",
+ summary: summaryParts.join(" · ") || ds.prettyName || "Dataset",
capabilities: [],
};
});
@@ -385,32 +679,65 @@ export function ModelsPage() {
const discoverRows = isDatasetMode ? datasetDiscoverRows : modelDiscoverRows;
- const filteredDiscoverRows = useMemo(
+ const filteredDiscoverRows = useMemo(() => {
+ if (isDatasetMode) return discoverRows;
+ return discoverRows.filter(
+ (row) =>
+ matchesFormat(detectResultFormat(row.result), effectiveDiscoverFormat) &&
+ matchesCapability(row.capabilities, deferredCapabilityFilter) &&
+ (!activeChannel?.finetunableOnly || isUnslothFinetunable(row.result)),
+ );
+ }, [
+ discoverRows,
+ isDatasetMode,
+ effectiveDiscoverFormat,
+ deferredCapabilityFilter,
+ activeChannel,
+ ]);
+
+ const listRows = filteredDiscoverRows;
+
+ const hubFeed = useHubFeed({
+ accessToken: debouncedHfToken || undefined,
+ online,
+ enabled: isFeedMode,
+ deviceType,
+ });
+
+ const feedTrendingRows = useMemo(
() =>
- discoverRows.filter((row) => {
- if (isDatasetMode) return true;
- return (
- matchesFormat(detectResultFormat(row.result), deferredFormatFilter) &&
- matchesCapability(row.capabilities, deferredCapabilityFilter) &&
- (!activeChannel?.finetunableOnly ||
- isUnslothFinetunable(row.result))
- );
- }),
- [
- discoverRows,
- isDatasetMode,
- deferredFormatFilter,
- deferredCapabilityFilter,
- activeChannel,
- ],
+ buildDiscoverRows(
+ hubFeed.trending.results,
+ effectiveCachedRows,
+ effectiveLocalRows,
+ ).filter((row) => matchesFormat(row.result.isGguf, "gguf")),
+ [hubFeed.trending.results, modelDiscoveryInventorySignature],
);
+ const feedRows = useMemo(() => {
+ if (!isFeedMode) return [];
+ const seen = new Set<string>();
+ const merged: DiscoverRow[] = [];
+ for (const row of [...feedTrendingRows, ...filteredDiscoverRows]) {
+ if (seen.has(row.id)) continue;
+ seen.add(row.id);
+ merged.push(row);
+ }
+ return merged;
+ }, [isFeedMode, feedTrendingRows, filteredDiscoverRows]);
+ const feedResults = useMemo(() => feedRows.map((row) => row.result), [feedRows]);
+ const selectionDiscoverRows = isFeedMode ? feedRows : discoverRows;
+ const selectionFilteredDiscoverRows = isFeedMode
+ ? feedRows
+ : filteredDiscoverRows;
+ const selectionResults = isFeedMode ? feedResults : results;
const inventoryTokens = useMemo(
() => (isDiscoverTab ? [] : tokenizeQuery(deferredDebouncedQuery)),
[isDiscoverTab, deferredDebouncedQuery],
);
- // Format filter hard-filters; the text query drives dim-not-filter on the On Device
- // tab so selection survives typing, with matching rows partitioned to the top.
+ // Format filter is a deliberate scope narrowing, so hard-filter it out. The
+ // text query instead drives dim-not-filter on On Device (see ModelsCatalog) so
+ // selection survives typing; matching rows are partitioned to the top.
const filteredCachedRows = useMemo(
() =>
partitionByMatch(
@@ -445,8 +772,9 @@ export function ModelsPage() {
deferredFormatFilter,
deferredCapabilityFilter,
effectiveSort,
- direction,
+ effectiveDirection,
activeChannelId,
+ ownerScope,
]),
[
deferredDebouncedQuery,
@@ -454,19 +782,26 @@ export function ModelsPage() {
deferredFormatFilter,
deferredCapabilityFilter,
effectiveSort,
- direction,
+ effectiveDirection,
activeChannelId,
+ ownerScope,
],
);
const handleClearFilters = useCallback(() => {
if (isDiscoverTab) {
- setActiveChannelId(null);
setDiscoverFormat("all");
+ if (urlSection) {
+ void navigate({
+ to: "/hub",
+ search: (prev) => ({ ...prev, section: undefined }),
+ replace: true,
+ });
+ }
} else {
setDownloadedFormat("all");
}
setCapabilityFilter("all");
- }, [isDiscoverTab]);
+ }, [isDiscoverTab, urlSection, navigate]);
const handleDiscoverFetchIntent = useCallback(() => {
setDiscoverFetchIntent((value) => value + 1);
}, []);
@@ -478,8 +813,10 @@ export function ModelsPage() {
fetchMoreManually: fetchMoreDiscoverManually,
} = useHubInfiniteScroll(
fetchMore,
- // Re-evaluate off the raw fetched count, not the filtered one: page-level filters
- // can reject every incoming row, stalling filteredDiscoverRows while results grow.
+ // Re-evaluate off the raw fetched count, not the filtered one: aggressive
+ // format/capability filters can reject every row, stalling
+ // filteredDiscoverRows.length while results grow. The raw count guarantees
+ // the auto-fire effect re-runs after each fetch lands.
scannedCount,
{
enabled: online && isDiscoverTab && hasMore,
@@ -501,13 +838,13 @@ export function ModelsPage() {
} = useModelsSelection({
isDiscoverTab,
isDatasetMode,
- discoverRows,
+ discoverRows: selectionDiscoverRows,
cachedRows: effectiveCachedRows,
localRows: effectiveLocalRows,
- filteredDiscoverRows,
+ filteredDiscoverRows: selectionFilteredDiscoverRows,
filteredCachedRows,
filteredLocalRows,
- results,
+ results: selectionResults,
accessToken: debouncedHfToken || undefined,
online,
});
@@ -515,24 +852,117 @@ export function ModelsPage() {
const handleSelect = useCallback(
(id: string) => {
setSelected(id);
- // Only flip the mobile drawer in single-pane layout; on lg+ both panes are
- // visible and setting state here just churns the catalog's virtualizer.
- if (
- typeof window !== "undefined" &&
- window.matchMedia("(max-width: 1023.98px)").matches
- ) {
- setMobileInspectorOpen(true);
- }
+ void navigate({
+ to: "/hub",
+ search: (prev) => ({ ...prev, model: id }),
+ });
},
- [setSelected],
+ [setSelected, navigate],
);
+ const handleCloseDetail = useCallback(() => {
+ // From split view, "Back to Hub" exits the master-detail layout and returns
+ // to the main hub feed (not the filtered list): leave split mode, reset
+ // discover state to defaults, and clear the inline preview and channel.
+ if (allModelsView === "split") {
+ const next = lastNonSplitViewRef.current;
+ setAllModelsViewState(next);
+ writeAllModelsViewPreference(next);
+ const preset = findChannel(DEFAULT_DISCOVER_CHANNEL);
+ setDiscoverFormat(preset?.format ?? "gguf");
+ setSortBy(preset?.sort ?? "trendingScore");
+ setDirection("desc");
+ setCapabilityFilter("all");
+ setSortBrowseActive(false);
+ setQuery("");
+ void navigate({
+ to: "/hub",
+ search: (prev) => ({ ...prev, model: undefined, section: undefined }),
+ });
+ return;
+ }
+ void navigate({
+ to: "/hub",
+ search: (prev) => ({ ...prev, model: undefined }),
+ });
+ }, [navigate, allModelsView]);
const handleQueryChange = useCallback(
(next: string) => {
- if (activeChannelId) setActiveChannelId(null);
+ if (next.trim() === "") {
+ const preset = findChannel(DEFAULT_DISCOVER_CHANNEL);
+ setCapabilityFilter("all");
+ setSortBrowseActive(false);
+ if (preset) {
+ setDiscoverFormat(preset.format);
+ setSortBy(preset.sort);
+ setDirection("desc");
+ }
+ }
+ if (urlModel || urlSection) {
+ void navigate({
+ to: "/hub",
+ search: (prev) => ({
+ ...prev,
+ model: undefined,
+ section: undefined,
+ }),
+ replace: true,
+ });
+ }
setQuery(next);
},
- [activeChannelId],
+ [urlSection, urlModel, navigate],
);
+
+ useEffect(() => {
+ if (urlModel !== selectedId) {
+ setSelected(urlModel);
+ }
+ }, [urlModel, selectedId, setSelected]);
+
+ // Track the last non-split layout so leaving split mode restores it.
+ useEffect(() => {
+ if (allModelsView !== "split") {
+ lastNonSplitViewRef.current = allModelsView;
+ }
+ }, [allModelsView]);
+
+ // Split view previews the first row so the detail pane isn't empty, except in
+ // feed mode where the feed must stay visible.
+ useEffect(() => {
+ if (allModelsView !== "split" || urlModel || isFeedMode) return;
+ // Use the filtered rows the master pane renders, not raw inventory, so the
+ // preview never lands on a filtered-out row.
+ const firstId = isDiscoverTab
+ ? listRows[0]?.id
+ : (filteredCachedRows[0]?.id ?? filteredLocalRows[0]?.id);
+ if (!firstId) return;
+ setSelected(firstId);
+ void navigate({
+ to: "/hub",
+ search: (prev) => ({ ...prev, model: firstId }),
+ replace: true,
+ });
+ }, [
+ allModelsView,
+ urlModel,
+ isFeedMode,
+ isDiscoverTab,
+ listRows,
+ filteredCachedRows,
+ filteredLocalRows,
+ setSelected,
+ navigate,
+ ]);
+
+ useEffect(() => {
+ if (!isModelDiscover || !sectionChannelId) return;
+ const preset = findChannel(sectionChannelId);
+ if (!preset) return;
+ setDiscoverFormat(preset.format);
+ setSortBy(preset.sort);
+ setDirection("desc");
+ setCapabilityFilter("all");
+ }, [isModelDiscover, sectionChannelId]);
const handleManageLocalFolders = useCallback(
() => setFoldersDialogOpen(true),
[],
@@ -601,7 +1031,34 @@ export function ModelsPage() {
(opts: ModelLoadOptions = {}) => runSelectedModel(opts, true),
[runSelectedModel],
);
- const handleTrain = useCallback(() => undefined, []);
+ const handleTrain = useCallback(() => {
+ // Hub → train integration ships in a later PR.
+ }, []);
+ const handleSearchHub = useCallback(
+ (next: string) => {
+ const trimmed = next.trim();
+ if (!trimmed) return;
+ setModelsTab("discover");
+ setResourceType("models");
+ setDiscoverFormat("all");
+ setCapabilityFilter("all");
+ setSortBrowseActive(false);
+ // Base models come from other publishers, so search the whole Hub.
+ setOwnerScope("all");
+ setQuery(trimmed);
+ void navigate({
+ to: "/hub",
+ search: (prev) => ({
+ ...prev,
+ tab: "discover",
+ section: undefined,
+ model: undefined,
+ kind: undefined,
+ }),
+ });
+ },
+ [navigate, setModelsTab, setOwnerScope],
+ );
const inspectorRuntime = useMemo(
() => ({
@@ -635,12 +1092,14 @@ export function ModelsPage() {
onUseInChat: openNewChat,
onTrain: handleTrain,
onInventoryChange: refreshInventory,
+ onSearchHub: handleSearchHub,
}),
[
handleLoad,
handleLoadLocal,
openNewChat,
handleTrain,
+ handleSearchHub,
refreshInventory,
],
);
@@ -648,7 +1107,7 @@ export function ModelsPage() {
const catalogState = useMemo<ModelsCatalogState>(
() => ({
tab,
- discoverRows: filteredDiscoverRows,
+ discoverRows: listRows,
cachedRows: filteredCachedRows,
localRows: filteredLocalRows,
selectedId,
@@ -668,11 +1127,13 @@ export function ModelsPage() {
hasMore,
manualFetchAvailable: discoverManualFetchAvailable,
hasActiveFilters:
- deferredFormatFilter !== "all" || deferredCapabilityFilter !== "all",
+ !isFeedMode &&
+ (deferredFormatFilter !== "all" || deferredCapabilityFilter !== "all"),
}),
[
tab,
- filteredDiscoverRows,
+ isFeedMode,
+ listRows,
filteredCachedRows,
filteredLocalRows,
selectedId,
@@ -724,9 +1185,134 @@ export function ModelsPage() {
],
);
+ const focusedHeadingText = useMemo(
+ () =>
+ buildFocusedHeading({
+ query: deferredDebouncedQuery,
+ channel: activeChannel,
+ isDataset: isDatasetMode,
+ }),
+ [deferredDebouncedQuery, activeChannel, isDatasetMode],
+ );
+
+ const listCount = listRows.length;
+ const channelSection = activeChannelId
+ ? CHANNEL_TO_SECTION[activeChannelId]
+ : null;
+ const catalogHeader = useMemo(() => {
+ if (!isDiscoverTab) return null;
+ if (isFeedMode) {
+ return (
+ <div className="flex flex-col gap-6 pt-6">
+ {allModelsView !== "split" && (
+ <HubFeed
+ trending={{
+ rows: feedTrendingRows,
+ isLoading: hubFeed.trending.isLoading,
+ }}
+ deviceType={deviceType}
+ isDataset={isDatasetMode}
+ onSelect={handleSelect}
+ onOpenChannel={handleOpenList}
+ />
+ )}
+ <div className="flex flex-col gap-3">
+ <HubListHeader
+ title={HUB_SECTION_TITLE.latest}
+ count={listCount}
+ view={allModelsView}
+ onViewChange={setAllModelsView}
+ onRefresh={handleRetrySearch}
+ isRefreshing={isLoading}
+ />
+ {allModelsView === "grid" && listCount > 0 && (
+ <ResultListHeader isDataset={isDatasetMode} />
+ )}
+ </div>
+ </div>
+ );
+ }
+ const ownerToggle = !isDatasetMode ? (
+ <OwnerScopeToggle value={ownerScope} onChange={setOwnerScope} />
+ ) : undefined;
+ // Compact pill so it stays beside the view-mode tabs even in the narrow
+ // split pane instead of dropping to its own row.
+ return (
+ <div className="flex flex-col gap-3 pt-6">
+ {isChannelListMode ? (
+ <HubListHeader
+ title={channelSection ? HUB_SECTION_TITLE[channelSection] : "Models"}
+ count={listCount}
+ view={allModelsView}
+ onViewChange={setAllModelsView}
+ onBack={handleBackToFeed}
+ actions={ownerToggle}
+ />
+ ) : (
+ <HubListHeader
+ title={focusedHeadingText}
+ view={allModelsView}
+ onViewChange={setAllModelsView}
+ onBack={isSortBrowseMode ? handleBackToFeed : undefined}
+ actions={ownerToggle}
+ />
+ )}
+ {allModelsView === "grid" && listCount > 0 && (
+ <ResultListHeader isDataset={isDatasetMode} />
+ )}
+ </div>
+ );
+ }, [
+ isDiscoverTab,
+ isFeedMode,
+ isChannelListMode,
+ isSortBrowseMode,
+ channelSection,
+ handleBackToFeed,
+ focusedHeadingText,
+ listCount,
+ allModelsView,
+ setAllModelsView,
+ ownerScope,
+ setOwnerScope,
+ isDatasetMode,
+ feedTrendingRows,
+ hubFeed.trending.isLoading,
+ deviceType,
+ handleSelect,
+ handleOpenList,
+ ]);
+
+ const downloadedHeader = useMemo(() => {
+ const sortControl = (
+ <InventorySortControl value={inventorySort} onChange={setInventorySort} />
+ );
+ // Compact pill so it stays beside the view-mode tabs even in the narrow
+ // split pane instead of dropping to its own row.
+ return (
+ <HubListHeader
+ title="On device"
+ count={effectiveCachedRows.length + effectiveLocalRows.length}
+ view={allModelsView}
+ onViewChange={setAllModelsView}
+ actions={sortControl}
+ />
+ );
+ }, [
+ effectiveCachedRows.length,
+ effectiveLocalRows.length,
+ allModelsView,
+ setAllModelsView,
+ inventorySort,
+ setInventorySort,
+ ]);
+
+ const detailOpen = urlModel !== null;
+ const splitMode = allModelsView === "split";
+
return (
- <div className="hub-page flex h-full min-h-0 flex-col">
- <div className="mx-auto flex w-full max-w-[1180px] flex-1 min-h-0 flex-col gap-6 px-5 pt-8 pb-6 sm:px-9 sm:pt-10 sm:pb-8">
+ <div className="hub-page flex min-h-0 min-w-0 flex-1 basis-0 flex-col overflow-hidden bg-background">
+ <HubTopBar>
<ModelsHeader
cachedCount={effectiveCachedRows.length}
localCount={effectiveLocalRows.length}
@@ -735,86 +1321,104 @@ export function ModelsPage() {
ramLabel={ramLabel}
activeCheckpoint={activeCheckpoint}
activeGgufVariant={activeGgufVariant}
+ onTitleClick={handleResetToDiscover}
onEject={() => void ejectModel()}
/>
+ <ModelsToolbar
+ tab={tab}
+ onTabChange={handleTabChange}
+ query={query}
+ onQueryChange={handleQueryChange}
+ isLoading={isLoading}
+ sortBy={effectiveSort}
+ onSortChange={handleSortChange}
+ resourceType={resourceType}
+ onResourceTypeChange={handleResourceTypeChange}
+ formatFilter={formatFilter}
+ onFormatFilterChange={setFormatFilter}
+ capabilityFilter={capabilityFilter}
+ onCapabilityFilterChange={setCapabilityFilter}
+ onManageLocalFolders={handleManageLocalFolders}
+ onOpenFineTune={() => handleOpenList("finetune")}
+ />
+ </HubTopBar>
- <section className="elevated-card flex min-h-0 flex-1 flex-col overflow-hidden bg-card">
- <div className="hub-side-surface shrink-0 px-4 pt-4 pb-6">
- <ModelsToolbar
- tab={tab}
- onTabChange={handleTabChange}
- query={query}
- onQueryChange={handleQueryChange}
- isLoading={isLoading}
- sortBy={effectiveSort}
- onSortChange={handleSortChange}
- resourceType={resourceType}
- onResourceTypeChange={handleResourceTypeChange}
- formatFilter={formatFilter}
- onFormatFilterChange={setFormatFilter}
- capabilityFilter={capabilityFilter}
- onCapabilityFilterChange={setCapabilityFilter}
- activeChannelId={activeChannelId}
- onChannelSelect={handleChannelSelect}
- onRefresh={handleRetrySearch}
- onManageLocalFolders={handleManageLocalFolders}
- />
- </div>
+ <div
+ className={cn(
+ "relative flex min-h-0 min-w-0 flex-1 basis-0",
+ // Split mode shares the top bar's centered 1100px measure so the
+ // master list lines up with the heading instead of hugging the edge.
+ splitMode
+ ? "flex-col lg:mx-auto lg:w-full lg:max-w-[1100px] lg:flex-row"
+ : "flex-col",
+ )}
+ >
+ <div
+ className={cn(
+ "flex min-h-0 flex-col",
+ // Split mode keeps the catalog as a fixed-width master pane on large
+ // screens; otherwise it fills the area and the detail view overlays it.
+ splitMode
+ ? "flex-1 lg:w-[460px] lg:max-w-[44%] lg:flex-none lg:shrink-0 lg:border-r lg:border-border/60"
+ : "flex-1",
+ detailOpen && !splitMode && "pointer-events-none",
+ )}
+ aria-hidden={(detailOpen && !splitMode) || undefined}
+ >
+ <ModelsCatalog
+ state={catalogState}
+ pagination={catalogPagination}
+ handlers={catalogHandlers}
+ header={catalogHeader}
+ downloadedHeader={downloadedHeader}
+ resetScrollKey={filterResetSignature}
+ discoverView={allModelsView}
+ inventorySort={inventorySort}
+ />
+ </div>
- <div className="flex min-h-0 flex-1 flex-col lg:grid lg:grid-cols-[360px_minmax(0,1fr)] xl:grid-cols-[400px_minmax(0,1fr)] 2xl:grid-cols-[440px_minmax(0,1fr)]">
- <div
- className={cn(
- "hub-side-surface flex min-h-0 min-w-0 flex-1 flex-col border-b border-sidebar-border lg:flex-initial lg:border-b-0 lg:border-r lg:border-sidebar-border",
- mobileInspectorOpen && "hidden lg:flex",
- )}
- >
- <ModelsCatalog
- state={catalogState}
- pagination={catalogPagination}
- handlers={catalogHandlers}
+ {splitMode ? (
+ detailOpen ? (
+ <div className="hub-canvas z-20 flex min-h-0 flex-col max-lg:absolute max-lg:inset-0 lg:relative lg:min-w-0 lg:flex-1">
+ <HubDetailView
+ model={selectedModel}
+ isDataset={isDatasetMode}
+ metadataUnavailable={metadataUnavailable}
+ selectionHiddenByFilters={selectionHiddenByFilters}
+ runtime={inspectorRuntime}
+ actions={inspectorActions}
+ onBack={handleCloseDetail}
+ compact={true}
/>
</div>
-
- <div
- className={cn(
- "hub-side-surface flex min-h-0 min-w-0 flex-1 flex-col lg:flex-initial",
- !mobileInspectorOpen && "hidden lg:flex",
- )}
- >
- <button
- type="button"
- onClick={() => setMobileInspectorOpen(false)}
- className="relative z-10 flex h-10 shrink-0 cursor-pointer select-none items-center gap-1.5 border-b border-border bg-transparent px-4 text-[12.5px] font-medium text-muted-foreground transition-colors hover:text-foreground lg:hidden"
- >
- <HugeiconsIcon
- icon={ArrowLeft01Icon}
- strokeWidth={1.75}
- className="size-3.5"
- />
- Back to list
- </button>
- <div className="flex min-h-0 flex-1 flex-col">
- {(isHubDesktop || mobileInspectorOpen) && (
- <ModelInspector
- model={selectedModel}
- isDataset={isDatasetMode}
- metadataUnavailable={metadataUnavailable}
- selectionHiddenByFilters={selectionHiddenByFilters}
- runtime={inspectorRuntime}
- actions={inspectorActions}
- />
- )}
- </div>
+ ) : (
+ <div className="hidden min-h-0 flex-1 items-center justify-center px-6 text-center text-[13px] text-muted-foreground lg:flex">
+ Select a model to preview its details.
</div>
- </div>
- </section>
- <OnDeviceFoldersDialog
- open={foldersDialogOpen}
- onOpenChange={setFoldersDialogOpen}
- onInventoryChange={refreshInventory}
- />
- <ExternalLinkConfirmDialog />
+ )
+ ) : (
+ detailOpen && (
+ <div className="hub-canvas absolute inset-0 z-20 flex min-h-0 flex-col">
+ <HubDetailView
+ model={selectedModel}
+ isDataset={isDatasetMode}
+ metadataUnavailable={metadataUnavailable}
+ selectionHiddenByFilters={selectionHiddenByFilters}
+ runtime={inspectorRuntime}
+ actions={inspectorActions}
+ onBack={handleCloseDetail}
+ />
+ </div>
+ )
+ )}
</div>
+
+ <OnDeviceFoldersDialog
+ open={foldersDialogOpen}
+ onOpenChange={setFoldersDialogOpen}
+ onInventoryChange={refreshInventory}
+ />
+ <ExternalLinkConfirmDialog />
</div>
);
}
diff --git a/studio/frontend/src/features/hub/hub.css b/studio/frontend/src/features/hub/hub.css
index 53f5ba576ce..c481ca11a5e 100644
--- a/studio/frontend/src/features/hub/hub.css
+++ b/studio/frontend/src/features/hub/hub.css
@@ -12,740 +12,1495 @@
classes so they do not bleed into chat, train or settings surfaces. */
:root {
- --format-gguf: #60a5fa;
- --format-checkpoint: #f472b6;
- --format-adapter: #8b5cf6;
- --format-mlx: #f59e0b;
- --status-warning: #eab308;
- --status-danger: #ef4444;
- --status-success: #11b686;
+ --format-gguf: #60a5fa;
+ --format-checkpoint: #f472b6;
+ --format-adapter: #8b5cf6;
+ --format-mlx: #f59e0b;
+ --status-warning: #eab308;
+ --status-danger: #ef4444;
+ --status-success: #11b686;
}
.dark {
- --format-gguf: #60a5fa;
- --format-checkpoint: #f472b6;
- --format-adapter: #a78bfa;
- --format-mlx: #fbbf24;
- --status-warning: #fbbf24;
- --status-danger: #ef4444;
- --status-success: #11b686;
+ --format-gguf: #60a5fa;
+ --format-checkpoint: #f472b6;
+ --format-adapter: #a78bfa;
+ --format-mlx: #fbbf24;
+ --status-warning: #fbbf24;
+ --status-danger: #ef4444;
+ --status-success: #11b686;
}
@theme inline {
- --color-format-gguf: var(--format-gguf);
- --color-format-checkpoint: var(--format-checkpoint);
- --color-format-adapter: var(--format-adapter);
- --color-format-mlx: var(--format-mlx);
- --color-status-warning: var(--status-warning);
- --color-status-danger: var(--status-danger);
- --color-status-success: var(--status-success);
+ --color-format-gguf: var(--format-gguf);
+ --color-format-checkpoint: var(--format-checkpoint);
+ --color-format-adapter: var(--format-adapter);
+ --color-format-mlx: var(--format-mlx);
+ --color-status-warning: var(--status-warning);
+ --color-status-danger: var(--status-danger);
+ --color-status-success: var(--status-success);
}
@layer base {
- /* Filled-control surface — Hub search, Hub filter triggers, Train
- number/text inputs, Train Selects, picker search bars. The same
- visual identity the Hub search has always had:
- - Resting: subtle 3% bg + 5% border
- - Hover / open: 5% bg + 8% border
- - Focus: 4% bg + 15% border (no solid colour swap)
- - box-shadow: none on focus to neutralise shadcn's
- focus-visible green ring (--ring is the brand primary).
- `!important` is used on focus box-shadow only — Tailwind's
- `focus-visible:ring-…` utility composes via `--tw-ring-shadow`
- into the final box-shadow at the same specificity as ours, and
- without bumping ours we'd lose the cascade tie inconsistently
- depending on which utility was applied last to the element. */
- .field-soft {
- background-color: color-mix(in srgb, var(--foreground) 3%, transparent);
- border: 1px solid color-mix(in srgb, var(--foreground) 5%, transparent);
- box-shadow: none;
- transition:
- background-color 160ms ease,
- border-color 160ms ease;
- }
-
- .field-soft:hover,
- .field-soft[data-state="open"] {
- background-color: color-mix(in srgb, var(--foreground) 5%, transparent);
- border-color: color-mix(in srgb, var(--foreground) 8%, transparent);
- }
-
- .field-soft:focus,
- .field-soft:focus-visible,
- .field-soft:focus-within {
- background-color: color-mix(in srgb, var(--foreground) 4%, transparent);
- border-color: color-mix(in srgb, var(--foreground) 15%, transparent) !important;
- box-shadow: none !important;
- outline: none;
- }
-
- .dark .field-soft {
- background-color: color-mix(in srgb, var(--foreground) 4%, transparent);
- border-color: color-mix(in srgb, var(--foreground) 6%, transparent);
- }
-
- .dark .field-soft:hover,
- .dark .field-soft[data-state="open"] {
- background-color: color-mix(in srgb, var(--foreground) 5%, transparent);
- border-color: color-mix(in srgb, var(--foreground) 8%, transparent);
- }
-
- .dark .field-soft:focus,
- .dark .field-soft:focus-visible,
- .dark .field-soft:focus-within {
- background-color: color-mix(in srgb, var(--foreground) 7%, transparent);
- border-color: color-mix(in srgb, var(--foreground) 15%, transparent) !important;
- }
-
- .hub-page .elevated-card {
- border: 1px solid color-mix(in srgb, var(--foreground) 5%, transparent);
- border-radius: 20px;
- /* No ambient glow: it tinted the white page gray around the card. */
- box-shadow: 0 12px 48px -8px color-mix(in srgb, var(--foreground) 8%, transparent);
- }
-
- @media (min-width: 640px) {
- .hub-page .elevated-card {
- border-radius: 28px;
- }
- }
-
- @media (min-width: 1024px) {
- .hub-page .elevated-card {
- border-radius: 32px;
- }
- }
-
- html.dark .hub-page .elevated-card {
- border-color: transparent;
- box-shadow: none;
- }
-
- .hub-page .page-title-halo {
- text-shadow:
- 0 0 24px #e4e3df,
- 0 0 56px #ebeae6,
- 0 0 96px #efeeea;
- }
-
- html.dark .hub-page .page-title-halo {
- text-shadow: none;
- }
-
- html:not(.dark) .hub-page {
- background-color: #fff;
- }
-
- html:not(.dark) .hub-page > div > section .border-b,
- html:not(.dark) .hub-page > div > section .border-r,
- html:not(.dark) .hub-page > div > section .border-t.border-border {
- border-color: color-mix(in srgb, var(--foreground) 6%, transparent);
- }
-
- html:not(.dark) .hub-page .hub-side-surface {
- background-color: var(--background);
- }
-
- html:not(.dark) .hub-page .hub-tag-soft,
- html:not(.dark) .hub-page .hub-tag-meta {
- background-color: transparent;
- transition:
- background-color 160ms ease,
- border-color 160ms ease;
- }
-
- html:not(.dark) .hub-page .hub-tag-soft:hover,
- html:not(.dark) .hub-page .hub-tag-meta:hover {
- background-color: color-mix(in srgb, var(--foreground) 4%, transparent);
- }
-
- html.dark .hub-page {
- background-color: var(--background);
- }
-
- html.dark .hub-page > div > section [class*="bg-card"],
- html.dark .hub-page > div > section [class*="bg-background"] {
- background-color: var(--popover);
- }
-
- html.dark .hub-page > div > section .border-b,
- html.dark .hub-page > div > section .border-r,
- html.dark .hub-page > div > section .border-t.border-border {
- border-color: color-mix(in srgb, var(--foreground) 5%, transparent);
- }
-
- html.dark .hub-page .hub-side-surface {
- background-color: transparent;
- }
-
- html.dark .hub-page .hub-tag-soft,
- html.dark .hub-page .hub-tag-meta {
- background-color: transparent;
- transition:
- background-color 160ms ease,
- border-color 160ms ease;
- }
-
- html.dark .hub-page .hub-tag-soft {
- color: var(--muted-foreground);
- }
-
- html.dark .hub-page .hub-tag-meta {
- color: var(--muted-foreground);
- }
-
- html.dark .hub-page .hub-tag-soft:hover,
- html.dark .hub-page .hub-tag-meta:hover {
- background-color: color-mix(in srgb, var(--foreground) 4%, transparent);
- }
-
- .hub-menu-instant {
- animation: none !important;
- transition: none !important;
- transform: none !important;
- --tw-translate-x: 0px !important;
- --tw-translate-y: 0px !important;
- --tw-scale-x: 1 !important;
- --tw-scale-y: 1 !important;
- translate: 0 0 !important;
- user-select: none;
- -webkit-user-select: none;
- will-change: auto !important;
- }
-
- .hub-menu-instant.menu-soft-surface {
- --menu-soft-blur: 18px;
- --menu-soft-spread: -8px;
- }
-
- .hub-menu-instant [data-slot="select-item"]:focus,
- .hub-menu-instant [data-slot="select-item"][data-highlighted],
- .hub-menu-instant [role="option"][data-highlighted] {
- background-color: color-mix(in srgb, var(--foreground) 6%, transparent);
- color: var(--foreground);
- }
-
- html.dark .hub-menu-instant [data-slot="select-item"]:focus,
- html.dark .hub-menu-instant [data-slot="select-item"][data-highlighted],
- html.dark .hub-menu-instant [role="option"][data-highlighted] {
- background-color: color-mix(in srgb, var(--foreground) 8%, transparent);
- color: var(--foreground);
- }
-
- html.dark .hub-menu-instant {
- background-color: #2e2f31 !important;
- }
-
- .hub-menu-instant *,
- .hub-menu-instant *::before,
- .hub-menu-instant *::after,
- .hub-menu-trigger,
- .hub-menu-trigger * {
- animation: none !important;
- transition: none !important;
- user-select: none;
- -webkit-user-select: none;
- }
-
- html:not(.dark) .hub-page .hub-tab-toggle {
- background-color: color-mix(in srgb, var(--foreground) 5%, transparent);
- border: 0;
- box-shadow: none;
- }
-
- html.dark .hub-page .hub-tab-toggle {
- background-color: color-mix(in srgb, var(--foreground) 4.5%, transparent);
- border: 0;
- box-shadow: none;
- }
-
- html:not(.dark) .hub-page .hub-tab-toggle-pill {
- background-color: var(--background);
- border: 0;
- box-shadow:
- 0 1px 2px color-mix(in srgb, var(--foreground) 8%, transparent),
- 0 4px 10px -3px color-mix(in srgb, var(--foreground) 6%, transparent);
- }
-
- html.dark .hub-page .hub-tab-toggle-pill {
- background-color: color-mix(in srgb, var(--foreground) 10%, transparent);
- border: 0;
- box-shadow:
- 0 1px 2px rgba(0, 0, 0, 0.14),
- 0 4px 10px -3px rgba(0, 0, 0, 0.1);
- }
-
- html:not(.dark) .hub-page .catalog-row {
- background-color: transparent;
- border-color: transparent;
- box-shadow: none;
- transition: background-color 160ms ease;
- }
-
- html:not(.dark) .hub-page .catalog-row:hover {
- background-color: color-mix(in srgb, var(--foreground) 3.5%, transparent);
- }
-
- html:not(.dark) .hub-page .catalog-row[data-selected="true"] {
- background-color: color-mix(in srgb, var(--foreground) 6%, transparent);
- }
-
- /* Currently-loaded checkpoint: a brand-green left stripe plus a faint
+ /* Filled-control surface — Hub search, Hub filter triggers, picker
+ search bars. Borderless soft fill matching the .hub-tab-toggle pills:
+ - Resting: 5% bg, no border
+ - Hover / open: 8% bg
+ - Focus: keyboard-only (:focus-visible) so a mouse click never
+ leaves the control looking "selected"; the open dropdown stays
+ lit via [data-state="open"].
+ `!important` is required because these controls also carry shadcn
+ Input utilities (bg-input/30, border, focus ring) that live in the
+ utilities layer and would otherwise win over this base layer. */
+ .field-soft {
+ background-color: color-mix(in srgb, var(--foreground) 5%, transparent) !important;
+ border: 0;
+ box-shadow: none;
+ transition: background-color 160ms ease;
+ }
+
+ .field-soft:hover,
+ .field-soft[data-state="open"] {
+ background-color: color-mix(in srgb, var(--foreground) 8%, transparent) !important;
+ }
+
+ .field-soft:focus-visible {
+ background-color: color-mix(in srgb, var(--foreground) 8%, transparent) !important;
+ box-shadow: none !important;
+ outline: none;
+ }
+
+ .dark .field-soft {
+ background-color: color-mix(in srgb, var(--foreground) 5%, transparent) !important;
+ }
+
+ .dark .field-soft:hover,
+ .dark .field-soft[data-state="open"] {
+ background-color: color-mix(in srgb, var(--foreground) 9%, transparent) !important;
+ }
+
+ .dark .field-soft:focus-visible {
+ background-color: #1c1c1c !important;
+ box-shadow: none !important;
+ }
+
+ /* The Hub search field is `type="search"` (so the browser won't offer saved
+ passwords on it). Suppress the native WebKit clear button / decoration so
+ the field keeps its custom trailing ⌘K hint and spinner. */
+ .field-soft[type="search"]::-webkit-search-cancel-button,
+ .field-soft[type="search"]::-webkit-search-decoration {
+ -webkit-appearance: none;
+ appearance: none;
+ }
+
+ .hub-page .hub-canvas {
+ background-color: var(--background);
+ }
+
+ html.dark .hub-page .hub-canvas {
+ background-color: var(--background);
+ }
+
+ .hub-page .hub-detail-bar {
+ background-color: var(--background);
+ }
+
+ .hub-page .hub-detail-bar::after {
+ content: "";
+ position: absolute;
+ left: 0;
+ right: 0;
+ top: 100%;
+ height: 40px;
+ pointer-events: none;
+ opacity: 0;
+ transition: opacity 240ms ease;
+ background: linear-gradient(
+ to bottom,
+ var(--background),
+ color-mix(in srgb, var(--background) 55%, transparent) 48%,
+ transparent
+ );
+ }
+
+ .hub-page .hub-scroll-fade {
+ pointer-events: none;
+ opacity: 0;
+ transition: opacity 240ms ease;
+ /* Thin solid band right under the search bar, then fade quickly so the
+ white area stays slim. */
+ background: linear-gradient(
+ to bottom,
+ var(--background),
+ var(--background) 8%,
+ color-mix(in srgb, var(--background) 55%, transparent) 38%,
+ transparent
+ );
+ }
+
+ .hub-page .hub-detail-bar[data-scrolled="true"]::after,
+ .hub-page .hub-scroll-fade[data-scrolled="true"] {
+ opacity: 1;
+ }
+
+ .hub-page .hub-carousel-fade {
+ pointer-events: none;
+ position: absolute;
+ z-index: 5;
+ width: 56px;
+ opacity: 0;
+ transition: opacity 240ms ease;
+ }
+
+ .hub-page .hub-carousel-fade[data-visible="true"] {
+ opacity: 1;
+ }
+
+ .hub-page .hub-carousel-fade-left {
+ left: 0;
+ background: linear-gradient(
+ to right,
+ var(--background),
+ color-mix(in srgb, var(--background) 55%, transparent) 48%,
+ transparent
+ );
+ }
+
+ .hub-page .hub-carousel-fade-right {
+ right: 0;
+ background: linear-gradient(
+ to left,
+ var(--background),
+ color-mix(in srgb, var(--background) 55%, transparent) 48%,
+ transparent
+ );
+ }
+
+ .hub-page .hub-model-card {
+ --hub-card-border-accent: var(--foreground);
+ --hub-card-edge-mix: 2.2%;
+ --hub-card-inner-accent: var(--background);
+ --hub-card-inner-mix: 12%;
+ --hub-card-inner-opacity: 0.14;
+ --hub-card-corner-mix: 8.5%;
+ --hub-card-corner-opacity: 0.48;
+ --hub-card-hover-edge-mix: 5.5%;
+ --hub-card-edge: color-mix(
+ in srgb,
+ var(--hub-card-border-accent) var(--hub-card-edge-mix),
+ transparent
+ );
+ --hub-card-inner-edge: color-mix(
+ in srgb,
+ var(--hub-card-inner-accent) var(--hub-card-inner-mix),
+ transparent
+ );
+ --hub-card-corner-edge: color-mix(
+ in srgb,
+ var(--hub-card-border-accent) var(--hub-card-corner-mix),
+ transparent
+ );
+ --hub-card-hover-edge: color-mix(
+ in srgb,
+ var(--hub-card-border-accent) var(--hub-card-hover-edge-mix),
+ transparent
+ );
+ position: relative;
+ overflow: hidden;
+ border-radius: 18px;
+ background-color: color-mix(in srgb, var(--foreground) 2.5%, transparent);
+ border: 1px solid transparent;
+ box-shadow: none;
+ transition: background-color 160ms ease, border-color 160ms ease;
+ }
+
+ .hub-page .hub-model-card::after {
+ position: absolute;
+ border-radius: inherit;
+ content: "";
+ pointer-events: none;
+ z-index: 2;
+ }
+
+ .hub-page .hub-model-card::after {
+ inset: 0;
+ border: 1px solid var(--hub-card-corner-edge);
+ opacity: 0;
+ -webkit-mask:
+ linear-gradient(
+ 90deg,
+ #000 0 76px,
+ rgb(0 0 0 / 94%) 34%,
+ rgb(0 0 0 / 58%) 76%,
+ transparent 100%
+ )
+ top left / 48% 44px no-repeat,
+ linear-gradient(
+ 180deg,
+ #000 0 54px,
+ rgb(0 0 0 / 68%) 86px,
+ transparent 140px
+ )
+ top left / 44px 160px no-repeat,
+ linear-gradient(
+ 270deg,
+ #000 0 76px,
+ rgb(0 0 0 / 94%) 34%,
+ rgb(0 0 0 / 58%) 76%,
+ transparent 100%
+ )
+ bottom right / 48% 44px no-repeat,
+ linear-gradient(
+ 0deg,
+ #000 0 54px,
+ rgb(0 0 0 / 68%) 86px,
+ transparent 140px
+ )
+ bottom right / 44px 160px no-repeat;
+ mask:
+ linear-gradient(
+ 90deg,
+ #000 0 76px,
+ rgb(0 0 0 / 94%) 34%,
+ rgb(0 0 0 / 58%) 76%,
+ transparent 100%
+ )
+ top left / 48% 44px no-repeat,
+ linear-gradient(
+ 180deg,
+ #000 0 54px,
+ rgb(0 0 0 / 68%) 86px,
+ transparent 140px
+ )
+ top left / 44px 160px no-repeat,
+ linear-gradient(
+ 270deg,
+ #000 0 76px,
+ rgb(0 0 0 / 94%) 34%,
+ rgb(0 0 0 / 58%) 76%,
+ transparent 100%
+ )
+ bottom right / 48% 44px no-repeat,
+ linear-gradient(
+ 0deg,
+ #000 0 54px,
+ rgb(0 0 0 / 68%) 86px,
+ transparent 140px
+ )
+ bottom right / 44px 160px no-repeat;
+ }
+
+ .hub-page .hub-model-card:hover {
+ background-color: color-mix(in srgb, var(--foreground) 4.5%, transparent);
+ border-color: transparent;
+ }
+
+ html.dark .hub-page .hub-model-card {
+ --hub-card-border-accent: var(--foreground);
+ --hub-card-edge-mix: 2.8%;
+ --hub-card-inner-accent: var(--foreground);
+ --hub-card-inner-mix: 2.5%;
+ --hub-card-inner-opacity: 0.22;
+ --hub-card-corner-mix: 9.5%;
+ --hub-card-hover-edge-mix: 6%;
+ background-color: color-mix(in srgb, var(--foreground) 7%, transparent);
+ border-color: transparent;
+ }
+
+ html.dark .hub-page .hub-model-card:hover {
+ background-color: #202020;
+ border-color: transparent;
+ }
+
+ .hub-page .hub-model-card-art {
+ --hub-model-card-accent: var(
+ --hub-card-art-accent,
+ var(--hub-card-border-accent)
+ );
+ --hub-model-card-art-base: var(--background);
+ position: relative;
+ background: radial-gradient(
+ 115% 90% at 18% 8%,
+ color-mix(in srgb, var(--hub-model-card-accent) 20%, transparent),
+ transparent 58%
+ ),
+ radial-gradient(
+ 90% 80% at 86% 18%,
+ color-mix(in srgb, var(--hub-model-card-accent) 14%, transparent),
+ transparent 60%
+ ),
+ linear-gradient(
+ 160deg,
+ color-mix(
+ in srgb,
+ var(--hub-model-card-accent) 10%,
+ var(--hub-model-card-art-base)
+ )
+ 0%,
+ color-mix(
+ in srgb,
+ var(--hub-model-card-accent) 18%,
+ var(--hub-model-card-art-base)
+ )
+ 52%,
+ color-mix(
+ in srgb,
+ var(--hub-model-card-accent) 11%,
+ var(--hub-model-card-art-base)
+ )
+ 100%
+ );
+ }
+
+ .hub-page .hub-model-card-art::after {
+ position: absolute;
+ inset: 0;
+ z-index: 1;
+ border-radius: inherit;
+ background: linear-gradient(
+ 90deg,
+ var(--hub-card-inner-edge),
+ transparent 72%
+ )
+ top left / 58% 1px no-repeat,
+ linear-gradient(270deg, var(--hub-card-inner-edge), transparent 72%) top
+ right / 42% 1px no-repeat;
+ content: "";
+ opacity: 0;
+ pointer-events: none;
+ }
+
+ html.dark .hub-page .hub-model-card-art {
+ background: linear-gradient(
+ 160deg,
+ color-mix(in srgb, var(--hub-model-card-accent) 76%, #0b0b0d) 0%,
+ color-mix(in srgb, var(--hub-model-card-accent) 92%, #0b0b0d) 52%,
+ color-mix(in srgb, var(--hub-model-card-accent) 70%, #0b0b0d) 100%
+ );
+ }
+
+ .hub-page .hub-trending-card {
+ /* Flat neutral surface shared by the featured, trending and fine-tune
+ cards: a clean elevated body, no border, no colour, no gradient. Dark
+ defaults here; the html:not(.dark) block recolours for the light theme
+ and adds the (light-only) drop shadow. */
+ --hub-trending-surface: color-mix(in srgb, var(--foreground) 7%, var(--background));
+ --hub-trending-surface-hover: color-mix(in srgb, var(--foreground) 10%, var(--background));
+ --hub-trending-title-ink: rgb(255 255 255 / 0.94);
+ --hub-trending-muted-ink: rgb(255 255 255 / 0.68);
+ isolation: isolate;
+ border: 0;
+ border-radius: 18px;
+ background-color: var(--hub-trending-surface);
+ box-shadow: none;
+ transition: background-color 160ms ease;
+ }
+
+ html:not(.dark) .hub-page .hub-trending-card {
+ --hub-trending-surface: var(--card);
+ --hub-trending-surface-hover: var(--card);
+ --hub-trending-title-ink: var(--foreground);
+ --hub-trending-muted-ink: var(--muted-foreground);
+ box-shadow: 0 2px 8px -2px rgba(0, 0, 0, 0.16);
+ transition:
+ box-shadow 200ms ease,
+ background-color 160ms ease;
+ }
+
+ html:not(.dark) .hub-page .hub-model-card.hub-trending-card {
+ transition:
+ box-shadow 200ms ease,
+ transform 200ms ease,
+ background-color 160ms ease;
+ }
+
+ html:not(.dark) .hub-page .hub-model-card.hub-trending-card:hover {
+ box-shadow: 0 2px 8px -2px rgba(0, 0, 0, 0.16);
+ transform: translateY(-2px);
+ }
+
+ .hub-page .hub-trending-card > * {
+ position: relative;
+ z-index: 1;
+ }
+
+ .hub-page .hub-trending-card:hover {
+ background-color: var(--hub-trending-surface-hover);
+ }
+
+ .hub-page .hub-trending-card::after {
+ opacity: 0;
+ }
+
+ /* Dark spotlight cards keep their avatars frameless; the light theme lets the
+ smooth hairline show so white-background logos read cleanly against the
+ pale surface instead of blending into it. */
+ html.dark .hub-page .hub-trending-card .hub-avatar-tile::after {
+ opacity: 0;
+ }
+
+ .hub-page .hub-trending-card .hub-model-card-art,
+ html.dark .hub-page .hub-trending-card .hub-model-card-art {
+ background: transparent;
+ }
+
+ .hub-page .hub-trending-card .hub-model-card-art::after {
+ opacity: 0;
+ }
+
+ .hub-page .hub-trending-title {
+ color: var(--hub-trending-title-ink);
+ }
+
+ .hub-page .hub-trending-owner,
+ .hub-page .hub-trending-stats .text-muted-foreground\/75 {
+ color: var(--hub-trending-muted-ink);
+ }
+
+ /* Dark theme paints the size chip with a translucent white fill against the
+ dark surface; in the light theme it falls through to the base .hub-chip
+ style, which is already theme-aware. */
+ html.dark .hub-page .hub-trending-card .hub-chip {
+ background-color: rgb(255 255 255 / 0.12);
+ color: rgb(255 255 255 / 0.82);
+ }
+
+ .hub-page .hub-focused-heading {
+ font-size: 18px;
+ font-weight: 600;
+ letter-spacing: 0;
+ color: var(--foreground);
+ }
+
+ .hub-page .page-title-halo {
+ text-shadow: 0 0 24px #e4e3df, 0 0 56px #ebeae6, 0 0 96px #efeeea;
+ }
+
+ html.dark .hub-page .page-title-halo {
+ text-shadow: none;
+ }
+
+ html:not(.dark) .hub-page {
+ background-color: var(--background);
+ }
+
+ html:not(.dark) .hub-page .border-b,
+ html:not(.dark) .hub-page .border-r,
+ html:not(.dark) .hub-page .border-t.border-border {
+ border-color: color-mix(in srgb, var(--foreground) 6%, transparent);
+ }
+
+ html:not(.dark) .hub-page .hub-side-surface {
+ background-color: var(--background);
+ }
+
+ html:not(.dark) .hub-page .hub-tag-soft,
+ html:not(.dark) .hub-page .hub-tag-meta {
+ background-color: transparent;
+ transition: background-color 160ms ease, border-color 160ms ease;
+ }
+
+ html:not(.dark) .hub-page .hub-tag-soft:hover,
+ html:not(.dark) .hub-page .hub-tag-meta:hover {
+ background-color: color-mix(in srgb, var(--foreground) 4%, transparent);
+ }
+
+ html.dark .hub-page {
+ background-color: var(--background);
+ }
+
+ html.dark .hub-page [class*="bg-card"],
+ html.dark .hub-page [class*="bg-background"] {
+ background-color: var(--popover);
+ }
+
+ html.dark .hub-page .border-b,
+ html.dark .hub-page .border-r,
+ html.dark .hub-page .border-t.border-border {
+ border-color: color-mix(in srgb, var(--foreground) 5%, transparent);
+ }
+
+ html.dark .hub-page .hub-side-surface {
+ background-color: transparent;
+ }
+
+ html.dark .hub-page .hub-tag-soft,
+ html.dark .hub-page .hub-tag-meta {
+ background-color: transparent;
+ transition: background-color 160ms ease, border-color 160ms ease;
+ }
+
+ html.dark .hub-page .hub-tag-soft {
+ color: var(--muted-foreground);
+ }
+
+ html.dark .hub-page .hub-tag-meta {
+ color: var(--muted-foreground);
+ }
+
+ html.dark .hub-page .hub-tag-soft:hover,
+ html.dark .hub-page .hub-tag-meta:hover {
+ background-color: color-mix(in srgb, var(--foreground) 4%, transparent);
+ }
+
+ /* List rows share the cards' flat neutral surface: no border, no gradient,
+ and a wide spread shadow that is present only in the light theme (dark gets
+ the flat surface with no shadow). The shadow paints freely past the content
+ column; the scroll pane (not the column) bounds it. */
+ .hub-page .hub-result-row {
+ border: 0;
+ border-radius: 14px;
+ background-color: var(--card);
+ box-shadow: 0 2px 8px -2px rgba(0, 0, 0, 0.16);
+ transition:
+ background-color 160ms ease,
+ box-shadow 180ms ease,
+ transform 180ms ease;
+ }
+
+ .hub-page .hub-result-row.hub-result-card {
+ border-radius: 16px;
+ }
+
+ .hub-page .hub-result-row:hover {
+ background-color: var(--card);
+ box-shadow: 0 2px 8px -2px rgba(0, 0, 0, 0.16);
+ }
+
+ html:not(.dark) .hub-page .hub-result-row:hover {
+ transform: translateY(-1px);
+ }
+
+ html.dark .hub-page .hub-result-row {
+ background-color: color-mix(in srgb, var(--foreground) 7%, var(--background));
+ box-shadow: none;
+ }
+
+ html.dark .hub-page .hub-result-row:hover {
+ background-color: color-mix(in srgb, var(--foreground) 10%, var(--background));
+ box-shadow: none;
+ }
+
+ /* On-device rows reuse the result-row card but carry selection/active state:
+ a neutral tint for the inspected row and a success tint with a primary edge
+ for the model currently loaded. Discover rows never set these attributes. */
+ .hub-page .hub-result-row[data-selected="true"] {
+ background-color: color-mix(in srgb, var(--foreground) 5%, var(--card));
+ }
+
+ .hub-page .hub-result-row[data-active="true"] {
+ background-color: color-mix(in srgb, var(--status-success) 7%, var(--card));
+ box-shadow: 0 2px 8px -2px rgba(0, 0, 0, 0.16), inset 2px 0 0 0 var(--primary);
+ }
+
+ html.dark .hub-page .hub-result-row[data-selected="true"] {
+ background-color: color-mix(in srgb, var(--foreground) 11%, var(--background));
+ box-shadow: none;
+ }
+
+ html.dark .hub-page .hub-result-row[data-active="true"] {
+ background-color: color-mix(in srgb, var(--status-success) 14%, var(--background));
+ box-shadow: inset 2px 0 0 0 var(--primary);
+ }
+
+ /* Recent-searches suggestion panel. The surface comes from
+ .menu-soft-surface; these rules add the row + control hover affordances
+ using the same neutral foreground mixes as the option menus and list
+ rows, so it reads as part of the same family. */
+ .hub-page .hub-recent-item {
+ transition: background-color 120ms ease;
+ }
+
+ .hub-page .hub-recent-item:hover {
+ background-color: color-mix(in srgb, var(--foreground) 6%, transparent);
+ }
+
+ html.dark .hub-page .hub-recent-item:hover {
+ background-color: color-mix(in srgb, var(--foreground) 8%, transparent);
+ }
+
+ .hub-page .hub-recent-clear:hover,
+ .hub-page .hub-recent-remove:hover {
+ background-color: color-mix(in srgb, var(--foreground) 10%, transparent);
+ }
+
+ .hub-menu-instant {
+ animation: none !important;
+ transition: none !important;
+ transform: none !important;
+ --tw-translate-x: 0px !important;
+ --tw-translate-y: 0px !important;
+ --tw-scale-x: 1 !important;
+ --tw-scale-y: 1 !important;
+ translate: 0 0 !important;
+ user-select: none;
+ -webkit-user-select: none;
+ will-change: auto !important;
+ }
+
+ .hub-menu-instant.menu-soft-surface {
+ --menu-soft-blur: 18px;
+ --menu-soft-spread: -8px;
+ }
+
+ .hub-menu-instant [data-slot="select-item"]:focus,
+ .hub-menu-instant [data-slot="select-item"][data-highlighted],
+ .hub-menu-instant [role="option"][data-highlighted] {
+ background-color: color-mix(in srgb, var(--foreground) 6%, transparent);
+ color: var(--foreground);
+ }
+
+ html.dark .hub-menu-instant [data-slot="select-item"]:focus,
+ html.dark .hub-menu-instant [data-slot="select-item"][data-highlighted],
+ html.dark .hub-menu-instant [role="option"][data-highlighted] {
+ background-color: color-mix(in srgb, var(--foreground) 8%, transparent);
+ color: var(--foreground);
+ }
+
+ html.dark .hub-menu-instant {
+ background-color: #2e2f31 !important;
+ }
+
+ .hub-menu-instant *,
+ .hub-menu-instant *::before,
+ .hub-menu-instant *::after,
+ .hub-menu-trigger,
+ .hub-menu-trigger * {
+ animation: none !important;
+ transition: none !important;
+ user-select: none;
+ -webkit-user-select: none;
+ }
+
+ /* Canonical segmented-control look. Un-scoped from .hub-page so every
+ segmented toggle in the app (Hub Discover/On Device, Models/Datasets,
+ Unsloth/All, Recent/Name/Size, plus Settings + Train tabs) shares one
+ design: a soft track with a white, softly-shadowed sliding pill. */
+ html:not(.dark) .hub-tab-toggle {
+ background-color: color-mix(in srgb, var(--foreground) 5%, transparent);
+ border: 0;
+ box-shadow: none;
+ }
+
+ html.dark .hub-tab-toggle {
+ background-color: color-mix(in srgb, var(--foreground) 4.5%, transparent);
+ border: 0;
+ box-shadow: none;
+ }
+
+ html:not(.dark) .hub-tab-toggle-pill {
+ background-color: var(--background);
+ border: 0;
+ box-shadow: 0 2px 8px -2px rgba(0, 0, 0, 0.16);
+ }
+
+ html.dark .hub-tab-toggle-pill {
+ background-color: color-mix(in srgb, var(--foreground) 10%, transparent);
+ border: 0;
+ box-shadow: none;
+ }
+
+ html:not(.dark) .hub-page .catalog-row {
+ background-color: transparent;
+ border-color: transparent;
+ box-shadow: none;
+ transition: background-color 160ms ease;
+ }
+
+ html:not(.dark) .hub-page .catalog-row:hover {
+ background-color: color-mix(in srgb, var(--foreground) 3.5%, transparent);
+ }
+
+ html:not(.dark) .hub-page .catalog-row[data-selected="true"] {
+ background-color: color-mix(in srgb, var(--foreground) 6%, transparent);
+ }
+
+ /* Currently-loaded checkpoint: a brand-green left stripe plus a faint
green wash, orthogonal to the neutral selected tint so a row that is
both loaded and selected still reads as loaded. */
- html:not(.dark) .hub-page .catalog-row[data-active="true"] {
- background-color: color-mix(in srgb, var(--status-success) 7%, transparent);
- box-shadow: inset 2px 0 0 0 var(--primary);
- }
-
- html.dark .hub-page .catalog-row {
- background-color: transparent;
- border-color: transparent;
- box-shadow: none;
- transition: background-color 160ms ease;
- }
-
- html.dark .hub-page .catalog-row:hover {
- background-color: color-mix(in srgb, var(--foreground) 3.5%, transparent);
- }
-
- html.dark .hub-page .catalog-row[data-selected="true"] {
- background-color: color-mix(in srgb, var(--foreground) 7%, transparent);
- }
-
- html.dark .hub-page .catalog-row[data-active="true"] {
- background-color: color-mix(in srgb, var(--status-success) 12%, transparent);
- box-shadow: inset 2px 0 0 0 var(--primary);
- }
-
+ html:not(.dark) .hub-page .catalog-row[data-active="true"] {
+ background-color: color-mix(in srgb, var(--status-success) 7%, transparent);
+ box-shadow: inset 2px 0 0 0 var(--primary);
+ }
+
+ html.dark .hub-page .catalog-row {
+ background-color: transparent;
+ border-color: transparent;
+ box-shadow: none;
+ transition: background-color 160ms ease;
+ }
+
+ html.dark .hub-page .catalog-row:hover {
+ background-color: color-mix(in srgb, var(--foreground) 3.5%, transparent);
+ }
+
+ html.dark .hub-page .catalog-row[data-selected="true"] {
+ background-color: color-mix(in srgb, var(--foreground) 7%, transparent);
+ }
+
+ html.dark .hub-page .catalog-row[data-active="true"] {
+ background-color: color-mix(in srgb, var(--status-success) 12%, transparent);
+ box-shadow: inset 2px 0 0 0 var(--primary);
+ }
}
@layer utilities {
- .hub-tag-soft,
- .hub-tag-meta {
- @apply min-h-[26px] rounded-full bg-muted/70 ring-1 ring-inset;
- --tw-ring-color: color-mix(in srgb, var(--foreground) 3.5%, transparent);
- }
-
- .dark .hub-tag-soft,
- .dark .hub-tag-meta {
- @apply bg-white/[0.05] ring-white/[0.035];
- }
- .hub-download-card {
- @apply flex w-full flex-col gap-2 rounded-[22px] p-2;
- background-color: color-mix(in srgb, var(--foreground) 3%, transparent);
- border: 1px solid color-mix(in srgb, var(--foreground) 5.5%, transparent);
- box-shadow: none;
- }
-
- /* Single-row state (variant + actions only) reads as a full pill. */
- .hub-download-card:not(:has(> :nth-child(2))) {
- border-radius: 9999px;
- }
-
- .dark .hub-download-card {
- background-color: color-mix(in srgb, var(--foreground) 3.5%, transparent);
- border: 1px solid color-mix(in srgb, var(--foreground) 5.5%, transparent);
- box-shadow: none;
- }
-
- .hub-download-panel {
- border-radius: 20px;
- background-color: var(--popover);
- border: 1px solid color-mix(in srgb, var(--foreground) 6%, transparent);
- box-shadow:
- 0 1px 2px color-mix(in srgb, var(--foreground) 7%, transparent),
- 0 18px 48px -12px color-mix(in srgb, var(--foreground) 22%, transparent);
- }
-
- .dark .hub-download-panel {
- border-color: color-mix(in srgb, var(--foreground) 8%, transparent);
- box-shadow:
- 0 1px 2px rgba(0, 0, 0, 0.4),
- 0 20px 56px -12px rgba(0, 0, 0, 0.6);
- }
-
- .hub-download-fab {
- position: relative;
- display: inline-flex;
- width: 2.75rem;
- height: 2.75rem;
- cursor: pointer;
- align-items: center;
- justify-content: center;
- border-radius: 9999px;
- color: var(--muted-foreground);
- background-color: var(--popover);
- border: 1px solid color-mix(in srgb, var(--foreground) 6%, transparent);
- box-shadow:
- 0 1px 2px color-mix(in srgb, var(--foreground) 7%, transparent),
- 0 12px 32px -10px color-mix(in srgb, var(--foreground) 22%, transparent);
- transition:
- color 150ms ease,
- background-color 150ms ease,
- box-shadow 150ms ease,
- transform 150ms ease;
- }
-
- .hub-download-fab:hover {
- color: var(--foreground);
- transform: translateY(-1px);
- box-shadow:
- 0 2px 4px color-mix(in srgb, var(--foreground) 8%, transparent),
- 0 16px 40px -10px color-mix(in srgb, var(--foreground) 26%, transparent);
- }
-
- .dark .hub-download-fab {
- border-color: color-mix(in srgb, var(--foreground) 8%, transparent);
- box-shadow:
- 0 1px 2px rgba(0, 0, 0, 0.4),
- 0 14px 36px -10px rgba(0, 0, 0, 0.6);
- }
-
- .dark .hub-download-fab:hover {
- box-shadow:
- 0 2px 4px rgba(0, 0, 0, 0.45),
- 0 18px 44px -10px rgba(0, 0, 0, 0.65);
- }
-
- .hub-download-fab-badge {
- position: absolute;
- top: -3px;
- right: -3px;
- display: inline-flex;
- min-width: 1.125rem;
- height: 1.125rem;
- align-items: center;
- justify-content: center;
- border-radius: 9999px;
- padding-inline: 0.3125rem;
- background-color: var(--status-success);
- color: var(--primary-foreground);
- font-size: 10.5px;
- font-weight: 600;
- line-height: 1;
- font-variant-numeric: tabular-nums;
- border: 2px solid var(--popover);
- }
+ .hub-tag-soft,
+ .hub-tag-meta {
+ @apply min-h-[26px] rounded-full bg-muted/70 ring-1 ring-inset;
+ --tw-ring-color: color-mix(in srgb, var(--foreground) 3.5%, transparent);
+ }
+
+ .dark .hub-tag-soft,
+ .dark .hub-tag-meta {
+ @apply bg-white/[0.05] ring-white/[0.035];
+ }
+ .hub-download-card {
+ @apply flex w-full flex-col gap-2 rounded-[22px] p-2;
+ background-color: color-mix(in srgb, var(--foreground) 3%, transparent);
+ border: 1px solid color-mix(in srgb, var(--foreground) 5.5%, transparent);
+ box-shadow: none;
+ }
+
+ .hub-download-card:not(:has(> :nth-child(2))) {
+ border-radius: 9999px;
+ }
+
+ .dark .hub-download-card {
+ background-color: color-mix(in srgb, var(--foreground) 3.5%, transparent);
+ border: 1px solid color-mix(in srgb, var(--foreground) 5.5%, transparent);
+ box-shadow: none;
+ }
+
+ .hub-download-panel {
+ border-radius: 20px;
+ background-color: var(--popover);
+ border: 1px solid color-mix(in srgb, var(--foreground) 6%, transparent);
+ box-shadow: 0 2px 8px -2px rgba(0, 0, 0, 0.16);
+ }
+
+ .dark .hub-download-panel {
+ border-color: color-mix(in srgb, var(--foreground) 8%, transparent);
+ box-shadow: none;
+ }
+
+ .hub-download-fab {
+ position: relative;
+ display: inline-flex;
+ width: 2.75rem;
+ height: 2.75rem;
+ cursor: pointer;
+ align-items: center;
+ justify-content: center;
+ border-radius: 9999px;
+ color: var(--muted-foreground);
+ background-color: var(--popover);
+ border: 1px solid color-mix(in srgb, var(--foreground) 6%, transparent);
+ box-shadow: 0 2px 8px -2px rgba(0, 0, 0, 0.16);
+ transition: color 150ms ease, background-color 150ms ease, box-shadow 150ms
+ ease, transform 150ms ease;
+ }
+
+ .hub-download-fab:hover {
+ color: var(--foreground);
+ transform: translateY(-1px);
+ box-shadow: 0 2px 8px -2px rgba(0, 0, 0, 0.16);
+ }
+
+ .dark .hub-download-fab {
+ border-color: color-mix(in srgb, var(--foreground) 8%, transparent);
+ box-shadow: none;
+ }
+
+ .dark .hub-download-fab:hover {
+ box-shadow: none;
+ }
+
+ .hub-download-fab-badge {
+ position: absolute;
+ top: -3px;
+ right: -3px;
+ display: inline-flex;
+ width: 1.125rem;
+ min-width: 1.125rem;
+ height: 1.125rem;
+ align-items: center;
+ justify-content: center;
+ border-radius: 9999px;
+ padding-inline: 0;
+ background-color: var(--status-success);
+ color: var(--primary-foreground);
+ font-size: 10.5px;
+ font-weight: 600;
+ line-height: 1;
+ font-variant-numeric: tabular-nums;
+ border: 2px solid var(--popover);
+ }
+
+ .hub-page .hub-carousel {
+ scrollbar-width: none !important;
+ -ms-overflow-style: none !important;
+ overflow-y: hidden;
+ -webkit-overflow-scrolling: touch;
+ overscroll-behavior-x: contain;
+ }
+
+ .hub-page .hub-carousel::-webkit-scrollbar {
+ display: none !important;
+ width: 0 !important;
+ height: 0 !important;
+ }
+
+ .hub-page .hub-carousel-arrow {
+ background-color: color-mix(in srgb, var(--background) 80%, transparent);
+ backdrop-filter: blur(10px);
+ -webkit-backdrop-filter: blur(10px);
+ border: 1px solid color-mix(in srgb, var(--foreground) 4%, transparent);
+ color: var(--foreground);
+ box-shadow: 0 2px 8px -2px rgba(0, 0, 0, 0.16);
+ transition: opacity 160ms ease, background-color 160ms ease, border-color
+ 160ms ease;
+ }
+
+ .hub-page .hub-carousel-arrow:hover {
+ background-color: var(--background);
+ border-color: color-mix(in srgb, var(--foreground) 8%, transparent);
+ }
}
@layer base {
- .hub-avatar-tile {
- box-shadow: 0 0 0 0.5px color-mix(in srgb, var(--foreground) 6%, transparent);
- }
-
- .dark .hub-avatar-tile {
- box-shadow: 0 0 0 0.5px color-mix(in srgb, var(--foreground) 8%, transparent);
- }
-
- /* Verified badge: solid badge shape with a check-shaped hole punched
+ .hub-avatar-tile {
+ /* Frame colour for the hairline drawn by ::after. Light theme keeps it a
+ soft, low-contrast value that cleanly frames white logo tiles; the
+ .dark override below lifts it against the dark surfaces. */
+ --hub-avatar-corner-edge: color-mix(
+ in srgb,
+ var(--foreground) 12%,
+ transparent
+ );
+ position: relative;
+ box-shadow: none;
+ }
+
+ .hub-avatar-tile::after {
+ position: absolute;
+ inset: 0;
+ border: 1px solid var(--hub-avatar-corner-edge);
+ border-radius: inherit;
+ content: "";
+ opacity: 0.92;
+ pointer-events: none;
+ -webkit-mask:
+ linear-gradient(
+ 90deg,
+ #000 0 38%,
+ rgb(0 0 0 / 72%) 68%,
+ transparent 100%
+ )
+ top left / 82% 34% no-repeat,
+ linear-gradient(
+ 180deg,
+ #000 0 38%,
+ rgb(0 0 0 / 72%) 68%,
+ transparent 100%
+ )
+ top left / 34% 82% no-repeat,
+ linear-gradient(
+ 270deg,
+ #000 0 38%,
+ rgb(0 0 0 / 72%) 68%,
+ transparent 100%
+ )
+ bottom right / 82% 34% no-repeat,
+ linear-gradient(
+ 0deg,
+ #000 0 38%,
+ rgb(0 0 0 / 72%) 68%,
+ transparent 100%
+ )
+ bottom right / 34% 82% no-repeat;
+ mask:
+ linear-gradient(
+ 90deg,
+ #000 0 38%,
+ rgb(0 0 0 / 72%) 68%,
+ transparent 100%
+ )
+ top left / 82% 34% no-repeat,
+ linear-gradient(
+ 180deg,
+ #000 0 38%,
+ rgb(0 0 0 / 72%) 68%,
+ transparent 100%
+ )
+ top left / 34% 82% no-repeat,
+ linear-gradient(
+ 270deg,
+ #000 0 38%,
+ rgb(0 0 0 / 72%) 68%,
+ transparent 100%
+ )
+ bottom right / 82% 34% no-repeat,
+ linear-gradient(
+ 0deg,
+ #000 0 38%,
+ rgb(0 0 0 / 72%) 68%,
+ transparent 100%
+ )
+ bottom right / 34% 82% no-repeat;
+ }
+
+ /* Light theme renders the frame as a single smooth hairline. The corner-mask
+ "bracket" treatment (kept for the dark surfaces below) stair-steps along
+ the rounded corners on light backgrounds and reads as pixelated, so it is
+ dropped here in favour of a clean, anti-aliased full-perimeter ring. */
+ html:not(.dark) .hub-avatar-tile::after {
+ -webkit-mask: none;
+ mask: none;
+ }
+
+ .dark .hub-avatar-tile {
+ --hub-avatar-corner-edge: color-mix(
+ in srgb,
+ var(--foreground) 58%,
+ transparent
+ );
+ }
+
+ /* Verified badge: solid badge shape with a check-shaped hole punched
through, so whatever sits behind shows through the check. The badge
fill follows currentColor (so `text-primary` makes it Unsloth green;
any text-* utility recolors it). Use as: `<span class="hub-verified-badge
size-4 text-primary" />`. */
- .hub-verified-badge {
- display: inline-block;
- background-color: currentColor;
- mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><defs><mask id='c'><rect width='24' height='24' fill='white'/><path d='m8.75 12.5 2.5 2.5 4.25-5.25' stroke='black' stroke-width='1.85' stroke-linecap='round' stroke-linejoin='round' fill='none'/></mask></defs><path d='M8.603 3.799A4.49 4.49 0 0 1 12 2.25c1.357 0 2.573.6 3.397 1.549a4.49 4.49 0 0 1 3.498 1.307 4.491 4.491 0 0 1 1.307 3.497A4.49 4.49 0 0 1 21.75 12a4.49 4.49 0 0 1-1.549 3.397 4.491 4.491 0 0 1-1.307 3.497 4.491 4.491 0 0 1-3.497 1.307A4.49 4.49 0 0 1 12 21.75a4.49 4.49 0 0 1-3.397-1.549 4.49 4.49 0 0 1-3.498-1.306 4.491 4.491 0 0 1-1.307-3.498A4.49 4.49 0 0 1 2.25 12c0-1.357.6-2.573 1.549-3.397a4.49 4.49 0 0 1 1.307-3.497 4.49 4.49 0 0 1 3.497-1.307Z' fill='white' mask='url(%23c)'/></svg>") center / contain no-repeat;
- -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><defs><mask id='c'><rect width='24' height='24' fill='white'/><path d='m8.75 12.5 2.5 2.5 4.25-5.25' stroke='black' stroke-width='1.85' stroke-linecap='round' stroke-linejoin='round' fill='none'/></mask></defs><path d='M8.603 3.799A4.49 4.49 0 0 1 12 2.25c1.357 0 2.573.6 3.397 1.549a4.49 4.49 0 0 1 3.498 1.307 4.491 4.491 0 0 1 1.307 3.497A4.49 4.49 0 0 1 21.75 12a4.49 4.49 0 0 1-1.549 3.397 4.491 4.491 0 0 1-1.307 3.497 4.491 4.491 0 0 1-3.497 1.307A4.49 4.49 0 0 1 12 21.75a4.49 4.49 0 0 1-3.397-1.549 4.49 4.49 0 0 1-3.498-1.306 4.491 4.491 0 0 1-1.307-3.498A4.49 4.49 0 0 1 2.25 12c0-1.357.6-2.573 1.549-3.397a4.49 4.49 0 0 1 1.307-3.497 4.49 4.49 0 0 1 3.497-1.307Z' fill='white' mask='url(%23c)'/></svg>") center / contain no-repeat;
- }
-
-
- @keyframes hub-loading-sweep {
- 0% {
- opacity: 0;
- transform: translate3d(-120%, 0, 0);
- }
-
- 16% {
- opacity: 0.92;
- }
-
- 78% {
- opacity: 0.92;
- }
-
- 100% {
- opacity: 0;
- transform: translate3d(520%, 0, 0);
- }
- }
-
- .hub-loading-bar {
- pointer-events: none;
- position: relative;
- overflow: hidden;
- width: 100%;
- height: 3px;
- }
-
- .hub-loading-bar::after {
- content: "";
- display: none;
- position: absolute;
- inset-block: 0;
- left: 0;
- width: 36%;
- background: linear-gradient(90deg,
- transparent,
- color-mix(in srgb, var(--foreground) 20%, transparent),
- color-mix(in srgb, var(--foreground) 58%, transparent),
- color-mix(in srgb, var(--foreground) 20%, transparent),
- transparent);
- will-change: opacity, transform;
- }
-
- html.dark .hub-loading-bar::after {
- background: linear-gradient(90deg,
- transparent,
- color-mix(in srgb, var(--foreground) 22%, transparent),
- color-mix(in srgb, var(--foreground) 60%, transparent),
- color-mix(in srgb, var(--foreground) 22%, transparent),
- transparent);
- }
-
- .hub-loading-bar[data-active="true"]::after {
- display: block;
- animation: hub-loading-sweep 3s cubic-bezier(0.22, 0.72, 0.18, 1) infinite;
- }
-
- @media (prefers-reduced-motion: reduce) {
- .hub-loading-bar[data-active="true"]::after {
- animation-duration: 3s !important;
- animation-iteration-count: infinite !important;
- }
- }
-
- /* README markdown can be thousands of nodes. Keep its paint/layout work
+ .hub-verified-badge {
+ display: inline-block;
+ background-color: currentColor;
+ mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><defs><mask id='c'><rect width='24' height='24' fill='white'/><path d='m8.75 12.5 2.5 2.5 4.25-5.25' stroke='black' stroke-width='1.85' stroke-linecap='round' stroke-linejoin='round' fill='none'/></mask></defs><path d='M8.603 3.799A4.49 4.49 0 0 1 12 2.25c1.357 0 2.573.6 3.397 1.549a4.49 4.49 0 0 1 3.498 1.307 4.491 4.491 0 0 1 1.307 3.497A4.49 4.49 0 0 1 21.75 12a4.49 4.49 0 0 1-1.549 3.397 4.491 4.491 0 0 1-1.307 3.497 4.491 4.491 0 0 1-3.497 1.307A4.49 4.49 0 0 1 12 21.75a4.49 4.49 0 0 1-3.397-1.549 4.49 4.49 0 0 1-3.498-1.306 4.491 4.491 0 0 1-1.307-3.498A4.49 4.49 0 0 1 2.25 12c0-1.357.6-2.573 1.549-3.397a4.49 4.49 0 0 1 1.307-3.497 4.49 4.49 0 0 1 3.497-1.307Z' fill='white' mask='url(%23c)'/></svg>")
+ center / contain no-repeat;
+ -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><defs><mask id='c'><rect width='24' height='24' fill='white'/><path d='m8.75 12.5 2.5 2.5 4.25-5.25' stroke='black' stroke-width='1.85' stroke-linecap='round' stroke-linejoin='round' fill='none'/></mask></defs><path d='M8.603 3.799A4.49 4.49 0 0 1 12 2.25c1.357 0 2.573.6 3.397 1.549a4.49 4.49 0 0 1 3.498 1.307 4.491 4.491 0 0 1 1.307 3.497A4.49 4.49 0 0 1 21.75 12a4.49 4.49 0 0 1-1.549 3.397 4.491 4.491 0 0 1-1.307 3.497 4.491 4.491 0 0 1-3.497 1.307A4.49 4.49 0 0 1 12 21.75a4.49 4.49 0 0 1-3.397-1.549 4.49 4.49 0 0 1-3.498-1.306 4.491 4.491 0 0 1-1.307-3.498A4.49 4.49 0 0 1 2.25 12c0-1.357.6-2.573 1.549-3.397a4.49 4.49 0 0 1 1.307-3.497 4.49 4.49 0 0 1 3.497-1.307Z' fill='white' mask='url(%23c)'/></svg>")
+ center / contain no-repeat;
+ }
+
+ @keyframes hub-loading-sweep {
+ 0% {
+ opacity: 0;
+ transform: translate3d(-120%, 0, 0);
+ }
+
+ 16% {
+ opacity: 0.92;
+ }
+
+ 78% {
+ opacity: 0.92;
+ }
+
+ 100% {
+ opacity: 0;
+ transform: translate3d(520%, 0, 0);
+ }
+ }
+
+ .hub-loading-bar {
+ pointer-events: none;
+ position: relative;
+ overflow: hidden;
+ width: 100%;
+ height: 3px;
+ }
+
+ .hub-loading-bar::after {
+ content: "";
+ display: none;
+ position: absolute;
+ inset-block: 0;
+ left: 0;
+ width: 36%;
+ background: linear-gradient(
+ 90deg,
+ transparent,
+ color-mix(in srgb, var(--foreground) 20%, transparent),
+ color-mix(in srgb, var(--foreground) 58%, transparent),
+ color-mix(in srgb, var(--foreground) 20%, transparent),
+ transparent
+ );
+ will-change: opacity, transform;
+ }
+
+ html.dark .hub-loading-bar::after {
+ background: linear-gradient(
+ 90deg,
+ transparent,
+ color-mix(in srgb, var(--foreground) 22%, transparent),
+ color-mix(in srgb, var(--foreground) 60%, transparent),
+ color-mix(in srgb, var(--foreground) 22%, transparent),
+ transparent
+ );
+ }
+
+ .hub-loading-bar[data-active="true"]::after {
+ display: block;
+ animation: hub-loading-sweep 3s cubic-bezier(0.22, 0.72, 0.18, 1) infinite;
+ }
+
+ @media (prefers-reduced-motion: reduce) {
+ .hub-loading-bar[data-active="true"]::after {
+ animation-duration: 3s !important;
+ animation-iteration-count: infinite !important;
+ }
+ }
+
+ /* README markdown can be thousands of nodes. Keep its paint/layout work
scoped so unrelated overlays, like the sidebar account menu, do less
route-wide recalculation while the Hub is open. */
- .hub-readme-prose {
- content-visibility: auto;
- contain-intrinsic-size: auto 640px;
- }
-
- .hub-readme-prose > * {
- content-visibility: auto;
- contain-intrinsic-size: auto 140px;
- }
-
- .hub-readme-prose :is(p, div):has(> a:nth-of-type(2) > img) {
- display: flex;
- flex-wrap: wrap;
- align-items: center;
- gap: 0.5rem;
- }
-
- .hub-readme-prose :is(p, div):has(> a:nth-of-type(2) > img) > br {
- display: none;
- }
-
- .hub-readme-prose :is(p, div):has(> a:nth-of-type(2) > img) > a {
- display: inline-flex;
- align-items: center;
- }
-
- .hub-readme-prose :is(p, div):has(> a:nth-of-type(2) > img) img {
- margin-block: 0;
- }
-
- /* Inspector action pills (Download / Run / Train / Cancel) for the hub
+ .hub-readme-prose {
+ content-visibility: auto;
+ contain-intrinsic-size: auto 640px;
+ }
+
+ .hub-readme-prose > * {
+ content-visibility: auto;
+ contain-intrinsic-size: auto 140px;
+ }
+
+ .hub-readme-prose > hr:first-child {
+ display: none;
+ }
+
+ .hub-readme-prose :is(p, div):has(> a:nth-of-type(2) > img) {
+ display: flex;
+ flex-wrap: wrap;
+ align-items: center;
+ gap: 0.5rem;
+ }
+
+ .hub-readme-prose :is(p, div):has(> a:nth-of-type(2) > img) > br {
+ display: none;
+ }
+
+ .hub-readme-prose :is(p, div):has(> a:nth-of-type(2) > img) > a {
+ display: inline-flex;
+ align-items: center;
+ }
+
+ .hub-readme-prose :is(p, div):has(> a:nth-of-type(2) > img) img {
+ margin-block: 0;
+ }
+
+ /* Inspector action pills (Download / Run / Train / Cancel) for the hub
inspector card. Centralized so all three sections (GGUF, safetensors,
datasets) stay in lock-step on type scale, padding, hover surface, and
the 16px icon size — mirrors the pattern used for `.sidebar-nav-btn`.
Width and disabled tint are layered inline by callers (some buttons
are w-24 in a pair, some are w-28 standalone). Raw CSS rather than
@apply so the cascade is explicit and predictable. */
- .hub-action-btn {
- display: inline-flex;
- height: 2.25rem;
- cursor: pointer;
- align-items: center;
- justify-content: center;
- gap: 0.5rem;
- white-space: nowrap;
- border-radius: 9999px;
- background-color: transparent;
- padding-left: 0.75rem;
- padding-right: 0.75rem;
- font-size: 13px;
- font-weight: 500;
- line-height: 18px;
- letter-spacing: -0.025em;
- color: var(--foreground);
- transition: color 150ms, background-color 150ms;
- }
-
- .hub-action-btn:hover:not(:disabled) {
- background-color: color-mix(in srgb, var(--foreground) 4%, transparent);
- }
-
- .dark .hub-action-btn:hover:not(:disabled) {
- background-color: color-mix(in srgb, var(--foreground) 5%, transparent);
- }
-
- .hub-action-btn:disabled {
- cursor: not-allowed;
- }
-
- /* Every glyph inside a hub action button — explicit icon, spinner, or
+ .hub-action-btn {
+ display: inline-flex;
+ height: 2.25rem;
+ cursor: pointer;
+ align-items: center;
+ justify-content: center;
+ gap: 0.5rem;
+ white-space: nowrap;
+ border-radius: 9999px;
+ background-color: transparent;
+ padding-left: 0.75rem;
+ padding-right: 0.75rem;
+ font-size: 13px;
+ font-weight: 500;
+ line-height: 18px;
+ letter-spacing: -0.025em;
+ color: var(--foreground);
+ transition: color 150ms, background-color 150ms;
+ }
+
+ .hub-action-btn:hover:not(:disabled) {
+ background-color: color-mix(in srgb, var(--foreground) 4%, transparent);
+ }
+
+ .dark .hub-action-btn:hover:not(:disabled) {
+ background-color: color-mix(in srgb, var(--foreground) 5%, transparent);
+ }
+
+ .hub-action-btn:disabled {
+ cursor: not-allowed;
+ }
+
+ /* Every glyph inside a hub action button — explicit icon, spinner, or
embedded SVG — locks to 16px so swapping icons or replacing the
spinner can't drift the layout. */
- .hub-action-btn svg {
- width: 1rem;
- height: 1rem;
- flex-shrink: 0;
- }
+ .hub-action-btn svg {
+ width: 1rem;
+ height: 1rem;
+ flex-shrink: 0;
+ }
- /* Primary "Run" action — confirms loading/running a model. Pill shape
+ /* Primary "Run" action — confirms loading/running a model. Pill shape
(rounded-full) so it reads as the unmistakable CTA in a row of
ghost actions and matches the live-model status-success token used
elsewhere in the app. Same h-9 geometry, 13px
medium type, tracking-tight, and 16px icon slot as .hub-action-btn
so the height aligns with adjacent ghost buttons. */
- .hub-run-action-btn {
- display: inline-flex;
- height: 2.25rem;
- cursor: pointer;
- align-items: center;
- justify-content: center;
- gap: 0.4rem;
- white-space: nowrap;
- border-radius: 9999px;
- background-color: var(--status-success);
- padding-left: 1rem;
- padding-right: 1rem;
- font-size: 13px;
- font-weight: 600;
- line-height: 18px;
- letter-spacing: -0.025em;
- color: var(--primary-foreground);
- transition: background-color 150ms, transform 150ms;
- box-shadow:
- inset 0 1px 0 color-mix(in srgb, var(--primary-foreground) 18%, transparent),
- 0 1px 2px color-mix(in srgb, var(--status-success) 22%, transparent);
- }
-
- .hub-run-action-btn:hover:not(:disabled) {
- background-color: color-mix(in srgb, var(--status-success) 88%, black);
- }
-
- .hub-run-action-btn:active:not(:disabled) {
- transform: scale(0.98);
- }
-
- .hub-run-action-btn:disabled {
- cursor: not-allowed;
- opacity: 0.5;
- }
-
- .hub-run-action-btn svg {
- width: 0.9rem;
- height: 0.9rem;
- flex-shrink: 0;
- }
-
- /* Spinner-default / cancel-on-hover swap inside `.hub-action-btn`.
+ .hub-run-action-btn {
+ display: inline-flex;
+ height: 2.25rem;
+ cursor: pointer;
+ align-items: center;
+ justify-content: center;
+ gap: 0.4rem;
+ white-space: nowrap;
+ border-radius: 9999px;
+ background-color: var(--status-success);
+ padding-left: 1rem;
+ padding-right: 1rem;
+ font-size: 13px;
+ font-weight: 600;
+ line-height: 18px;
+ letter-spacing: -0.025em;
+ color: var(--primary-foreground);
+ transition: background-color 150ms, transform 150ms;
+ box-shadow: inset 0 1px 0
+ color-mix(in srgb, var(--primary-foreground) 18%, transparent), 0 1px 2px
+ color-mix(in srgb, var(--status-success) 22%, transparent);
+ }
+
+ .hub-run-action-btn:hover:not(:disabled) {
+ background-color: color-mix(in srgb, var(--status-success) 88%, black);
+ }
+
+ .hub-run-action-btn:active:not(:disabled) {
+ transform: scale(0.98);
+ }
+
+ .hub-run-action-btn:disabled {
+ cursor: not-allowed;
+ opacity: 0.5;
+ }
+
+ .hub-run-action-btn svg {
+ width: 0.9rem;
+ height: 0.9rem;
+ flex-shrink: 0;
+ }
+
+ /* Spinner-default / cancel-on-hover swap inside `.hub-action-btn`.
Two glyphs occupy the same 16×16 slot; the button's :hover toggles
their opacities so the percentage label beside them never shifts. */
- .hub-cta-indicator {
- position: relative;
- display: inline-flex;
- width: 1rem;
- height: 1rem;
- flex-shrink: 0;
- align-items: center;
- justify-content: center;
- }
-
- .hub-cta-indicator-spinner,
- .hub-cta-indicator-cancel {
- transition: opacity 150ms;
- }
-
- .hub-cta-indicator-cancel {
- position: absolute;
- opacity: 0;
- }
-
- .hub-action-btn:hover .hub-cta-indicator-spinner {
- opacity: 0;
- }
-
- .hub-action-btn:hover .hub-cta-indicator-cancel {
- opacity: 1;
- }
-
- /* Hover-revealed inline action overlay (used for the row-end trash on
+ .hub-cta-indicator {
+ position: relative;
+ display: inline-flex;
+ width: 1rem;
+ height: 1rem;
+ flex-shrink: 0;
+ align-items: center;
+ justify-content: center;
+ }
+
+ .hub-cta-indicator-spinner,
+ .hub-cta-indicator-cancel {
+ transition: opacity 150ms;
+ }
+
+ .hub-cta-indicator-cancel {
+ position: absolute;
+ opacity: 0;
+ }
+
+ .hub-action-btn:hover .hub-cta-indicator-spinner {
+ opacity: 0;
+ }
+
+ .hub-action-btn:hover .hub-cta-indicator-cancel {
+ opacity: 1;
+ }
+
+ /* Hover-revealed inline action overlay (used for the row-end trash on
downloaded models and datasets in the inspector). Wrapper 28×28 with a
16px glyph — same icon size as `.hub-action-btn` so the destructive
affordance reads consistently with the primary actions. Relies on a
`.group/dl` ancestor for the hover scope (the Hub download row). */
- .hub-row-action {
- position: absolute;
- right: 0.25rem;
- top: 50%;
- display: inline-flex;
- width: 1.75rem;
- height: 1.75rem;
- transform: translateY(-50%);
- align-items: center;
- justify-content: center;
- border-radius: 8px;
- color: var(--muted-foreground);
- opacity: 0;
- cursor: pointer;
- transition: opacity 150ms, color 150ms;
- }
-
- .group\/dl:hover .hub-row-action,
- .hub-row-action:focus-visible {
- opacity: 1;
- }
-
- .hub-row-action:hover {
- color: rgb(225 29 72);
- }
-
- .dark .hub-row-action:hover {
- color: rgb(251 113 133);
- }
-
- .hub-row-action svg {
- width: 1rem;
- height: 1rem;
- flex-shrink: 0;
- }
+ .hub-row-action {
+ position: absolute;
+ right: 0.25rem;
+ top: 50%;
+ display: inline-flex;
+ width: 1.75rem;
+ height: 1.75rem;
+ transform: translateY(-50%);
+ align-items: center;
+ justify-content: center;
+ border-radius: 8px;
+ color: var(--muted-foreground);
+ opacity: 0;
+ cursor: pointer;
+ transition: opacity 150ms, color 150ms;
+ }
+
+ .group\/dl:hover .hub-row-action,
+ .hub-row-action:focus-visible {
+ opacity: 1;
+ }
+
+ .hub-row-action:hover {
+ color: rgb(225 29 72);
+ }
+
+ .dark .hub-row-action:hover {
+ color: rgb(251 113 133);
+ }
+
+ .hub-row-action svg {
+ width: 1rem;
+ height: 1rem;
+ flex-shrink: 0;
+ }
}
@layer base {
- .hub-page .field-trigger.field-filter {
- color: var(--muted-foreground);
- font-weight: 400;
- padding-top: 0.25rem;
- padding-bottom: 0.25rem;
- line-height: 1.25rem;
- }
-
- .hub-page .field-trigger.field-filter:hover {
- color: var(--foreground);
- }
+ .hub-page .field-trigger.field-filter {
+ color: var(--muted-foreground);
+ font-weight: 400;
+ padding-top: 0.25rem;
+ padding-bottom: 0.25rem;
+ line-height: 1.25rem;
+ }
+
+ .hub-page .field-trigger.field-filter:hover {
+ color: var(--foreground);
+ }
+
+ .hub-page .hub-stat-pill {
+ display: inline-flex;
+ flex-shrink: 0;
+ align-items: center;
+ gap: 0.4rem;
+ height: 2rem;
+ padding-inline: 0.7rem;
+ border-radius: 9999px;
+ border: 1px solid color-mix(in srgb, var(--foreground) 8%, transparent);
+ background-color: color-mix(in srgb, var(--foreground) 2.5%, transparent);
+ font-size: 12px;
+ line-height: 1;
+ color: var(--muted-foreground);
+ white-space: nowrap;
+ }
+
+ html.dark .hub-page .hub-stat-pill {
+ background-color: color-mix(in srgb, var(--foreground) 4%, transparent);
+ }
+
+ .hub-page .hub-stat-pill-value {
+ font-weight: 600;
+ color: var(--foreground);
+ font-variant-numeric: tabular-nums;
+ }
+
+ .hub-page .hub-hero {
+ --hub-hero-fill: color-mix(in srgb, var(--foreground) 3.2%, transparent);
+ --hub-card-border-accent: var(--foreground);
+ --hub-card-edge-mix: 2.2%;
+ --hub-card-inner-accent: var(--background);
+ --hub-card-inner-mix: 12%;
+ --hub-card-inner-opacity: 0.14;
+ --hub-card-corner-mix: 8.5%;
+ --hub-card-corner-opacity: 0.48;
+ --hub-hero-edge: color-mix(
+ in srgb,
+ var(--hub-card-border-accent) var(--hub-card-edge-mix),
+ transparent
+ );
+ --hub-hero-inner-edge: color-mix(
+ in srgb,
+ var(--hub-card-inner-accent) var(--hub-card-inner-mix),
+ transparent
+ );
+ --hub-hero-corner-edge: color-mix(
+ in srgb,
+ var(--hub-card-border-accent) var(--hub-card-corner-mix),
+ transparent
+ );
+ position: relative;
+ overflow: hidden;
+ border-radius: 24px;
+ border: 1px solid transparent;
+ background-color: var(--hub-hero-fill);
+ }
+
+ .hub-page .hub-hero::before,
+ .hub-page .hub-hero::after {
+ position: absolute;
+ border-radius: inherit;
+ content: "";
+ pointer-events: none;
+ }
+
+ .hub-page .hub-hero::before {
+ inset: 1px;
+ border: 1px solid var(--hub-hero-inner-edge);
+ opacity: 0;
+ }
+
+ .hub-page .hub-hero::after {
+ inset: 0;
+ border: 1px solid var(--hub-hero-corner-edge);
+ opacity: 0;
+ -webkit-mask:
+ linear-gradient(
+ 90deg,
+ #000 0 76px,
+ rgb(0 0 0 / 94%) 34%,
+ rgb(0 0 0 / 58%) 76%,
+ transparent 100%
+ )
+ top left / 48% 44px no-repeat,
+ linear-gradient(
+ 180deg,
+ #000 0 54px,
+ rgb(0 0 0 / 68%) 86px,
+ transparent 140px
+ )
+ top left / 44px 160px no-repeat,
+ linear-gradient(
+ 270deg,
+ #000 0 76px,
+ rgb(0 0 0 / 94%) 34%,
+ rgb(0 0 0 / 58%) 76%,
+ transparent 100%
+ )
+ bottom right / 48% 44px no-repeat,
+ linear-gradient(
+ 0deg,
+ #000 0 54px,
+ rgb(0 0 0 / 68%) 86px,
+ transparent 140px
+ )
+ bottom right / 44px 160px no-repeat;
+ mask:
+ linear-gradient(
+ 90deg,
+ #000 0 76px,
+ rgb(0 0 0 / 94%) 34%,
+ rgb(0 0 0 / 58%) 76%,
+ transparent 100%
+ )
+ top left / 48% 44px no-repeat,
+ linear-gradient(
+ 180deg,
+ #000 0 54px,
+ rgb(0 0 0 / 68%) 86px,
+ transparent 140px
+ )
+ top left / 44px 160px no-repeat,
+ linear-gradient(
+ 270deg,
+ #000 0 76px,
+ rgb(0 0 0 / 94%) 34%,
+ rgb(0 0 0 / 58%) 76%,
+ transparent 100%
+ )
+ bottom right / 48% 44px no-repeat,
+ linear-gradient(
+ 0deg,
+ #000 0 54px,
+ rgb(0 0 0 / 68%) 86px,
+ transparent 140px
+ )
+ bottom right / 44px 160px no-repeat;
+ }
+
+ html.dark .hub-page .hub-hero {
+ --hub-hero-fill: #1c1c1c;
+ --hub-card-border-accent: var(--foreground);
+ --hub-card-edge-mix: 2.8%;
+ --hub-card-inner-accent: var(--foreground);
+ --hub-card-inner-mix: 2.5%;
+ --hub-card-inner-opacity: 0.22;
+ --hub-card-corner-mix: 9.5%;
+ }
+
+ .hub-page .hub-hero-panel {
+ border-radius: 18px;
+ border: 1px solid transparent;
+ background-color: color-mix(in srgb, var(--background) 72%, transparent);
+ }
+
+ html.dark .hub-page .hub-hero-panel {
+ border-color: transparent;
+ background-color: #202020;
+ }
+
+ .hub-page .hub-hero-orb {
+ position: absolute;
+ border-radius: 9999px;
+ background-color: color-mix(in srgb, var(--foreground) 4.5%, transparent);
+ opacity: 0.42;
+ }
+
+ .hub-page .hub-hero-orb-accent {
+ background-color: color-mix(in srgb, var(--foreground) 8%, transparent);
+ opacity: 0.34;
+ }
+
+ .hub-page .hub-section-chevron {
+ transition: color 150ms ease, transform 150ms ease;
+ }
+
+ .hub-page .hub-section-chevron:hover {
+ color: var(--foreground);
+ }
+
+ .hub-page .hub-section-title:hover .hub-section-chevron {
+ color: var(--foreground);
+ transform: translateX(2px);
+ }
+
+ @media (prefers-reduced-motion: reduce) {
+ .hub-page .hub-section-chevron {
+ transition: none;
+ }
+
+ .hub-page .hub-section-title:hover .hub-section-chevron {
+ transform: none;
+ }
+ }
+}
+
+@layer utilities {
+ .hub-chip {
+ @apply inline-flex items-center gap-1 rounded-full px-2 py-[3px] text-[11px] font-medium leading-none;
+ background-color: color-mix(in srgb, var(--foreground) 5%, transparent);
+ color: var(--muted-foreground);
+ }
+
+ .dark .hub-chip {
+ background-color: color-mix(in srgb, var(--foreground) 7%, transparent);
+ }
+
+ .hub-meta-tag {
+ @apply inline-flex h-[18px] shrink-0 items-center gap-1 rounded-full px-2 text-[11px] font-medium leading-none;
+ background-color: color-mix(in srgb, var(--foreground) 5%, transparent);
+ color: var(--muted-foreground);
+ }
+
+ .dark .hub-meta-tag {
+ background-color: color-mix(in srgb, var(--foreground) 7.5%, transparent);
+ }
}
html:not(.dark) .hub-page [data-hub-scroll="true"] {
- scrollbar-color: oklch(0.5 0 0 / 0.22) transparent;
+ scrollbar-color: oklch(0.5 0 0 / 0.22) transparent;
}
html.dark .hub-page [data-hub-scroll="true"] {
- scrollbar-color: oklch(0.72 0 0 / 0.3) transparent;
+ scrollbar-color: oklch(0.55 0 0 / 0.16) transparent;
}
html:not(.dark) .hub-page [data-hub-scroll="true"]::-webkit-scrollbar-thumb {
- background: oklch(0.5 0 0 / 0.22);
+ background: oklch(0.5 0 0 / 0.22);
}
html.dark .hub-page [data-hub-scroll="true"]::-webkit-scrollbar-thumb {
- background: oklch(0.72 0 0 / 0.3);
+ background: oklch(0.55 0 0 / 0.16);
}
/* While a modal dialog is open (delete confirmation, transport-mode swap, the
@@ -759,5 +1514,5 @@ html.dark .hub-page [data-hub-scroll="true"]::-webkit-scrollbar-thumb {
by the body-level rule, and the dialog's own portaled content never carries
this class. */
body[data-scroll-locked] .hub-modal-pe-guard {
- pointer-events: none !important;
+ pointer-events: none !important;
}
diff --git a/studio/frontend/src/features/hub/inventory/use-device-inventory.ts b/studio/frontend/src/features/hub/inventory/use-device-inventory.ts
index c662a582287..00eaa31a224 100644
--- a/studio/frontend/src/features/hub/inventory/use-device-inventory.ts
+++ b/studio/frontend/src/features/hub/inventory/use-device-inventory.ts
@@ -215,8 +215,8 @@ export function fetchInventorySource<K extends DeviceInventorySource>(
}
// Carry `ready` across refetches so a stale-but-known state doesn't flip to
- // "loading" on a bump and flash a spinner in every consumer; show prior rows
- // until the success path lands fresh data.
+ // "loading" on a bump and flash a spinner in every consumer; keep showing
+ // prior rows until the success path lands fresh data.
updateSourceState(source, {
loading: true,
ready: current.ready,
diff --git a/studio/frontend/src/features/hub/lib/avatar-theme.ts b/studio/frontend/src/features/hub/lib/avatar-theme.ts
new file mode 100644
index 00000000000..c2e24f5be0b
--- /dev/null
+++ b/studio/frontend/src/features/hub/lib/avatar-theme.ts
@@ -0,0 +1,28 @@
+// SPDX-License-Identifier: AGPL-3.0-only
+// Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0
+
+const PALETTE = [
+ "hsl(214 66% 52%)",
+ "hsl(172 54% 44%)",
+ "hsl(30 70% 52%)",
+ "hsl(348 62% 56%)",
+ "hsl(198 64% 50%)",
+ "hsl(140 48% 46%)",
+ "hsl(222 50% 56%)",
+ "hsl(16 64% 54%)",
+ "hsl(260 46% 58%)",
+ "hsl(44 72% 50%)",
+];
+
+function hashOwner(owner: string): number {
+ let h = 0;
+ for (let i = 0; i < owner.length; i++) {
+ h = (h * 31 + owner.charCodeAt(i)) | 0;
+ }
+ return Math.abs(h);
+}
+
+export function ownerPaletteColor(owner: string): string {
+ const owned = owner.trim() || "?";
+ return PALETTE[hashOwner(owned) % PALETTE.length];
+}
diff --git a/studio/frontend/src/features/hub/lib/card-accent.ts b/studio/frontend/src/features/hub/lib/card-accent.ts
new file mode 100644
index 00000000000..743d9d02515
--- /dev/null
+++ b/studio/frontend/src/features/hub/lib/card-accent.ts
@@ -0,0 +1,109 @@
+// SPDX-License-Identifier: AGPL-3.0-only
+// Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0
+
+import type { CSSProperties } from "react";
+
+export type AdaptiveCardAccentStyle = CSSProperties & {
+ "--hub-card-art-accent"?: string;
+ "--hub-card-inner-mix"?: string;
+ "--hub-card-inner-opacity"?: string;
+};
+
+interface Rgb {
+ r: number;
+ g: number;
+ b: number;
+}
+
+function clamp(value: number, min: number, max: number): number {
+ return Math.min(Math.max(value, min), max);
+}
+
+function formatPercent(value: number): string {
+ return `${Math.round(value * 10) / 10}%`;
+}
+
+function formatOpacity(value: number): string {
+ return (Math.round(value * 100) / 100).toString();
+}
+
+function parseRgb(color: string): Rgb | null {
+ const value = color.trim().toLowerCase();
+ if (!(value.startsWith("rgb(") || value.startsWith("rgba("))) {
+ return null;
+ }
+
+ const start = value.indexOf("(");
+ const end = value.indexOf(")", start + 1);
+ if (start === -1 || end === -1) {
+ return null;
+ }
+
+ const channels = value
+ .slice(start + 1, end)
+ .split(",")
+ .slice(0, 3)
+ .map((channel) => Number.parseFloat(channel.trim()));
+ if (
+ channels.length !== 3 ||
+ channels.some((channel) => !Number.isFinite(channel))
+ ) {
+ return null;
+ }
+
+ const [r, g, b] = channels.map((channel) => clamp(channel, 0, 255));
+ return { r, g, b };
+}
+
+function relativeLuminance({ r, g, b }: Rgb): number {
+ const toLinear = (channel: number) => {
+ const value = channel / 255;
+ return value <= 0.04045 ? value / 12.92 : ((value + 0.055) / 1.055) ** 2.4;
+ };
+ return 0.2126 * toLinear(r) + 0.7152 * toLinear(g) + 0.0722 * toLinear(b);
+}
+
+function saturation({ r, g, b }: Rgb): number {
+ const max = Math.max(r, g, b);
+ const min = Math.min(r, g, b);
+ return max === 0 ? 0 : (max - min) / max;
+}
+
+export function buildAdaptiveCardAccentStyle(
+ color: string | null,
+): AdaptiveCardAccentStyle | undefined {
+ if (!color) {
+ return undefined;
+ }
+
+ const rgb = parseRgb(color);
+ if (!rgb) {
+ return undefined;
+ }
+
+ const sat = saturation(rgb);
+ if (sat < 0.22) {
+ return undefined;
+ }
+
+ const lum = relativeLuminance(rgb);
+ const darkPenalty = lum < 0.24 ? 3.4 : lum < 0.36 ? 2.1 : 0;
+ const brightPenalty = lum > 0.78 ? 1.4 : 0;
+
+ const innerMix = clamp(
+ 16 + sat * 9 - darkPenalty * 1.8 - brightPenalty,
+ 12,
+ 25,
+ );
+ const innerOpacity = clamp(
+ 0.18 + sat * 0.16 - darkPenalty * 0.035 - brightPenalty * 0.015,
+ 0.16,
+ 0.34,
+ );
+
+ return {
+ "--hub-card-art-accent": color,
+ "--hub-card-inner-mix": formatPercent(innerMix),
+ "--hub-card-inner-opacity": formatOpacity(innerOpacity),
+ };
+}
diff --git a/studio/frontend/src/features/hub/lib/channels.ts b/studio/frontend/src/features/hub/lib/channels.ts
index 6fc3fe7c9a6..4106820c4d3 100644
--- a/studio/frontend/src/features/hub/lib/channels.ts
+++ b/studio/frontend/src/features/hub/lib/channels.ts
@@ -1,13 +1,13 @@
// SPDX-License-Identifier: AGPL-3.0-only
// Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0
+import type { HfSortKey } from "@/features/hub/hooks/use-hub-model-search";
import {
NewReleasesIcon,
SlidersHorizontalIcon,
SparklesIcon,
} from "@hugeicons/core-free-icons";
import type { IconSvgElement } from "@hugeicons/react";
-import type { HfSortKey } from "@/features/hub/hooks/use-hub-model-search";
import type { ModelFormatFilter } from "../types";
export type ChannelId =
@@ -35,8 +35,9 @@ export const CHANNEL_PRESETS: readonly ChannelPreset[] = [
id: "unsloth-trending",
label: "Unsloth Trending",
icon: SparklesIcon,
- hint: "Trending Unsloth models.",
+ hint: "Most trending models published by Unsloth.",
owner: "unsloth",
+ tags: ["gguf"],
format: "gguf",
sort: "trendingScore",
},
@@ -44,7 +45,7 @@ export const CHANNEL_PRESETS: readonly ChannelPreset[] = [
id: "unsloth-latest",
label: "Latest Unsloth",
icon: NewReleasesIcon,
- hint: "Newest Unsloth releases.",
+ hint: "Freshly released models from the Unsloth channel.",
owner: "unsloth",
format: "all",
sort: "lastModified",
@@ -65,3 +66,33 @@ export function findChannel(id: ChannelId | null): ChannelPreset | null {
if (!id) return null;
return CHANNEL_PRESETS.find((preset) => preset.id === id) ?? null;
}
+
+export type HubSection = "trending" | "latest" | "finetune";
+
+export const HUB_SECTION_ORDER: readonly HubSection[] = [
+ "trending",
+ "latest",
+ "finetune",
+];
+
+export const SECTION_TO_CHANNEL: Record<HubSection, ChannelId> = {
+ trending: "unsloth-trending",
+ latest: "unsloth-latest",
+ finetune: "unsloth-safetensors",
+};
+
+export const CHANNEL_TO_SECTION: Record<ChannelId, HubSection> = {
+ "unsloth-trending": "trending",
+ "unsloth-latest": "latest",
+ "unsloth-safetensors": "finetune",
+};
+
+export const HUB_SECTION_TITLE: Record<HubSection, string> = {
+ trending: "Trending Now",
+ latest: "Latest Unsloth Models",
+ finetune: "Fine-tune Ready",
+};
+
+export function isHubSection(value: unknown): value is HubSection {
+ return value === "trending" || value === "latest" || value === "finetune";
+}
diff --git a/studio/frontend/src/features/hub/lib/format-filters.ts b/studio/frontend/src/features/hub/lib/format-filters.ts
index 27d59724041..7b8e73bb0a3 100644
--- a/studio/frontend/src/features/hub/lib/format-filters.ts
+++ b/studio/frontend/src/features/hub/lib/format-filters.ts
@@ -3,10 +3,10 @@
export type FormatFilterModelFormat =
| "gguf"
- | "mlx"
| "safetensors"
| "adapter"
| "checkpoint"
+ | "mlx"
| "unknown";
export type FormatFilterValue = "all" | "gguf" | "checkpoint" | "mlx";
@@ -27,9 +27,6 @@ export function matchesFormat(
return normalized === "safetensors" || normalized === "checkpoint";
}
-// Discover results carry an isGguf flag plus HF tags/library. MLX repos are
-// tagged "mlx" or use library_name "mlx", so detect those before falling back
-// to safetensors.
export function detectResultFormat(result: {
isGguf: boolean;
tags?: string[];
diff --git a/studio/frontend/src/features/hub/lib/format.ts b/studio/frontend/src/features/hub/lib/format.ts
index 862597ff952..95e2c5b671b 100644
--- a/studio/frontend/src/features/hub/lib/format.ts
+++ b/studio/frontend/src/features/hub/lib/format.ts
@@ -51,6 +51,16 @@ export function repoOf(id: string): string {
return id.includes("/") ? id.split("/").slice(1).join("/") : id;
}
+export function formatShortDate(iso?: string): string {
+ if (!iso) return "N/A";
+ const time = new Date(iso).getTime();
+ if (Number.isNaN(time)) return "N/A";
+ return new Intl.DateTimeFormat("en", {
+ month: "short",
+ year: "numeric",
+ }).format(time);
+}
+
export function formatRelativeShort(iso?: string): string {
if (!iso) return "N/A";
const then = new Date(iso).getTime();
@@ -70,3 +80,21 @@ export function formatRelativeShort(iso?: string): string {
const years = Math.floor(days / 365);
return `${years}y ago`;
}
+
+export function formatRelativeLong(iso?: string): string {
+ if (!iso) return "N/A";
+ const then = new Date(iso).getTime();
+ if (Number.isNaN(then)) return "N/A";
+ const diffMs = Math.max(0, Date.now() - then);
+ const minutes = Math.floor(diffMs / 60_000);
+ if (minutes < 1) return "just now";
+ const unit = (value: number, name: string) =>
+ `${value} ${name}${value === 1 ? "" : "s"} ago`;
+ if (minutes < 60) return unit(minutes, "minute");
+ const hours = Math.floor(minutes / 60);
+ if (hours < 24) return unit(hours, "hour");
+ const days = Math.floor(hours / 24);
+ if (days < 30) return unit(days, "day");
+ if (days < 365) return unit(Math.floor(days / 30), "month");
+ return unit(Math.floor(days / 365), "year");
+}
diff --git a/studio/frontend/src/features/hub/lib/hf-cache.ts b/studio/frontend/src/features/hub/lib/hf-cache.ts
index f2cab8b2ca5..8860d430ea1 100644
--- a/studio/frontend/src/features/hub/lib/hf-cache.ts
+++ b/studio/frontend/src/features/hub/lib/hf-cache.ts
@@ -9,11 +9,30 @@ import { fingerprintToken } from "./token-fingerprint";
const CACHE_TTL_MS = 5 * 60 * 1000;
const CACHE_MAX_ENTRIES = 256;
const MAX_CONCURRENT = 3;
-const ALL_FIELDS: ("safetensors" | "tags")[] = ["safetensors", "tags"];
+type CachedAdditionalField =
+ | "safetensors"
+ | "tags"
+ | "library_name"
+ | "config"
+ | "createdAt"
+ | "downloadsAllTime";
+
+const DEFAULT_FIELDS: CachedAdditionalField[] = [
+ "safetensors",
+ "tags",
+ "library_name",
+ "config",
+ "createdAt",
+ "downloadsAllTime",
+];
export type CachedResult = ModelEntry & {
safetensors?: { total?: number; parameters?: Record<string, number> };
tags?: string[];
+ library_name?: string;
+ config?: { quantization_config?: { quant_method?: string } };
+ createdAt?: string | Date;
+ downloadsAllTime?: number;
};
interface CacheEntry {
@@ -88,9 +107,15 @@ export async function cachedModelInfo(
const promise = (async () => {
await acquire();
try {
+ const additionalFields = Array.from(
+ new Set([
+ ...DEFAULT_FIELDS,
+ ...((params.additionalFields ?? []) as CachedAdditionalField[]),
+ ]),
+ );
const result = await modelInfo({
...params,
- additionalFields: ALL_FIELDS,
+ additionalFields,
});
const entry = { data: result as CachedResult, ts: Date.now() };
cache.set(key, entry);
diff --git a/studio/frontend/src/features/hub/lib/hf-owner-avatar.ts b/studio/frontend/src/features/hub/lib/hf-owner-avatar.ts
index e3871f4011c..6e83cfe3c50 100644
--- a/studio/frontend/src/features/hub/lib/hf-owner-avatar.ts
+++ b/studio/frontend/src/features/hub/lib/hf-owner-avatar.ts
@@ -11,24 +11,31 @@ type AvatarCacheEntry =
| { kind: "miss-permanent" }
| { kind: "miss-transient"; until: number; failures: number };
-// Avatars rarely change; after this the cached URL is shown immediately, then
+// Avatars rarely change; after this TTL the cached URL is still shown, then
// refreshed in the background and swapped if changed (stale-while-revalidate).
const URL_TTL_MS = 24 * 60 * 60 * 1000;
// Transient (429/5xx) avatar failures are negative-cached so they auto-recover.
-// Each consecutive failure doubles the retry delay up to a cap (a success
-// resets it); the backoff lives in the cache entry to survive virtualized-list churn.
+// Each consecutive failure doubles the retry delay up to a cap (success resets);
+// the backoff lives in the cache entry to survive virtualized-list remount churn.
const TRANSIENT_MISS_BASE_TTL_MS = 60_000;
const TRANSIENT_MISS_MAX_TTL_MS = 30 * 60_000;
// Bound each fetch so a stalled connection can't hold a concurrency permit open
-// forever (which would hang every queued lookup); timeout is treated as transient.
+// forever (which would eventually hang every queued lookup); timeout is treated
+// as a transient miss so it auto-recovers.
const AVATAR_FETCH_TIMEOUT_MS = 10_000;
+// Defer the first network lookup so rows scrolled past in under this window
+// cancel before they ever touch HF, instead of a fast scroll firing hundreds of
+// requests that swamp the gate. Cached avatars (url / miss) still resolve sync.
+const AVATAR_FETCH_DEBOUNCE_MS = 200;
+
const cache = new LruMap<string, AvatarCacheEntry>(256);
const inflight = new Map<string, Promise<string | null>>();
-// Cap concurrent avatar lookups so a fast scroll doesn't burst past the rate limit.
+// Cap concurrent avatar lookups so a fast scroll doesn't burst past the rate
+// limit, mirroring the modelInfo limiter in hf-cache.ts.
const MAX_AVATAR_CONCURRENT = 6;
let activeFetches = 0;
const waiting: Array<() => void> = [];
@@ -145,7 +152,10 @@ function loadAvatar(name: string): Promise<string | null> {
return promise;
}
-export function useHfOwnerAvatar(owner: string | null | undefined): string | null {
+export function useHfOwnerAvatar(
+ owner: string | null | undefined,
+ enabled = true,
+): string | null {
const key = owner?.trim() ?? "";
const online = useOnlineStatus();
const [state, setState] = useState<{ key: string; url: string | null }>(() => {
@@ -154,9 +164,13 @@ export function useHfOwnerAvatar(owner: string | null | undefined): string | nul
const url = state.key === key ? state.url : readCachedUrl(key);
useEffect(() => {
- if (!key || !online) return;
+ // When disabled (virtualized list rows), never hit the network: show a
+ // cached avatar if one exists, else the colored-initial tile. Keeps the
+ // "All publishers" feed from firing a per-row lookup storm.
+ if (!key || !online || !enabled) return;
let cancelled = false;
let retryTimer: ReturnType<typeof setTimeout> | null = null;
+ let fetchTimer: ReturnType<typeof setTimeout> | null = null;
const scheduleRetry = (until: number) => {
const wait = Math.max(until - Date.now(), 0) + 100;
@@ -165,6 +179,19 @@ export function useHfOwnerAvatar(owner: string | null | undefined): string | nul
}, wait);
};
+ const runFetch = () => {
+ void loadAvatar(key).then((next) => {
+ if (cancelled) return;
+ setState({ key, url: next });
+ if (next == null) {
+ const post = readCache(key);
+ if (post?.kind === "miss-transient") {
+ scheduleRetry(post.until);
+ }
+ }
+ });
+ };
+
const attempt = async () => {
const cached = readCache(key);
if (cached?.kind === "url") {
@@ -185,15 +212,9 @@ export function useHfOwnerAvatar(owner: string | null | undefined): string | nul
scheduleRetry(cached.until);
return;
}
- const next = await loadAvatar(key);
- if (cancelled) return;
- setState({ key, url: next });
- if (next == null) {
- const post = readCache(key);
- if (post?.kind === "miss-transient") {
- scheduleRetry(post.until);
- }
- }
+ // Uncached: defer the network lookup so rows scrolled past in under
+ // AVATAR_FETCH_DEBOUNCE_MS cancel before they ever hit HF.
+ fetchTimer = setTimeout(runFetch, AVATAR_FETCH_DEBOUNCE_MS);
};
void attempt();
@@ -201,8 +222,9 @@ export function useHfOwnerAvatar(owner: string | null | undefined): string | nul
return () => {
cancelled = true;
if (retryTimer != null) clearTimeout(retryTimer);
+ if (fetchTimer != null) clearTimeout(fetchTimer);
};
- }, [key, online]);
+ }, [key, online, enabled]);
return url;
}
diff --git a/studio/frontend/src/features/hub/lib/hf-readme.ts b/studio/frontend/src/features/hub/lib/hf-readme.ts
index 89cb5590dc7..d68df2b808e 100644
--- a/studio/frontend/src/features/hub/lib/hf-readme.ts
+++ b/studio/frontend/src/features/hub/lib/hf-readme.ts
@@ -17,13 +17,14 @@ interface ReadmeCacheEntry {
promise: Promise<FetchedReadme | null>;
// Epoch ms after which the result is refetched. 404s and transient failures
// are cached briefly (transient shorter) so absence/outage can recover;
- // positive results and pending requests never expire within the session.
+ // positive and pending results never expire within the session.
staleAt: number;
}
const cache = new LruMap<string, ReadmeCacheEntry>(64);
-// Bound each request so a stalled HF connection aborts and surfaces as a transient failure.
+// Bound each request so a stalled HF connection aborts and surfaces as a
+// transient failure, matching the dataset-size and owner-avatar helpers.
const README_FETCH_TIMEOUT_MS = 10_000;
const README_NEGATIVE_TTL_MS = 5 * 60_000;
const README_TRANSIENT_TTL_MS = 30_000;
diff --git a/studio/frontend/src/features/hub/lib/hub-feature-flags.ts b/studio/frontend/src/features/hub/lib/hub-feature-flags.ts
index d0d527b7209..858a8b89dbf 100644
--- a/studio/frontend/src/features/hub/lib/hub-feature-flags.ts
+++ b/studio/frontend/src/features/hub/lib/hub-feature-flags.ts
@@ -1,5 +1,11 @@
// SPDX-License-Identifier: AGPL-3.0-only
// Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0
+// Hub feature flags for staged rollout. JSX/wiring stay in place so flipping
+// a flag here is the only edit needed to re-enable.
+
+// Post-download Run / New Chat / Use in chat / Train CTAs; hidden until the
+// Hub-aware chat and train pickers ship.
export const HUB_POST_DOWNLOAD_ACTIONS_VISIBLE = false;
+
export const HUB_GGUF_RUN_ACTIONS_VISIBLE = true;
diff --git a/studio/frontend/src/features/hub/lib/model-capabilities.ts b/studio/frontend/src/features/hub/lib/model-capabilities.ts
index bbfc2174dfb..033a3b6f1f3 100644
--- a/studio/frontend/src/features/hub/lib/model-capabilities.ts
+++ b/studio/frontend/src/features/hub/lib/model-capabilities.ts
@@ -10,7 +10,8 @@ export type CapabilityKey =
| "reasoning"
| "code"
| "embedding"
- | "multilingual";
+ | "multilingual"
+ | "conversational";
export interface Capability {
key: CapabilityKey;
@@ -69,11 +70,63 @@ const CODE_TAGS = new Set([
"programming",
]);
+const CONVERSATIONAL_TAGS = new Set([
+ "conversational",
+ "chat",
+ "chatbot",
+ "text-generation-inference",
+]);
+
+const CONVERSATIONAL_ID_RE = /(?:^|[-_/])conversational(?:[-_/]|$)/;
+
const COMMON_LANGUAGE_TAGS = new Set([
- "en", "fr", "de", "es", "it", "pt", "nl", "ru", "pl", "uk", "tr", "cs",
- "sv", "no", "da", "fi", "el", "ro", "bg", "hu", "hr", "sr", "sl", "sk",
- "zh", "ja", "ko", "ar", "he", "fa", "hi", "bn", "ta", "te", "th", "vi",
- "id", "ms", "tl", "sw", "ur", "ca", "eu", "is", "lv", "lt", "et",
+ "en",
+ "fr",
+ "de",
+ "es",
+ "it",
+ "pt",
+ "nl",
+ "ru",
+ "pl",
+ "uk",
+ "tr",
+ "cs",
+ "sv",
+ "no",
+ "da",
+ "fi",
+ "el",
+ "ro",
+ "bg",
+ "hu",
+ "hr",
+ "sr",
+ "sl",
+ "sk",
+ "zh",
+ "ja",
+ "ko",
+ "ar",
+ "he",
+ "fa",
+ "hi",
+ "bn",
+ "ta",
+ "te",
+ "th",
+ "vi",
+ "id",
+ "ms",
+ "tl",
+ "sw",
+ "ur",
+ "ca",
+ "eu",
+ "is",
+ "lv",
+ "lt",
+ "et",
]);
function lower(values: string[] | undefined): Set<string> {
@@ -133,6 +186,12 @@ export function detectCapabilities(
) {
out.push({ key: "code", label: "Code" });
}
+ if (
+ hasAny(CONVERSATIONAL_TAGS) ||
+ CONVERSATIONAL_ID_RE.test(lowerId)
+ ) {
+ out.push({ key: "conversational", label: "Conversational" });
+ }
if (
hasAny(EMBEDDING_TAGS) ||
/embed|embedding|retriever|reranker|bge[-_]|e5[-_]|gte[-_]|colbert|sentence[-_]?transformer|sentence[-_]?similarity|jina[-_]?embeddings?|nomic[-_]?embed|arctic[-_]?embed|qwen3[-_]?embedding|qwen3[-_]?reranker|text[-_]?embedding/.test(
@@ -160,3 +219,27 @@ export function detectLicense(tags: string[] | undefined): string | null {
const license = tags.find((t) => t.startsWith("license:"));
return license ? license.slice("license:".length) : null;
}
+
+export function detectBaseModel(tags: string[] | undefined): string | null {
+ if (!tags) {
+ return null;
+ }
+ let quantizedBaseModel: string | null = null;
+
+ for (const tag of tags) {
+ if (!tag.startsWith("base_model:")) {
+ continue;
+ }
+ const value = tag.slice("base_model:".length).trim();
+ if (!value) {
+ continue;
+ }
+ if (value.startsWith("quantized:")) {
+ quantizedBaseModel ??= value.slice("quantized:".length).trim() || null;
+ continue;
+ }
+ return value;
+ }
+
+ return quantizedBaseModel;
+}
diff --git a/studio/frontend/src/features/hub/lib/network.ts b/studio/frontend/src/features/hub/lib/network.ts
index 549af99fbc4..48d165c92a7 100644
--- a/studio/frontend/src/features/hub/lib/network.ts
+++ b/studio/frontend/src/features/hub/lib/network.ts
@@ -29,8 +29,8 @@ function emitNetworkStatusChange(): void {
}
export function getBrowserOfflineRetryDelayMs(): number {
- // Keyed off the empirical remote-offline TTL, not navigator.onLine, so recovery
- // doesn't stall on platforms where navigator.onLine is stuck false.
+ // Keyed off the empirical remote-offline TTL, not navigator.onLine, so
+ // recovery doesn't stall on platforms where navigator.onLine is stuck false.
return Math.max(
0,
getRemoteOfflineUntil(HUGGING_FACE_REMOTE_ORIGINS) - Date.now(),
@@ -64,7 +64,8 @@ export function isRemoteNetworkOffline(
export function isHuggingFaceOffline(): boolean {
// navigator.onLine is advisory only (false-reports offline on WSL2 / some
// WebKitGTK/Tauri webviews). The authoritative signal is the empirical
- // remote-offline TTL, set when a real fetch fails and cleared on next success.
+ // remote-offline TTL, set when a real fetch fails and cleared on next success;
+ // navigator's online/offline events still drive re-evaluation.
return isRemoteNetworkOffline(HUGGING_FACE_REMOTE_ORIGINS);
}
diff --git a/studio/frontend/src/features/hub/lib/provider-logos.ts b/studio/frontend/src/features/hub/lib/provider-logos.ts
index d271351df37..9d1a94206b1 100644
--- a/studio/frontend/src/features/hub/lib/provider-logos.ts
+++ b/studio/frontend/src/features/hub/lib/provider-logos.ts
@@ -3,12 +3,15 @@
/**
* Provider-logo registry for Unsloth re-uploads. Unsloth re-uploads upstream
- * models (e.g. unsloth/Qwen2.5-7B is Alibaba's Qwen); we render the upstream
- * provider's logo in place of the Unsloth profile picture.
+ * models (e.g. unsloth/Qwen2.5-7B is Alibaba's Qwen); we show the upstream
+ * provider's logo in place of the Unsloth picture (username stays "unsloth").
*
- * Providers are evaluated in declaration order; a provider matches if any of its
- * `prefixes` is a prefix of the repo name (the part after "owner/"). Repo names
- * are case-sensitive — match the publisher's exact casing.
+ * Matching: providers are evaluated in declaration order; a provider matches if
+ * any of its `prefixes` is a prefix of the repo name (the part after "owner/").
+ * Most-specific providers MUST be declared first (first match wins): e.g.
+ * NVIDIA's Nemotron/Minitron/Mistral-NeMo before meta-llama/mistralai, and
+ * DeepSeek-R1-Distill- before Qwen/meta-llama. Repo names are case-sensitive -
+ * match the publisher's exact casing (e.g. `phi-` for v1/v2 vs `Phi-` for v3+).
*/
/**
@@ -27,15 +30,19 @@ export type LogoBackground = "white" | "transparent";
export type LogoFit = "contain" | "cover";
export interface ProviderLogo {
+ /** Stable kebab-case identifier (debug/telemetry only). */
id: string;
+ /** Display name used as the avatar's accessible label. */
name: string;
+ /** Path to the logo under /public. */
logoPath: string;
treatment: LogoTreatment;
background: LogoBackground;
+ /** Only consulted when treatment is "original". Defaults to "contain". */
fit?: LogoFit;
/**
- * Repo-name prefixes (after `owner/`) mapping to this provider. A prefix
- * match suffices — variants (-Instruct, -bnb-4bit, -GGUF) ride along. Match
+ * Repo-name prefixes (after `owner/`) that map to this provider. A prefix
+ * match suffices - variants (-Instruct, -bnb-4bit, -GGUF) ride along. Match
* on the family stem so future minor versions are picked up automatically.
*/
prefixes: readonly string[];
@@ -258,6 +265,7 @@ export function matchProviderLogo(repoName: string): ProviderLogo | null {
// Owners whose avatars get swapped for the matched provider's logo.
const RELABELED_OWNERS: ReadonlySet<string> = new Set(["unsloth"]);
+/** True if the owner's avatars get replaced with the upstream provider's logo. */
export function isProviderRelabeledOwner(
owner: string | null | undefined,
): boolean {
diff --git a/studio/frontend/src/features/hub/lib/recent-searches.ts b/studio/frontend/src/features/hub/lib/recent-searches.ts
new file mode 100644
index 00000000000..f245032b619
--- /dev/null
+++ b/studio/frontend/src/features/hub/lib/recent-searches.ts
@@ -0,0 +1,101 @@
+// SPDX-License-Identifier: AGPL-3.0-only
+// Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0
+
+import { useEffect, useState } from "react";
+
+// Persisted recent Hub search terms, newest first. Uses the localStorage +
+// same-tab CHANGE_EVENT + cross-tab `storage` pattern so consumers stay in sync.
+const STORAGE_KEY = "unsloth.hub.recentSearches";
+const CHANGE_EVENT = "unsloth:hub-recent-searches-change";
+
+export const MAX_RECENT_SEARCHES = 8;
+// Single characters are usually noise (a half-typed query), so skip them.
+const MIN_QUERY_LENGTH = 2;
+
+function readStored(): string[] {
+ if (typeof window === "undefined") {
+ return [];
+ }
+ try {
+ const raw = window.localStorage.getItem(STORAGE_KEY);
+ if (!raw) {
+ return [];
+ }
+ const parsed: unknown = JSON.parse(raw);
+ if (!Array.isArray(parsed)) {
+ return [];
+ }
+ return parsed
+ .filter((value): value is string => typeof value === "string")
+ .slice(0, MAX_RECENT_SEARCHES);
+ } catch {
+ return [];
+ }
+}
+
+function writeStored(list: string[]): void {
+ if (typeof window === "undefined") {
+ return;
+ }
+ try {
+ window.localStorage.setItem(STORAGE_KEY, JSON.stringify(list));
+ } catch {
+ return;
+ }
+ window.dispatchEvent(new Event(CHANGE_EVENT));
+}
+
+/**
+ * Record a searched term: trims, drops short queries, de-dupes case-insensitively
+ * (moving a match to the front), and caps at {@link MAX_RECENT_SEARCHES}.
+ */
+export function recordRecentSearch(query: string): void {
+ const trimmed = query.trim();
+ if (trimmed.length < MIN_QUERY_LENGTH) {
+ return;
+ }
+ const withoutDuplicate = readStored().filter(
+ (item) => item.toLowerCase() !== trimmed.toLowerCase(),
+ );
+ writeStored([trimmed, ...withoutDuplicate].slice(0, MAX_RECENT_SEARCHES));
+}
+
+export function removeRecentSearch(query: string): void {
+ const existing = readStored();
+ const next = existing.filter((item) => item !== query);
+ if (next.length !== existing.length) {
+ writeStored(next);
+ }
+}
+
+export function clearRecentSearches(): void {
+ if (readStored().length === 0) {
+ return;
+ }
+ writeStored([]);
+}
+
+export function useRecentSearches(): string[] {
+ const [list, setList] = useState<string[]>(readStored);
+
+ useEffect(() => {
+ const handleLocal = () => setList(readStored());
+ const handleStorage = (event: StorageEvent) => {
+ if (event.storageArea !== window.localStorage) {
+ return;
+ }
+ if (event.key !== null && event.key !== STORAGE_KEY) {
+ return;
+ }
+ setList(readStored());
+ };
+ window.addEventListener(CHANGE_EVENT, handleLocal);
+ window.addEventListener("storage", handleStorage);
+ return () => {
+ window.removeEventListener(CHANGE_EVENT, handleLocal);
+ window.removeEventListener("storage", handleStorage);
+ };
+ }, []);
+
+ return list;
+}
diff --git a/studio/frontend/src/features/hub/lib/selection-resolution.ts b/studio/frontend/src/features/hub/lib/selection-resolution.ts
index f3c45434485..642fb68f1d8 100644
--- a/studio/frontend/src/features/hub/lib/selection-resolution.ts
+++ b/studio/frontend/src/features/hub/lib/selection-resolution.ts
@@ -124,22 +124,6 @@ export function resolveDownloadedSelection({
filteredCachedIds,
filteredLocalIds,
localRows,
- ) ??
- resolveDownloadedId(
- filteredCachedRows[0]?.id ?? null,
- cachedById,
- localById,
- filteredCachedIds,
- filteredLocalIds,
- localRows,
- ) ??
- resolveDownloadedId(
- filteredLocalRows[0]?.id ?? null,
- cachedById,
- localById,
- filteredCachedIds,
- filteredLocalIds,
- localRows,
) ?? { selectedId: null, hiddenByFilters: false }
);
}
diff --git a/studio/frontend/src/features/hub/lib/unsloth-support.ts b/studio/frontend/src/features/hub/lib/unsloth-support.ts
index 45e913b2b9c..966f381051f 100644
--- a/studio/frontend/src/features/hub/lib/unsloth-support.ts
+++ b/studio/frontend/src/features/hub/lib/unsloth-support.ts
@@ -188,7 +188,14 @@ export function classifyUnslothSupport({
const formatTags = excludedFormatTagsForDevice(deviceType);
const normalizedQuant = normalizeQuantMethod(quantMethod);
- if (normalizedQuant) {
+ // GGUF runs through llama.cpp regardless of the base model's quant config, so
+ // the HF quant_method must not disqualify a GGUF repo.
+ const isGguf =
+ lowerTags.has("gguf") ||
+ library === "gguf" ||
+ (modelId ? /(?:^|[-_.])gguf$/i.test(repoLeaf(modelId)) : false);
+
+ if (normalizedQuant && !isGguf) {
if (SUPPORTED_QUANT_METHODS.has(normalizedQuant)) {
return { status: "supported", reason: null };
}
diff --git a/studio/frontend/src/features/hub/lib/use-dominant-color.ts b/studio/frontend/src/features/hub/lib/use-dominant-color.ts
new file mode 100644
index 00000000000..84f72653fbc
--- /dev/null
+++ b/studio/frontend/src/features/hub/lib/use-dominant-color.ts
@@ -0,0 +1,101 @@
+// SPDX-License-Identifier: AGPL-3.0-only
+// Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0
+
+import { useEffect, useState } from "react";
+
+const colorCache = new Map<string, string | null>();
+const inflight = new Map<string, Promise<string | null>>();
+
+function computeDominant(data: Uint8ClampedArray): string | null {
+ const buckets = new Map<
+ number,
+ { r: number; g: number; b: number; w: number }
+ >();
+ for (let i = 0; i < data.length; i += 4) {
+ if (data[i + 3] < 128) continue;
+ const r = data[i];
+ const g = data[i + 1];
+ const b = data[i + 2];
+ const max = Math.max(r, g, b);
+ const min = Math.min(r, g, b);
+ const light = (max + min) / 510;
+ const sat = max === 0 ? 0 : (max - min) / max;
+ if (light > 0.93 || light < 0.07) continue;
+ if (sat < 0.18) continue;
+ const key = ((r >> 5) << 6) | ((g >> 5) << 3) | (b >> 5);
+ const w = sat * (1 - Math.abs(light - 0.5));
+ const bucket = buckets.get(key);
+ if (bucket) {
+ bucket.r += r * w;
+ bucket.g += g * w;
+ bucket.b += b * w;
+ bucket.w += w;
+ } else {
+ buckets.set(key, { r: r * w, g: g * w, b: b * w, w });
+ }
+ }
+ let best: { r: number; g: number; b: number; w: number } | null = null;
+ for (const bucket of buckets.values()) {
+ if (!best || bucket.w > best.w) best = bucket;
+ }
+ if (!best || best.w < 2) return null;
+ return `rgb(${Math.round(best.r / best.w)}, ${Math.round(best.g / best.w)}, ${Math.round(best.b / best.w)})`;
+}
+
+function extractColor(url: string): Promise<string | null> {
+ return new Promise((resolve) => {
+ const img = new Image();
+ img.crossOrigin = "anonymous";
+ img.decoding = "async";
+ img.onload = () => {
+ try {
+ const size = 36;
+ const canvas = document.createElement("canvas");
+ canvas.width = size;
+ canvas.height = size;
+ const ctx = canvas.getContext("2d", { willReadFrequently: true });
+ if (!ctx) {
+ resolve(null);
+ return;
+ }
+ ctx.drawImage(img, 0, 0, size, size);
+ resolve(computeDominant(ctx.getImageData(0, 0, size, size).data));
+ } catch {
+ resolve(null);
+ }
+ };
+ img.onerror = () => resolve(null);
+ img.src = url;
+ });
+}
+
+export function useDominantColor(url: string | null): string | null {
+ const [color, setColor] = useState<string | null>(() =>
+ url ? (colorCache.get(url) ?? null) : null,
+ );
+ useEffect(() => {
+ if (!url) {
+ setColor(null);
+ return;
+ }
+ if (colorCache.has(url)) {
+ setColor(colorCache.get(url) ?? null);
+ return;
+ }
+ let alive = true;
+ let promise = inflight.get(url);
+ if (!promise) {
+ promise = extractColor(url);
+ inflight.set(url, promise);
+ }
+ void promise.then((next) => {
+ colorCache.set(url, next);
+ inflight.delete(url);
+ if (alive) setColor(next);
+ });
+ return () => {
+ alive = false;
+ };
+ }, [url]);
+ return color;
+}
diff --git a/studio/frontend/src/features/hub/lib/view-models.ts b/studio/frontend/src/features/hub/lib/view-models.ts
index 50f5b70d8e0..9ee6c5de5d7 100644
--- a/studio/frontend/src/features/hub/lib/view-models.ts
+++ b/studio/frontend/src/features/hub/lib/view-models.ts
@@ -13,15 +13,16 @@ import type {
ModelFormatFilter,
} from "../types";
import {
+ detectBaseModel,
detectCapabilities,
type CapabilityKey,
} from "./model-capabilities";
import { ownerOf, repoOf } from "@/features/hub/lib/format";
import { estimateSizeFromDtypes, isGgufLike } from "./hf-model-meta";
export {
- matchesFormat,
detectResultFormat,
isUnslothFinetunable,
+ matchesFormat,
} from "./format-filters";
export {
formatLocalUpdated,
@@ -35,12 +36,9 @@ export const CAPABILITY_FILTER_OPTIONS: ReadonlyArray<{
}> = [
{ value: "all", label: "All capabilities" },
{ value: "reasoning", label: "Reasoning" },
- { value: "code", label: "Code" },
{ value: "vision", label: "Vision" },
{ value: "audio", label: "Audio" },
- { value: "tools", label: "Tools" },
{ value: "embedding", label: "Embeddings" },
- { value: "multilingual", label: "Multilingual" },
];
export const FORMAT_FILTER_OPTIONS: ReadonlyArray<{
@@ -49,10 +47,44 @@ export const FORMAT_FILTER_OPTIONS: ReadonlyArray<{
}> = [
{ value: "all", label: "All formats" },
{ value: "gguf", label: "GGUF" },
- { value: "checkpoint", label: "Checkpoints" },
+ { value: "checkpoint", label: "Safetensors" },
{ value: "mlx", label: "MLX" },
];
+const BILLION = 1_000_000_000;
+
+export function formatParamCount(totalParams: number | undefined): string {
+ if (!totalParams || totalParams <= 0) return "N/A";
+ const billions = totalParams / BILLION;
+ if (billions >= 1) {
+ return `${billions >= 100 ? Math.round(billions) : Number(billions.toFixed(billions >= 10 ? 0 : 1))}B`;
+ }
+ const millions = totalParams / 1_000_000;
+ return `${Math.round(millions)}M`;
+}
+
+const PARAM_IN_ID_RE = /(\d+(?:\.\d+)?)\s*[bB](?=$|[^a-z0-9])/gi;
+
+export function paramLabelFromId(repo: string): string | null {
+ let bestLabel: string | null = null;
+ let bestValue = Number.NEGATIVE_INFINITY;
+ for (const match of repo.matchAll(PARAM_IN_ID_RE)) {
+ const value = Number.parseFloat(match[1]);
+ if (Number.isFinite(value) && value > bestValue) {
+ bestValue = value;
+ bestLabel = match[1];
+ }
+ }
+ return bestLabel ? `${bestLabel}B` : null;
+}
+
+export function formatModelParamLabel(
+ repo: string,
+ totalParams: number | undefined,
+): string {
+ return paramLabelFromId(repo) ?? formatParamCount(totalParams);
+}
+
export function formatPipelineTag(tag: string | undefined): string | null {
if (!tag) return null;
return tag
@@ -71,7 +103,8 @@ export function buildSummary(result: HfModelResult): string {
const parts: string[] = [];
const pipeline = formatPipelineTag(result.pipelineTag);
if (pipeline) parts.push(pipeline);
- if (result.totalParams) parts.push(`${compactNumber(result.totalParams)} params`);
+ if (result.totalParams)
+ parts.push(`${compactNumber(result.totalParams)} params`);
if (result.isGguf) {
parts.push("GGUF");
} else {
@@ -89,7 +122,9 @@ function compactNumber(value: number): string {
}
function finiteNumber(value: unknown): number | undefined {
- return typeof value === "number" && Number.isFinite(value) ? value : undefined;
+ return typeof value === "number" && Number.isFinite(value)
+ ? value
+ : undefined;
}
export function toHfModelResult(raw: unknown): HfModelResult | null {
@@ -101,10 +136,14 @@ export function toHfModelResult(raw: unknown): HfModelResult | null {
name?: string;
downloads?: number;
likes?: number;
+ private?: boolean;
+ gated?: false | "auto" | "manual";
task?: string;
pipeline_tag?: string;
library_name?: string;
updatedAt?: Date | string;
+ createdAt?: Date | string;
+ downloadsAllTime?: number;
safetensors?: { total?: number; parameters?: Record<string, number> };
gguf?: { total?: number; architecture?: string };
tags?: string[];
@@ -122,18 +161,29 @@ export function toHfModelResult(raw: unknown): HfModelResult | null {
: typeof model.updatedAt === "string"
? model.updatedAt
: undefined;
+ const createdAt =
+ model.createdAt instanceof Date
+ ? model.createdAt.toISOString()
+ : typeof model.createdAt === "string"
+ ? model.createdAt
+ : undefined;
return {
id: model.name,
downloads: finiteNumber(model.downloads) ?? 0,
likes: finiteNumber(model.likes) ?? 0,
+ private: model.private,
+ gated: model.gated,
totalParams:
finiteNumber(model.safetensors?.total) ?? finiteNumber(model.gguf?.total),
estimatedSizeBytes: estimateSizeFromDtypes(model.safetensors?.parameters),
isGguf,
+ baseModel: detectBaseModel(model.tags),
tags: model.tags,
pipelineTag: model.task ?? model.pipeline_tag,
updatedAt,
+ createdAt,
+ downloadsAllTime: finiteNumber(model.downloadsAllTime),
libraryName: model.library_name,
quantMethod: model.config?.quantization_config?.quant_method,
};
diff --git a/studio/frontend/src/features/hub/stores/hf-token-store.ts b/studio/frontend/src/features/hub/stores/hf-token-store.ts
index c63aa82ad45..31a7f0a4dad 100644
--- a/studio/frontend/src/features/hub/stores/hf-token-store.ts
+++ b/studio/frontend/src/features/hub/stores/hf-token-store.ts
@@ -33,7 +33,7 @@ function loadInitial(): string {
const fromTraining = parsed?.state?.hfToken;
if (typeof fromTraining === "string" && fromTraining.length > 0) {
const normalized = normalize(fromTraining);
- // Copy only: training-config-store still reads its own hfToken, so deleting it would drop that token.
+ // Copy only: training-config-store reads its own hfToken; deleting the legacy field drops it.
persist(normalized);
return normalized;
}
diff --git a/studio/frontend/src/features/hub/stores/hub-feed-store.ts b/studio/frontend/src/features/hub/stores/hub-feed-store.ts
new file mode 100644
index 00000000000..9e7a103a041
--- /dev/null
+++ b/studio/frontend/src/features/hub/stores/hub-feed-store.ts
@@ -0,0 +1,149 @@
+// SPDX-License-Identifier: AGPL-3.0-only
+// Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0
+
+import { create } from "zustand";
+import { createJSONStorage, persist } from "zustand/middleware";
+import type { HfModelResult } from "../hooks/use-hub-model-search";
+import { type ChannelId, findChannel } from "../lib/channels";
+import { createThrottledStorage, noopStorage } from "./persist-storage";
+
+export interface ChannelFeedEntry {
+ results: HfModelResult[];
+ fetchedAt: number;
+ tokenFingerprint: string;
+}
+
+export interface HubFeedState {
+ channels: Partial<Record<ChannelId, ChannelFeedEntry>>;
+ tokenFingerprint: string;
+ setChannelEntry: (
+ id: ChannelId,
+ results: HfModelResult[],
+ tokenFingerprint: string,
+ ) => void;
+ clearForToken: (tokenFingerprint: string) => void;
+}
+
+export const FEED_CACHE_CAP = 24;
+
+export const FEED_TTL_MS: Record<ChannelId, number> = {
+ "unsloth-trending": 30 * 60 * 1000,
+ "unsloth-latest": 5 * 60 * 1000,
+ "unsloth-safetensors": 30 * 60 * 1000,
+};
+
+const PERSIST_KEY = "unsloth.studio.hubFeed";
+const PERSIST_VERSION = 1;
+const PERSIST_THROTTLE_MS = 1_000;
+
+export function isChannelEntryFresh(
+ entry: ChannelFeedEntry | undefined,
+ id: ChannelId,
+ tokenFingerprint: string,
+ now: number = Date.now(),
+): boolean {
+ if (!entry) return false;
+ if (entry.tokenFingerprint !== tokenFingerprint) return false;
+ if (entry.results.length === 0) return false;
+ return now - entry.fetchedAt < FEED_TTL_MS[id];
+}
+
+export const selectChannelEntry =
+ (id: ChannelId) =>
+ (state: HubFeedState): ChannelFeedEntry | undefined =>
+ state.channels[id];
+
+function isRecord(value: unknown): value is Record<string, unknown> {
+ return value !== null && typeof value === "object" && !Array.isArray(value);
+}
+
+function sanitizeEntry(value: unknown): ChannelFeedEntry | null {
+ if (!isRecord(value)) return null;
+ if (!Array.isArray(value.results)) return null;
+ if (
+ typeof value.fetchedAt !== "number" ||
+ !Number.isFinite(value.fetchedAt)
+ ) {
+ return null;
+ }
+ const tokenFingerprint =
+ typeof value.tokenFingerprint === "string"
+ ? value.tokenFingerprint
+ : "anon";
+ const results = value.results.filter(
+ (item): item is HfModelResult =>
+ isRecord(item) && typeof item.id === "string",
+ );
+ if (results.length === 0) return null;
+ return {
+ results: results.slice(0, FEED_CACHE_CAP),
+ fetchedAt: value.fetchedAt,
+ tokenFingerprint,
+ };
+}
+
+function sanitizeFeedState(persisted: unknown): Partial<HubFeedState> {
+ if (!isRecord(persisted) || !isRecord(persisted.channels)) {
+ return { channels: {}, tokenFingerprint: "anon" };
+ }
+ const channels: Partial<Record<ChannelId, ChannelFeedEntry>> = {};
+ for (const [key, value] of Object.entries(persisted.channels)) {
+ if (!findChannel(key as ChannelId)) continue;
+ const entry = sanitizeEntry(value);
+ if (entry) channels[key as ChannelId] = entry;
+ }
+ const tokenFingerprint =
+ typeof persisted.tokenFingerprint === "string"
+ ? persisted.tokenFingerprint
+ : "anon";
+ return { channels, tokenFingerprint };
+}
+
+export const useHubFeedStore = create<HubFeedState>()(
+ persist(
+ (set) => ({
+ channels: {},
+ tokenFingerprint: "anon",
+ setChannelEntry: (id, results, tokenFingerprint) =>
+ set((state) => {
+ const base =
+ state.tokenFingerprint === tokenFingerprint ? state.channels : {};
+ return {
+ tokenFingerprint,
+ channels: {
+ ...base,
+ [id]: {
+ results: results.slice(0, FEED_CACHE_CAP),
+ fetchedAt: Date.now(),
+ tokenFingerprint,
+ },
+ },
+ };
+ }),
+ clearForToken: (tokenFingerprint) =>
+ set((state) =>
+ state.tokenFingerprint === tokenFingerprint
+ ? state
+ : { tokenFingerprint, channels: {} },
+ ),
+ }),
+ {
+ name: PERSIST_KEY,
+ version: PERSIST_VERSION,
+ storage: createJSONStorage(() =>
+ typeof window === "undefined"
+ ? noopStorage
+ : createThrottledStorage(window.localStorage, PERSIST_THROTTLE_MS),
+ ),
+ migrate: (persisted) => sanitizeFeedState(persisted),
+ merge: (persisted, current) => ({
+ ...current,
+ ...sanitizeFeedState(persisted),
+ }),
+ partialize: (state) => ({
+ channels: state.channels,
+ tokenFingerprint: state.tokenFingerprint,
+ }),
+ },
+ ),
+);
diff --git a/studio/frontend/src/features/hub/stores/persist-storage.ts b/studio/frontend/src/features/hub/stores/persist-storage.ts
new file mode 100644
index 00000000000..177fd439b17
--- /dev/null
+++ b/studio/frontend/src/features/hub/stores/persist-storage.ts
@@ -0,0 +1,46 @@
+// SPDX-License-Identifier: AGPL-3.0-only
+// Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0
+
+import type { StateStorage } from "zustand/middleware";
+
+export const noopStorage: StateStorage = {
+ getItem: () => null,
+ setItem: () => undefined,
+ removeItem: () => undefined,
+};
+
+export function createThrottledStorage(
+ base: StateStorage,
+ delayMs: number,
+): StateStorage {
+ let timer: ReturnType<typeof setTimeout> | null = null;
+ const pending = new Map<string, string>();
+ const flush = (): void => {
+ if (timer !== null) {
+ clearTimeout(timer);
+ timer = null;
+ }
+ for (const [name, value] of pending) {
+ base.setItem(name, value);
+ }
+ pending.clear();
+ };
+ if (typeof window !== "undefined") {
+ window.addEventListener("pagehide", flush);
+ }
+ return {
+ getItem: (name) => base.getItem(name),
+ setItem: (name, value) => {
+ pending.set(name, value);
+ if (timer === null) timer = setTimeout(flush, delayMs);
+ },
+ removeItem: (name) => {
+ pending.delete(name);
+ if (pending.size === 0 && timer !== null) {
+ clearTimeout(timer);
+ timer = null;
+ }
+ base.removeItem(name);
+ },
+ };
+}
diff --git a/studio/frontend/src/features/hub/types.ts b/studio/frontend/src/features/hub/types.ts
index bf5e2aafeef..ae9ddf5d4bc 100644
--- a/studio/frontend/src/features/hub/types.ts
+++ b/studio/frontend/src/features/hub/types.ts
@@ -86,12 +86,16 @@ export interface SelectedModelView {
license: string | null;
pipelineTag?: string;
libraryName?: string;
+ gated?: false | "auto" | "manual";
+ private?: boolean;
downloads?: number;
+ downloadsAllTime?: number;
likes?: number;
totalParams?: number;
estimatedSizeBytes?: number;
cachedBytes?: number;
updatedAt?: string;
+ createdAt?: string;
localUpdatedAt?: number | null;
tags?: string[];
quantMethod?: string;
diff --git a/studio/frontend/src/features/profile/components/profile-personalization-panel.tsx b/studio/frontend/src/features/profile/components/profile-personalization-panel.tsx
index 40040a43b8d..4ec8395bcfa 100644
--- a/studio/frontend/src/features/profile/components/profile-personalization-panel.tsx
+++ b/studio/frontend/src/features/profile/components/profile-personalization-panel.tsx
@@ -229,7 +229,7 @@ export function ProfilePersonalizationPanel() {
<Label className="text-xs font-medium text-muted-foreground">
{t("settings.profile.avatarShape")}
</Label>
- <div className="inline-flex w-fit items-center gap-1 rounded-full border border-border/70 bg-muted/40 p-1">
+ <div className="hub-tab-toggle inline-flex h-8 w-fit items-center rounded-full">
{(["circle", "rounded"] as const).map((shape) => (
<button
key={shape}
@@ -237,9 +237,9 @@ export function ProfilePersonalizationPanel() {
onClick={() => setAvatarShape(shape)}
aria-pressed={avatarShape === shape}
className={cn(
- "rounded-full px-4 py-1.5 text-xs font-medium transition-colors",
+ "inline-flex h-8 items-center rounded-full px-4 text-[13px] font-medium transition-colors",
avatarShape === shape
- ? "bg-background text-foreground shadow-sm"
+ ? "hub-tab-toggle-pill text-foreground"
: "text-muted-foreground hover:text-foreground",
)}
>
diff --git a/studio/frontend/src/features/settings/components/create-key-form.tsx b/studio/frontend/src/features/settings/components/create-key-form.tsx
index c375bc280c2..e2ad23e59f7 100644
--- a/studio/frontend/src/features/settings/components/create-key-form.tsx
+++ b/studio/frontend/src/features/settings/components/create-key-form.tsx
@@ -45,19 +45,16 @@ export function CreateKeyForm({
};
return (
- <form
- onSubmit={handleSubmit}
- className="flex flex-col gap-2 rounded-lg border border-border bg-muted/20 p-3"
- >
+ <form onSubmit={handleSubmit} className="flex flex-col gap-2">
<div className="flex flex-wrap items-center gap-2">
<Input
value={name}
onChange={(e) => setName(e.target.value)}
placeholder={t("settings.apiKeys.tokenNamePlaceholder")}
- className="h-8 min-w-[180px] flex-1 text-sm"
+ className="h-9 min-w-[200px] flex-1 text-sm"
aria-label={t("settings.apiKeys.newAccessTokenName")}
/>
- <div className="inline-flex items-center rounded-md border border-border bg-background p-0.5">
+ <div className="hub-tab-toggle inline-flex h-8 items-center rounded-full">
{EXPIRY_PRESETS.map((p) => {
const active = expiry === p.value;
return (
@@ -67,9 +64,9 @@ export function CreateKeyForm({
onClick={() => setExpiry(p.value)}
aria-pressed={active}
className={cn(
- "rounded px-2 py-1 text-[11px] font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
+ "inline-flex h-8 items-center rounded-full px-3.5 text-[12px] font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
active
- ? "bg-accent text-foreground"
+ ? "hub-tab-toggle-pill text-foreground"
: "text-muted-foreground hover:text-foreground",
)}
>
diff --git a/studio/frontend/src/features/settings/components/theme-segmented.tsx b/studio/frontend/src/features/settings/components/theme-segmented.tsx
index 36e7062d8fb..4852d4bc904 100644
--- a/studio/frontend/src/features/settings/components/theme-segmented.tsx
+++ b/studio/frontend/src/features/settings/components/theme-segmented.tsx
@@ -27,7 +27,7 @@ export function ThemeSegmented() {
const { theme, setTheme } = useTheme();
const reduced = useReducedMotion();
return (
- <div className="inline-flex items-center rounded-md border border-border bg-muted/30 p-0.5">
+ <div className="hub-tab-toggle inline-flex h-8 items-center rounded-full">
{OPTIONS.map((opt) => {
const active = theme === opt.value;
return (
@@ -37,7 +37,7 @@ export function ThemeSegmented() {
onClick={() => setTheme(opt.value)}
aria-pressed={active}
className={cn(
- "relative flex h-7 items-center gap-1.5 rounded px-2.5 text-xs font-medium transition-colors",
+ "relative flex h-8 items-center gap-1.5 rounded-full px-3 text-xs font-medium transition-colors",
active
? "text-foreground"
: "text-muted-foreground hover:text-foreground",
@@ -46,7 +46,7 @@ export function ThemeSegmented() {
{active && (
<motion.span
layoutId="theme-pill"
- className="absolute inset-0 rounded bg-background shadow-border"
+ className="hub-tab-toggle-pill absolute inset-0 rounded-full"
transition={
reduced
? { duration: 0 }
diff --git a/studio/frontend/src/features/settings/components/update-studio-instructions.tsx b/studio/frontend/src/features/settings/components/update-studio-instructions.tsx
index 2b7855127a5..e7ec970cc0f 100644
--- a/studio/frontend/src/features/settings/components/update-studio-instructions.tsx
+++ b/studio/frontend/src/features/settings/components/update-studio-instructions.tsx
@@ -187,10 +187,10 @@ function ShellToggleButton({
onClick={onClick}
aria-pressed={active}
className={cn(
- "rounded-full px-2.5 py-1 text-[11px] font-medium transition-colors",
+ "inline-flex h-8 items-center justify-center rounded-full px-3.5 text-[12px] font-medium transition-colors",
active
- ? "bg-foreground/[0.08] text-foreground dark:bg-white/[0.12]"
- : "text-muted-foreground hover:text-foreground",
+ ? "hub-tab-toggle-pill text-foreground"
+ : "cursor-pointer text-muted-foreground hover:text-foreground",
)}
>
{label}
@@ -265,7 +265,7 @@ export function UpdateStudioInstructions({
{t("settings.about.update.title")}
</p>
) : null}
- <div className="flex shrink-0 items-center gap-1.5">
+ <div className="hub-tab-toggle inline-flex h-8 shrink-0 items-center rounded-full">
<ShellToggleButton
active={!windows}
label="MacOS / Linux"
diff --git a/studio/frontend/src/features/settings/components/usage-examples.tsx b/studio/frontend/src/features/settings/components/usage-examples.tsx
index 874c9fa930b..4085aa2ab06 100644
--- a/studio/frontend/src/features/settings/components/usage-examples.tsx
+++ b/studio/frontend/src/features/settings/components/usage-examples.tsx
@@ -320,7 +320,7 @@ function HighlightedCode({
[code, language],
);
return (
- <div className="max-w-full overflow-x-auto p-3 pr-16 text-[11px] leading-relaxed [&_pre]:!m-0 [&_pre]:!whitespace-pre-wrap [&_pre]:!break-words [&_pre]:!border-0 [&_pre]:!bg-transparent [&_pre]:!p-0 [&_[data-streamdown=code-block]]:!my-0 [&_[data-streamdown=code-block]]:!border-0 [&_[data-streamdown=code-block]]:!bg-transparent [&_[data-streamdown=code-block]]:!p-0">
+ <div className="max-w-full overflow-x-auto p-3 pr-16 text-[11px] leading-relaxed [&_pre]:!m-0 [&_pre]:!whitespace-pre-wrap [&_pre]:!break-words [&_pre]:!border-0 [&_pre]:!bg-transparent [&_pre]:!p-0 [&_pre]:!text-[11px] [&_pre]:!leading-relaxed [&_code]:!text-[11px] [&_[data-streamdown=code-block]]:!my-0 [&_[data-streamdown=code-block]]:!border-0 [&_[data-streamdown=code-block]]:!bg-transparent [&_[data-streamdown=code-block]]:!p-0 [&_[data-streamdown=code-block]]:!text-[11px]">
<Streamdown
mode="static"
plugins={{ code: codePlugin }}
@@ -467,9 +467,9 @@ export function UsageExamples({ apiKey }: { apiKey?: string | null }) {
onClick={() => setLang(tab.id)}
aria-pressed={active}
className={cn(
- "rounded px-2 py-1 text-[11px] font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
+ "rounded-full px-2.5 py-1 text-[11px] font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
active
- ? "bg-background text-foreground shadow-border"
+ ? "hub-tab-toggle-pill text-foreground"
: "text-muted-foreground hover:text-foreground",
)}
>
@@ -488,7 +488,7 @@ export function UsageExamples({ apiKey }: { apiKey?: string | null }) {
className={cn(
"rounded-full px-2.5 py-1 text-[11px] font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
os === "unix"
- ? "bg-foreground/[0.08] text-foreground dark:bg-white/[0.12]"
+ ? "hub-tab-toggle-pill text-foreground"
: "text-muted-foreground hover:text-foreground",
)}
>
@@ -501,7 +501,7 @@ export function UsageExamples({ apiKey }: { apiKey?: string | null }) {
className={cn(
"rounded-full px-2.5 py-1 text-[11px] font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
os === "windows"
- ? "bg-foreground/[0.08] text-foreground dark:bg-white/[0.12]"
+ ? "hub-tab-toggle-pill text-foreground"
: "text-muted-foreground hover:text-foreground",
)}
>
diff --git a/studio/frontend/src/features/settings/settings-dialog.tsx b/studio/frontend/src/features/settings/settings-dialog.tsx
index a2da6c201be..4255dc1c930 100644
--- a/studio/frontend/src/features/settings/settings-dialog.tsx
+++ b/studio/frontend/src/features/settings/settings-dialog.tsx
@@ -114,7 +114,7 @@ export function SettingsDialog() {
<Dialog open={open} onOpenChange={(o) => !o && closeDialog()}>
<DialogContent
showCloseButton={false}
- overlayClassName="bg-background/40"
+ overlayClassName="bg-black/30 supports-backdrop-filter:backdrop-blur-[2px]"
onCloseAutoFocus={(e) => {
// Restore focus to the element that triggered openDialog(). Radix's
// FocusScope races our rAF-scheduled tab focus and loses the
diff --git a/studio/frontend/src/features/studio/recent-trainings-section.tsx b/studio/frontend/src/features/studio/recent-trainings-section.tsx
new file mode 100644
index 00000000000..43808a7ca9c
--- /dev/null
+++ b/studio/frontend/src/features/studio/recent-trainings-section.tsx
@@ -0,0 +1,37 @@
+// SPDX-License-Identifier: AGPL-3.0-only
+// Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0
+
+import { useNavigate } from "@tanstack/react-router";
+import { useTrainingRuntimeStore } from "@/features/training";
+import { useTrainingHistorySidebarItems } from "@/features/training/hooks/use-training-history-sidebar";
+import { HistoryCardGrid } from "./history-card-grid";
+
+/**
+ * Recent training runs surfaced on Data Recipes and Export. Selecting a run
+ * stores its id and navigates to Studio, which auto-opens its History tab.
+ * Renders nothing once we know there are no runs.
+ */
+export function RecentTrainingsSection() {
+ const navigate = useNavigate();
+ const setSelectedHistoryRunId = useTrainingRuntimeStore(
+ (s) => s.setSelectedHistoryRunId,
+ );
+ const { items, loaded } = useTrainingHistorySidebarItems(true);
+
+ if (loaded && items.length === 0) return null;
+
+ return (
+ <section className="mt-10">
+ <h2 className="mb-4 text-[18px] font-semibold tracking-[-0.02em] text-foreground">
+ Recent trainings
+ </h2>
+ <HistoryCardGrid
+ onSelectRun={(runId) => {
+ setSelectedHistoryRunId(runId);
+ navigate({ to: "/studio" });
+ }}
+ onResumeStarted={() => navigate({ to: "/studio" })}
+ />
+ </section>
+ );
+}
diff --git a/studio/frontend/src/features/studio/sections/dataset-section.tsx b/studio/frontend/src/features/studio/sections/dataset-section.tsx
index 970e5246af2..38dbc8742b8 100644
--- a/studio/frontend/src/features/studio/sections/dataset-section.tsx
+++ b/studio/frontend/src/features/studio/sections/dataset-section.tsx
@@ -27,6 +27,7 @@ import {
} from "@/components/ui/select";
import { Spinner } from "@/components/ui/spinner";
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
+import { cn } from "@/lib/utils";
import {
Tooltip,
TooltipContent,
@@ -590,31 +591,67 @@ export function DatasetSection() {
}`}
>
<div className="flex min-w-0 flex-col gap-4">
- <Tabs
- value={datasetSource}
- onValueChange={(value) => {
- if (value === datasetSource) return;
- if (value === "huggingface") {
- selectHfDataset(dataset);
- } else if (value === "upload") {
- selectLocalDataset(uploadedFile);
- } else if (value === "s3") {
- if (isMultimodalModel) return;
- selectS3Source();
- }
- }}
- className="w-full"
- >
- <TabsList className="w-full">
- <TabsTrigger value="huggingface">Hugging Face</TabsTrigger>
- <TabsTrigger value="upload">
- {t("studio.dataset.localTab")}
- </TabsTrigger>
- {!isMultimodalModel && (
- <TabsTrigger value="s3">Amazon S3</TabsTrigger>
- )}
- </TabsList>
- </Tabs>
+ {(() => {
+ // Hub-style sliding-pill segmented control, matching the Hub tabs
+ // via the shared .hub-tab-toggle / .hub-tab-toggle-pill classes.
+ const sourceTabs: {
+ value: "huggingface" | "upload" | "s3";
+ label: string;
+ }[] = [
+ { value: "huggingface", label: "Hugging Face" },
+ { value: "upload", label: t("studio.dataset.localTab") },
+ ...(!isMultimodalModel
+ ? [{ value: "s3" as const, label: "Amazon S3" }]
+ : []),
+ ];
+ const activeIndex = Math.max(
+ 0,
+ sourceTabs.findIndex((item) => item.value === datasetSource),
+ );
+ return (
+ <div
+ role="radiogroup"
+ aria-label="Dataset source"
+ className="hub-tab-toggle relative inline-flex h-9 w-full items-center rounded-full"
+ >
+ <span
+ aria-hidden="true"
+ className="hub-tab-toggle-pill pointer-events-none absolute inset-y-0 left-0 rounded-full transition-transform duration-200 ease-out"
+ style={{
+ width: `${100 / sourceTabs.length}%`,
+ transform: `translateX(${activeIndex * 100}%)`,
+ }}
+ />
+ {sourceTabs.map((item) => (
+ <button
+ key={item.value}
+ type="button"
+ role="radio"
+ aria-checked={datasetSource === item.value}
+ onClick={() => {
+ if (item.value === datasetSource) return;
+ if (item.value === "huggingface") {
+ selectHfDataset(dataset);
+ } else if (item.value === "upload") {
+ selectLocalDataset(uploadedFile);
+ } else if (item.value === "s3") {
+ if (isMultimodalModel) return;
+ selectS3Source();
+ }
+ }}
+ className={cn(
+ "relative z-10 inline-flex h-9 flex-1 cursor-pointer items-center justify-center rounded-full px-3 text-[12.5px] font-medium transition-colors",
+ datasetSource === item.value
+ ? "text-foreground"
+ : "text-muted-foreground hover:text-foreground",
+ )}
+ >
+ {item.label}
+ </button>
+ ))}
+ </div>
+ );
+ })()}
{datasetSource === "s3" && <S3ConfigForm />}
diff --git a/studio/frontend/src/features/studio/sections/model-section.tsx b/studio/frontend/src/features/studio/sections/model-section.tsx
index 425f55eb538..e37620cc0a0 100644
--- a/studio/frontend/src/features/studio/sections/model-section.tsx
+++ b/studio/frontend/src/features/studio/sections/model-section.tsx
@@ -470,7 +470,7 @@ export function ModelSection() {
)}
<div
ref={scrollRef}
- className="max-h-64 overflow-y-auto overscroll-contain [scrollbar-width:thin]"
+ className="hover-scrollbar max-h-64 overflow-y-auto overscroll-contain [scrollbar-width:thin]"
>
<ComboboxList className="p-1 !max-h-none !overflow-visible">
{(id: string) => {
diff --git a/studio/frontend/src/index.css b/studio/frontend/src/index.css
index 118d5f93835..42b8bca35f6 100644
--- a/studio/frontend/src/index.css
+++ b/studio/frontend/src/index.css
@@ -906,8 +906,9 @@
border: none;
/* Pin to the dark --radius so rounded-3xl corners stay consistent. */
--radius: 0.625rem;
- /* Match the chat box: soft elevation. */
- box-shadow: 0 2px 8px -2px rgba(0, 0, 0, 0.16);
+ /* Prominent, wide ChatGPT-style elevation. */
+ box-shadow: 0 24px 70px -16px rgba(0, 0, 0, 0.28),
+ 0 8px 24px -12px rgba(0, 0, 0, 0.18);
}
/* Dark: page-bg shadow so the dialog does not merge into same-color