Model page: Files tab first with a new file list, colored tags, single Hub link

- Files is the default tab: icon/size/LFS/state per file, on-disk summary, unselected files collapsed
- Custom tags color-coded by name (editor, library, filter chips and menu)
- Header: only the Hugging Face link (top right); README link moved to the end of the model card
- App icon; proxy lets /icon.svg through

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Pascal LinxweilerandClaude Opus 5.5 committed 2026-10-05 20:24:23 +02:00
1 parent 5fadd64367
commit 6dc9527682
9 files changed
+263 -119

No files matched your search

+68
View File
@@ -0,0 +1,68 @@
import { cn } from "@/lib/utils";
// Fixed palette (full class strings so Tailwind picks them up). A tag's color is derived from its
// name, so the same tag has the same color everywhere without storing anything.
const PALETTE = [
"border-sky-500/30 bg-sky-500/10 text-sky-700 dark:text-sky-300",
"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300",
"border-amber-500/30 bg-amber-500/10 text-amber-700 dark:text-amber-300",
"border-rose-500/30 bg-rose-500/10 text-rose-700 dark:text-rose-300",
"border-violet-500/30 bg-violet-500/10 text-violet-700 dark:text-violet-300",
"border-cyan-500/30 bg-cyan-500/10 text-cyan-700 dark:text-cyan-300",
"border-lime-500/30 bg-lime-500/10 text-lime-700 dark:text-lime-300",
"border-orange-500/30 bg-orange-500/10 text-orange-700 dark:text-orange-300",
"border-fuchsia-500/30 bg-fuchsia-500/10 text-fuchsia-700 dark:text-fuchsia-300",
"border-teal-500/30 bg-teal-500/10 text-teal-700 dark:text-teal-300",
];
const DOTS = [
"bg-sky-500",
"bg-emerald-500",
"bg-amber-500",
"bg-rose-500",
"bg-violet-500",
"bg-cyan-500",
"bg-lime-500",
"bg-orange-500",
"bg-fuchsia-500",
"bg-teal-500",
];
function colorIndex(name: string): number {
let h = 0;
for (const ch of name.trim().toLowerCase()) h = (h * 31 + ch.codePointAt(0)!) >>> 0;
return h % PALETTE.length;
}
export function tagColorClass(name: string): string {
return PALETTE[colorIndex(name)];
}
/** Small colored dot for a tag (e.g. in filter menus). */
export function TagDot({ name }: { name: string }) {
return <span className={cn("inline-block size-2 shrink-0 rounded-full", DOTS[colorIndex(name)])} />;
}
/** A user tag, colored by its name. */
export function TagBadge({
name,
className,
children,
}: {
name: string;
className?: string;
children?: React.ReactNode;
}) {
return (
<span
className={cn(
"inline-flex h-5 items-center gap-1 rounded-full border px-2 text-xs font-medium whitespace-nowrap",
tagColorClass(name),
className,
)}
>
{name}
{children}
</span>
);
}