Download more, file labels, split-file grouping, settings for labels and tags
- Files tab: "Download more" adds files to a model's selection and queues them - Colored file labels (Model, MTP, Vision/mmproj, imatrix, Config, …) - Split GGUF/safetensors parts shown and selected as one entry everywhere - Settings page with a Labels section: file label names/colors, tag rename/recolor/delete; new settings table and tags.color - Quants only count model weights Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
5211ec9064
commit
df18415e02
34 files changed
+2256
-132
No files matched your search
@@ -0,0 +1,40 @@
|
||||
"use client";
|
||||
|
||||
import { createContext, useContext } from "react";
|
||||
import { BADGE_CLASS } from "@/lib/colors";
|
||||
import { FILE_ROLES, fileRole, type FileRoleStyles } from "@/lib/file-roles";
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
const defaults = Object.fromEntries(
|
||||
Object.entries(FILE_ROLES).map(([role, r]) => [role, { label: r.label, color: r.color }]),
|
||||
) as FileRoleStyles;
|
||||
|
||||
const LabelContext = createContext<FileRoleStyles>(defaults);
|
||||
|
||||
/** Provides the label settings (from the Settings page) to client components. */
|
||||
export function LabelSettingsProvider({ fileRoles, children }: { fileRoles: FileRoleStyles; children: React.ReactNode }) {
|
||||
return <LabelContext.Provider value={fileRoles}>{children}</LabelContext.Provider>;
|
||||
}
|
||||
|
||||
export function useFileRoleStyles(): FileRoleStyles {
|
||||
return useContext(LabelContext);
|
||||
}
|
||||
|
||||
/** Label in front of a file name telling what the file is (Model, MTP, Vision, …). */
|
||||
export function FileRoleBadge({ path, className }: { path: string; className?: string }) {
|
||||
const styles = useFileRoleStyles();
|
||||
const role = fileRole(path);
|
||||
const style = styles[role];
|
||||
return (
|
||||
<span
|
||||
title={FILE_ROLES[role].description}
|
||||
className={cn(
|
||||
"inline-flex h-5 min-w-16 shrink-0 items-center justify-center rounded-md border px-1.5 text-[11px] font-medium whitespace-nowrap",
|
||||
BADGE_CLASS[style.color],
|
||||
className,
|
||||
)}
|
||||
>
|
||||
{style.label}
|
||||
</span>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user