Studio: default Hub Discover scope to all models (#6593)
- Discover defaults to the whole Hub instead of the unsloth org; an explicit Unsloth choice is still remembered - Discover models placeholder reads Search all models to match - Give the Unsloth/All scope pill a min width so it stays readable
This commit is contained in:
parent
643e13ac33
commit
655b0cbcee
3 changed files with 8 additions and 7 deletions
|
|
@ -252,7 +252,7 @@ export const ModelsToolbar = memo(function ModelsToolbar({
|
|||
? `Search on-device ${isDataset ? "datasets" : "models"}`
|
||||
: isDataset
|
||||
? "Search datasets"
|
||||
: "Search models"
|
||||
: "Search all models"
|
||||
}
|
||||
className={cn(
|
||||
"field-soft h-9 rounded-full !border-0 pl-10 text-[13px] placeholder:text-muted-foreground/80 focus-visible:!ring-0",
|
||||
|
|
|
|||
|
|
@ -28,8 +28,8 @@ export function OwnerScopeToggle({
|
|||
onValueChange={onChange}
|
||||
ariaLabel="Publisher scope"
|
||||
align="end"
|
||||
// Extra gap so the chevron sits a touch further from the label.
|
||||
className="h-8 gap-1.5 text-[11.5px]"
|
||||
// Extra gap before the chevron; min-width keeps the pill readable.
|
||||
className="h-8 min-w-[96px] gap-1.5 text-[11.5px]"
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -90,18 +90,19 @@ 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. */
|
||||
/** Discover browsing scope: the whole Hub (default) or only the unsloth org. */
|
||||
export type OwnerScope = "unsloth" | "all";
|
||||
|
||||
function readOwnerScopePreference(): OwnerScope {
|
||||
if (typeof window === "undefined") {
|
||||
return "unsloth";
|
||||
return "all";
|
||||
}
|
||||
try {
|
||||
const value = window.localStorage.getItem(OWNER_SCOPE_STORAGE_KEY);
|
||||
return value === "all" ? "all" : "unsloth";
|
||||
// Default to the whole Hub; only honor an explicit "unsloth" preference.
|
||||
return value === "unsloth" ? "unsloth" : "all";
|
||||
} catch {
|
||||
return "unsloth";
|
||||
return "all";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue